|
|
|
@ -18,7 +18,7 @@ |
|
|
|
v-model="palletCode" |
|
|
|
placeholder="请扫描栈板编码" |
|
|
|
class="form-input" |
|
|
|
style="flex: 0.75;" |
|
|
|
:style="{ flex: sortedSourceFlag ? '1' : '0.75' }" |
|
|
|
clearable |
|
|
|
inputmode="none" |
|
|
|
autocomplete="off" |
|
|
|
@ -27,7 +27,7 @@ |
|
|
|
@keyup.enter.native="handlePalletScan" |
|
|
|
ref="palletInput" |
|
|
|
/> |
|
|
|
<button class="action-btn secondary" style="flex: 0.25; margin: 0;" @click="submitFinishSorting" :disabled="interfaceBusy || finishSortingLoading || detailList.length === 0"> |
|
|
|
<button class="action-btn secondary" style="flex: 0.25; margin: 0;" @click="submitFinishSorting" v-if="!sortedSourceFlag" :disabled="interfaceBusy || finishSortingLoading || detailList.length === 0"> |
|
|
|
{{ finishSortingLoading ? '处理中...' : '结束分拣' }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
@ -101,6 +101,10 @@ |
|
|
|
刷新 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<!-- 被分拣源盘提示:站点命中 R1-R4 后按放回标签处理 - rqrq --> |
|
|
|
<div v-if="sortedSourceFlag" style="margin-top: 6px; color: #e6a23c; font-size: 12px;"> |
|
|
|
当前为被分拣站点,扫进=放回标签,提交=通知回库 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 第四行:扫进/扫回 + 扫描按钮,保持与原PDA页面一致 - rqrq --> |
|
|
|
@ -108,8 +112,8 @@ |
|
|
|
<div style="display: flex; gap: 8px; align-items: center;"> |
|
|
|
<div style="flex: 0.75;"> |
|
|
|
<el-radio-group v-model="operationType" style="display: flex;"> |
|
|
|
<el-radio label="in" style="margin-right: 0px; white-space: nowrap;">扫进</el-radio> |
|
|
|
<el-radio label="out" style="white-space: nowrap;">扫回</el-radio> |
|
|
|
<el-radio label="in" style="margin-right: 0px; white-space: nowrap;">{{ sortedSourceFlag ? '放回' : '扫进' }}</el-radio> |
|
|
|
<el-radio label="out" style="white-space: nowrap;">{{ sortedSourceFlag ? '解绑' : '扫回' }}</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</div> |
|
|
|
<button |
|
|
|
@ -134,7 +138,7 @@ |
|
|
|
<label style="margin-left: 5px;">条码数:{{ detailList.length }}</label> |
|
|
|
</div> |
|
|
|
<button class="action-btn primary" style="flex: 0.25; margin: 0;" @click="submitSorting" :disabled="interfaceBusy || submitSortingLoading"> |
|
|
|
{{ submitSortingLoading ? '处理中...' : '提交分拣' }} |
|
|
|
{{ submitSortingLoading ? '处理中...' : (sortedSourceFlag ? '通知回库' : '提交分拣') }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<div class="detail-table"> |
|
|
|
@ -277,6 +281,7 @@ import { |
|
|
|
getPalletDetails, |
|
|
|
savePalletDetail, |
|
|
|
restorePalletDetail, |
|
|
|
deletePalletDetail, |
|
|
|
getLabelInfo, |
|
|
|
getPalletInfo, |
|
|
|
getPalletTypeList, |
|
|
|
@ -299,6 +304,8 @@ export default { |
|
|
|
currentPalletType: '', |
|
|
|
currentAutoSort: 'N', |
|
|
|
currentPalletStation: '', |
|
|
|
// 被分拣源盘标记:由后端按 location_code 对照 R1-R4 返回,前端不自行猜点位 - rqrq |
|
|
|
sortedSourceFlag: false, |
|
|
|
forceFullPalletOut: false, |
|
|
|
palletTypeDisabled: false, |
|
|
|
autoSortDisabled: false, |
|
|
|
@ -397,6 +404,7 @@ export default { |
|
|
|
this.currentPalletType = '' |
|
|
|
this.currentAutoSort = 'N' |
|
|
|
this.currentPalletStation = '' |
|
|
|
this.sortedSourceFlag = false |
|
|
|
this.forceFullPalletOut = false |
|
|
|
this.palletTypeDisabled = false |
|
|
|
this.autoSortDisabled = false |
|
|
|
@ -451,6 +459,7 @@ export default { |
|
|
|
this.palletCode = data.palletId |
|
|
|
this.positionOptions = data.positions || [] |
|
|
|
this.palletScanned = true |
|
|
|
this.sortedSourceFlag = data.sortedSourceFlag === true |
|
|
|
this.scanCode = '' |
|
|
|
this.scanPosition = '' |
|
|
|
this.scanLayer = 1 |
|
|
|
@ -715,7 +724,7 @@ export default { |
|
|
|
throw new Error((data && data.msg) || '获取分拣清单失败') |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 分拣扫码:扫进需命中分拣清单并缓存原位置,扫回需按缓存恢复 - rqrq |
|
|
|
// 分拣扫码:工作盘扫进卡分拣清单;被分拣源盘扫进=放回本盘、扫回=解绑 - rqrq |
|
|
|
handleLabelScan() { |
|
|
|
if (!this.ensureSite()) { |
|
|
|
return |
|
|
|
@ -743,14 +752,18 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
this.scanRequestLoading = true |
|
|
|
this.loadSortingListIfNeeded() |
|
|
|
.then((list) => { |
|
|
|
const scanInPromise = this.sortedSourceFlag |
|
|
|
? Promise.resolve() |
|
|
|
: this.loadSortingListIfNeeded().then((list) => { |
|
|
|
if (list.length === 0) { |
|
|
|
throw new Error('当前不存在分拣任务') |
|
|
|
} |
|
|
|
if (!list.includes(this.scanCode)) { |
|
|
|
throw new Error('该标签不在分拣清单中') |
|
|
|
} |
|
|
|
}) |
|
|
|
scanInPromise |
|
|
|
.then(() => { |
|
|
|
return getLabelInfo({ |
|
|
|
site: this.site, |
|
|
|
serialNo: this.scanCode |
|
|
|
@ -765,7 +778,7 @@ export default { |
|
|
|
sortFlag: 1 |
|
|
|
}).then(({ data: saveData }) => { |
|
|
|
if (saveData && saveData.code === 0) { |
|
|
|
if (original) { |
|
|
|
if (!this.sortedSourceFlag && original) { |
|
|
|
this.originalDetailCache[this.scanCode] = { |
|
|
|
palletId: original.palletId || '', |
|
|
|
position: original.position || '', |
|
|
|
@ -777,25 +790,50 @@ export default { |
|
|
|
wcsFlag: original.wcsFlag === null || original.wcsFlag === undefined ? 0 : original.wcsFlag |
|
|
|
} |
|
|
|
} |
|
|
|
this.$message.success('分拣扫进成功') |
|
|
|
this.$message.success(this.sortedSourceFlag ? '放回标签成功' : '分拣扫进成功') |
|
|
|
this.needRefreshOnClose = true |
|
|
|
this.scanCode = '' |
|
|
|
this.loadLayerOptions() |
|
|
|
this.moveFocusToScanInput() |
|
|
|
return |
|
|
|
} |
|
|
|
throw new Error((saveData && saveData.msg) || '分拣扫进失败') |
|
|
|
throw new Error((saveData && saveData.msg) || (this.sortedSourceFlag ? '放回标签失败' : '分拣扫进失败')) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
this.$alert(error.message || '分拣扫进失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
this.$alert(error.message || (this.sortedSourceFlag ? '放回标签失败' : '分拣扫进失败'), '错误', { confirmButtonText: '确定' }) |
|
|
|
this.scanCode = '' |
|
|
|
this.moveFocusToScanInput() |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.scanRequestLoading = false |
|
|
|
}) |
|
|
|
} else if (this.sortedSourceFlag) { |
|
|
|
// 被分拣源盘扫回=从本盘解绑,不再 restore 到原托盘,避免写回错误栈板 - rqrq |
|
|
|
this.scanRequestLoading = true |
|
|
|
deletePalletDetail({ |
|
|
|
site: this.site, |
|
|
|
palletId: this.palletCode, |
|
|
|
serialNo: this.scanCode |
|
|
|
}).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('解绑标签成功') |
|
|
|
this.needRefreshOnClose = true |
|
|
|
this.scanCode = '' |
|
|
|
this.moveFocusToScanInput() |
|
|
|
} else { |
|
|
|
this.scanCode = '' |
|
|
|
this.$alert((data && data.msg) || '解绑标签失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
this.moveFocusToScanInput() |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.scanCode = '' |
|
|
|
this.$alert(error.message || '解绑标签失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
this.moveFocusToScanInput() |
|
|
|
}).finally(() => { |
|
|
|
this.scanRequestLoading = false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
const original = this.originalDetailCache[this.scanCode] |
|
|
|
if (!original) { |
|
|
|
@ -855,7 +893,8 @@ export default { |
|
|
|
}).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.sortingList = [] |
|
|
|
this.$message.success('分拣提交成功') |
|
|
|
const resultRow = data.row || {} |
|
|
|
this.$message.success(resultRow.message || (this.sortedSourceFlag ? '已通知托盘回库' : '分拣提交成功')) |
|
|
|
} else { |
|
|
|
this.$alert((data && data.msg) || '分拣提交失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
|