This commit is contained in:
liushuai
2019-12-04 17:21:01 +08:00
parent ad1a5d749f
commit d3bd8686e3
6 changed files with 175 additions and 139 deletions

View File

@@ -116,31 +116,42 @@
style="width: 100%;max-height: 500px;"
height="500px"
size="mini"
@selection-change="handleSelectionChange1">
@selection-change="handleSelectionChange1"
@select="handleSelection">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<el-table-column v-if="switchValue" label="操作" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="materialChange(scope.row)">物料变更</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="70">
<template slot-scope="scope">
<span v-if="unInquiry(scope.row)" style="color: orange">未询价</span>
<span v-if="inquiry(scope.row)" style="color: blue">已询价</span>
<span v-if="approval(scope.row)" style="color: green">审批中</span>
<span v-if="purchased(scope.row)">已采购</span>
</template>
</el-table-column>
<!--<el-table-column label="状态" align="center" width="70">-->
<!--<template slot-scope="scope">-->
<!--<span v-if="unInquiry(scope.row)" style="color: orange">未询价</span>-->
<!--<span v-if="inquiry(scope.row)" style="color: blue">已询价</span>-->
<!--<span v-if="approval(scope.row)" style="color: green">审批中</span>-->
<!--<span v-if="purchased(scope.row)">已采购</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" width="130" prop="机床图号" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="名称" align="center" width="180" prop="名称">
<template slot-scope="scope">
{{ scope.row.物料名称 }}
@@ -156,11 +167,6 @@
{{ scope.row.物料型号 }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.组号 }}
</template>
</el-table-column>
<el-table-column label="分配数" align="center" min-width="60">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
@@ -199,11 +205,6 @@
{{ Number(scope.row.滞货数量) }}
</template>
</el-table-column>
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="分配时间" align="center" min-width="90">
<template slot-scope="scope">
{{ scope.row.任务分配时间.split(' ')[0] }}
@@ -214,12 +215,12 @@
{{ scope.row.组件设计者 || scope.row.机床设计者 || '—' }}
</template>
</el-table-column>
<el-table-column label="询价单编号" align="center" min-width="100">
<template slot-scope="scope">
<b v-if="inquiry(scope.row)">{{ scope.row.询价单编号 }}</b>
<b v-else>—</b>
</template>
</el-table-column>
<!--<el-table-column label="询价单编号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--<b v-if="inquiry(scope.row)">{{ scope.row.询价单编号 }}</b>-->
<!--<b v-else>—</b>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column :filters="source" :filter-method="filterSource" align="center" label="数据来源" min-width="90px" prop="零件类型">-->
<!--<template slot-scope="scope">-->
<!--{{ Number(scope.row.零件类型) === 1 ? 'BZ' : 'WG' }}-->
@@ -232,10 +233,17 @@
:page-sizes="[10, 50, 100, 150]"
:page-size="pageSize11"
:total="total11"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
style="display:inline-block;width:50px"
layout="total"
@size-change="handleSizeChange11"
@current-change="handleCurrentChange11"/>
<el-tooltip :open-delay="1000" effect="dark" content="为选择的询价单添加物料" placement="top">
<el-button
type="warning"
size="small"
style="margin: 0px 20px"
@click="addInquirySheet">选入物料</el-button>
</el-tooltip>
</div>
</el-row>
</el-tab-pane>
@@ -248,7 +256,7 @@
<!--:label="item.label"-->
<!--:value="item.value"/>-->
<!--</el-select>-->
<el-input v-model="partNum" placeholder="图号名称规格" size="small" clearable @keyup.enter.native="materialStatusValue=[0];pageCurrent11=1;pageSize11=20;total11=0;searchTable12()"/>
<el-input v-model="partNum" placeholder="图号名称规格" size="small" clearable @keyup.enter.native="searchTable12()"/>
<el-select v-model="machineValue" placeholder="机床" size="small" clearable filterable>
<el-option
v-for="item in machine"
@@ -264,7 +272,7 @@
<!--:value="item.value"/>-->
<!--</el-select>-->
<!--<el-cascader :options="materialStatus" :props="{ checkStrictly: true }" v-model="materialStatusValue" style="width: 100px" size="small"/>-->
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="materialStatusValue=[0];pageCurrent12=1;pageSize12=100;total12=0;searchTable12()">查询</el-button>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="searchTable12()">查询</el-button>
<el-button type="warning" size="small" icon="el-icon-download" style="margin-left: 10px" @click="exportUninquirySheet">导出未询价单</el-button>
<el-date-picker
v-model="endTime"
@@ -306,31 +314,37 @@
<el-table
v-loading=""
:data="tableData12"
:row-class-name="tableRowClassName"
:row-class-name="tableRowClassName2"
border
style="width: 100%;max-height: 500px;"
height="500px"
size="mini"
@selection-change="handleSelectionChange2">
@selection-change="handleSelectionChange2"
@select="handleSelection1">
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<!--<el-table-column label="操作" align="center" width="100" fixed="left">-->
<!--<template slot-scope="scope">-->
<!--<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="partChange(scope.row)">零件变更</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="采购状态" align="center" width="80">
<template slot-scope="scope">
<el-tag v-if="unInquiry(scope.row)" type="warning" size="small">未询价</el-tag>
<el-tag v-if="inquiry(scope.row)" type="success" size="small">已询价</el-tag>
<el-tag v-if="approval(scope.row)" type="primary" size="small">审批中</el-tag>
<el-tag v-if="purchased(scope.row)" type="info" size="small">已采购</el-tag>
</template>
</el-table-column>
<!--<el-table-column label="采购状态" align="center" width="80">-->
<!--<template slot-scope="scope">-->
<!--<el-tag v-if="unInquiry(scope.row)" type="warning" size="small">未询价</el-tag>-->
<!--<el-tag v-if="inquiry(scope.row)" type="success" size="small">已询价</el-tag>-->
<!--<el-tag v-if="approval(scope.row)" type="primary" size="small">审批中</el-tag>-->
<!--<el-tag v-if="purchased(scope.row)" type="info" size="small">已采购</el-tag>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column :filters="supplierFilters" :filter-method="filterHandler" label="供货商" align="center" min-width="100" prop="供货商">
<template slot-scope="scope">
{{ scope.row.供货商 }}
</template>
</el-table-column>
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="图号" align="center" min-width="130">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
@@ -371,11 +385,6 @@
{{ scope.row.零件数量 }}
</template>
</el-table-column>
<el-table-column :filters="remarkFilters" :filter-method="filterHandler0" label="备注" align="center" min-width="100" prop="备注">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="分配时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.任务分配时间.split(' ')[0] }}
@@ -386,12 +395,12 @@
{{ scope.row.组件设计者 || scope.row.机床设计者 || '—' }}
</template>
</el-table-column>
<el-table-column label="询价单编号" align="center" min-width="100">
<template slot-scope="scope">
<b v-if="inquiry(scope.row)">{{ scope.row.询价单编号 }}</b>
<b v-else>—</b>
</template>
</el-table-column>
<!--<el-table-column label="询价单编号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--<b v-if="inquiry(scope.row)">{{ scope.row.询价单编号 }}</b>-->
<!--<b v-else>—</b>-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
</el-row>
<div class="block">
@@ -400,10 +409,17 @@
:page-sizes="[10, 50, 100, 150]"
:page-size="pageSize12"
:total="total12"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
style="display:inline-block;width:50px"
layout="total"
@size-change="handleSizeChange12"
@current-change="handleCurrentChange12"/>
<el-tooltip :open-delay="1000" effect="dark" content="为选择的询价单添加物料" placement="top">
<el-button
type="warning"
size="small"
style="margin: 0px 20px"
@click="addInquirySheet">选入物料</el-button>
</el-tooltip>
</div>
</el-tab-pane>
<!--<el-tab-pane v-show="false" label="标准件" name="标准件">-->
@@ -592,39 +608,24 @@
<el-card>
<el-card style="width: 1188px">
<el-row>
<el-input v-model="inquirySheetNum" placeholder="询价单号" size="small" clearable/>
<el-input v-model="supplierName" placeholder="供应商" size="small" style="margin: 0px 10px" clearable/>
<el-input v-model="inquirySheetNum" placeholder="询价单号或供应商" size="small" clearable @keyup.enter.native="pageCurrent2=1;pageSize2=10000;total2=0;searchTable2()"/>
<el-button
type="success"
size="small"
size="mini"
icon="el-icon-search"
style="margin:0px 10px"
@click="pageCurrent2=1;pageSize2=10000;total2=0;searchTable2()">查询</el-button>
<el-tooltip :open-delay="1000" effect="dark" content="为选择的询价单添加物料" placement="top">
<el-button
type="warning"
size="small"
style="margin: 0px 20px"
@click="addInquirySheet">选入物料</el-button>
</el-tooltip>
<el-button
type="primary"
size="small"
style="float: right;margin:0px 10px"
@click="createInquirySheet">创建询价单</el-button>
</el-row>
<el-row style="margin-top: 5px;">
<h3 style="margin: 0px 30px;display:inline-block; ">询价单</h3>
<el-button type="warning" size="mini" plain icon="el-icon-edit" style="margin: 0px 20px" @click="editInquirySheet()">编辑</el-button>
<el-button type="danger" size="mini" plain icon="el-icon-delete" style="margin: 0px 60px 0px 20px" @click="deleteInquirySheet()">删除</el-button>
<!--<h3 style="margin: 0px 40px;display:inline-block;">询价单明细</h3>-->
icon="el-icon-circle-plus-outline"
size="mini"
style="margin-left: 10px"
@click="createInquirySheet">创建</el-button>
<el-button type="warning" size="mini" plain icon="el-icon-edit" style="margin-left: 10px" @click="editInquirySheet()">编辑</el-button>
<el-button type="danger" size="mini" plain icon="el-icon-delete" style="margin-left: 10px" @click="deleteInquirySheet()">删除</el-button>
<el-button :disabled="tableData3.length===0" type="primary" size="small" plain style="float: right" @click="printInquirySheet()">打印</el-button>
<el-button :disabled="tableData3.length===0" type="warning" size="small" style="margin-left:10px;float: right" @click="exportInquirySheet()">导出</el-button>
<el-tooltip :open-delay="1000" effect="dark" content="保存该询价单" placement="top" style="float: right">
<el-button :disabled="tableData3.length===0" type="success" size="small" @click="saveOrder()">保存</el-button>
</el-tooltip>
</el-row>
<!--<el-button :loading="baseInfoLoading" type="success" size="mini" style="float: right" plain @click="inquirySheetBaseInfoMaintain">信息维护</el-button>-->
</el-card>
<el-row>
<el-col style="width:310px">
@@ -729,7 +730,7 @@
</el-table-column>
<el-table-column label="实询数" align="center" width="110">
<template slot-scope="scope">
<el-input v-direction="{x: 0, y: scope.$index}" v-model="scope.row.数量" size="mini" style="width: 75px"/>
<el-input v-direction="{x: 0, y: scope.$index}" v-model="scope.row.数量" size="mini" style="width: 75px" @change="saveOrder(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="单位" align="center" width="50">
@@ -739,7 +740,7 @@
</el-table-column>
<el-table-column label="询价备注" align="center" width="110">
<template slot-scope="scope">
<el-input v-direction="{x: 1, y: scope.$index}" v-model="scope.row.备注" size="mini" style="width: 75px"/>
<el-input v-direction="{x: 1, y: scope.$index}" v-model="scope.row.备注" size="mini" style="width: 75px" @change="saveOrder(scope.row)"/>
</template>
</el-table-column>
<!-- <el-table-column label="询价单编号" align="center" min-width="100">-->
@@ -1180,11 +1181,11 @@ export default {
tableData11: [], // 外购件列表
total11: 0,
pageCurrent11: 1,
pageSize11: 100,
pageSize11: 1000,
tableData12: [], // 基本件列表
total12: 0,
pageCurrent12: 1,
pageSize12: 100,
pageSize12: 1000,
tableData13: [], // 外购件列表
total13: 0,
pageCurrent13: 1,
@@ -1197,6 +1198,7 @@ export default {
pageSize2: 10000,
tableData3: [], // 询价单明细
dialogVisible1: false,
visible1: false,
inquirySheetNum: '', // 询价单号
inquirySheetFlowNum: '', // 询价单流水号
form1: {},
@@ -1265,6 +1267,8 @@ export default {
cancelNum: 0,
machines1: [],
machines2: [],
numbers: [],
numbers1: [],
row1: ''
}
},
@@ -1312,6 +1316,30 @@ export default {
this.searchTable11()
})
},
handleSelection(val, row) {
this.tableData11.forEach((item, i) => {
if (item.组件零件流水号 === row.组件零件流水号) {
console.log(this.numbers.indexOf(i), 234)
if (this.numbers.indexOf(i) === -1) {
this.numbers.push(i)
} else {
this.numbers.splice(this.numbers.indexOf(i), 1)
}
}
})
},
handleSelection1(val, row) {
this.tableData12.forEach((item, i) => {
if (item.组件零件基本件流水号 === row.组件零件基本件流水号) {
console.log(this.numbers1.indexOf(i), 234)
if (this.numbers1.indexOf(i) === -1) {
this.numbers1.push(i)
} else {
this.numbers1.splice(this.numbers1.indexOf(i), 1)
}
}
})
},
timeChange1() {
if (this.startTime) {
timeChange1(this.startTime[0], this.startTime[1])
@@ -1689,20 +1717,9 @@ export default {
// this.$message.info('已取消操作')
// })
// },
saveOrder() { // 保存询价单
const orderNumGroup = []
const numGroup = []
const remarkGroup = []
for (let i = 0; i < this.tableData3.length; i++) {
orderNumGroup.push(this.tableData3[i].询价单明细流水号)
numGroup.push(this.tableData3[i].数量)
remarkGroup.push(this.tableData3[i].备注)
}
saveOrder(orderNumGroup, numGroup, remarkGroup).then(response => {
if (response.data[0].result === '1') {
this.$message.success('保存成功')
} else { this.$message.error('保存失败') }
})
saveOrder(row) { // 保存询价单
console.log(row, 1111)
saveOrder(row.询价单明细流水号, row.数量, row.备注).then(response => {})
},
selectable(row, index) { // 控制某行是否可选
return (parseInt(row.询价状态编号) === 1 && parseInt(row.采购状态编号) < 3 && parseInt(row.是否确认) === 1) // 未询价&&未采购&&确认物料修改
@@ -1823,9 +1840,8 @@ export default {
this.searchTable13()
},
searchTable2() { // 查询询价单列表
this.supplierName ? this.check3 = 1 : this.check3 = 0
this.inquirySheetNum ? this.check4 = 1 : this.check4 = 0
searchCreateInquirySheet(this.pageCurrent2, this.pageSize2, this.check3, this.supplierName, this.check4, this.inquirySheetNum, this.id).then(response => {
searchCreateInquirySheet(this.pageCurrent2, this.pageSize2, this.check4, this.inquirySheetNum, this.id).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
@@ -2299,10 +2315,22 @@ export default {
})
},
tableRowClassName({ row, rowIndex }) {
if (parseInt(row.是否确认) === 0) {
return 'MistyRose'
}
return ''
let color = ''
this.numbers.forEach((r, i) => {
if (rowIndex === r) {
color = 'MistyRose'
}
})
return color
},
tableRowClassName2({ row, rowIndex }) {
let color = ''
this.numbers1.forEach((r, i) => {
if (rowIndex === r) {
color = 'MistyRose'
}
})
return color
}
}
}
@@ -2352,7 +2380,7 @@ export default {
background: Tomato!important;
}
.el-table .MistyRose {
background: MistyRose!important;
background: #9BD7FC!important;
}
.el-table .gray {
background: lightgray;