Browse Source

2026-01-20

跨区调拨优化
拆合组托优化
master
fengyuan_yang 2 days ago
parent
commit
4b72959b60
  1. 2
      src/views/modules/cross-area-transfer/crossAreaTransfer.vue
  2. 82
      src/views/modules/label-split-merge/labelSplitMerge.vue

2
src/views/modules/cross-area-transfer/crossAreaTransfer.vue

@ -327,7 +327,7 @@ export default {
const params = {
scanCode: this.scanCode.trim(),
transferMode: this.transferMode,
sourceLocation: this.transferMode === 'label' ? this.labelInfo.locationId : this.scanCode.trim(),
sourceLocation: this.transferMode === 'label' ? this.scanCode.trim() : this.labelInfo.locationId,
targetLocation: targetLocation,
site: site,
buNo: this.transferMode === 'label' ? this.labelInfo.buNo : this.locationLabels[0].buNo,

82
src/views/modules/label-split-merge/labelSplitMerge.vue

@ -80,12 +80,22 @@
<div class="dialog-body">
<div class="split-input-section">
<el-input v-model="splitQuantity" placeholder="请输入拆分数量" type="number" class="split-input inlineNumber numInput"/>
<div class="split-input-row">
<span class="split-label">拆分张数</span>
<el-input v-model="splitCount" placeholder="请输入拆分张数" type="number" class="split-input inlineNumber numInput"/>
</div>
<div class="split-input-row">
<span class="split-label">每张数量</span>
<el-input v-model="splitQuantity" placeholder="请输入每张数量" type="number" class="split-input inlineNumber numInput"/>
</div>
<div class="split-info-row" v-if="splitCount > 0 && splitQuantity > 0">
<span class="split-info-text">拆分后原标签剩余 {{ calculateRemainingQty }} 新增 {{ splitCount }} 张标签每张 {{ splitQuantity }} </span>
</div>
</div>
</div>
<div class="dialog-footer">
<button class="btn-split" @click="confirmSplit" :disabled="!splitQuantity || splitQuantity <= 0">
<button class="btn-split" @click="confirmSplit" :disabled="!canSplit">
拆分
</button>
<button class="btn-cancel" @click="closeSplitDialog">
@ -141,7 +151,8 @@ export default {
currentLabel: {},
splitDialogVisible: false,
mergeDialogVisible: false,
splitQuantity: '',
splitCount: '', //
splitQuantity: '', //
mergeTargetCode: '',
mergeTargetLabel: {}
};
@ -187,25 +198,34 @@ export default {
return;
}
this.splitDialogVisible = true;
this.splitCount = '';
this.splitQuantity = '';
},
//
closeSplitDialog() {
this.splitDialogVisible = false;
this.splitCount = '';
this.splitQuantity = '';
},
//
confirmSplit() {
const splitCnt = parseInt(this.splitCount);
const splitQty = parseFloat(this.splitQuantity);
const currentQty = parseFloat(this.currentLabel.qtyOnHand);
const totalSplitQty = splitCnt * splitQty;
if (!splitCnt || splitCnt <= 0) {
this.$message.warning('请输入有效的拆分张数');
return;
}
if (!splitQty || splitQty <= 0) {
this.$message.warning('请输入有效的拆分数量');
this.$message.warning('请输入有效的每张数量');
return;
}
if (splitQty >= currentQty) {
this.$message.warning('拆分数量必须小于当前数量');
if (totalSplitQty >= currentQty) {
this.$message.warning('拆分数量必须小于当前数量');
return;
}
const params = {
@ -218,7 +238,8 @@ export default {
batchNo: this.currentLabel.batchNo,
locationId: this.currentLabel.locationId,
originalQuantity: currentQty,
splitQuantity: splitQty,
splitCount: splitCnt, //
splitQuantity: splitQty, //
labelTypeTb: this.currentLabel.labelTypeTb,
labelType: this.currentLabel.labelType,
freezeFlag: this.currentLabel.freezeFlag,
@ -233,7 +254,8 @@ export default {
};
splitLabel(params).then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success(`拆分成功!新标签: ${data.data.newLabelCode}`);
const newLabelCodes = data.data.newLabelCodes || [data.data.newLabelCode];
this.$message.success(`拆分成功!新标签: ${newLabelCodes.join(', ')}`);
this.closeSplitDialog();
//
@ -477,6 +499,25 @@ export default {
}
},
computed: {
//
calculateRemainingQty() {
const currentQty = parseFloat(this.currentLabel.qtyOnHand) || 0;
const splitCnt = parseInt(this.splitCount) || 0;
const splitQty = parseFloat(this.splitQuantity) || 0;
const totalSplitQty = splitCnt * splitQty;
return currentQty - totalSplitQty;
},
//
canSplit() {
const splitCnt = parseInt(this.splitCount) || 0;
const splitQty = parseFloat(this.splitQuantity) || 0;
const currentQty = parseFloat(this.currentLabel.qtyOnHand) || 0;
const totalSplitQty = splitCnt * splitQty;
return splitCnt > 0 && splitQty > 0 && totalSplitQty < currentQty;
}
},
mounted() {
//
this.$nextTick(() => {
@ -669,6 +710,31 @@ export default {
margin-bottom: 20px;
}
.split-input-row {
display: flex;
align-items: center;
margin-bottom: 12px;
}
.split-label {
width: 80px;
font-size: 14px;
color: #333;
flex-shrink: 0;
}
.split-info-row {
margin-top: 8px;
padding: 8px 12px;
background: #f5f5f5;
border-radius: 4px;
}
.split-info-text {
font-size: 13px;
color: #666;
}
.split-input,
.merge-input {
width: 100%;

Loading…
Cancel
Save