|
|
@@ -288,6 +288,7 @@
|
|
|
import printQRCode from '@/views/warehouseManagement/stockManagement/components/printQRCode.vue';
|
|
|
import unlockModal from '@/views/warehouseManagement/unlockApplication/components/unlockModal.vue';
|
|
|
import BatchChangeDialog from './BatchChangeDialog.vue';
|
|
|
+ import stockBatchChange from '@/api/warehouseManagement/stockBatchChange';
|
|
|
|
|
|
export default {
|
|
|
mixins: [tabMixins],
|
|
|
@@ -747,7 +748,7 @@
|
|
|
}
|
|
|
this.$refs.unlockModalRef.open('add', this.checkRadioData[0]);
|
|
|
},
|
|
|
- openBatchChange(mode) {
|
|
|
+ async openBatchChange(mode) {
|
|
|
if (mode === 'split' && this.checkRadioData.length !== 1)
|
|
|
return this.$message.warning('拆批请选择一条库存批次');
|
|
|
if (mode === 'merge' && this.checkRadioData.length < 2)
|
|
|
@@ -760,6 +761,18 @@
|
|
|
) {
|
|
|
return this.$message.warning('数量为0的库存批次不支持拆批和合批');
|
|
|
}
|
|
|
+ if (mode === 'split') {
|
|
|
+ try {
|
|
|
+ const isUnpack = await stockBatchChange.checkSplit(
|
|
|
+ this.checkRadioData.map((row) => row.categoryId)
|
|
|
+ );
|
|
|
+ if (isUnpack) {
|
|
|
+ return this.$message.warning('拆包产品不支持拆批');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ return this.$message.error(error.message || '拆批校验失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$refs.batchChangeRef.open(mode, this.checkRadioData);
|
|
|
},
|
|
|
|