|
@ -156,6 +156,8 @@ |
|
|
let itemInfo = that.itemList.find(r => { |
|
|
let itemInfo = that.itemList.find(r => { |
|
|
return r.itemCode == result.data.itemCode |
|
|
return r.itemCode == result.data.itemCode |
|
|
}) |
|
|
}) |
|
|
|
|
|
let params = JSON.stringify(that.currentLabel); |
|
|
|
|
|
console.log('采购上架', params); |
|
|
if (itemInfo == undefined) { |
|
|
if (itemInfo == undefined) { |
|
|
that.getBalance(); |
|
|
that.getBalance(); |
|
|
} else { |
|
|
} else { |
|
@ -223,6 +225,7 @@ |
|
|
//根据零件号和箱码获取采购信息 |
|
|
//根据零件号和箱码获取采购信息 |
|
|
let purchaseDetail = await getPurchaseDetailAsync(balanceItem.itemCode, balanceItem |
|
|
let purchaseDetail = await getPurchaseDetailAsync(balanceItem.itemCode, balanceItem |
|
|
.packingCode); |
|
|
.packingCode); |
|
|
|
|
|
debugger; |
|
|
if (purchaseDetail.error) { |
|
|
if (purchaseDetail.error) { |
|
|
that.showScanMessage(purchaseDetail.error.message); |
|
|
that.showScanMessage(purchaseDetail.error.message); |
|
|
} else { |
|
|
} else { |
|
@ -235,6 +238,7 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
createBalanceItem(balanceItem, purchaseDetail) { |
|
|
createBalanceItem(balanceItem, purchaseDetail) { |
|
|
|
|
|
|
|
|
let locationErpCode = purchaseDetail.recommendErpCode; |
|
|
let locationErpCode = purchaseDetail.recommendErpCode; |
|
|
if (this.itemList.length == 0) { |
|
|
if (this.itemList.length == 0) { |
|
|
this.recommendErpLocationCode = locationErpCode; |
|
|
this.recommendErpLocationCode = locationErpCode; |
|
@ -276,29 +280,88 @@ |
|
|
|
|
|
|
|
|
createLabel(balanceItem, purchaseDetail) { |
|
|
createLabel(balanceItem, purchaseDetail) { |
|
|
let label = this.currentLabel; |
|
|
let label = this.currentLabel; |
|
|
label.putawayType = 0; |
|
|
// label.putawayType = 0; |
|
|
label.qty = balanceItem.qty; |
|
|
// label.qty = balanceItem.qty; |
|
|
label.uom = balanceItem.uom; |
|
|
// label.uom = balanceItem.uom; |
|
|
label.status = balanceItem.status; |
|
|
// label.status = balanceItem.status; |
|
|
|
|
|
|
|
|
|
|
|
// label.locationCode = balanceItem.locationCode; |
|
|
|
|
|
// label.fromContainerCode = balanceItem.containerCode; |
|
|
|
|
|
// label.fromStatus = balanceItem.status; |
|
|
|
|
|
// label.fromPackingCode = balanceItem.packingCode; |
|
|
|
|
|
// label.fromLocationCode = balanceItem.locationCode; |
|
|
|
|
|
// label.fromLocationGroup = balanceItem.locationGroup; |
|
|
|
|
|
// label.fromLocationArea = balanceItem.locationArea; |
|
|
|
|
|
// label.fromLocationErpCode = balanceItem.locationErpCode; |
|
|
|
|
|
// label.fromWarehouseCode = balanceItem.warehouseCode; |
|
|
|
|
|
// label.fromLot = balanceItem.lot; |
|
|
|
|
|
|
|
|
|
|
|
// label.poNumber = purchaseDetail.poNumber; |
|
|
|
|
|
// label.poLine = purchaseDetail.poLine; |
|
|
|
|
|
// label.supplierPackUom = purchaseDetail.supplierPackUom; |
|
|
|
|
|
// label.supplierPackQty = purchaseDetail.supplierPackQty; |
|
|
|
|
|
// label.stdPackUom = purchaseDetail.stdPackUom; |
|
|
|
|
|
// label.stdPackQty = purchaseDetail.stdPackQty; |
|
|
|
|
|
|
|
|
|
|
|
// label.worker = localStorage.userName; |
|
|
|
|
|
|
|
|
|
|
|
//============================================ |
|
|
label.locationCode = balanceItem.locationCode; |
|
|
label.locationCode = balanceItem.locationCode; |
|
|
label.fromContainerCode = balanceItem.containerCode; |
|
|
label.qty = balanceItem.qty; |
|
|
label.fromStatus = balanceItem.status; |
|
|
label.stdPackQty = purchaseDetail.stdPackQty; |
|
|
label.fromPackingCode = balanceItem.packingCode; |
|
|
label.fromPackingCode = balanceItem.packingCode; |
|
|
|
|
|
label.toPackingCode = label.fromPackingCode; |
|
|
|
|
|
label.fromContainerCode = balanceItem.containerCode; |
|
|
|
|
|
label.toContainerCode = balanceItem.containerCode; |
|
|
|
|
|
label.fromLot = balanceItem.lot; |
|
|
|
|
|
label.toLot = balanceItem.lot; |
|
|
|
|
|
label.supplierBatch = balanceItem.supplierBatch; |
|
|
|
|
|
label.arriveDate = balanceItem.arriveDate; |
|
|
|
|
|
label.produceDate = balanceItem.produceDate; |
|
|
|
|
|
label.expireDate = balanceItem.expireDate; |
|
|
label.fromLocationCode = balanceItem.locationCode; |
|
|
label.fromLocationCode = balanceItem.locationCode; |
|
|
label.fromLocationGroup = balanceItem.locationGroup; |
|
|
|
|
|
label.fromLocationArea = balanceItem.locationArea; |
|
|
label.fromLocationArea = balanceItem.locationArea; |
|
|
|
|
|
label.fromLocationGroup = balanceItem.locationGroup; |
|
|
label.fromLocationErpCode = balanceItem.locationErpCode; |
|
|
label.fromLocationErpCode = balanceItem.locationErpCode; |
|
|
label.fromWarehouseCode = balanceItem.warehouseCode; |
|
|
label.fromWarehouseCode = balanceItem.warehouseCode; |
|
|
label.fromLot = balanceItem.lot; |
|
|
|
|
|
|
|
|
label.toWarehouseCode = balanceItem.warehouseCode; |
|
|
|
|
|
label.fromStatus = balanceItem.status; |
|
|
|
|
|
label.toStatus = balanceItem.status; |
|
|
|
|
|
|
|
|
|
|
|
label.recommendContainerCode = balanceItem.containerCode; |
|
|
|
|
|
label.recommendPackingCode = balanceItem.packingCode; |
|
|
|
|
|
label.recommendSupplierBatch = balanceItem.supplierBatch; |
|
|
|
|
|
label.recommendArriveDate = balanceItem.arriveDate; |
|
|
|
|
|
label.recommendProduceDate = balanceItem.produceDate; |
|
|
|
|
|
label.recommendExpireDate = balanceItem.expireDate; |
|
|
|
|
|
label.recommendLot = balanceItem.lot; |
|
|
|
|
|
label.recommendToLocationCode = balanceItem.locationCode; |
|
|
|
|
|
label.recommendToLocationArea = balanceItem.locationArea; |
|
|
|
|
|
label.recommendToLocationGroup = balanceItem.locationGroup; |
|
|
|
|
|
label.recommendToLocationErpCode = balanceItem.locationErpCode; |
|
|
|
|
|
label.recommendToWarehouseCode = balanceItem.warehouseCode; |
|
|
|
|
|
label.uom = balanceItem.uom; |
|
|
|
|
|
label.recommendQty = balanceItem.qty; |
|
|
|
|
|
|
|
|
|
|
|
label.handledContainerCode = balanceItem.containerCode; |
|
|
|
|
|
label.handledPackingCode = balanceItem.packingCode; |
|
|
|
|
|
label.handledSupplierBatch = balanceItem.supplierBatch; |
|
|
|
|
|
label.handledArriveDate = balanceItem.arriveDate; |
|
|
|
|
|
label.handledProduceDate = balanceItem.produceDate; |
|
|
|
|
|
label.handledExpireDate = balanceItem.expireDate; |
|
|
|
|
|
label.handledLot = balanceItem.lot; |
|
|
|
|
|
label.handledToLocationCode = balanceItem.locationCode; |
|
|
|
|
|
label.handledToLocationArea = balanceItem.locationArea; |
|
|
|
|
|
label.handledToLocationGroup = balanceItem.locationGroup; |
|
|
|
|
|
label.handledToLocationErpCode = balanceItem.locationErpCode; |
|
|
|
|
|
label.handledToWarehouseCode = balanceItem.warehouseCode; |
|
|
|
|
|
label.handledQty = balanceItem.qty; |
|
|
|
|
|
|
|
|
label.poNumber = purchaseDetail.poNumber; |
|
|
label.poNumber = purchaseDetail.poNumber; |
|
|
label.poLine = purchaseDetail.poLine; |
|
|
label.poLine = purchaseDetail.poLine; |
|
|
label.supplierPackUom = purchaseDetail.supplierPackUom; |
|
|
label.status = balanceItem.status; |
|
|
label.supplierPackQty = purchaseDetail.supplierPackQty; |
|
|
|
|
|
label.stdPackUom = purchaseDetail.stdPackUom; |
|
|
|
|
|
label.stdPackQty = purchaseDetail.stdPackQty; |
|
|
|
|
|
|
|
|
|
|
|
label.worker = localStorage.userName; |
|
|
|
|
|
return label; |
|
|
return label; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -310,8 +373,9 @@ |
|
|
async selectedBalanceItem(balanceItem) { |
|
|
async selectedBalanceItem(balanceItem) { |
|
|
let purchaseDetail = await getPurchaseDetailAsync(balanceItem.itemCode, balanceItem |
|
|
let purchaseDetail = await getPurchaseDetailAsync(balanceItem.itemCode, balanceItem |
|
|
.packingCode); |
|
|
.packingCode); |
|
|
|
|
|
|
|
|
if (purchaseDetail != null) { |
|
|
if (purchaseDetail != null) { |
|
|
this.createBalanceItem(purchaseDetail); |
|
|
this.createBalanceItem(balanceItem,purchaseDetail); |
|
|
} else { |
|
|
} else { |
|
|
this.showScanMessage('未查到零件【' + balanceItem.itemCode + '】的采购信息'); |
|
|
this.showScanMessage('未查到零件【' + balanceItem.itemCode + '】的采购信息'); |
|
|
} |
|
|
} |
|
@ -375,31 +439,38 @@ |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
let item = { |
|
|
let item = { |
|
|
company: localStorage.company, |
|
|
// company: localStorage.company, |
|
|
number: "", |
|
|
number: "", |
|
|
worker: localStorage.userName, |
|
|
worker: localStorage.userName, |
|
|
warehouseCode: localStorage.warehouseCode, |
|
|
// warehouseCode: localStorage.warehouseCode, |
|
|
jobNumber: "validation errors", |
|
|
jobNumber: "validation errors", |
|
|
details: [] |
|
|
details: [] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
that.itemList.forEach(i => { |
|
|
that.itemList.forEach(i => { |
|
|
i.labelList.forEach(r => { |
|
|
i.labelList.forEach(r => { |
|
|
r.toContainerCode = r.fromContainerCode, |
|
|
// r.toContainerCode = r.fromContainerCode, |
|
|
r.toStatus = r.fromStatus, |
|
|
// r.toStatus = r.fromStatus, |
|
|
r.toPackingCode = r.fromPackingCode, |
|
|
// r.toPackingCode = r.fromPackingCode, |
|
|
r.toWarehouseCode = r.fromWarehouseCode, |
|
|
// r.toWarehouseCode = r.fromWarehouseCode, |
|
|
r.toLot = r.fromLot, |
|
|
// r.toLot = r.fromLot, |
|
|
r.toLocationCode = that.location.code, |
|
|
// r.toLocationCode = that.location.code, |
|
|
r.toLocationGroup = that.location.locationGroupCode, |
|
|
// r.toLocationGroup = that.location.locationGroupCode, |
|
|
r.toLocationArea = that.location.areaCode, |
|
|
// r.toLocationArea = that.location.areaCode, |
|
|
r.toLocationErpCode = that.location.erpLocationCode, |
|
|
// r.toLocationErpCode = that.location.erpLocationCode, |
|
|
|
|
|
|
|
|
r.worker = localStorage.userName, |
|
|
// r.worker = localStorage.userName, |
|
|
|
|
|
|
|
|
|
|
|
r.toLocationCode = this.location.code; |
|
|
|
|
|
r.toLocationGroup = this.location.locationGroupCode; |
|
|
|
|
|
r.toLocationArea = this.location.areaCode; |
|
|
|
|
|
r.toLocationErpCode = this.location.erpLocationCode; |
|
|
|
|
|
|
|
|
item.details.push(r); |
|
|
item.details.push(r); |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
let params = JSON.stringify(item); |
|
|
let params = JSON.stringify(item); |
|
|
|
|
|
console.log("采购上架", params) |
|
|
purchasePutaway(params) |
|
|
purchasePutaway(params) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
that.showCommitSuccess(); |
|
|
that.showCommitSuccess(); |
|
|