Browse Source

组盘优化

master
常熟吴彦祖 1 month ago
parent
commit
df777dfadc
  1. 52
      src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue
  2. 54
      src/views/modules/haianAutoWarehouse/haianPalletPacking.vue
  3. 58
      src/views/modules/haianAutoWarehouse/haianPalletSorting.vue

52
src/views/modules/haianAutoWarehouse/haianPalletAssembly.vue

@ -82,12 +82,13 @@
<div v-if="palletScanned" class="input-group">
<el-checkbox
v-model="forceFullPalletOut"
:key="forceFullPalletOutRenderKey"
:value="forceFullPalletOut"
:disabled="palletTypeDisabled || interfaceBusy"
@change="handleForceFullPalletOutChange"
style="width: 100%;"
>
是否强制整托出库
<span :class="{ 'force-full-pallet-out-active': forceFullPalletOut }">是否强制整托出库</span>
</el-checkbox>
</div>
@ -362,6 +363,8 @@ export default {
savedManualRemark: '',
manualRemarkSaving: false,
forceFullPalletOut: false,
// 取消未确认的勾选时重建控件,避免原生checkbox短暂显示未保存的新状态。- rqrq
forceFullPalletOutRenderKey: 0,
palletTypeDisabled: false,
autoSortDisabled: false,
currentWcsAutoSort: '',
@ -677,8 +680,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() {
@ -720,12 +747,13 @@ export default {
}
this.autoSortDisabled = this.detailList.length > 0 || this.interfaceBusy
},
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,
@ -736,11 +764,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
})
@ -1138,6 +1169,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;

54
src/views/modules/haianAutoWarehouse/haianPalletPacking.vue

@ -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;

58
src/views/modules/haianAutoWarehouse/haianPalletSorting.vue

@ -80,12 +80,13 @@
<!-- 第2.5行:是否强制整托出库,保持与原PDA页面一致 - 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>
@ -400,6 +401,8 @@ export default {
// 被分拣源盘标记:由后端按海安新增被分拣站数组返回,前端不自行猜点位;R1-R4 是手工分拣区 - rqrq
sortedSourceFlag: false,
forceFullPalletOut: false,
// 取消未确认的勾选时重建控件,避免原生checkbox短暂显示未保存的新状态。- rqrq
forceFullPalletOutRenderKey: 0,
palletTypeDisabled: false,
autoSortDisabled: false,
currentWcsAutoSort: '',
@ -769,8 +772,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
})
})
},
// 统一自动分拣禁用策略:强制整托、类型不支持、已有明细三类场景锁定 - rqrq
updateAutoSortControl() {
@ -786,17 +813,27 @@ export default {
}
this.autoSortDisabled = this.detailList.length > 0
},
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,
autoSort: this.currentAutoSort,
forceFullPalletOut: this.forceFullPalletOut
}).then(({ data }) => {
if (data && data.code === 0) {
return true
}
this.$alert((data && data.msg) || '托盘配置更新失败', '错误', { confirmButtonText: '确定' })
return false
}).catch((error) => {
this.$message.error(error.message || '托盘配置更新失败')
return false
}).finally(() => {
this.palletConfigLoading = false
})
@ -1220,6 +1257,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;

Loading…
Cancel
Save