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