Browse Source

【nev-pc】kitting创建底盘组,未更新右下序号和汇总bug处理

ag_report_nev
安虹睿 7 months ago
parent
commit
0eeeab8be0
  1. 79
      fe/PC/src/views/padManage/isPadForKittingPack.vue

79
fe/PC/src/views/padManage/isPadForKittingPack.vue

@ -333,6 +333,40 @@ export default {
this.loading = false 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(){ initKittingData(){
let _data = { let _data = {
@ -367,37 +401,7 @@ export default {
} }
if(this.centerChassisList && this.centerChassisList.length > 0)this.centerChassisList[0].canSelect = true if(this.centerChassisList && this.centerChassisList.length > 0)this.centerChassisList[0].canSelect = true
// //
let _ChassisBomData = {} this.fleshRightBottomBomData()
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
})
}).catch(err => { }).catch(err => {
this.loading = false this.loading = false
}) })
@ -436,7 +440,13 @@ export default {
return return
} }
let _selectChassisNumber = [] 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(",")}) 移入底盘组` let _msg = `是否确定将底盘号 (${_selectChassisNumber.join(",")}) 移入底盘组`
this.$confirm(_msg, '提示', { this.$confirm(_msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -444,12 +454,15 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).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 = [
...this.rightTopChassisGroup, ...this.rightTopChassisGroup,
..._selectItems ..._selectItems
] ]
//
this.fleshRightBottomBomData()
}).catch(() => { }).catch(() => {
}); });
}, },

Loading…
Cancel
Save