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

修改新增物料勾选问题

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