Browse Source

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

intex_online20241111
zhang_li 4 weeks ago
parent
commit
b226315337
  1. 19
      src/common/record.js
  2. 78
      src/pages/inventoryMove/coms/comMoveRecord.vue
  3. 37
      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) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();

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

@ -75,7 +75,8 @@
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
calcHandleQty,
calcHandleQtyAdd
} from '@/common/record.js';
export default {
@ -238,7 +239,14 @@
this.toLocationCode = code;
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 pack = result.package;
var item = this.detailSource.find(res => {
@ -297,7 +305,65 @@
}
}
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) {
if (this.$refs.scanPopup) {
@ -407,7 +473,9 @@
});
return;
}
console.log("提交" + JSON.stringify(params))
// if(this.balanceInfo)
console.log("提交" ,params)
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -457,6 +525,8 @@
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail)
console.log(233,submitItem)
console.log(244,info)
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
@ -467,7 +537,7 @@
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.packingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber

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

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

Loading…
Cancel
Save