常熟吴彦祖 1 month ago
parent
commit
fef42b36dc
  1. 6
      src/api/automatedWarehouse/palletPacking.js
  2. 211
      src/views/modules/automatedWarehouse/palletSearch.vue

6
src/api/automatedWarehouse/palletPacking.js

@ -82,3 +82,9 @@ export const finishSortingNoAgv = data => createAPI(`/wcsIntegration/finishSorti
// 根据栈板站点获取分拣明细RFID列表 - rqrq
export const getSortingList = data => createAPI(`/wcsIntegration/getSortingList`,'post',data)
// 获取栈板上被预留的标签列表 - rqrq
export const getPalletReservedLabels = data => createAPI(`/wcsIntegration/getPalletReservedLabels`,'post',data)
// 批量取消栈板上的预留标签 - rqrq
export const batchCancelReserve = data => createAPI(`/wcsIntegration/batchCancelReserve`,'post',data)

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

@ -57,12 +57,20 @@
<!-- 栈板明细表格 (扫描栈板后显示) - 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;">
<div class="list-title" style="flex: 1; margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px;">
<button class="action-btn primary" style="margin: 0;" @click="showDetailModal" >
{{ '浏览明细' }}
</button>
<label style="margin-left: 5px;">条码数:{{detailList.length}}</label>
</div>
<!-- 预留清单按钮 - rqrq -->
<button
class="action-btn"
:class="reserveCount > 0 ? 'warning' : 'secondary'"
style="margin: 0; margin-left: 10px;"
@click="showReserveModal">
预留清单({{ reserveCount }})
</button>
</div>
</div>
<div class="detail-table">
<div class="table-header">
@ -124,13 +132,65 @@
<button class="action-btn secondary" @click="detailModalVisible=false">关闭</button>
</div>
</el-dialog>
<!-- 预留清单弹窗 - rqrq -->
<el-dialog
:title="'预留清单 (共'+reserveCount+'条)'"
:visible.sync="reserveModalVisible"
width="95%"
: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: 350px; overflow-y: auto;">
<div class="detail-table">
<div class="table-header reserve-header">
<div class="col-serial-reserve">标签号</div>
<div class="col-ref">申请单号</div>
<div class="col-ref">订单号</div>
</div>
<div
v-for="(item, index) in reservedLabels"
:key="index"
class="table-row"
>
<div class="col-serial-reserve">{{ item.serialNo || '-' }}</div>
<div class="col-ref">{{ item.reserveOrderRef1 || '-' }}</div>
<div class="col-ref">{{ item.reserveOrderRef3 || '-' }}</div>
</div>
<!-- 暂无数据提示 -->
<div v-if="reservedLabels.length === 0" class="table-row empty-row">
<div class="empty-hint">暂无预留标签</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer" style="display: flex; gap: 10px; justify-content: center;">
<button class="action-btn secondary" @click="reserveModalVisible=false" :disabled="cancelReserveLoading">关闭</button>
<button
class="action-btn danger"
@click="handleBatchCancelReserve"
:disabled="cancelReserveLoading || reservedLabels.length === 0 || locationCode === '1101'"
v-if="reservedLabels.length > 0"
>
{{ cancelReserveLoading ? '取消中...' : '一键取消预留' }}
</button>
</div>
<!-- 库位1101提示 - rqrq -->
<div v-if="locationCode === '1101'" class="reserve-warning">
<i class="el-icon-warning"></i> 栈板在立库异常位上不允许取消预留
</div>
</el-dialog>
</div>
</template>
<script>
import {
getPalletInfoSimple,
getPalletDetails
getPalletDetails,
getPalletReservedLabels,
batchCancelReserve
} from '../../../api/automatedWarehouse/palletPacking'
export default {
@ -146,7 +206,16 @@ export default {
positionOptions: [],
// - rqrq
detailList: []
detailList: [],
// - rqrq
locationCode: '',
// - rqrq
reserveModalVisible: false,
reservedLabels: [],
reserveCount: 0,
cancelReserveLoading: false
};
},
methods: {
@ -163,6 +232,10 @@ export default {
this.positionOptions = [];
this.detailList = [];
this.detailModalVisible = false;
this.locationCode = '';
this.reserveModalVisible = false;
this.reservedLabels = [];
this.reserveCount = 0;
// - rqrq
this.$nextTick(() => {
@ -189,7 +262,9 @@ export default {
this.palletCode = data.palletId;
this.palletScanned = true;
this.positionOptions = data.positions || [];
this.locationCode = data.locationCode || '';
this.refreshTable();
this.loadReservedLabels(); // - rqrq
} else {
let errorMsg = data.msg || '栈板不存在';
if (errorMsg.length > 100) {
@ -250,6 +325,75 @@ export default {
// - rqrq
showDetailModal() {
this.detailModalVisible = true;
},
// - rqrq
showReserveModal() {
this.loadReservedLabels();
this.reserveModalVisible = true;
},
// - rqrq
loadReservedLabels() {
getPalletReservedLabels({
site: this.site,
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0 && data.data) {
this.reservedLabels = data.data.reservedLabels || [];
this.reserveCount = data.data.reserveCount || 0;
this.locationCode = data.data.locationCode || '';
} else {
this.reservedLabels = [];
this.reserveCount = 0;
}
}).catch(error => {
console.error('获取预留标签列表失败:', error);
this.reservedLabels = [];
this.reserveCount = 0;
});
},
// - rqrq
handleBatchCancelReserve() {
if (this.locationCode === '1101') {
this.$message.error('栈板在库位1101上,不允许取消预留');
return;
}
this.$confirm('确定要取消所有预留标签吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.doBatchCancelReserve();
}).catch(() => {
//
});
},
// - rqrq
doBatchCancelReserve() {
this.cancelReserveLoading = true;
batchCancelReserve({
site: this.site,
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('取消预留成功');
this.reserveModalVisible = false;
// - rqrq
this.loadReservedLabels();
} else {
this.$message.error(data.msg || '取消预留失败');
}
}).catch(error => {
console.error('批量取消预留失败:', error);
this.$message.error('取消预留异常');
}).finally(() => {
this.cancelReserveLoading = false;
});
}
},
mounted() {
@ -377,4 +521,63 @@ export default {
width: 100%;
}
/* 预留清单相关样式 - rqrq */
.action-btn.warning {
background: #E6A23C;
color: white;
border: none;
}
.action-btn.warning:hover {
background: #d99429;
}
.action-btn.danger {
background: #F56C6C;
color: white;
border: none;
}
.action-btn.danger:hover:not(:disabled) {
background: #e45656;
}
.action-btn.danger:disabled {
background: #ccc;
cursor: not-allowed;
opacity: 0.6;
}
.reserve-header {
font-size: 12px;
}
.col-serial-reserve {
flex: 2;
text-align: center;
word-break: break-all;
font-size: 12px;
}
.col-ref {
flex: 1.5;
text-align: center;
word-break: break-all;
font-size: 12px;
}
.reserve-warning {
text-align: center;
color: #E6A23C;
padding: 10px;
font-size: 14px;
background: #fdf6ec;
border-radius: 4px;
margin-top: 10px;
}
.reserve-warning i {
margin-right: 5px;
}
</style>
Loading…
Cancel
Save