diff --git a/src/views/modules/haianAutoWarehouse/haianEmptyPalletAssembly.vue b/src/views/modules/haianAutoWarehouse/haianEmptyPalletAssembly.vue index ae71c1c..b0a2c6d 100644 --- a/src/views/modules/haianAutoWarehouse/haianEmptyPalletAssembly.vue +++ b/src/views/modules/haianAutoWarehouse/haianEmptyPalletAssembly.vue @@ -36,6 +36,7 @@ v-model="currentPalletType" placeholder="请选择托盘类型" style="width: 100%;" + :disabled="palletTypeChangeLoading" @change="handlePalletTypeChange" > {{ notifyLoading ? '处理中...' : '通知入库' }} @@ -124,7 +125,8 @@ export default { count: 1, // 加载状态 - rqrq notifyLoading: false, - transportLoading: false + transportLoading: false, + palletTypeChangeLoading: false }; }, methods: { @@ -214,28 +216,41 @@ export default { }); }, - // 托盘类型变更事件 - rqrq + // 托盘类型变更事件:按小类主数据重置自动分拣和强制整托后落库,禁止残留上一类型勾选 - rqrq handlePalletTypeChange() { - // 保存到数据库 - rqrq + if (this.palletTypeChangeLoading) { + return; + } + const selectedType = this.palletTypeOptions.find((item) => item.palletType === this.currentPalletType); + const wcsSoreType = selectedType && selectedType.wcsSoreType != null ? Number(selectedType.wcsSoreType) : 0; + const forceFullPalletOut = wcsSoreType === 3 + || this.currentPalletType === 'A0103' + || this.currentPalletType === 'A0206'; + let autoSort = selectedType && selectedType.wcsAutoSort === 'Y' ? 'Y' : 'N'; + if (forceFullPalletOut) { + autoSort = 'N'; + } + this.palletTypeChangeLoading = true; updatePalletTypeAndAutoSort({ site: this.site, palletId: this.palletCode, palletType: this.currentPalletType, - autoSort: 'N', - forceFullPalletOut: false + autoSort: autoSort, + forceFullPalletOut: forceFullPalletOut }).then(({ data }) => { - if (data.code === 0) { + if (data && data.code === 0) { this.$message.success('更新成功'); } else { - this.$alert(data.msg || '更新失败', '错误', { + this.$alert((data && data.msg) || '更新失败', '错误', { confirmButtonText: '确定' }); } }).catch(error => { - console.error('更新失败:', error); this.$alert(error.message || '更新失败', '错误', { confirmButtonText: '确定' }); + }).finally(() => { + this.palletTypeChangeLoading = false; }); }, @@ -364,6 +379,7 @@ export default { this.currentPalletType = ''; this.palletTypeOptions = []; this.count = 1; + this.palletTypeChangeLoading = false; if (needFocus) { this.$nextTick(() => { diff --git a/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue b/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue index 7c46911..1134079 100644 --- a/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue +++ b/src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue @@ -612,13 +612,19 @@ export default { }, handlePalletTypeChange() { const selectedType = this.palletTypeOptions.find((item) => item.palletType === this.currentPalletType) - this.currentWcsAutoSort = selectedType ? (selectedType.wcsAutoSort || 'N') : '' + this.applyPalletTypeDefaults(selectedType) + this.savePalletTypeConfig() + }, + // 改小类时全部选项回到类型主数据:强制整托看wcs_sore_type=3,自动分拣看wcs_auto_sort;从强制改到非强制必须取消勾选 - rqrq + applyPalletTypeDefaults(selectedType) { + this.currentWcsAutoSort = selectedType ? (selectedType.wcsAutoSort || 'N') : 'N' this.currentMaxLayer = selectedType ? Number(selectedType.maxLayer || 0) : 0 - if (this.currentPalletType === 'A0103' || this.currentPalletType === 'A0206') { - this.forceFullPalletOut = true - } + const wcsSoreType = selectedType && selectedType.wcsSoreType != null ? Number(selectedType.wcsSoreType) : 0 + this.forceFullPalletOut = wcsSoreType === 3 + || this.currentPalletType === 'A0103' + || this.currentPalletType === 'A0206' + this.currentAutoSort = this.currentWcsAutoSort this.updateAutoSortControl() - this.savePalletTypeConfig() }, handleAutoSortChange() { this.savePalletTypeConfig() diff --git a/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue b/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue index 4b2ccda..789ae10 100644 --- a/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue +++ b/src/views/modules/haianAutoWarehouse/haianPalletPacking.vue @@ -654,14 +654,19 @@ export default { }, handlePalletTypeChange() { const selectedType = this.palletTypeOptions.find((item) => item.palletType === this.currentPalletType) - this.currentWcsAutoSort = selectedType ? (selectedType.wcsAutoSort || 'N') : '' + this.applyPalletTypeDefaults(selectedType) + this.savePalletTypeConfig() + }, + // 改小类时全部选项回到类型主数据:强制整托看wcs_sore_type=3,自动分拣看wcs_auto_sort;从强制改到非强制必须取消勾选 - rqrq + applyPalletTypeDefaults(selectedType) { + this.currentWcsAutoSort = selectedType ? (selectedType.wcsAutoSort || 'N') : 'N' this.currentMaxLayer = selectedType ? Number(selectedType.maxLayer || 0) : 0 - // A0103类型要求强制整托出库,避免部分扫出导致业务冲突 - rqrq - if (this.currentPalletType === 'A0103'||this.currentPalletType === 'A0206') { - this.forceFullPalletOut = true - } + const wcsSoreType = selectedType && selectedType.wcsSoreType != null ? Number(selectedType.wcsSoreType) : 0 + this.forceFullPalletOut = wcsSoreType === 3 + || this.currentPalletType === 'A0103' + || this.currentPalletType === 'A0206' + this.currentAutoSort = this.currentWcsAutoSort this.updateAutoSortControl() - this.savePalletTypeConfig() }, handleAutoSortChange() { this.savePalletTypeConfig() @@ -1050,6 +1055,8 @@ export default { }).then(({ data }) => { if (data && data.code === 0) { this.$message.success('运输入库任务已提交') + // 与老组盘页一致:运输入库成功后清空整页,避免继续操作已提交入库的栈板 - rqrq + this.resetPage(true) } else { this.$alert((data && data.msg) || '运输入库失败', '错误', { confirmButtonText: '确定' }) } diff --git a/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue b/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue index 31d9fcb..bc29ff5 100644 --- a/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue +++ b/src/views/modules/haianAutoWarehouse/haianPalletSorting.vue @@ -712,13 +712,19 @@ export default { }, handlePalletTypeChange() { const selectedType = this.palletTypeOptions.find((item) => item.palletType === this.currentPalletType) - this.currentWcsAutoSort = selectedType ? (selectedType.wcsAutoSort || 'N') : '' + this.applyPalletTypeDefaults(selectedType) + this.savePalletTypeConfig() + }, + // 改小类时全部选项回到类型主数据:强制整托看wcs_sore_type=3,自动分拣看wcs_auto_sort;从强制改到非强制必须取消勾选 - rqrq + applyPalletTypeDefaults(selectedType) { + this.currentWcsAutoSort = selectedType ? (selectedType.wcsAutoSort || 'N') : 'N' this.currentMaxLayer = selectedType ? Number(selectedType.maxLayer || 0) : 0 - if (this.currentPalletType === 'A0103') { - this.forceFullPalletOut = true - } + const wcsSoreType = selectedType && selectedType.wcsSoreType != null ? Number(selectedType.wcsSoreType) : 0 + this.forceFullPalletOut = wcsSoreType === 3 + || this.currentPalletType === 'A0103' + || this.currentPalletType === 'A0206' + this.currentAutoSort = this.currentWcsAutoSort this.updateAutoSortControl() - this.savePalletTypeConfig() }, handleAutoSortChange() { this.savePalletTypeConfig()