|
|
@ -333,6 +333,40 @@ export default { |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 刷新右下数据,重新计算底盘序号和汇总 |
|
|
|
fleshRightBottomBomData(){ |
|
|
|
let _ChassisBomData = {} |
|
|
|
let _Chassis_index = {} |
|
|
|
this.rightTopChassisGroup.forEach((Citem,Ckey)=>{ |
|
|
|
_ChassisBomData[Citem.chassisNumber] = Citem.itemCode |
|
|
|
_Chassis_index[Citem.chassisNumber] = Number(Ckey) + 1 |
|
|
|
}) |
|
|
|
// 初始化右下角底盘序号与右上数据序号相对应 |
|
|
|
getKittingChassisBom(this.currentKittingInfo.code,_ChassisBomData) |
|
|
|
.then(res=>{ |
|
|
|
let _rightData = [] |
|
|
|
this.currentKittingInfo.details.forEach(item=>{ |
|
|
|
let _item = JSON.parse(JSON.stringify(item)) |
|
|
|
res.forEach((rItem,rIndex)=>{ |
|
|
|
if(rItem.itemCode == _item.itemCode){ |
|
|
|
let _chassisIndex = [] |
|
|
|
rItem.chassisNumberList.forEach((litem,lindex)=>{ |
|
|
|
_chassisIndex.push(_Chassis_index[litem]) |
|
|
|
}) |
|
|
|
_item.chassisIndex = _chassisIndex.join(",") |
|
|
|
_item.chassisTotal = _chassisIndex.length * Number(item.qty) |
|
|
|
} |
|
|
|
}) |
|
|
|
_rightData.push(_item) |
|
|
|
}) |
|
|
|
this.rightBottomBomData = _rightData |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.rightBottomBomData = JSON.parse(JSON.stringify(this.currentKittingInfo.details)) |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取中间数据 及初始化数据 |
|
|
|
initKittingData(){ |
|
|
|
let _data = { |
|
|
@ -367,37 +401,7 @@ export default { |
|
|
|
} |
|
|
|
if(this.centerChassisList && this.centerChassisList.length > 0)this.centerChassisList[0].canSelect = true |
|
|
|
// 初始化右下数据 |
|
|
|
let _ChassisBomData = {} |
|
|
|
let _Chassis_index = {} |
|
|
|
this.rightTopChassisGroup.forEach((Citem,Ckey)=>{ |
|
|
|
_ChassisBomData[Citem.chassisNumber] = Citem.itemCode |
|
|
|
_Chassis_index[Citem.chassisNumber] = Number(Ckey) + 1 |
|
|
|
}) |
|
|
|
// 初始化右下角底盘序号与右上数据序号相对应 |
|
|
|
getKittingChassisBom(this.currentKittingInfo.code,_ChassisBomData) |
|
|
|
.then(res=>{ |
|
|
|
let _rightData = [] |
|
|
|
this.currentKittingInfo.details.forEach(item=>{ |
|
|
|
let _item = JSON.parse(JSON.stringify(item)) |
|
|
|
res.forEach((rItem,rIndex)=>{ |
|
|
|
if(rItem.itemCode == _item.itemCode){ |
|
|
|
let _chassisIndex = [] |
|
|
|
rItem.chassisNumberList.forEach((litem,lindex)=>{ |
|
|
|
_chassisIndex.push(_Chassis_index[litem]) |
|
|
|
}) |
|
|
|
_item.chassisIndex = _chassisIndex.join(",") |
|
|
|
_item.chassisTotal = _chassisIndex.length * Number(item.qty) |
|
|
|
} |
|
|
|
}) |
|
|
|
_rightData.push(_item) |
|
|
|
}) |
|
|
|
this.rightBottomBomData = _rightData |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.rightBottomBomData = JSON.parse(JSON.stringify(this.currentKittingInfo.details)) |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
this.fleshRightBottomBomData() |
|
|
|
}).catch(err => { |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
@ -436,7 +440,13 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
let _selectChassisNumber = [] |
|
|
|
_selectItems.forEach(item=>{ if(item.isSelect)_selectChassisNumber.push(item.chassisNumber)}) |
|
|
|
let _selectChassisIds = [] |
|
|
|
_selectItems.forEach(item=>{ |
|
|
|
if(item.isSelect){ |
|
|
|
_selectChassisNumber.push(item.chassisNumber) |
|
|
|
_selectChassisIds.push(item.id) |
|
|
|
} |
|
|
|
}) |
|
|
|
let _msg = `是否确定将底盘号 (${_selectChassisNumber.join(",")}) 移入底盘组` |
|
|
|
this.$confirm(_msg, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
@ -444,12 +454,15 @@ export default { |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
// 中间数据移除已选项 |
|
|
|
this.centerChassisList = this.centerChassisList.filter(item => !_selectChassisNumber.includes(item.chassisNumber)) |
|
|
|
console.log(451,this.centerChassisList) |
|
|
|
this.centerChassisList = this.centerChassisList.filter(item => !_selectChassisIds.includes(item.id)) |
|
|
|
// 右侧数据添加已选 |
|
|
|
this.rightTopChassisGroup = [ |
|
|
|
...this.rightTopChassisGroup, |
|
|
|
..._selectItems |
|
|
|
] |
|
|
|
// 初始化右下数据 |
|
|
|
this.fleshRightBottomBomData() |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
}, |
|
|
|