Browse Source

直接发料来源库位,库存移动批次

intex_online20241111
zhang_li 4 weeks ago
parent
commit
b226315337
  1. 19
      src/common/record.js
  2. 88
      src/pages/inventoryMove/coms/comMoveRecord.vue
  3. 47
      src/pages/issue/record/directIssue.vue

19
src/common/record.js

@ -79,7 +79,24 @@ export function calcHandleQty(detailSource) {
} }
} }
} }
//添加数量
export function calcHandleQtyAdd(detailSource,label) {
console.log(label.qty)
console.log(detailSource)
for (let item of detailSource) {
item.handleQty = item.handleQty || new Decimal(0).toNumber();
item.qty = item.qty|| new Decimal(0).toNumber();
item.handleQty = calc.add(item.handleQty, label.qty);
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
detail.handleQty = calc.add(detail.handleQty, label.qty);
}
// 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();

88
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -75,7 +75,8 @@
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
createDetailInfo, createDetailInfo,
calcHandleQty calcHandleQty,
calcHandleQtyAdd
} from '@/common/record.js'; } from '@/common/record.js';
export default { export default {
@ -238,7 +239,14 @@
this.toLocationCode = code; this.toLocationCode = code;
this.toLocationInfo = location; this.toLocationInfo = location;
}, },
getScanResult(result) { getScanResult(result,managementType) {
if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){
this.getScanResultAfterBatch(result)
}else{
this.getScanResultAfter(result)
}
},
getScanResultAfter(result){
var balance = result.balance; var balance = result.balance;
var pack = result.package; var pack = result.package;
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
@ -249,11 +257,11 @@
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
if (newDetail.packingNumber == '') { if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number; newDetail.packingNumber = pack.number;
} }
if (this.businessTypeCode == "Move") { if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus; newDetail.toInventoryStatus = balance.inventoryStatus;
} else { } else {
@ -273,7 +281,7 @@
return r; return r;
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
// newDetail.inventoryStatus = balance.inventoryStatus; // newDetail.inventoryStatus = balance.inventoryStatus;
@ -282,7 +290,7 @@
} else { } else {
newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus;
} }
if (newDetail.packingNumber == '') { if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number; newDetail.packingNumber = pack.number;
} }
@ -297,7 +305,65 @@
} }
} }
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
},
getScanResultAfterBatch(result){
var balance = result.balance;
this.balanceInfo = result.balance;
var pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack);
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
}
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
newDetail.handleQty = 0
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.batch == pack.batch &&
r.fromLocationCode == balance.locationCode &&
r.toInventoryStatus == balance.inventoryStatus &&
r.scaned == true) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
// newDetail.inventoryStatus = balance.inventoryStatus;
if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus;
} else {
newDetail.toInventoryStatus = this.toInventoryStatus;
}
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
}
newDetail.handleQty = 0
newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
item.subList.push(newDetail);
} else {
}
}
calcHandleQtyAdd(this.detailSource,result.label);
}, },
showErrorMessage(message) { showErrorMessage(message) {
if (this.$refs.scanPopup) { if (this.$refs.scanPopup) {
@ -407,7 +473,9 @@
}); });
return; return;
} }
console.log("提交" + JSON.stringify(params)) // if(this.balanceInfo)
console.log("提交" ,params)
inventoryMoveRecordSubmit(params).then(res => { inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -457,6 +525,8 @@
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail) var submitItem = deepCopyData(detail)
console.log(233,submitItem)
console.log(244,info)
submitItem.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
@ -467,7 +537,7 @@
submitItem.fromPackingNumber = info.packingNumber; submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber; submitItem.toPackingNumber = info.packingNumber;
submitItem.packingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber

47
src/pages/issue/record/directIssue.vue

@ -39,9 +39,13 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
</winComScanBalance>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'">
</win-scan-pack-and-location>
<!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> -->
<balanceQuery ref="refBalanceQuery" :businessTypeCode="businessTypeCode"></balanceQuery> <balanceQuery ref="refBalanceQuery" :businessTypeCode="businessTypeCode"></balanceQuery>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -188,18 +192,12 @@
}); });
}, },
async getScanResult(result) { async getScanResult(result,managementType) {
await getManagementPrecisions([result.label.itemCode], result.balance.locationCode, res => { if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){
if (res.success) { this.setDataBatch(result);
this.managementList = res.list; }else{
this.managementType = this.managementList && this.managementList[0] ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING' this.setData(result);
if(this.managementType == "BY_BATCH" ||this.managementType == "BY_QUANTITY" ){ }
this.setDataBatch(result);
}else{
this.setData(result);
}
}
})
}, },
async setData(result) { async setData(result) {
let balance = result.balance; let balance = result.balance;
@ -541,7 +539,12 @@
openScanPopup() { openScanPopup() {
if (this.businessType) { if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType); // this.$refs.scanFromLocationCode.openScanPopup();
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
} else { } else {
this.getBusinessType() this.getBusinessType()
} }
@ -549,13 +552,13 @@
showFromLocationPopup() { showFromLocationPopup() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup(); this.$refs.scanFromLocationCode.openScanPopup();
}) })
}, },
closeScanPopup() { closeScanPopup() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanFromLocationCode != undefined) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanFromLocationCode.closeScanPopup();
} }
}, },
@ -705,7 +708,11 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
getFromLocation(location) {
this.fromLocationCode = location.code;
this.fromLocationInfo = location;
this.openScanPopup();
},
clearData() { clearData() {
this.fromLocationInfo = {}; this.fromLocationInfo = {};
this.fromLocationCode = ''; this.fromLocationCode = '';

Loading…
Cancel
Save