Commit b9f3b430 authored by 张伯涛's avatar 张伯涛

修改新增物料勾选问题

parent 25ab9260
......@@ -474,6 +474,8 @@ export default {
replaceMaterialList: [],
// 记录成品料号回显
endMaterialList: [],
// 存一下记录成品料号回显
beforeEndMaterialList: [],
// 刷新table num值
tableNum: 0,
// 表格第一行数据
......@@ -579,7 +581,6 @@ export default {
if (this.$store.getters.searchParams[this.$route.path]) {
const { searchParams } = this.$store.getters; const { path } = this.$route
const param = JSON.parse(searchParams[path]) // 保留着的查询条件
console.log(param)
this.workingLoading = param.data.workingLoading,
this.factory = param.data.factory,
this.htmlType = param.data.htmlType,
......@@ -758,7 +759,7 @@ export default {
})
this.form.modelCodeList = this.form.modelCode.join(';')
this.positionList = this.initTableData(res.data.stationList)
console.log(this.form.modelCodeList)
// console.log(this.form.modelCodeList)
})
} else if (this.htmlType === '2') {
nltordermodelDetail(params).then(res => {
......@@ -917,9 +918,11 @@ export default {
}
})
} else if (this.type === '3') {
console.log('this.endMaterialList', this.endMaterialList)
this.endMaterialList.forEach(item => {
this.addMaterialMap[item.businessId] = item
})
// 遍历列表数据
this.selectPartNum.forEach(item => {
if (this.addMaterialMap[item.businessId]) {
this.$nextTick(() => {
......@@ -1050,8 +1053,8 @@ export default {
})
}
// 勾选数据 添加
console.log(this.addMaterialMap, 'this.addMaterialMap[item.businessId]')
console.log(data, 'data')
// console.log(this.addMaterialMap, 'this.addMaterialMap[item.businessId]')
// console.log(data, 'data')
data.forEach(item => {
this.addMaterialMap[item.businessId] = item
})
......@@ -1060,6 +1063,9 @@ export default {
for (const key in this.addMaterialMap) {
this.addMaterialList.push(this.addMaterialMap[key])
}
// 勾选改变后最终的list也变
this.endMaterialList = this.addMaterialList
console.log('selectChange', this.addMaterialList)
}
},
// 禁用
......@@ -1301,7 +1307,6 @@ export default {
})
} else if (this.htmlType === '3') {
nltmodelAdd(params).then(res => {
console.log('aaaaaaaaaaaaaaaaa')
this.$message.success('新增成功')
this.queryParams = this.$options.data().queryParams
this.positionList = this.$options.data().positionList
......@@ -1358,7 +1363,6 @@ export default {
return
}
}
console.log('aaaaaaaaaaaaa', this.form.modelType, this.addPositionListOne[0].staType, this.positionList)
if (this.form.modelType === '3' && this.positionList.length === 1) {
if (this.addPositionListOne[0].staType !== '1') {
this.$message.error('包装测试的第二工站必须为测试工站')
......@@ -1412,6 +1416,7 @@ export default {
cancelChoicePart() {
this.openPartNo = false
this.modelCodeOne = ''
this.endMaterialList = this.beforeEndMaterialList
},
// 确定关闭选择成品料号弹窗
submitChoicePart() {
......@@ -1445,7 +1450,6 @@ export default {
this.$message.error('请选择成品物料')
return
}
console.log(this.addMaterialList, 'this.addMaterialList')
this.form.modelCode = []
this.form.materId = []
this.addMaterialList.forEach(item => {
......@@ -1453,6 +1457,7 @@ export default {
this.form.materId.push(item.businessId)
})
this.endMaterialList = this.addMaterialList
this.beforeEndMaterialList = this.addMaterialList // 存一下
this.form.modelCodeList = this.form.modelCode.join(';')
this.$refs.form.clearValidate('modelCode')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment