Browse Source

feat(automatedWarehouse): 优化托盘合并功能的输入处理逻辑

- 修改扫描输入处理方法,去除所有空格而非仅末尾R/L字符
- 更新来源托盘和目标托盘扫描验证流程
- 使用后台返回的真实托盘号进行重复性校验
- 确保目标托盘与来源托盘不同时采用真实托盘号比较
- 完善托盘编码处理逻辑,提高系统容错能力
master
常熟吴彦祖 1 month ago
parent
commit
063ac2dcbd
  1. 58
      src/views/modules/automatedWarehouse/palletMerge.vue

58
src/views/modules/automatedWarehouse/palletMerge.vue

@ -186,34 +186,32 @@ export default {
this.$router.back()
},
// R/L- rqrq
processPalletCode(palletCode) {
if (palletCode && palletCode.length > 0) {
const lastChar = palletCode.charAt(palletCode.length - 1)
if (lastChar === 'R' || lastChar === 'L' || lastChar === 'r' || lastChar === 'l') {
return palletCode.substring(0, palletCode.length - 1)
// - rqrq
processScanInput(input) {
if (input) {
// - rqrq
return input.replace(/\s+/g, '')
}
}
return palletCode
return input
},
// - rqrq
handleSourcePalletScan() {
if (!this.sourcePalletCode.trim()) {
// - rqrq
const scannedCode = this.processScanInput(this.sourcePalletCode)
if (!scannedCode) {
this.$message.error('请输入来源托盘编码')
return
}
// - rqrq
const processedCode = this.processPalletCode(this.sourcePalletCode.trim())
this.sourcePalletCode = processedCode
// - rqrq
// LR- rqrq
checkPalletForMerge({
site: this.site,
palletId: processedCode
palletId: scannedCode
}).then(({ data }) => {
if (data && data.code === 0) {
// 使 - rqrq
this.sourcePalletCode = data.palletId || scannedCode
this.sourceValidated = true
this.sourcePalletType = data.palletType || ''
this.sourceTypeDesc = data.typeDesc || ''
@ -286,37 +284,39 @@ export default {
// - rqrq
handleTargetPalletScan() {
if (!this.targetPalletCode.trim()) {
// - rqrq
const scannedCode = this.processScanInput(this.targetPalletCode)
if (!scannedCode) {
this.$message.error('请输入目标托盘编码')
return
}
// - rqrq
const processedCode = this.processPalletCode(this.targetPalletCode.trim())
this.targetPalletCode = processedCode
// - rqrq
if (this.sourcePalletCode && processedCode === this.sourcePalletCode) {
this.$message.error('目标托盘不能与来源托盘相同')
this.targetPalletCode = ''
return
}
// - rqrq
// LR- rqrq
checkPalletForMerge({
site: this.site,
palletId: processedCode
palletId: scannedCode
}).then(({ data }) => {
if (data && data.code === 0) {
// 使 - rqrq
const realPalletId = data.palletId || scannedCode
const palletType = data.palletType || ''
const typeDesc = data.typeDesc || ''
// 使- rqrq
if (this.sourcePalletCode && realPalletId === this.sourcePalletCode) {
this.$message.error('目标托盘不能与来源托盘相同')
this.targetPalletCode = ''
return
}
// wcs_auto_sort = 'N'- rqrq
checkTargetPalletType({
site: this.site,
palletType: palletType
}).then(({ data: typeData }) => {
if (typeData && typeData.code === 0) {
// - rqrq
this.targetPalletCode = realPalletId
this.targetValidated = true
this.targetPalletType = palletType
this.targetTypeDesc = typeDesc

Loading…
Cancel
Save