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) { export function calcTreeHandleQty(detailSource) {
for (let item of detailSource) { for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber(); item.handleQty = new Decimal(0).toNumber();

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

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

Loading…
Cancel
Save