成组配套查询
This commit is contained in:
@@ -125,10 +125,88 @@ export default {
|
||||
departmentData: [] // 树状数据
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route': {
|
||||
handler(route) {
|
||||
if (this.$route.query.机床流水号) {
|
||||
console.log(this.$route.query.机床流水号)
|
||||
this.getTreeData2(this.$route.query.机床流水号)
|
||||
} else {
|
||||
// var that = this
|
||||
if (!this.MachineValue) {
|
||||
this.getMachine()
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getMachine()
|
||||
// this.getMachine()
|
||||
},
|
||||
methods: {
|
||||
getTreeData2(num) {
|
||||
this.MachineValue = ''
|
||||
this.Machine = []
|
||||
getMachines().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Machine.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号,
|
||||
value2: response.data[i].机床名称
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.MachineValue = num
|
||||
getMachinesStatue(num).then(res => {
|
||||
if (res.data[0].是否发货 === 0) {
|
||||
this.MachineColor = 'rgb(126,172,237)'
|
||||
} else {
|
||||
this.MachineColor = 'green'
|
||||
}
|
||||
})
|
||||
this.tableData1 = []
|
||||
this.tableData2 = []
|
||||
for (let i = 0; i < this.Machine.length; i++) {
|
||||
if (this.MachineValue === this.Machine[i].value) {
|
||||
this.机床图号 = this.Machine[i].label
|
||||
this.机床名称 = this.Machine[i].value2
|
||||
}
|
||||
}
|
||||
this.option = []
|
||||
getGroups(num).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.option.push({
|
||||
isLeaf: false,
|
||||
label: response.data[i].组号 + '\xa0\xa0\xa0' + (response.data[i].组件名称 ? response.data[i].组件名称 : ''),
|
||||
value: response.data[i].组件流水号,
|
||||
组件完成状态: response.data[i].组件完成状态,
|
||||
father: true,
|
||||
children: []
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.option.map(firstLevel => {
|
||||
// 根据分组查零件
|
||||
selectParts(1, firstLevel.value, 0, 0).then(response => {
|
||||
firstLevel.children = []
|
||||
for (let j = 0; j < response.data.length; j++) {
|
||||
firstLevel.children.push({
|
||||
label: (response.data[j].零件图号 ? response.data[j].零件图号 : '无零件图号') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].规格 ? response.data[j].规格 : '') + '\xa0\xa0\xa0\xa0\xa0\xa0' + (response.data[j].投产总数量 ? response.data[j].投产总数量 : '') + '..........' + (response.data[j].零件名称 ? response.data[j].零件名称 : '无零件名称') + (response.data[j].零件类型 === 1 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0自制:' + response.data[j].考核状态名称 : (response.data[j].零件类型 === 2 ? '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0制造采购' : '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0外购:' + response.data[j].采购状态)),
|
||||
value: response.data[j].工艺计划流水号,
|
||||
考核状态: response.data[j].考核状态,
|
||||
采购状态: response.data[j].采购状态,
|
||||
零件类型: response.data[j].零件类型,
|
||||
father: false
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}).then(() => {
|
||||
this.departmentData = this.option
|
||||
})
|
||||
})
|
||||
},
|
||||
getMachine() {
|
||||
this.MachineValue = ''
|
||||
this.Machine = []
|
||||
|
||||
@@ -86,7 +86,6 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="采购部采购" name="采购部采购">
|
||||
<!--<h3 style="text-align: center;">采购部采购</h3>-->
|
||||
<el-tabs v-model="PartType" type="border-card" style="margin-top: 10px" @tab-click="searchTable()">
|
||||
<el-tab-pane label="标准件" name="标准件">
|
||||
<el-table :data="tableData00" size="mini" height="530px" border stripe>
|
||||
@@ -291,7 +290,6 @@
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="制造部采购" name="制造部采购">
|
||||
<!--<h3 style="text-align: center;">制造部采购</h3>-->
|
||||
<el-table :data="tableData1" border style="width: 100%;margin-top: 6px;" height="600">
|
||||
<el-table-column label="进程" align="center" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
@@ -511,7 +509,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
turnTo() {
|
||||
this.$router.push({ path: '/ManufacturingCenter/CompletionOfWorkshopComponents' })
|
||||
this.$router.push({
|
||||
path: '/ManufacturingCenter/CompletionOfWorkshopComponents',
|
||||
query: {
|
||||
机床流水号: this.Machine
|
||||
}
|
||||
})
|
||||
},
|
||||
searchData() {
|
||||
this.totalNum = 0
|
||||
|
||||
Reference in New Issue
Block a user