常熟吴彦祖 3 months ago
parent
commit
4f493b6ea7
  1. 14
      src/api/automatedWarehouse/cancelWcsPallet.js
  2. 1
      src/router/index.js
  3. 6
      src/views/main.vue
  4. 76
      src/views/modules/automatedWarehouse/callOut.vue
  5. 468
      src/views/modules/automatedWarehouse/cancelWcsPallet.vue
  6. 3
      src/views/modules/automatedWarehouse/emptyPalletAssembly.vue
  7. 7
      src/views/modules/automatedWarehouse/palletChangeStation.vue
  8. 7
      src/views/modules/automatedWarehouse/palletManualMove.vue

14
src/api/automatedWarehouse/cancelWcsPallet.js

@ -0,0 +1,14 @@
import { createAPI } from "@/utils/httpRequest.js";
// ========== 取消WCS组盘相关 ========== - rqrq
// 检查栈板WCS组盘状态 - rqrq
export const checkPalletWcsStatus = data => createAPI(`/wcsIntegration/checkPalletWcsStatus`, 'post', data)
// 取消组盘 - rqrq
export const cancelWcsPallet = data => createAPI(`/wcsIntegration/cancelWcsPallet`, 'post', data)
// 移出全部物料 - rqrq
export const removeAllPalletDetails = data => createAPI(`/wcsIntegration/removeAllPalletDetails`, 'post', data)

1
src/router/index.js

@ -131,6 +131,7 @@ const globalRoutes = [
{path: "/palletChangeStation",name: "palletChangeStation", component: resolve => require(["@/views/modules/automatedWarehouse/palletChangeStation.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
{path: "/palletManualMove",name: "palletManualMove", component: resolve => require(["@/views/modules/automatedWarehouse/palletManualMove.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
{path: "/emptyPalletAssembly",name: "emptyPalletAssembly", component: resolve => require(["@/views/modules/automatedWarehouse/emptyPalletAssembly.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
{path: "/cancelWcsPallet",name: "cancelWcsPallet", component: resolve => require(["@/views/modules/automatedWarehouse/cancelWcsPallet.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}},
]

6
src/views/main.vue

@ -179,6 +179,12 @@
</div>
<div class="menu-text">空托盘入库</div>
</div>
<div class="menu-item" @click="navigateWithWarehouseCheck('cancelWcsPallet')">
<div class="menu-icon purchase">
<van-icon name="shopping-cart-o" size="24" />
</div>
<div class="menu-text">取消组盘</div>
</div>
</div>
</div>
<!-- 库内管理 -->

76
src/views/modules/automatedWarehouse/callOut.vue

@ -18,6 +18,7 @@
<div class="table-body" style="max-height: 500px; overflow-y: auto;">
<div class="main-content form-section">
<!-- 表单区域 -->
<div class="input-group">
<label class="input-label">物料编码</label>
<el-input
@ -28,7 +29,16 @@
@blur="handlePartNoBlur"
/>
</div>
<!-- 栈板编码搜索框 - rqrq -->
<div class="input-group">
<label class="input-label">栈板编码</label>
<el-input
v-model="formData.palletId"
placeholder="请输入栈板编码"
class="form-input"
clearable
/>
</div>
<div class="input-group">
<label class="input-label">物料名称</label>
<el-input
@ -79,7 +89,19 @@
<div class="rma-item" @click="selectPallet(pallet)" :class="{ 'selected': isSelected(pallet) }">
<div class="item-info">
<span class="part-no">栈板号: {{ pallet.palletId }}</span>
<span class="batch-qty">物料: {{ pallet.partNo }} | 数量: {{ pallet.qty }}</span>
<!-- rqrq - 如果有物料编码显示明细否则只显示栈板 -->
<span class="batch-qty" v-if="pallet.partNo">
物料: {{ pallet.partNo }} | 数量: {{ pallet.qty }}
</span>
<span class="batch-qty" v-if="pallet.partNo && pallet.batchNo">
| 批号: {{ pallet.batchNo }}
</span>
<span class="batch-qty" v-if="pallet.partNo && pallet.wdr">
| WDR: {{ pallet.wdr }}
</span>
<span class="batch-qty" v-if="pallet.partNo && pallet.expiredDate">
| 失效日期: {{ pallet.expiredDate }}
</span>
</div>
<div class="item-status">
<i class="el-icon-check" v-if="isSelected(pallet)"></i>
@ -117,6 +139,7 @@ export default {
loading: false, // loading
lastPartNo: '', //
formData: {
palletId: '', // - rqrq
partNo: '',
partDesc: '',
batchNo: '',
@ -178,19 +201,30 @@ export default {
},
//
// - rqrq
confirmDo() {
if(this.formData.partNo==null||this.formData.partNo===''){
this.$message.error('请输入物料编码');
// - rqrq
if((!this.formData.partNo || this.formData.partNo === '') &&
(!this.formData.palletId || this.formData.palletId === '')){
this.$message.error('请输入物料编码或栈板编码');
return;
}
//
// - rqrq
const queryParams = {
site: this.formData.site,
partNo: this.formData.partNo
site: this.formData.site
};
// - rqrq
if (this.formData.palletId && this.formData.palletId.trim()) {
queryParams.palletId = this.formData.palletId.trim();
}
// - rqrq
if (this.formData.partNo && this.formData.partNo.trim()) {
queryParams.partNo = this.formData.partNo.trim();
}
//
if (this.formData.batchNo && this.formData.batchNo.trim()) {
queryParams.batchNo = this.formData.batchNo.trim();
@ -205,9 +239,6 @@ export default {
} else {
this.$message.success(`找到 ${this.palletList.length} 个栈板`);
}
for (let i = 0; i <this.palletList.length ; i++) {
this.palletList[i].batchNo=this.formData.batchNo
}
//
this.selectedPallet = null;
this.selectedPallets = []; //
@ -226,19 +257,29 @@ export default {
});
},
//
// - rqrq ID
selectPallet(pallet) {
const index = this.selectedPallets.findIndex(item => item.palletId === pallet.palletId);
const palletId = pallet.palletId;
const index = this.selectedPallets.findIndex(item => item.palletId === palletId);
if (index > -1) {
// - rqrq
this.selectedPallets.splice(index, 1);
this.$message.success('已取消选择栈板');
} else {
this.selectedPallets.push(pallet);
this.$message.success(`已选择栈板: ${pallet.palletId}`);
// Call- rqrq
this.selectedPallets.push({
site: pallet.site,
palletId: pallet.palletId,
partNo: pallet.partNo || '', //
qty: pallet.qty || 0,
batchNo: pallet.batchNo || this.formData.batchNo || ''
});
this.$message.success(`已选择栈板: ${palletId}`);
}
},
//
// - rqrq
isSelected(pallet) {
return this.selectedPallets.some(item => item.palletId === pallet.palletId);
},
@ -306,8 +347,9 @@ export default {
},
cleanData(){
//
// - rqrq
this.formData = {
palletId: '', // - rqrq
partNo: '',
partDesc: '',
batchNo: '',

468
src/views/modules/automatedWarehouse/cancelWcsPallet.vue

@ -0,0 +1,468 @@
<template>
<div>
<div class="pda-container">
<!-- 头部栏 - rqrq -->
<div class="header-bar">
<div class="header-left" @click="handleBack">
<i class="el-icon-arrow-left"></i>
<span>取消WCS组盘任务</span>
</div>
<div class="header-right" @click="$router.push({ path: '/' })">
首页
</div>
</div>
<div class="table-body" style="max-height: 600px; 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
@keyup.enter.native="handlePalletScan"
inputmode="none"
autocomplete="off"
autocorrect="off"
spellcheck="false"
ref="palletInput"
/>
</div>
<!-- 栈板信息显示扫描栈板后显示- rqrq -->
<div v-if="palletScanned" class="pallet-info-section">
<div class="info-row">
<label class="info-label">是否被调用:</label>
<span class="info-value" :style="{color: palletInfo.callingFlag === 'Y' ? '#F56C6C' : '#67C23A'}">
{{ palletInfo.callingFlag === 'Y' ? '是' : '否' }}
</span>
</div>
<!-- 是否发送组盘任务 - rqrq -->
<div class="info-row">
<label class="info-label">是否已组盘:</label>
<span class="info-value" :style="{color: hasSentWcsTask ? '#F56C6C' : '#67C23A'}">
{{ hasSentWcsTask ? '是' : '否' }}
</span>
</div>
<!-- 浏览明细按钮 - rqrq -->
<div class="button-row">
<button class="action-btn primary" @click="showDetailModal" style="width: 100%;">
浏览明细 ({{ detailList.length }})
</button>
</div>
<!-- 取消组盘按钮只有发送了组盘任务才显示- rqrq -->
<div v-if="showCancelButton" class="button-row">
<button
class="action-btn primary"
@click="handleCancelWcsPallet"
:disabled="cancelLoading"
style="width: 100%;">
{{ cancelLoading ? '取消中...' : '取消组盘' }}
</button>
</div>
<!-- 移出全部物料按钮只有未发送组盘任务且未被调用且有明细才显示- rqrq -->
<div v-if="showRemoveAllButton" class="button-row">
<button
class="action-btn warning"
@click="handleRemoveAllMaterials"
:disabled="removeAllLoading"
style="width: 100%;">
{{ removeAllLoading ? '移出中...' : '移出全部物料' }}
</button>
</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 {
getPalletDetails
} from '../../../api/automatedWarehouse/palletPacking'
import {
checkPalletWcsStatus,
cancelWcsPallet,
removeAllPalletDetails
} from '../../../api/automatedWarehouse/cancelWcsPallet'
export default {
data() {
return {
site: localStorage.getItem('site'),
// - rqrq
palletCode: '',
palletScanned: false,
palletInfo: {
callingFlag: '',
canOperate: '',
isEmpty: ''
},
// - rqrq
hasSentWcsTask: false,
showCancelButton: false,
showRemoveAllButton: false,
// - rqrq
detailList: [],
detailModalVisible: false,
// - rqrq
cancelLoading: false,
removeAllLoading: false
};
},
methods: {
// - rqrq
handleBack() {
this.$router.back();
},
// - rqrq
handlePalletScan() {
if (!this.palletCode.trim()) {
this.$message.error('请输入栈板编码');
return;
}
checkPalletWcsStatus({
site: this.site,
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0) {
// 6 - rqrq
this.palletCode = data.row.palletId;
// - rqrq
this.palletInfo = data.row;
this.palletScanned = true;
// - rqrq
// canOperateshowCancelButton- rqrq
this.showCancelButton = data.row.canOperate === 'Y';
// isEmptyshowRemoveAllButton- rqrq
this.showRemoveAllButton = data.row.isEmpty === 'Y';
// hasSentWcsTask - rqrq
this.hasSentWcsTask = this.showCancelButton;
// - rqrq
this.loadPalletDetails();
} else {
this.$alert(data.msg || '栈板不存在', '错误', {
confirmButtonText: '确定',
callback: () => {
this.palletCode = '';
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
}
});
}
}).catch(error => {
console.error('查询栈板失败:', error);
this.$alert(error.message || '查询栈板失败', '错误', {
confirmButtonText: '确定',
callback: () => {
this.palletCode = '';
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
}
});
});
},
// - rqrq
loadPalletDetails() {
getPalletDetails({
site: this.site,
palletId: this.palletCode,
position: '',
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;
},
// - rqrq
handleCancelWcsPallet() {
this.$confirm('确定要取消组盘吗?取消后需要重新组盘才能推送到WCS。', '确认操作', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelLoading = true;
cancelWcsPallet({
site: this.site,
palletId: this.palletCode
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消组盘成功');
// - rqrq
this.handlePalletScan();
} else {
this.$alert(data.msg || '取消组盘失败', '错误');
}
}).catch(error => {
console.error('取消组盘失败:', error);
this.$message.error(error.message || '取消组盘失败');
}).finally(() => {
this.cancelLoading = false;
});
}).catch(() => {
//
});
},
// - rqrq
handleRemoveAllMaterials() {
this.$confirm('确定要移出栈板上的全部物料吗?此操作不可恢复!', '确认操作', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.removeAllLoading = true;
removeAllPalletDetails({
site: this.site,
palletId: this.palletCode
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('移出全部物料成功');
// - rqrq
this.handlePalletScan();
} else {
this.$alert(data.msg || '移出全部物料失败', '错误');
}
}).catch(error => {
console.error('移出全部物料失败:', error);
this.$message.error(error.message || '移出全部物料失败');
}).finally(() => {
this.removeAllLoading = false;
});
}).catch(() => {
//
});
}
},
mounted() {
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
}
};
</script>
<style scoped>
/* 栈板信息区域 - rqrq */
.pallet-info-section {
margin-top: 16px;
padding: 12px;
background: #f5f7fa;
border-radius: 6px;
}
.info-row {
display: flex;
align-items: center;
padding: 8px 0;
border-bottom: 1px solid #e4e7ed;
}
.info-row:last-child {
border-bottom: none;
}
.info-label {
font-weight: bold;
color: #606266;
width: 140px;
flex-shrink: 0;
}
.info-value {
color: #303133;
font-size: 14px;
font-weight: bold;
}
.button-row {
margin-top: 12px;
}
/* 警告按钮 - rqrq */
.action-btn.warning {
background-color: #E6A23C;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
.action-btn.warning:hover {
background-color: #d99525;
}
.action-btn.warning:disabled {
background-color: #f5dab1;
cursor: not-allowed;
}
/* 表格样式 - rqrq */
.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;
}
/* 空数据提示 - rqrq */
.empty-hint {
text-align: center;
color: #999;
padding: 20px;
background: white;
border-radius: 6px;
}
/* 空数据行样式 - rqrq */
.empty-row {
justify-content: center;
align-items: center;
padding: 20px;
border-bottom: none;
}
.empty-row .empty-hint {
text-align: center;
color: #999;
width: 100%;
}
.dialog-footer {
display: flex;
gap: 8px;
text-align: center;
}
/* 修复模态框层级问题 - rqrq */
::v-deep .el-dialog__wrapper {
z-index: 2000 !important;
}
::v-deep .el-overlay {
z-index: 2000 !important;
}
</style>

3
src/views/modules/automatedWarehouse/emptyPalletAssembly.vue

@ -131,6 +131,9 @@ export default {
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0) {
// 6 - rqrq
this.palletCode = data.row.palletId;
// - rqrq
this.palletInfo = data.row;
this.currentPalletType = data.row.palletType || '';

7
src/views/modules/automatedWarehouse/palletChangeStation.vue

@ -23,6 +23,10 @@
class="form-input"
clearable
@keyup.enter.native="handlePalletScan"
inputmode="none"
autocomplete="off"
autocorrect="off"
spellcheck="false"
ref="palletInput"
/>
</div>
@ -202,6 +206,9 @@ export default {
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0) {
// 6 - rqrq
this.palletCode = data.row.palletId;
// - rqrq
if (data.row.callingFlag === 'Y') {
this.$alert('栈板被调用,请选择其他栈板', '提示', {

7
src/views/modules/automatedWarehouse/palletManualMove.vue

@ -23,6 +23,10 @@
class="form-input"
clearable
@keyup.enter.native="handlePalletScan"
inputmode="none"
autocomplete="off"
autocorrect="off"
spellcheck="false"
ref="palletInput"
/>
</div>
@ -250,6 +254,9 @@ export default {
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0) {
// 6 - rqrq
this.palletCode = data.row.palletId;
// - rqrq
if (data.row.callingFlag === 'Y') {
this.$alert('托盘被调用,无法进行移动操作', '提示', {

Loading…
Cancel
Save