|
|
|
@ -98,12 +98,13 @@ |
|
|
|
<!-- 第2.5行:是否强制整托出库 (扫描栈板后显示) - rqrq --> |
|
|
|
<div v-if="palletScanned" class="input-group"> |
|
|
|
<el-checkbox |
|
|
|
v-model="forceFullPalletOut" |
|
|
|
:disabled="palletTypeDisabled" |
|
|
|
:key="forceFullPalletOutRenderKey" |
|
|
|
:value="forceFullPalletOut" |
|
|
|
:disabled="palletTypeDisabled || interfaceBusy" |
|
|
|
@change="handleForceFullPalletOutChange" |
|
|
|
style="width: 100%;" |
|
|
|
> |
|
|
|
是否强制整托出库 |
|
|
|
<span :class="{ 'force-full-pallet-out-active': forceFullPalletOut }">是否强制整托出库</span> |
|
|
|
</el-checkbox> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -419,6 +420,8 @@ export default { |
|
|
|
savedManualRemark: '', |
|
|
|
manualRemarkSaving: false, |
|
|
|
forceFullPalletOut: false, |
|
|
|
// 取消未确认的勾选时重建控件,避免原生checkbox短暂显示未保存的新状态。- rqrq |
|
|
|
forceFullPalletOutRenderKey: 0, |
|
|
|
palletTypeDisabled: false, |
|
|
|
autoSortDisabled: false, |
|
|
|
currentWcsAutoSort: '', |
|
|
|
@ -732,8 +735,32 @@ export default { |
|
|
|
handleAutoSortChange() { |
|
|
|
this.savePalletTypeConfig() |
|
|
|
}, |
|
|
|
handleForceFullPalletOutChange() { |
|
|
|
this.savePalletTypeConfig() |
|
|
|
// 勾选变化先保持原值;操作员确认后才更新强制整托标记并保存,取消时不触发接口。- rqrq |
|
|
|
handleForceFullPalletOutChange (nextValue) { |
|
|
|
this.forceFullPalletOutRenderKey += 1 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$confirm('是否修改强制整托出库标记', '提示', { |
|
|
|
confirmButtonText: '确认', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
closeOnClickModal: false |
|
|
|
}).then(() => { |
|
|
|
const previousForceFullPalletOut = this.forceFullPalletOut |
|
|
|
const previousAutoSort = this.currentAutoSort |
|
|
|
this.forceFullPalletOut = nextValue |
|
|
|
this.updateAutoSortControl() |
|
|
|
// 确认后保存;接口拒绝或网络失败时恢复原勾选和自动分拣状态,避免页面值与海安托盘配置不一致。- rqrq |
|
|
|
this.savePalletTypeConfig().then((saved) => { |
|
|
|
if (!saved) { |
|
|
|
this.forceFullPalletOut = previousForceFullPalletOut |
|
|
|
this.currentAutoSort = previousAutoSort |
|
|
|
this.updateAutoSortControl() |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
// 取消或关闭弹框时受控勾选框保持原值,不修改托盘配置。- rqrq |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// A0206失焦才保存手工备注;内容和上次成功值相同则不请求,失败保留输入供再次离开重试 - rqrq |
|
|
|
handleManualRemarkBlur() { |
|
|
|
@ -777,12 +804,13 @@ export default { |
|
|
|
this.autoSortDisabled = this.detailList.length > 0 |
|
|
|
}, |
|
|
|
// 更新托盘类型与自动分拣设置,保持海安后端状态一致 - rqrq |
|
|
|
savePalletTypeConfig() { |
|
|
|
// 保存海安托盘配置并返回是否成功;失败由页面提示,勾选确认调用方据此恢复原状态。- rqrq |
|
|
|
savePalletTypeConfig () { |
|
|
|
if (this.interfaceBusy) { |
|
|
|
return |
|
|
|
return Promise.resolve(false) |
|
|
|
} |
|
|
|
this.palletConfigLoading = true |
|
|
|
updatePalletTypeAndAutoSort({ |
|
|
|
return updatePalletTypeAndAutoSort({ |
|
|
|
site: this.site, |
|
|
|
palletId: this.palletCode, |
|
|
|
palletType: this.currentPalletType, |
|
|
|
@ -793,11 +821,14 @@ export default { |
|
|
|
this.palletInfo.palletType = this.currentPalletType |
|
|
|
this.palletInfo.autoSort = this.currentAutoSort |
|
|
|
this.$message.success('托盘配置已更新') |
|
|
|
return true |
|
|
|
} else { |
|
|
|
this.$alert((data && data.msg) || '托盘配置更新失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
return false |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$alert(error.message || '托盘配置更新失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
this.$message.error(error.message || '托盘配置更新失败') |
|
|
|
return false |
|
|
|
}).finally(() => { |
|
|
|
this.palletConfigLoading = false |
|
|
|
}) |
|
|
|
@ -1215,6 +1246,11 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
.force-full-pallet-out-active { |
|
|
|
color: #8b1e1e; |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.header-action-disabled { |
|
|
|
opacity: 0.5; |
|
|
|
pointer-events: none; |
|
|
|
|