|
@ -320,7 +320,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="7"> |
|
|
<el-col :span="7"> |
|
|
<div style="border:1px;height:570px;width:270px"> |
|
|
<div style="border:1px;height:570px;width:270px"> |
|
|
<el-table :data="tempdetails" ref="leftTable" height="550" stripe border highlight-current-row @row-click="rowClickLeft" @select="selectLeft"> |
|
|
<el-table :data="tempdetails" ref="leftTable" height="550" stripe border highlight-current-row @row-click="rowClickLeft" @select="selectLeft" @select-all="selectLeftAll"> |
|
|
<el-table-column type="selection" width="40px"></el-table-column> |
|
|
<el-table-column type="selection" width="40px"></el-table-column> |
|
|
<el-table-column prop="partCode" label="结算件代码" width="150px" align="center"></el-table-column> |
|
|
<el-table-column prop="partCode" label="结算件代码" width="150px" align="center"></el-table-column> |
|
|
<el-table-column prop="partNum" label="数量" width="78px" align="center"></el-table-column> |
|
|
<el-table-column prop="partNum" label="数量" width="78px" align="center"></el-table-column> |
|
@ -340,7 +340,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="7"> |
|
|
<el-col :span="7"> |
|
|
<div style="border:1px;height:570px;width:270px"> |
|
|
<div style="border:1px;height:570px;width:270px"> |
|
|
<el-table :data="data2" ref="rightTable" height="550" stripe border highlight-current-row @row-click="rowClickRight" @select="selectRight"> |
|
|
<el-table :data="data2" ref="rightTable" height="550" stripe border highlight-current-row @row-click="rowClickRight" @select="selectRight" @select-all="selectRightAll"> |
|
|
<el-table-column type="selection" width="40px"></el-table-column> |
|
|
<el-table-column type="selection" width="40px"></el-table-column> |
|
|
<el-table-column prop="partCode" label="结算件代码" width="150px" align="center"></el-table-column> |
|
|
<el-table-column prop="partCode" label="结算件代码" width="150px" align="center"></el-table-column> |
|
|
<el-table-column prop="partNum" label="数量" width="78px" align="center"></el-table-column> |
|
|
<el-table-column prop="partNum" label="数量" width="78px" align="center"></el-table-column> |
|
@ -815,6 +815,13 @@ export default { |
|
|
this.formTitle = "添加总成"; |
|
|
this.formTitle = "添加总成"; |
|
|
this.isEdit = false; |
|
|
this.isEdit = false; |
|
|
this.form = {}; |
|
|
this.form = {}; |
|
|
|
|
|
this.leftRowTemp = []; |
|
|
|
|
|
this.rightRowTemp = []; |
|
|
|
|
|
this.assly = {}; |
|
|
|
|
|
this.tempdetails = []; |
|
|
|
|
|
this.erpAssemblyCfgList =[]; |
|
|
|
|
|
this.tempAssCfgList = []; |
|
|
|
|
|
this.asTemp = []; |
|
|
this.getUnknownAssemblyList(); |
|
|
this.getUnknownAssemblyList(); |
|
|
this.getZcCode(); |
|
|
this.getZcCode(); |
|
|
this.getvehicleModel(); |
|
|
this.getvehicleModel(); |
|
@ -954,6 +961,7 @@ export default { |
|
|
}; |
|
|
}; |
|
|
lastSubmit.erpAssemblyCfgList = this.tempAssCfgList; |
|
|
lastSubmit.erpAssemblyCfgList = this.tempAssCfgList; |
|
|
|
|
|
|
|
|
|
|
|
//#region |
|
|
// var lastSubmitt = []; |
|
|
// var lastSubmitt = []; |
|
|
// console.log("flag") |
|
|
// console.log("flag") |
|
|
// this.tempAssCfgList.forEach(element => { |
|
|
// this.tempAssCfgList.forEach(element => { |
|
@ -990,6 +998,7 @@ export default { |
|
|
// }) |
|
|
// }) |
|
|
// }); |
|
|
// }); |
|
|
// console.log("this is lastSubmit:",lastSubmit) |
|
|
// console.log("this is lastSubmit:",lastSubmit) |
|
|
|
|
|
//#endregion |
|
|
|
|
|
|
|
|
this.$axios |
|
|
this.$axios |
|
|
.posts( |
|
|
.posts( |
|
@ -1114,30 +1123,31 @@ export default { |
|
|
if(this.rightRowTemp.length === 0){ |
|
|
if(this.rightRowTemp.length === 0){ |
|
|
alert("请先选择需移动的零件") |
|
|
alert("请先选择需移动的零件") |
|
|
} |
|
|
} |
|
|
else if(this.rightRowTemp.length !== 0 && parseInt(this.rightRowTemp[0].partNum) !== 1){ |
|
|
else if(this.rightRowTemp.length === 1 && parseInt(this.rightRowTemp[0].partNum) !== 1){ |
|
|
this.numFormData.num = parseInt(this.rightRowTemp[0].partNum); |
|
|
this.numFormData.num = parseInt(this.rightRowTemp[0].partNum); |
|
|
this.dialogNumVisible = true; |
|
|
this.dialogNumVisible = true; |
|
|
this.numTitle = "输入移动结算件数量" |
|
|
this.numTitle = "输入移动结算件数量" |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
console.log("R->F"); |
|
|
console.log("R->F"); |
|
|
this.numFormData.num = 1; |
|
|
this.rightRowTemp.forEach(item => { |
|
|
if(this.numFormData.num <= this.rightRowTemp[0].partNum && this.numFormData.num > 0){ |
|
|
this.numFormData.num = item.partNum; |
|
|
|
|
|
//if(this.numFormData.num <= item.partNum && this.numFormData.num > 0){ |
|
|
|
|
|
|
|
|
//数据插入最终缓存 |
|
|
//数据插入最终缓存 |
|
|
if(this.tempAssCfgList.length !== 0){ |
|
|
if(this.tempAssCfgList.length !== 0){ |
|
|
console.log("second") |
|
|
console.log("second") |
|
|
var rfMove = this.tempAssCfgList.filter(u=>u.erpAssemblyCode === this.asTemp[0].erpAssemblyCode); |
|
|
var rfMove = this.tempAssCfgList.filter(u=>u.erpAssemblyCode === this.asTemp[0].erpAssemblyCode); |
|
|
if(rfMove.length !== 0){ |
|
|
if(rfMove.length !== 0){ |
|
|
var sameDetail = rfMove[0].details.filter(u=>u.partCode === this.rightRowTemp[0].partCode); |
|
|
var sameDetail = rfMove[0].details.filter(u=>u.partCode === item.partCode); |
|
|
if(sameDetail.length !== 0){ |
|
|
if(sameDetail.length !== 0){ |
|
|
sameDetail[0].partNum = parseInt(sameDetail[0].partNum) + parseInt(this.numFormData.num); |
|
|
sameDetail[0].partNum = parseInt(sameDetail[0].partNum) + parseInt(this.numFormData.num); |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
rfMove[0].details.push({ |
|
|
rfMove[0].details.push({ |
|
|
description: this.rightRowTemp[0].description, |
|
|
description: item.description, |
|
|
isKey: false, |
|
|
isKey: false, |
|
|
partCode: this.rightRowTemp[0].partCode, |
|
|
partCode: item.partCode, |
|
|
partNum: this.numFormData.num,//移动框输入的数量 |
|
|
partNum: this.numFormData.num,//移动框输入的数量 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -1151,9 +1161,9 @@ export default { |
|
|
previousVersionId: this.asTemp[0].previousVersionId, |
|
|
previousVersionId: this.asTemp[0].previousVersionId, |
|
|
vehicleModel: this.asTemp[0].carModel, |
|
|
vehicleModel: this.asTemp[0].carModel, |
|
|
details:[{ |
|
|
details:[{ |
|
|
description: this.rightRowTemp[0].description, |
|
|
description: item.description, |
|
|
isKey: false, |
|
|
isKey: false, |
|
|
partCode: this.rightRowTemp[0].partCode, |
|
|
partCode: item.partCode, |
|
|
partNum: this.numFormData.num,//移动框输入的数量 |
|
|
partNum: this.numFormData.num,//移动框输入的数量 |
|
|
}] |
|
|
}] |
|
|
}) |
|
|
}) |
|
@ -1167,9 +1177,9 @@ export default { |
|
|
isCover: false, |
|
|
isCover: false, |
|
|
previousVersionId: this.asTemp[0].previousVersionId, |
|
|
previousVersionId: this.asTemp[0].previousVersionId, |
|
|
details:[{ |
|
|
details:[{ |
|
|
description: this.rightRowTemp[0].description, |
|
|
description: item.description, |
|
|
isKey: false, |
|
|
isKey: false, |
|
|
partCode: this.rightRowTemp[0].partCode, |
|
|
partCode: item.partCode, |
|
|
partNum: this.numFormData.num,//移动框输入的数量 |
|
|
partNum: this.numFormData.num,//移动框输入的数量 |
|
|
}] |
|
|
}] |
|
|
}) |
|
|
}) |
|
@ -1177,32 +1187,34 @@ export default { |
|
|
|
|
|
|
|
|
console.log("this is tempAssCfgList 最终数据",this.tempAssCfgList) |
|
|
console.log("this is tempAssCfgList 最终数据",this.tempAssCfgList) |
|
|
//数据插入中间数据源 |
|
|
//数据插入中间数据源 |
|
|
var judge = this.tempdetails.filter(u=>u.partCode === this.rightRowTemp[0].partCode); |
|
|
var judge = this.tempdetails.filter(u=>u.partCode === item.partCode); |
|
|
if(judge.length === 1){ |
|
|
if(judge.length === 1){ |
|
|
var t = parseInt(judge[0].partNum) + parseInt(this.numFormData.num); |
|
|
var t = parseInt(judge[0].partNum) + parseInt(this.numFormData.num); |
|
|
this.tempdetails.filter(u=>u.partCode === this.rightRowTemp[0].partCode)[0].partNum = t; |
|
|
this.tempdetails.filter(u=>u.partCode === item.partCode)[0].partNum = t; |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
this.tempdetails.push({ |
|
|
this.tempdetails.push({ |
|
|
description: this.rightRowTemp[0].description, |
|
|
description: item.description, |
|
|
isKey: false, |
|
|
isKey: false, |
|
|
partCode: this.rightRowTemp[0].partCode, |
|
|
partCode: item.partCode, |
|
|
partNum: parseInt(this.numFormData.num),//移动框输入的数量 |
|
|
partNum: parseInt(this.numFormData.num),//移动框输入的数量 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
/* 右侧数据移动 */ |
|
|
/* 右侧数据移动 */ |
|
|
var delid = this.data2.filter(u=>u.id === this.rightRowTemp[0].id)[0] |
|
|
var delid = this.data2.filter(u=>u.partCode === item.partCode)[0] |
|
|
var n1 = parseInt(this.numFormData.num); |
|
|
var n1 = parseInt(this.numFormData.num); |
|
|
var n2 = parseInt(delid.partNum); |
|
|
var n2 = parseInt(delid.partNum); |
|
|
if(n1 === n2){ |
|
|
if(n1 === n2){ |
|
|
this.data2 = this.data2.filter(u=>u.id !== this.rightRowTemp[0].id); |
|
|
this.data2 = this.data2.filter(u=>u.partCode !== item.partCode); |
|
|
this.rightRowTemp = []; |
|
|
this.rightRowTemp = []; |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
this.data2.filter(u=>u.id === this.rightRowTemp[0].id)[0].partNum = delid.partNum - this.numFormData.num; |
|
|
this.data2.filter(u=>u.partCode === item.partCode)[0].partNum = delid.partNum - this.numFormData.num; |
|
|
this.rightRowTemp[0].partNum = n2 - n1; |
|
|
item.partNum = n2 - n1; |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -1214,23 +1226,24 @@ export default { |
|
|
if(this.leftRowTemp.length === 0){ |
|
|
if(this.leftRowTemp.length === 0){ |
|
|
alert("请先选择需移动的零件") |
|
|
alert("请先选择需移动的零件") |
|
|
} |
|
|
} |
|
|
else if(this.leftRowTemp.length !== 0 && parseInt(this.leftRowTemp[0].partNum) !== 1){ |
|
|
else if(this.leftRowTemp.length === 1 && parseInt(this.leftRowTemp[0].partNum) !== 1){ |
|
|
this.numFormData.num = parseInt(this.leftRowTempnpm[0].partNum); |
|
|
this.numFormData.num = parseInt(this.leftRowTempnpm[0].partNum); |
|
|
this.dialogNumVisible = true; |
|
|
this.dialogNumVisible = true; |
|
|
this.numTitle = "输入移动结算件数量" |
|
|
this.numTitle = "输入移动结算件数量" |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
console.log("F->R"); |
|
|
console.log("F->R"); |
|
|
this.numFormData.num = 1; |
|
|
this.leftRowTemp.forEach(item => { |
|
|
if(this.numFormData.num <= this.leftRowTemp[0].partNum && this.numFormData.num > 0){ |
|
|
this.numFormData.num = item.partNum; |
|
|
|
|
|
//if(this.numFormData.num <= this.leftRowTemp[0].partNum && this.numFormData.num > 0){ |
|
|
|
|
|
|
|
|
//数据插入最终缓存 |
|
|
//数据插入最终缓存 |
|
|
console.log("移除或删除") |
|
|
console.log("移除或删除") |
|
|
var frMove = this.tempAssCfgList.filter(u=>u.erpAssemblyCode === this.asTemp[0].erpAssemblyCode); |
|
|
var frMove = this.tempAssCfgList.filter(u=>u.erpAssemblyCode === this.asTemp[0].erpAssemblyCode); |
|
|
var samedetail = frMove[0].details.filter(u=>u.partCode === this.leftRowTemp[0].partCode); |
|
|
var samedetail = frMove[0].details.filter(u=>u.partCode === item.partCode); |
|
|
if(samedetail.length !== 0){ |
|
|
if(samedetail.length !== 0){ |
|
|
if(parseInt(samedetail[0].partNum) === parseInt(this.numFormData.num)){ |
|
|
if(parseInt(samedetail[0].partNum) === parseInt(this.numFormData.num)){ |
|
|
frMove[0].details = frMove[0].details.filter(u=>u.partCode !== this.leftRowTemp[0].partCode); |
|
|
frMove[0].details = frMove[0].details.filter(u=>u.partCode !== item.partCode); |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
samedetail[0].partNum = parseInt(samedetail[0].partNum) - parseInt(this.numFormData.num); |
|
|
samedetail[0].partNum = parseInt(samedetail[0].partNum) - parseInt(this.numFormData.num); |
|
@ -1243,32 +1256,35 @@ export default { |
|
|
console.log("this is tempAssCfgList 最终数据",this.tempAssCfgList) |
|
|
console.log("this is tempAssCfgList 最终数据",this.tempAssCfgList) |
|
|
|
|
|
|
|
|
//数据插入右侧数据源 |
|
|
//数据插入右侧数据源 |
|
|
var judge = this.data2.filter(u=>u.partCode === this.leftRowTemp[0].partCode); |
|
|
var judge = this.data2.filter(u=>u.partCode === item.partCode); |
|
|
if(judge.length === 1){ |
|
|
if(judge.length === 1){ |
|
|
var t = parseInt(judge[0].partNum) + parseInt(this.numFormData.num); |
|
|
var t = parseInt(judge[0].partNum) + parseInt(this.numFormData.num); |
|
|
this.data2.filter(u=>u.partCode === this.leftRowTemp[0].partCode)[0].partNum = t; |
|
|
this.data2.filter(u=>u.partCode === item.partCode)[0].partNum = t; |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
this.data2.push({ |
|
|
this.data2.push({ |
|
|
description: this.leftRowTemp[0].description, |
|
|
description: item.description, |
|
|
isKey: false, |
|
|
isKey: false, |
|
|
partCode: this.leftRowTemp[0].partCode, |
|
|
partCode: item.partCode, |
|
|
partNum: parseInt(this.numFormData.num),//移动框输入的数量 |
|
|
partNum: parseInt(this.numFormData.num),//移动框输入的数量 |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
/* 中间数据移动 */ |
|
|
/* 中间数据移动 */ |
|
|
var delid = this.tempdetails.filter(u=>u.partCode === this.leftRowTemp[0].partCode)[0] |
|
|
var delid = this.tempdetails.filter(u=>u.partCode === item.partCode)[0]; |
|
|
|
|
|
console.log(this.tempdetails); |
|
|
var n1 = parseInt(this.numFormData.num); |
|
|
var n1 = parseInt(this.numFormData.num); |
|
|
var n2 = parseInt(delid.partNum); |
|
|
var n2 = parseInt(delid.partNum); |
|
|
if(n1 === n2){ |
|
|
if(n1 === n2){ |
|
|
this.tempdetails = this.tempdetails.filter(u=>u.partCode !== this.leftRowTemp[0].partCode); |
|
|
this.tempdetails = this.tempdetails.filter(u=>u.partCode !== item.partCode); |
|
|
this.leftRowTemp = []; |
|
|
this.leftRowTemp = []; |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
this.tempdetails.filter(u=>u.partCode === this.leftRowTemp[0].partCode)[0].partNum = parseInt(delid.partNum) - parseInt(this.numFormData.num); |
|
|
this.tempdetails.filter(u=>u.partCode === item.partCode)[0].partNum = parseInt(delid.partNum) - parseInt(this.numFormData.num); |
|
|
this.leftRowTemp[0].partNum = n2 - n1; |
|
|
item.partNum = n2 - n1; |
|
|
} |
|
|
} |
|
|
} |
|
|
//} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -1516,27 +1532,49 @@ export default { |
|
|
this.rightRowTemp=[]; //清空已选 |
|
|
this.rightRowTemp=[]; //清空已选 |
|
|
console.log('当用户手动勾选数据行的 Checkbox 时触发的事件', selection, row) |
|
|
console.log('当用户手动勾选数据行的 Checkbox 时触发的事件', selection, row) |
|
|
// 选择项大于1时 |
|
|
// 选择项大于1时 |
|
|
if (selection.length > 1) { |
|
|
// if (selection.length > 1) { |
|
|
let del_row = selection.shift(); |
|
|
// let del_row = selection.shift(); |
|
|
// console.log('把数组的第一个元素从其中删除后', selection); |
|
|
// // console.log('把数组的第一个元素从其中删除后', selection); |
|
|
this.$refs.rightTable.toggleRowSelection(del_row, false); // 用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中) |
|
|
// this.$refs.rightTable.toggleRowSelection(del_row, false); // 用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中) |
|
|
} |
|
|
// } |
|
|
this.rightRowTemp.push(selection[0]) |
|
|
selection.forEach(item => { |
|
|
|
|
|
this.rightRowTemp.push(item); |
|
|
|
|
|
}); |
|
|
console.log('当用户手动勾选数据行', this.rightRowTemp) |
|
|
console.log('当用户手动勾选数据行', this.rightRowTemp) |
|
|
}, |
|
|
}, |
|
|
|
|
|
/* 右侧复选框全选事件 */ |
|
|
|
|
|
selectRightAll(selection) { |
|
|
|
|
|
this.rightRowTemp=[]; //清空已选 |
|
|
|
|
|
console.log('当用户手动勾选全选 Checkbox 时触发的事件', selection) |
|
|
|
|
|
selection.forEach(item => { |
|
|
|
|
|
this.rightRowTemp.push(item); |
|
|
|
|
|
}); |
|
|
|
|
|
console.log('当用户手动勾选全选', this.rightRowTemp) |
|
|
|
|
|
}, |
|
|
/* 左侧复选框单选事件 */ |
|
|
/* 左侧复选框单选事件 */ |
|
|
selectLeft(selection, row) { |
|
|
selectLeft(selection, row) { |
|
|
this.leftRowTemp=[]; //清空已选 |
|
|
this.leftRowTemp=[]; //清空已选 |
|
|
console.log('当用户手动勾选数据行的 Checkbox 时触发的事件', selection, row) |
|
|
console.log('当用户手动勾选数据行的 Checkbox 时触发的事件', selection, row) |
|
|
// 选择项大于1时 |
|
|
// // 选择项大于1时 |
|
|
if (selection.length > 1) { |
|
|
// if (selection.length > 1) { |
|
|
let del_row = selection.shift(); |
|
|
// let del_row = selection.shift(); |
|
|
// console.log('把数组的第一个元素从其中删除后', selection); |
|
|
// // console.log('把数组的第一个元素从其中删除后', selection); |
|
|
this.$refs.rightTable.toggleRowSelection(del_row, false); // 用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中) |
|
|
// this.$refs.rightTable.toggleRowSelection(del_row, false); // 用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中) |
|
|
} |
|
|
// } |
|
|
this.leftRowTemp.push(selection[0]) |
|
|
selection.forEach(item => { |
|
|
|
|
|
this.leftRowTemp.push(item); |
|
|
|
|
|
}); |
|
|
console.log('当用户手动勾选数据行', this.leftRowTemp) |
|
|
console.log('当用户手动勾选数据行', this.leftRowTemp) |
|
|
}, |
|
|
}, |
|
|
|
|
|
/* 左侧复选框全选事件 */ |
|
|
|
|
|
selectLeftAll(selection) { |
|
|
|
|
|
this.leftRowTemp=[]; //清空已选 |
|
|
|
|
|
console.log('当用户手动勾选全选 Checkbox 时触发的事件', selection) |
|
|
|
|
|
selection.forEach(item => { |
|
|
|
|
|
this.leftRowTemp.push(item); |
|
|
|
|
|
}); |
|
|
|
|
|
console.log('当用户手动勾选全选', this.leftRowTemp) |
|
|
|
|
|
}, |
|
|
getvehicleModel() |
|
|
getvehicleModel() |
|
|
{ |
|
|
{ |
|
|
this.$axios |
|
|
this.$axios |
|
|