Browse Source

修改采购退货申请

hella_online_20240829
Niext 6 months ago
parent
commit
3267c9dd4f
  1. 10
      src/mycomponents/scan/winScanPackAndLocation.vue
  2. 136
      src/pages/purchaseReturn/job/returnDetail.vue

10
src/mycomponents/scan/winScanPackAndLocation.vue

@ -88,7 +88,7 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
// //
noShowBalanceMessage: { noShowBalanceMessage: {
type: Boolean, type: Boolean,
default: false default: false
@ -102,6 +102,10 @@
type: String, type: String,
default: "HPQ,HMQ" default: "HPQ,HMQ"
}, },
queryBalance: {
type: Boolean,
default: true
}
}, },
data() { data() {
return { return {
@ -246,6 +250,7 @@
checkPackage(result) { checkPackage(result) {
if (result.label != null) { if (result.label != null) {
this.scanResult = result; this.scanResult = result;
if (this.queryBalance == true) {
// uni.showLoading({ // uni.showLoading({
// title: '...', // title: '...',
// mask: true // mask: true
@ -263,6 +268,9 @@
} }
// uni.hideLoading(); // uni.hideLoading();
}); });
} else {
this.packCallBack(null);
}
} }
}, },

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

@ -35,7 +35,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :queryBalance='false'></win-scan-pack-and-location>
<return-detail-info-popup ref="jobDetailPopup"></return-detail-info-popup> <return-detail-info-popup ref="jobDetailPopup"></return-detail-info-popup>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -225,6 +225,7 @@
getScanResult(result) { getScanResult(result) {
try { try {
debugger;
var packingNumber = result.label.packingNumber; var packingNumber = result.label.packingNumber;
var batch = result.label.batch; var batch = result.label.batch;
var qty = result.label.qty; var qty = result.label.qty;
@ -240,77 +241,94 @@
r.batch == batch && r.batch == batch &&
r.fromLocationCode == result.fromLocationCode r.fromLocationCode == result.fromLocationCode
}) })
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); // let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// //
if (itemDetail == undefined) { if (itemDetail == undefined) {
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>未找到记录") .fromLocationCode + "】<br>未找到明细")
return; return;
} else { } else {
itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.inventoryStatus == result.balance.inventoryStatus
})
//
if (itemDetail == undefined) {
itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode
})
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") .fromLocationCode + "】已经扫描")
return; return;
} } else {
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续退货?', res => {
if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty); itemDetail.handleQty = Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus =result.balance.inventoryStatus; itemDetail.toInventoryStatus = itemDetail.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty; // itemDetail.balance = result.balance;
itemDetail.balance.packQty = result.package.packQty // itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packUnit = result.package.packUnit // itemDetail.balance.packQty = Number(result.package.packQty)
// itemDetail.balance.packUnit = result.package.packUnit
// itemDetail.toInventoryStatus = result.balance.inventoryStatus;
// itemDetail.inventoryStatus =result.balance.inventoryStatus;
// itemDetail.toInventoryStatus = result.balance.inventoryStatus;
// itemDetail.inventoryStatus =result.balance.inventoryStatus;
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = Number(result.balance.qty);
// itemDetail.balance.packQty = Number(result.package.packQty)
// itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty(); this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
} }
} else { // if (itemDetail == undefined) {
// // itemDetail = detail.subList.find(r => {
if (itemDetail.scaned) { // return r.packingNumber == packingNumber &&
this.showErrorMessage("箱码【" + packingNumber + "】<br>批次【" + batch + "】<br>库位【" + result // r.batch == batch &&
.fromLocationCode + "】<br>状态【" + balanceStatus + "】<br>已经扫描") // r.fromLocationCode == result.fromLocationCode
return; // })
} else { // if (itemDetail.scaned) {
itemDetail.scaned = true; // this.showErrorMessage("" + packingNumber + "<br>" + batch + "<br>" + result
itemDetail.handleQty = Number(result.balance.qty); // .fromLocationCode + "<br>" + balanceStatus + "<br>")
itemDetail.toInventoryStatus = result.balance.inventoryStatus; // return;
itemDetail.inventoryStatus =result.balance.inventoryStatus; // }
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty); // let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
itemDetail.balance.packQty = Number(result.package.packQty) // if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
itemDetail.balance.packUnit = result.package.packUnit // this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
this.calcHandleQty(); // '],退?', res => {
} // if (res) {
} // itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty);
// itemDetail.toInventoryStatus = result.balance.inventoryStatus;
// itemDetail.inventoryStatus =result.balance.inventoryStatus;
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// } else {
// this.scanPopupGetFocus();
// }
// });
// } else {
// this.showQuestionMessage(',[' + balanceStatus + '][' +
// itemStatus +
// '],!', res => {
// this.scanPopupGetFocus();
// });
// }
// } else {
// //
// if (itemDetail.scaned) {
// this.showErrorMessage("" + packingNumber + "<br>" + batch + "<br>" + result
// .fromLocationCode + "<br>" + balanceStatus + "<br>")
// return;
// } else {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty);
// itemDetail.toInventoryStatus = result.balance.inventoryStatus;
// itemDetail.inventoryStatus =result.balance.inventoryStatus;
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = Number(result.balance.qty);
// itemDetail.balance.packQty = Number(result.package.packQty)
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// }
// }
} }

Loading…
Cancel
Save