Browse Source

支持orderNo-releaseNo-sequenceNo[-transQty] 格式解析

master
han\hanst 3 weeks ago
parent
commit
2c5b37eacb
  1. 34
      src/views/modules/production-inbound/inboundRegister.vue

34
src/views/modules/production-inbound/inboundRegister.vue

@ -205,7 +205,8 @@ export default {
warehouseId: localStorage.getItem('selectedWarehouse'),
fullscreenLoading: false,
loadingText: '加载中...',
autoCalculate: false
autoCalculate: false,
issueQty: ''
};
},
computed: {
@ -215,8 +216,12 @@ export default {
return sum + Math.round(Number(item.qty) * 10000);
}, 0);
const sum = sumInCents / 10000;
this.inboundItem.transQty = sum;
return sum;
// transQty0
if (this.handlingUnit.length > 0) {
this.inboundItem.transQty = sum;
return sum;
}
return parseFloat(this.inboundItem.transQty) || 0;
},
huKey() {
return `hu_shop_${this.inboundItem.orderNo}_${this.inboundItem.releaseNo}`;
@ -265,14 +270,21 @@ export default {
this.loadingText = '搜索中...';
this.fullscreenLoading = true;
// "3038851" "3038851-1-2"
// "3038851""3038851-1-2" "3038851-1-2-1000"
let orderNo = this.scanCode.trim();
let releaseNo = "*";
let sequenceNo = "*";
this.issueQty = '';
// "-" orderNo-releaseNo-sequenceNo
// "-" orderNo-releaseNo-sequenceNo[-transQty]
const parts = orderNo.split('-');
if (parts.length >= 2) {
if (parts.length === 4) {
// : orderNo-releaseNo-sequenceNo-transQty
orderNo = parts[0];
releaseNo = parts[1] || "*";
sequenceNo = parts[2] || "*";
this.issueQty = parts[3];
} else if (parts.length >= 2) {
orderNo = parts[0];
releaseNo = parts[1];
if (parts.length >= 3) {
@ -281,8 +293,6 @@ export default {
}
const requestData = {
ifsDBName: "IFST",
domainUserID: "CCL_WMS",
ifsSiteID: this.site,
ifsOrderNo: orderNo,
ifsReleaseNo: releaseNo,
@ -296,6 +306,8 @@ export default {
this.shopOrderList = data.data || []
if (this.shopOrderList.length === 0) {
this.$message.warning('未找到匹配的工单');
} else if (this.shopOrderList.length === 1) {
this.selectShopOrder(this.shopOrderList[0]);
}
} else {
this.$message.error(data.msg || '查询失败');
@ -360,7 +372,7 @@ export default {
this.inboundItem = {
...row,
transQty: '',
transQty: this.issueQty || '', // transQty使
unCompleteQty: parseFloat(row.lotSize) - parseFloat(row.qtyComplete),
sequenceNoNew: nextSequence,
batchNo: `${row.orderNo}-${row.releaseNo}-${row.sequenceNo}-${nextSequence}`,
@ -417,8 +429,8 @@ export default {
return;
}
// 使""使""
let qtyToReceive = parseFloat(this.inboundItem.transQty) || 0;
// 使transQty使
let qtyToReceive = parseFloat(this.issueQty) || parseFloat(this.inboundItem.transQty) || 0;
if (qtyToReceive <= 0) {
qtyToReceive = parseFloat(this.inboundItem.unCompleteQty) || 0;
}

Loading…
Cancel
Save