Browse Source

修改采购退货数量汇总

hella_online_20240911
lijuncheng 2 weeks ago
parent
commit
a45813976d
  1. 2
      src/pages/purchaseReturn/coms/comReturnDetailCard.vue
  2. 1
      src/pages/purchaseReturn/coms/comScanReturnPack.vue
  3. 102
      src/pages/purchaseReturn/job/returnDetail.vue

2
src/pages/purchaseReturn/coms/comReturnDetailCard.vue

@ -12,7 +12,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="itemCoceClick($event,item,index)" <uni-swipe-action-item @click="itemCoceClick($event,item,index)"
:right-options="removeOptions"> :right-options="removeOptions">
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty> <item-qty :dataContent="item" :isShowBalanceQty="false" :handleQty="item.handleQty"></item-qty>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<!-- <com-issue-request-info :workShopCode="dataContent.workShopCode" :dataContent="dataContent"> <!-- <com-issue-request-info :workShopCode="dataContent.workShopCode" :dataContent="dataContent">

1
src/pages/purchaseReturn/coms/comScanReturnPack.vue

@ -497,6 +497,7 @@
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
this.$emit('updateData', "");
this.getfocus(); this.getfocus();
}, },

102
src/pages/purchaseReturn/job/returnDetail.vue

@ -236,25 +236,53 @@
}, },
updateData(record) { updateData(record) {
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); if(record){
let itemHandleQty = 0; let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
if (item != undefined) { let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
item.Locations.forEach(l => { let itemHandleQty = 0;
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b if (item != undefined) {
.packingNumber == null || b.packingNumber == '') && b.batch == item.Locations.forEach(l => {
record.batch); let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
let handleQty = 0; .packingNumber == null || b.packingNumber == '') && b.batch ==
if (batch != undefined) { record.batch);
batch.Records.forEach(res => { let handleQty = 0;
handleQty = calc.add(handleQty, res.qty) if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
item.handleQty=itemHandleQty;
}
this.$forceUpdate()
}else {
//
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if(record){
var handleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,handleQty)
}
})
})
}) })
batch.handleQty = handleQty; //
itemHandleQty = calc.add(itemHandleQty, handleQty) item.handleQty =totalQty
} })
}) })
} }
// item.handleQty=itemHandleQty;
//
}, },
submit(){ submit(){
@ -280,50 +308,18 @@
checkCount(){ checkCount(){
let str="" let str=""
let commitHint="" let commitHint=""
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
// if (batch.qty != record.qty) {
// var tempHandleQty = 0
// if (record.qty) {
// tempHandleQty = record.qty
// } else {
// tempHandleQty = 0
// }
// if (batch.qty != 0) {
// str +=
// `${record.packingNumber}${tempHandleQty}${batch.qty}\n`
// }
// }
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
//
item.totalQty =totalQty
})
})
// //
this.detailSource.forEach(detail=>{ this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{ detail.Items.forEach(item=>{
if(this.jobContent.allowPartialComplete=="FALSE"){ if(this.jobContent.allowPartialComplete=="FALSE"){
if(item.taskQty!=item.totalQty){ if(item.taskQty!=item.handleQty){
str += `物料号【${item.itemCode}任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` str += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.taskQty}】不一致\n`
} }
}else { }else {
// //
if(item.taskQty!=item.totalQty){ if(item.taskQty!=item.handleQty){
commitHint += `物料号【${item.itemCode}任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致,是否提交\n` commitHint += `物料号【${item.itemCode}】实际提交数量【${item.handleQty}】与任务数量【${item.taskQty}】不一致,是否提交?\n`
} }
} }
}) })

Loading…
Cancel
Save