常熟吴彦祖 3 months ago
parent
commit
2140fc917c
  1. 9
      src/api/automatedWarehouse/palletPacking.js
  2. 1
      src/router/index.js
  3. 6
      src/views/main.vue
  4. 100
      src/views/modules/automatedWarehouse/palletAssembly.vue
  5. 100
      src/views/modules/automatedWarehouse/palletPacking.vue
  6. 382
      src/views/modules/automatedWarehouse/palletSearch.vue
  7. 186
      src/views/modules/automatedWarehouse/palletSorting.vue

9
src/api/automatedWarehouse/palletPacking.js

@ -3,6 +3,9 @@ import { createAPI } from "@/utils/httpRequest.js";
// 检查栈板是否存在并获取位置信息 - AI制作
export const checkPalletExists = data => createAPI(`/wcsIntegration/checkPalletExists`,'post',data)
// 简单查询栈板信息(无任何校验)- rqrq
export const getPalletInfoSimple = data => createAPI(`/wcsIntegration/getPalletInfoSimple`,'post',data)
// 获取栈板位置信息 - AI制作
export const getPalletPositions = data => createAPI(`/wcsIntegration/getPalletPositions`,'post',data)
@ -21,6 +24,12 @@ export const savePalletDetail = data => createAPI(`/wcsIntegration/savePalletDet
// 删除栈板明细(扫出) - AI制作
export const deletePalletDetail = data => createAPI(`/wcsIntegration/deletePalletDetail`,'post',data)
// 恢复标签到原栈板(分拣撤回) - rqrq
export const restorePalletDetail = data => createAPI(`/wcsIntegration/restorePalletDetail`,'post',data)
// 查询标签当前所在栈板的信息 - rqrq
export const getLabelInfo = data => createAPI(`/wcsIntegration/getLabelInfo`,'post',data)
// 获取编辑位置时的层数选项(排除指定标签) - AI制作
export const getLayersForEdit = data => createAPI(`/wcsIntegration/getLayersForEdit`,'post',data)

1
src/router/index.js

@ -121,6 +121,7 @@ const globalRoutes = [
// 立库-打托
{path: "/palletAssembly",name: "palletAssembly", component: resolve => require(["@/views/modules/automatedWarehouse/palletAssembly.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
{path: "/palletSorting",name: "palletSorting", component: resolve => require(["@/views/modules/automatedWarehouse/palletSorting.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
{path: "/palletSearch",name: "palletSearch", component: resolve => require(["@/views/modules/automatedWarehouse/palletSearch.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
]

6
src/views/main.vue

@ -148,6 +148,12 @@
</div>
<div class="menu-text">分拣组盘</div>
</div>
<div class="menu-item" @click="navigateWithWarehouseCheck('palletSearch')">
<div class="menu-icon purchase">
<van-icon name="shopping-cart-o" size="24" />
</div>
<div class="menu-text">查看托盘</div>
</div>
</div>
</div>
<!-- 库内管理 -->

100
src/views/modules/automatedWarehouse/palletAssembly.vue

@ -127,16 +127,21 @@
<!-- 栈板明细表格 (扫描栈板后显示) -->
<div v-if="palletScanned" class="rma-list">
<div class="list-title-row" style="display: flex; gap: 8px; align-items: center; padding: 0;">
<div class="list-title" style="flex: 0.75; margin: 0;">
<button class="action-btn primary" style="flex: 0.25; margin: 0;" @click="showDetailModal" :disabled="completeAssemblyLoading">
{{ '浏览明细' }}
<div class="list-title" style="flex: 0.4; margin: 0;">
<button class="action-btn primary" style="margin: 0;" @click="showDetailModal" :disabled="completeAssemblyLoading">
{{ '明细' }}
</button>
<laber style="margin-left: 5px;">条码数:{{detailList.length}}</laber>
</div>
<button class="action-btn primary" style="flex: 0.25; margin: 0;" @click="handleCompleteAssembly" :disabled="completeAssemblyLoading">
<button class="action-btn warning" style="flex: 0.3; margin: 0;" @click="showScanOutModal" :disabled="scanOutList.length === 0">
扫出({{scanOutList.length}})
</button>
<button class="action-btn primary" style="flex: 0.3; margin: 0;" @click="handleCompleteAssembly" :disabled="completeAssemblyLoading">
{{ completeAssemblyLoading ? '处理中...' : '完成组托' }}
</button>
</div>
<div class="list-title" style="flex: 0.5; margin: 0;">
<label style="margin-left: 5px;">条码数:{{detailList.length}}</label>
</div>
<div class="detail-table">
<div class="table-header">
<div class="col-position">位置</div>
@ -161,6 +166,7 @@
</div>
</div>
</div>
<!-- 浏览明细弹窗 - rqrq -->
<el-dialog
:title="'已扫描数量:'+detailList.length"
:visible.sync="detailModalVisible"
@ -198,6 +204,44 @@
<button class="action-btn secondary" style="margin-left: 10px;" @click="detailModalVisible=false">取消</button>
</div>
</el-dialog>
<!-- 查看扫出弹窗 - rqrq -->
<el-dialog
:title="'扫出记录 (共'+scanOutList.length+'条)'"
:visible.sync="scanOutModalVisible"
width="90%"
:close-on-click-modal="false"
:show-close="false"
:modal="true"
:modal-append-to-body="true"
:append-to-body="true"
>
<div class="table-body" style="max-height: 300px; overflow-y: auto;">
<div class="detail-table">
<div class="table-header">
<div class="col-position">位置</div>
<div class="col-layer">层数</div>
<div class="col-serial">标签号</div>
</div>
<div
v-for="(detail, index) in scanOutList"
:key="index"
class="table-row"
>
<div class="col-position">{{ detail.position }}</div>
<div class="col-layer">{{ detail.layer }}</div>
<div class="col-serial">{{ detail.serialNo }}</div>
</div>
<!-- 暂无数据提示 -->
<div v-if="scanOutList.length === 0" class="table-row empty-row">
<div class="empty-hint">暂无扫出记录</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<button class="action-btn secondary" @click="scanOutModalVisible=false">关闭</button>
</div>
</el-dialog>
<!-- 扫码模态框 - rqrq -->
<el-dialog
title="扫描标签"
@ -464,6 +508,10 @@ export default {
//
detailList: [],
// - rqrq
scanOutList: [],
scanOutModalVisible: false,
// Call
callPalletModalVisible: false,
callStartStationOptions: [], // statusDb=1
@ -487,11 +535,14 @@ export default {
};
},
methods: {
// - rqrq
handleBack() {
// - rqrq
this.scanOutList = [];
this.$router.back();
},
//
// - rqrq
resetPage() {
//
this.palletCode = '';
@ -517,6 +568,10 @@ export default {
//
this.detailList = [];
// - rqrq
this.scanOutList = [];
this.scanOutModalVisible = false;
//
this.scanModalVisible = false;
this.scanCode = '';
@ -1060,13 +1115,26 @@ export default {
});
});
} else {
//
// - rqrq
// - rqrq
const scanOutItem = this.detailList.find(item => item.serialNo === this.scanCode);
deletePalletDetail({
site: this.site,
palletId: this.palletCode,
serialNo: this.scanCode
}).then(({ data }) => {
if (data.code === 0) {
// - rqrq
if (scanOutItem) {
this.scanOutList.push({
position: scanOutItem.position,
layer: scanOutItem.layer,
serialNo: scanOutItem.serialNo
});
console.log('扫出记录已缓存 - rqrq,serialNo=' + scanOutItem.serialNo + ',当前扫出总数=' + this.scanOutList.length);
}
this.$message.success('扫出成功');
this.needRefreshOnClose = true;
this.scanCode = '';
@ -1320,9 +1388,15 @@ export default {
this.callStartStationOptions = [];
this.callTargetStationOptions = [];
},
// - rqrq
showDetailModal(){
this.detailModalVisible=true;
},
// - rqrq
showScanOutModal(){
this.scanOutModalVisible=true;
},
},
mounted() {
this.$nextTick(() => {
@ -1457,6 +1531,18 @@ export default {
border-color: #ccc !important;
}
/* 警告按钮样式 - rqrq */
.action-btn.warning {
background-color: #E6A23C;
border-color: #E6A23C;
color: white;
}
.action-btn.warning:hover:not(:disabled) {
background-color: #f0b757;
border-color: #f0b757;
}
/* 层数网格样式 - rqrq */
.layer-grid {
display: flex;

100
src/views/modules/automatedWarehouse/palletPacking.vue

@ -127,13 +127,18 @@
<!-- 栈板明细表格 (扫描栈板后显示) -->
<div v-if="palletScanned" class="rma-list">
<div class="list-title-row" style="display: flex; gap: 8px; align-items: center; padding: 0;">
<div class="list-title" style="flex: 0.75; margin: 0;">
<button class="action-btn primary" style="flex: 0.25; margin: 0;" @click="showDetailModal" >
{{ '浏览明细' }}
<div class="list-title" style="flex: 0.4; margin: 0;">
<button class="action-btn primary" style="margin: 0;" @click="showDetailModal" >
{{ '明细' }}
</button>
<laber style="margin-left: 5px;">条码数:{{detailList.length}}</laber>
</div>
<button class="action-btn secondary" style="flex: 0.25; margin: 0;" @click="handleTransportOrder">运输指令</button>
<button class="action-btn warning" style="flex: 0.3; margin: 0;" @click="showScanOutModal" :disabled="scanOutList.length === 0">
扫出({{scanOutList.length}})
</button>
<button class="action-btn secondary" style="flex: 0.3; margin: 0;" @click="handleTransportOrder">运输</button>
</div>
<div class="list-title" style="flex: 0.5; margin: 0;">
<label style="margin-left: 5px;">条码数:{{detailList.length}}</label>
</div>
<div class="detail-table">
<div class="table-header">
@ -159,6 +164,7 @@
</div>
</div>
</div>
<!-- 浏览明细弹窗 - rqrq -->
<el-dialog
:title="'已扫描数量:'+detailList.length"
:visible.sync="detailModalVisible"
@ -196,6 +202,44 @@
<button class="action-btn secondary" style="margin-left: 10px;" @click="detailModalVisible=false">取消</button>
</div>
</el-dialog>
<!-- 查看扫出弹窗 - rqrq -->
<el-dialog
:title="'扫出记录 (共'+scanOutList.length+'条)'"
:visible.sync="scanOutModalVisible"
width="90%"
:close-on-click-modal="false"
:show-close="false"
:modal="true"
:modal-append-to-body="true"
:append-to-body="true"
>
<div class="table-body" style="max-height: 300px; overflow-y: auto;">
<div class="detail-table">
<div class="table-header">
<div class="col-position">位置</div>
<div class="col-layer">层数</div>
<div class="col-serial">标签号</div>
</div>
<div
v-for="(detail, index) in scanOutList"
:key="index"
class="table-row"
>
<div class="col-position">{{ detail.position }}</div>
<div class="col-layer">{{ detail.layer }}</div>
<div class="col-serial">{{ detail.serialNo }}</div>
</div>
<!-- 暂无数据提示 -->
<div v-if="scanOutList.length === 0" class="table-row empty-row">
<div class="empty-hint">暂无扫出记录</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<button class="action-btn secondary" @click="scanOutModalVisible=false">关闭</button>
</div>
</el-dialog>
<!-- 扫码模态框 - rqrq -->
<el-dialog
title="扫描标签"
@ -523,6 +567,10 @@ export default {
//
detailList: [],
// - rqrq
scanOutList: [],
scanOutModalVisible: false,
//
transportModalVisible: false,
transportAreaOptions: [], //
@ -552,11 +600,14 @@ export default {
};
},
methods: {
// - rqrq
handleBack() {
// - rqrq
this.scanOutList = [];
this.$router.back();
},
//
// - rqrq
resetPage() {
//
this.palletCode = '';
@ -582,6 +633,10 @@ export default {
//
this.detailList = [];
// - rqrq
this.scanOutList = [];
this.scanOutModalVisible = false;
//
this.scanModalVisible = false;
this.scanCode = '';
@ -1129,13 +1184,26 @@ export default {
});
});
} else {
//
// - rqrq
// - rqrq
const scanOutItem = this.detailList.find(item => item.serialNo === this.scanCode);
deletePalletDetail({
site: this.site,
palletId: this.palletCode,
serialNo: this.scanCode
}).then(({ data }) => {
if (data.code === 0) {
// - rqrq
if (scanOutItem) {
this.scanOutList.push({
position: scanOutItem.position,
layer: scanOutItem.layer,
serialNo: scanOutItem.serialNo
});
console.log('扫出记录已缓存 - rqrq,serialNo=' + scanOutItem.serialNo + ',当前扫出总数=' + this.scanOutList.length);
}
this.$message.success('扫出成功');
this.needRefreshOnClose = true;
this.scanCode = '';
@ -1453,9 +1521,15 @@ export default {
this.callStartStationOptions = [];
this.callTargetStationOptions = [];
},
// - rqrq
showDetailModal(){
this.detailModalVisible=true;
},
// - rqrq
showScanOutModal(){
this.scanOutModalVisible=true;
},
},
mounted() {
this.$nextTick(() => {
@ -1590,6 +1664,18 @@ export default {
border-color: #ccc !important;
}
/* 警告按钮样式 - rqrq */
.action-btn.warning {
background-color: #E6A23C;
border-color: #E6A23C;
color: white;
}
.action-btn.warning:hover:not(:disabled) {
background-color: #f0b757;
border-color: #f0b757;
}
/* 层数网格样式 - rqrq */
.layer-grid {
display: flex;

382
src/views/modules/automatedWarehouse/palletSearch.vue

@ -0,0 +1,382 @@
<template>
<div>
<div class="pda-container">
<!-- 头部栏 -->
<div class="header-bar">
<div class="header-left" @click="handleBack">
<i class="el-icon-arrow-left"></i>
<span>查看托盘</span>
</div>
<div class="header-right" @click="$router.push({ path: '/' })">
首页
</div>
</div>
<div class="table-body" style="max-height: 500px; overflow-y: auto;">
<div class="main-content form-section">
<!-- 栈板扫描 - rqrq -->
<div class="input-group">
<label class="input-label">栈板编码</label>
<el-input
v-model="palletCode"
placeholder="请扫描栈板编码"
class="form-input"
clearable
inputmode="none"
autocomplete="off"
autocorrect="off"
spellcheck="false"
@keyup.enter.native="handlePalletScan"
ref="palletInput"
/>
</div>
<!-- 筛选条件 (扫描栈板后显示) - rqrq -->
<div v-if="palletScanned" class="input-group">
<label class="input-label">位置</label>
<div style="display: flex; gap: 8px;">
<el-select
v-model="selectedPosition"
placeholder="请选择位置"
style="flex: 0.75;"
>
<el-option label="ALL" value=""></el-option>
<el-option
v-for="position in positionOptions"
:key="position"
:label="position"
:value="position"
/>
</el-select>
<button
class="action-btn secondary"
style="flex: 0.25; margin: 0; white-space: nowrap;"
@click="refreshTable"
>
刷新
</button>
</div>
</div>
</div>
<!-- 栈板明细表格 (扫描栈板后显示) - rqrq -->
<div v-if="palletScanned" class="rma-list">
<div class="list-title-row" style="display: flex; gap: 8px; align-items: center; padding: 0;">
<div class="list-title" style="flex: 1; margin: 0;">
<button class="action-btn primary" style="margin: 0;" @click="showDetailModal" >
{{ '浏览明细' }}
</button>
<label style="margin-left: 5px;">条码数:{{detailList.length}}</label>
</div>
</div>
<div class="detail-table">
<div class="table-header">
<div class="col-position">位置</div>
<div class="col-layer">层数</div>
<div class="col-serial">标签号</div>
</div>
<div
v-for="(detail, index) in detailList"
:key="index"
class="table-row"
>
<div class="col-position">{{ detail.position }}</div>
<div class="col-layer">{{ detail.layer }}</div>
<div class="col-serial">{{ detail.serialNo }}</div>
</div>
<!-- 暂无数据提示 -->
<div v-if="detailList.length === 0" class="table-row empty-row">
<div class="empty-hint">暂无栈板明细数据</div>
</div>
</div>
</div>
</div>
</div>
<!-- 浏览明细弹窗 - rqrq -->
<el-dialog
:title="'栈板明细 (共'+detailList.length+'条)'"
:visible.sync="detailModalVisible"
width="90%"
:close-on-click-modal="false"
:show-close="false"
:modal="true"
:modal-append-to-body="true"
:append-to-body="true"
>
<div class="table-body" style="max-height: 400px; overflow-y: auto;">
<div class="detail-table">
<div class="table-header">
<div class="col-position">位置</div>
<div class="col-layer">层数</div>
<div class="col-serial">标签号</div>
</div>
<div
v-for="(detail, index) in detailList"
:key="index"
class="table-row"
>
<div class="col-position">{{ detail.position }}</div>
<div class="col-layer">{{ detail.layer }}</div>
<div class="col-serial">{{ detail.serialNo }}</div>
</div>
<!-- 暂无数据提示 -->
<div v-if="detailList.length === 0" class="table-row empty-row">
<div class="empty-hint">暂无栈板明细数据</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<button class="action-btn secondary" @click="detailModalVisible=false">关闭</button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getPalletInfoSimple,
getPalletDetails
} from '../../../api/automatedWarehouse/palletPacking'
export default {
data() {
return {
site: localStorage.getItem('site'),
palletCode: '',
palletScanned: false,
detailModalVisible: false,
// - rqrq
selectedPosition: '',
positionOptions: [],
// - rqrq
detailList: []
};
},
methods: {
// - rqrq
handleBack() {
this.$router.back();
},
// - rqrq
resetPage() {
this.palletCode = '';
this.palletScanned = false;
this.selectedPosition = '';
this.positionOptions = [];
this.detailList = [];
this.detailModalVisible = false;
// - rqrq
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
},
// 使- rqrq
handlePalletScan() {
if (!this.palletCode.trim()) {
this.$message.error('请输入栈板编码');
return;
}
getPalletInfoSimple({
site: this.site,
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0) {
this.palletCode = data.palletId;
this.palletScanned = true;
this.positionOptions = data.positions || [];
this.refreshTable();
} else {
let errorMsg = data.msg || '栈板不存在';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}
this.$alert(errorMsg, '错误', {
confirmButtonText: '确定',
callback: () => {
this.palletCode = '';
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
}
});
}
}).catch(error => {
console.error('查询栈板失败:', error);
let errorMsg = error.message || '查询栈板失败';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}
this.$alert(errorMsg, '错误', {
confirmButtonText: '确定',
callback: () => {
this.palletCode = '';
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
}
});
});
},
// - rqrq
refreshTable() {
getPalletDetails({
site: this.site,
palletId: this.palletCode,
position: this.selectedPosition,
layer: ''
}).then(({ data }) => {
if (data.code === 0) {
this.detailList = data.details || [];
} else {
this.detailList = [];
}
}).catch(error => {
console.error('获取栈板明细失败:', error);
this.detailList = [];
});
},
// - rqrq
showDetailModal() {
this.detailModalVisible = true;
}
},
mounted() {
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
}
};
</script>
<style scoped>
/* 表格样式 */
.detail-table {
background: white;
border-radius: 6px;
overflow: hidden;
border: 1px solid #e0e0e0;
}
.table-header,
.table-row {
display: flex;
align-items: center;
padding: 8px;
border-bottom: 1px solid #e0e0e0;
}
.table-header {
background: #f5f5f5;
font-weight: bold;
font-size: 14px;
}
.table-row {
font-size: 13px;
}
.table-row:last-child {
border-bottom: none;
}
.col-position {
flex: 1;
text-align: center;
}
.col-layer {
flex: 1;
text-align: center;
}
.col-serial {
flex: 4;
text-align: center;
word-break: break-all;
}
/* 空数据提示 */
.empty-hint {
text-align: center;
color: #999;
padding: 20px;
background: white;
border-radius: 6px;
margin-top: 16px;
}
/* 模态框样式 */
.scan-modal-content {
padding: 10px 0;
}
.modal-form {
margin-bottom: 16px;
}
.dialog-footer {
text-align: center;
}
/* 修复模态框层级问题 */
::v-deep .el-dialog__wrapper {
z-index: 2000 !important;
}
::v-deep .el-overlay {
z-index: 2000 !important;
}
/* 修复单选框样式 */
::v-deep .el-radio {
margin-right: 8px !important;
}
::v-deep .el-radio__label {
font-size: 14px;
}
/* 标题行样式 */
.list-title-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.list-title-row .list-title {
margin: 0;
flex: 1;
}
/* 空数据行样式 */
.empty-row {
justify-content: center;
align-items: center;
padding: 20px;
border-bottom: none;
}
.empty-row .empty-hint {
text-align: center;
color: #999;
width: 100%;
}
</style>

186
src/views/modules/automatedWarehouse/palletSorting.vue

@ -109,7 +109,7 @@
<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="out" style="white-space: nowrap;"></el-radio>
</el-radio-group>
</div>
<button
@ -409,6 +409,8 @@ import {
getLayersByPosition,
savePalletDetail,
deletePalletDetail,
restorePalletDetail,
getLabelInfo,
getLayersForEdit,
updatePalletDetailPosition,
getPalletInfo,
@ -464,6 +466,10 @@ export default {
//
detailList: [],
// - rqrq
// key: serialNo, value: {palletId, position, layer, wcsFlag, partNo, createDate, createBy}
originalDetailCache: {},
// Call
callPalletModalVisible: false,
callStartStationOptions: [], // statusDb=1
@ -487,11 +493,15 @@ export default {
};
},
methods: {
// - rqrq
handleBack() {
// - rqrq
this.originalDetailCache = {};
console.log('已清空分拣原始数据缓存 - rqrq');
this.$router.back();
},
//
// - rqrq
resetPage() {
//
this.palletCode = '';
@ -517,6 +527,10 @@ export default {
//
this.detailList = [];
// - rqrq
this.originalDetailCache = {};
console.log('已清空分拣原始数据缓存 - rqrq');
//
this.scanModalVisible = false;
this.scanCode = '';
@ -1005,75 +1019,135 @@ export default {
return;
}
savePalletDetail({
// - rqrq
getLabelInfo({
site: this.site,
palletId: this.palletCode,
position: this.scanPosition,
layer: this.scanLayer,
serialNo: this.scanCode
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('扫进成功');
this.needRefreshOnClose = true;
this.scanCode = '';
}).then(({ data: queryData }) => {
let originalDetail = null;
if (queryData && queryData.code === 0 && queryData.row) {
originalDetail = queryData.row;
}
// - rqrq
this.loadLayerOptions();
// - rqrq
savePalletDetail({
site: this.site,
palletId: this.palletCode,
position: this.scanPosition,
layer: this.scanLayer,
serialNo: this.scanCode
}).then(({ data }) => {
if (data.code === 0) {
// - rqrq
if (originalDetail) {
this.originalDetailCache[this.scanCode] = {
palletId: originalDetail.palletId || '',
position: originalDetail.position || '',
layer: originalDetail.layer || 1,
wcsFlag: originalDetail.wcsFlag !== undefined ? originalDetail.wcsFlag : 1,
partNo: originalDetail.partNo || '',
createDate: originalDetail.createDate || new Date().toISOString(),
createBy: originalDetail.createBy || ''
};
console.log('扫进成功,已缓存原始数据 - rqrq,serialNo=' + this.scanCode +
',原栈板=' + originalDetail.palletId);
}
// - rqrq
this.$refs.scanInput.focus();
} else {
// 100 - rqrq
let errorMsg = data.msg || '扫进失败';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}
this.$alert(errorMsg, '错误', {
confirmButtonText: '确定',
callback: () => {
this.scanCode = '';
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
this.$message.success('扫进成功');
this.needRefreshOnClose = true;
this.scanCode = '';
// - rqrq
this.loadLayerOptions();
// - rqrq
this.$refs.scanInput.focus();
} else {
// 100 - rqrq
let errorMsg = data.msg || '扫进失败';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}
this.$alert(errorMsg, '错误', {
confirmButtonText: '确定',
callback: () => {
this.scanCode = '';
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
}
});
}
});
}
});
}
}).catch(error => {
console.error('扫进失败:', error);
// - rqrq
let errorMsg = error.message || '扫进失败';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}
this.$alert(errorMsg, '错误', {
confirmButtonText: '确定',
callback: () => {
this.scanCode = '';
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
}).catch(error => {
console.error('扫进失败:', error);
// - rqrq
let errorMsg = error.message || '扫进失败';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}
this.$alert(errorMsg, '错误', {
confirmButtonText: '确定',
callback: () => {
this.scanCode = '';
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
}
});
}
});
}
});
});
}).catch(error => {
console.error('查询标签信息失败:', error);
// - rqrq
console.log('无法查询标签原始信息,将不缓存 - rqrq');
});
} else {
//
deletePalletDetail({
// - rqrq
// - rqrq
const originalData = this.originalDetailCache[this.scanCode];
if (!originalData) {
this.$message.error('未找到该标签的原始数据,无法扫回');
this.scanCode = '';
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
}
});
return;
}
// - rqrq
restorePalletDetail({
site: this.site,
palletId: this.palletCode,
serialNo: this.scanCode
serialNo: this.scanCode,
originalPalletId: originalData.palletId,
originalPosition: originalData.position,
originalLayer: originalData.layer,
partNo: originalData.partNo,
createDate: originalData.createDate,
createBy: originalData.createBy,
wcsFlag: originalData.wcsFlag
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('扫出成功');
// - rqrq
delete this.originalDetailCache[this.scanCode];
console.log('扫回成功,已删除缓存 - rqrq,serialNo=' + this.scanCode);
this.$message.success('扫回成功');
this.needRefreshOnClose = true;
this.scanCode = '';
this.$refs.scanInput.focus();
this.$nextTick(() => {
if (this.$refs.scanInput) {
this.$refs.scanInput.focus();
}
});
} else {
// 100 - rqrq
let errorMsg = data.msg || '扫出失败';
// 100 - rqrq
let errorMsg = data.msg || '扫失败';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}
@ -1090,9 +1164,9 @@ export default {
});
}
}).catch(error => {
console.error('扫失败:', error);
console.error('扫失败:', error);
// - rqrq
let errorMsg = error.message || '扫失败';
let errorMsg = error.message || '扫失败';
if (errorMsg.length > 100) {
errorMsg = errorMsg.substring(0, 100) + '...';
}

Loading…
Cancel
Save