|
@ -67,6 +67,10 @@ |
|
|
calc |
|
|
calc |
|
|
} from '@/common/calc.js'; |
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
Decimal |
|
|
|
|
|
} from 'decimal.js'; //引入 |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getDirectoryItemArray |
|
|
getDirectoryItemArray |
|
|
} from '@/common/directory.js'; |
|
|
} from '@/common/directory.js'; |
|
@ -168,7 +172,7 @@ |
|
|
this.$refs.scanPopup.openScanPopup(isEditPosition); |
|
|
this.$refs.scanPopup.openScanPopup(isEditPosition); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getScanResult(result, param) { |
|
|
async getScanResult(result, param) { |
|
|
this.positionInfo = param.positionInfo; |
|
|
this.positionInfo = param.positionInfo; |
|
|
this.workshopCode = param.workshopCode; |
|
|
this.workshopCode = param.workshopCode; |
|
|
this.productionLineCode = param.productionLineCode; |
|
|
this.productionLineCode = param.productionLineCode; |
|
@ -186,26 +190,26 @@ |
|
|
|
|
|
|
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
var filters = [] |
|
|
var filters = [] |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
column: "itemCode", |
|
|
column: "itemCode", |
|
|
action: "==", |
|
|
action: "==", |
|
|
value: label.itemCode |
|
|
value: label.itemCode |
|
|
}) |
|
|
}) |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
column: "locationCode", |
|
|
column: "locationCode", |
|
|
action: "==", |
|
|
action: "==", |
|
|
value: this.rawLocationCode |
|
|
value: this.rawLocationCode |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
var params = { |
|
|
var params = { |
|
|
filters: filters, |
|
|
filters: filters, |
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
pageSize: 100, |
|
|
pageSize: 100, |
|
|
} |
|
|
} |
|
|
var isCheckItemCode = await getBalanceByFilter(params); |
|
|
var isCheckItemCode = await getBalanceByFilter(params); |
|
|
if(isCheckItemCode.data==null||isCheckItemCode.data.list==0){ |
|
|
if (isCheckItemCode.data == null || isCheckItemCode.data.list == 0) { |
|
|
this.showErrorMessage("未查询到物料号[" + label.itemCode + "]" + |
|
|
this.showErrorMessage("未查询到物料号[" + label.itemCode + "]" + |
|
|
"库位[" + this.rawLocationCode + "]的信息") |
|
|
"库位[" + this.rawLocationCode + "]的信息") |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -247,8 +251,8 @@ |
|
|
itemName: pack.itemName, |
|
|
itemName: pack.itemName, |
|
|
stdPackQty: pack.stdPackQty, |
|
|
stdPackQty: pack.stdPackQty, |
|
|
stdPackUnit: pack.stdPackUnit, |
|
|
stdPackUnit: pack.stdPackUnit, |
|
|
qty: Number(label.qty), |
|
|
qty: new Decimal(label.qty).toNumber(), |
|
|
handleQty: 0, |
|
|
handleQty: new Decimal(0).toNumber(), |
|
|
uom: pack.uom, |
|
|
uom: pack.uom, |
|
|
subList: [] |
|
|
subList: [] |
|
|
} |
|
|
} |
|
@ -256,11 +260,10 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
createDetailInfo(label, pack) { |
|
|
createDetailInfo(label, pack) { |
|
|
let detail = {}; |
|
|
let detail = deepCopyData(label); |
|
|
Object.assign(detail, label) |
|
|
|
|
|
detail.scaned = true; |
|
|
detail.scaned = true; |
|
|
detail.qty = Number(label.qty); |
|
|
detail.qty = new Decimal(label.qty).toNumber(); |
|
|
detail.handleQty = 0; |
|
|
detail.handleQty = new Decimal(label.qty).toNumber(); |
|
|
detail.inventoryStatus = "OK" |
|
|
detail.inventoryStatus = "OK" |
|
|
detail.stdPackQty = pack.stdPackQty; |
|
|
detail.stdPackQty = pack.stdPackQty; |
|
|
detail.stdPackUnit = pack.stdPackUnit; |
|
|
detail.stdPackUnit = pack.stdPackUnit; |
|
@ -273,10 +276,10 @@ |
|
|
|
|
|
|
|
|
calcHandleQty() { |
|
|
calcHandleQty() { |
|
|
for (let item of this.detailSource) { |
|
|
for (let item of this.detailSource) { |
|
|
item.qty = 0; |
|
|
item.handleQty = new Decimal(0).toNumber(); |
|
|
for (let detail of item.subList) { |
|
|
for (let detail of item.subList) { |
|
|
if (detail != undefined) { |
|
|
if (detail != undefined) { |
|
|
item.qty = calc.add(item.qty,detail.qty) |
|
|
item.handleQty = calc.add(item.handleQty, detail.handleQty) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -421,9 +424,11 @@ |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
var submitItem = deepCopyData(detail) |
|
|
var submitItem = deepCopyData(detail) |
|
|
var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode, |
|
|
var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail |
|
|
|
|
|
.itemCode, |
|
|
detail.packingNumber, detail.fromLocationCode, detail.batch); |
|
|
detail.packingNumber, detail.fromLocationCode, detail.batch); |
|
|
var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode, |
|
|
var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail |
|
|
|
|
|
.itemCode, |
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
|
|
|
|
|
|
submitItem.itemCode = detail.itemCode; |
|
|
submitItem.itemCode = detail.itemCode; |
|
@ -448,7 +453,7 @@ |
|
|
submitItem.productionlineCode = this.productionLineCode; |
|
|
submitItem.productionlineCode = this.productionLineCode; |
|
|
submitItem.workStationCode = this.workStationCode; |
|
|
submitItem.workStationCode = this.workStationCode; |
|
|
|
|
|
|
|
|
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; |
|
|
submitItem.qty = detail.handleQty; |
|
|
|
|
|
|
|
|
subList.push(submitItem) |
|
|
subList.push(submitItem) |
|
|
} |
|
|
} |
|
|