|
|
@ -95,10 +95,10 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="dialog-footer"> |
|
|
<div class="dialog-footer"> |
|
|
<button class="btn-split" @click="confirmSplit" :disabled="!canSplit"> |
|
|
|
|
|
拆分 |
|
|
|
|
|
|
|
|
<button class="btn-split" @click="confirmSplit" :disabled="!canSplit || isSplitting"> |
|
|
|
|
|
{{ isSplitting ? '拆分中...' : '拆分' }} |
|
|
</button> |
|
|
</button> |
|
|
<button class="btn-cancel" @click="closeSplitDialog"> |
|
|
|
|
|
|
|
|
<button class="btn-cancel" @click="closeSplitDialog" :disabled="isSplitting"> |
|
|
取消 |
|
|
取消 |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
@ -154,7 +154,8 @@ export default { |
|
|
splitCount: '', // 拆分张数 |
|
|
splitCount: '', // 拆分张数 |
|
|
splitQuantity: '', // 每张数量 |
|
|
splitQuantity: '', // 每张数量 |
|
|
mergeTargetCode: '', |
|
|
mergeTargetCode: '', |
|
|
mergeTargetLabel: {} |
|
|
|
|
|
|
|
|
mergeTargetLabel: {}, |
|
|
|
|
|
isSplitting: false // 拆分防抖/加载状态 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
@ -211,6 +212,8 @@ export default { |
|
|
|
|
|
|
|
|
// 确认拆分 |
|
|
// 确认拆分 |
|
|
confirmSplit() { |
|
|
confirmSplit() { |
|
|
|
|
|
if (this.isSplitting) return; |
|
|
|
|
|
|
|
|
const splitCnt = parseInt(this.splitCount); |
|
|
const splitCnt = parseInt(this.splitCount); |
|
|
const splitQty = parseFloat(this.splitQuantity); |
|
|
const splitQty = parseFloat(this.splitQuantity); |
|
|
const currentQty = parseFloat(this.currentLabel.qtyOnHand); |
|
|
const currentQty = parseFloat(this.currentLabel.qtyOnHand); |
|
|
@ -228,6 +231,9 @@ export default { |
|
|
this.$message.warning('拆分总数量必须小于当前数量'); |
|
|
this.$message.warning('拆分总数量必须小于当前数量'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.isSplitting = true; |
|
|
|
|
|
|
|
|
const params = { |
|
|
const params = { |
|
|
site: localStorage.getItem('site'), |
|
|
site: localStorage.getItem('site'), |
|
|
buNo: this.currentLabel.buNo, |
|
|
buNo: this.currentLabel.buNo, |
|
|
@ -272,6 +278,8 @@ export default { |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
console.error('拆分失败:', error); |
|
|
console.error('拆分失败:', error); |
|
|
this.$message.error('拆分失败'); |
|
|
this.$message.error('拆分失败'); |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.isSplitting = false; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|