|
|
|
@ -36,6 +36,7 @@ |
|
|
|
v-model="currentPalletType" |
|
|
|
placeholder="请选择托盘类型" |
|
|
|
style="width: 100%;" |
|
|
|
:disabled="palletTypeChangeLoading" |
|
|
|
@change="handlePalletTypeChange" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
@ -75,14 +76,14 @@ |
|
|
|
<button |
|
|
|
class="action-btn primary" |
|
|
|
@click="handleNotifyInbound" |
|
|
|
:disabled="notifyLoading || !currentPalletType" |
|
|
|
:disabled="notifyLoading || palletTypeChangeLoading || !currentPalletType" |
|
|
|
style="flex: 1;"> |
|
|
|
{{ notifyLoading ? '处理中...' : '通知入库' }} |
|
|
|
</button> |
|
|
|
<button |
|
|
|
class="action-btn primary" |
|
|
|
@click="handleInboundAndTransport" |
|
|
|
:disabled="transportLoading || !currentPalletType" |
|
|
|
:disabled="transportLoading || palletTypeChangeLoading || !currentPalletType" |
|
|
|
style="flex: 1;"> |
|
|
|
{{ transportLoading ? '处理中...' : '入库并运输' }} |
|
|
|
</button> |
|
|
|
@ -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(() => { |
|
|
|
|