Browse Source

修改计划外出库

hella_online_20240803
lijuncheng 3 months ago
parent
commit
e14ee61328
  1. 22
      src/common/detail.js
  2. 64
      src/pages/unPlanned/job/issueJobDetail.vue

22
src/common/detail.js

@ -116,6 +116,28 @@ export function calcHandleQty(detailSource) {
}
}
//计算推荐和扫描的不是用一个的数量
export function calcHandleNewQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail ) {
if (!detail.isRecommend && detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
if (!detail.isRecommend ) {
item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
}
export function calcTreeHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();

64
src/pages/unPlanned/job/issueJobDetail.vue

@ -60,9 +60,17 @@
import {
getDataSource,
createRecordInfo,
calcHandleQty,
calcHandleNewQty,
getScanCount
} from '@/common/detail.js';
import {
calc
} from '@/common/calc'
import {
Decimal
} from 'decimal.js'; //
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
@ -192,7 +200,7 @@
},
calcHandleQty() {
calcHandleQty(this.detailSource)
calcHandleNewQty(this.detailSource)
// this.continueScan()
this.$forceUpdate();
},
@ -203,7 +211,7 @@
var item =this.detailSource[i]
for (var j = 0; j < item.subList.length; j++) {
var sub =item.subList[j]
if(sub.isRecommend&&!sub.scaned){
if(!sub.isRecommend&&!sub.scaned){
item.subList.splice(j,1)
}
}
@ -239,8 +247,8 @@
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:Number(result.balance.qty),
qty:qty,
handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.qty),
qty:detail.qty,
fromLocationCode:locationCode,
inventoryStatus:inventoryStatus,
toInventoryStatus:inventoryStatus,
@ -253,50 +261,12 @@
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
this.calcHandleQty();
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】已经扫描")
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续出库?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = 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();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = 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();
}
}
}
}
}
} catch (e) {
@ -349,7 +319,7 @@
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if(cur.scaned){
if(!cur.isRecommend&&cur.scaned){
if (cur.qty != cur.handleQty) {
var tempHandleQty =0
if(cur.handleQty){
@ -357,7 +327,7 @@
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
str += `物料号【${cur.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
}

Loading…
Cancel
Save