|
|
@ -6,6 +6,10 @@ import { |
|
|
|
getDirectoryItemArray, |
|
|
|
} from '@/common/directory.js'; |
|
|
|
import { calc } from '@/common/calc' |
|
|
|
import { Decimal } from 'decimal.js';//引入
|
|
|
|
import { |
|
|
|
deepCopyData |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
export function createItemInfo(balance, pack) { |
|
|
|
let item = { |
|
|
@ -13,25 +17,24 @@ export function createItemInfo(balance, pack) { |
|
|
|
itemName: pack.itemName, |
|
|
|
stdPackQty: pack.stdPackQty, |
|
|
|
stdPackUnit: pack.stdPackUnit, |
|
|
|
qty: Number(balance.qty), |
|
|
|
handleQty: 0, |
|
|
|
qty: new Decimal(balance.qty).toNumber(), |
|
|
|
handleQty:new Decimal(0).toNumber(), |
|
|
|
uom: pack.uom, |
|
|
|
subList: [] |
|
|
|
} |
|
|
|
return item; |
|
|
|
} |
|
|
|
|
|
|
|
export function createDetailInfo(data, pack) { |
|
|
|
data.scaned = true; |
|
|
|
export function createDetailInfo(balance, pack) { |
|
|
|
balance.scaned = true; |
|
|
|
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
|
|
|
|
// data.inventoryStatus = data.inventoryStatus;
|
|
|
|
let detail = {}; |
|
|
|
Object.assign(detail, data) |
|
|
|
detail.balanceQty = Number(detail.qty) |
|
|
|
detail.qty = Number(detail.qty); |
|
|
|
detail.stdPackQty = Number(pack.stdPackQty) |
|
|
|
let detail = deepCopyData(balance); |
|
|
|
detail.balanceQty = new Decimal(detail.qty).toNumber() |
|
|
|
detail.qty = new Decimal(detail.qty).toNumber(); |
|
|
|
detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber() |
|
|
|
detail.stdPackUnit = pack.stdPackUnit |
|
|
|
detail.handleQty =0; |
|
|
|
detail.handleQty = new Decimal(detail.qty).toNumber() ; |
|
|
|
detail.package = pack; |
|
|
|
|
|
|
|
return detail; |
|
|
@ -40,10 +43,10 @@ export function createDetailInfo(data, pack) { |
|
|
|
//计算实际数量
|
|
|
|
export function calcHandleQty(detailSource) { |
|
|
|
for (let item of detailSource) { |
|
|
|
item.qty = 0; |
|
|
|
item.handleQty = new Decimal(0).toNumber(); |
|
|
|
for (let detail of item.subList) { |
|
|
|
if (detail != undefined && detail.scaned) { |
|
|
|
item.qty = calc.add(item.qty,detail.qty); |
|
|
|
item.handleQty = calc.add(item.handleQty,detail.handleQty); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|