常熟吴彦祖 3 months ago
parent
commit
b855a8baad
  1. 16
      src/api/automatedWarehouse/emptyPalletAssembly.js
  2. 1
      src/router/index.js
  3. 6
      src/views/main.vue
  4. 349
      src/views/modules/automatedWarehouse/emptyPalletAssembly.vue

16
src/api/automatedWarehouse/emptyPalletAssembly.js

@ -0,0 +1,16 @@
import { createAPI } from "@/utils/httpRequest.js";
// ========== 空托盘组盘相关 ========== - rqrq
// 检查是否为空托盘(pallet_detail表无数据)- rqrq
export const checkEmptyPallet = data => createAPI(`/wcsIntegration/checkEmptyPallet`, 'post', data)
// 获取托盘类型列表 - rqrq
export const getPalletTypes = data => createAPI(`/wcsIntegration/getPalletTypes`, 'post', data)
// 更新托盘类型和自动分拣标志 - rqrq
export const updatePalletTypeAndAutoSort = data => createAPI(`/wcsIntegration/updatePalletTypeAndAutoSort`, 'post', data)
// 空托盘通知入库(包含入库并运输)- rqrq
export const notifyEmptyPalletInbound = data => createAPI(`/wcsIntegration/notifyEmptyPalletInbound`, 'post', data)

1
src/router/index.js

@ -130,6 +130,7 @@ const globalRoutes = [
{path: "/palletSearch",name: "palletSearch", component: resolve => require(["@/views/modules/automatedWarehouse/palletSearch.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}},
{path: "/palletChangeStation",name: "palletChangeStation", component: resolve => require(["@/views/modules/automatedWarehouse/palletChangeStation.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}}, {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: "/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}},
] ]

6
src/views/main.vue

@ -173,6 +173,12 @@
</div> </div>
<div class="menu-text">栈板人工移动</div> <div class="menu-text">栈板人工移动</div>
</div> </div>
<div class="menu-item" @click="navigateWithWarehouseCheck('emptyPalletAssembly')">
<div class="menu-icon purchase">
<van-icon name="shopping-cart-o" size="24" />
</div>
<div class="menu-text">空托盘入库</div>
</div>
</div> </div>
</div> </div>
<!-- 库内管理 --> <!-- 库内管理 -->

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

@ -0,0 +1,349 @@
<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>空托盘组盘</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"
ref="palletInput"
/>
</div>
<!-- 托盘信息显示扫描托盘后显示- rqrq -->
<div v-if="palletScanned" class="pallet-info-section">
<!-- 托盘类型选择 - rqrq -->
<div class="input-group">
<label class="input-label">托盘类型</label>
<el-select
v-model="currentPalletType"
placeholder="请选择托盘类型"
style="width: 100%;"
@change="handlePalletTypeChange"
>
<el-option
v-for="type in palletTypeOptions"
:key="type.palletType"
:label="`${type.palletType} - ${type.typeDesc}`"
:value="type.palletType"
/>
</el-select>
</div>
<!-- 当前站点信息 - rqrq -->
<div class="info-row">
<label class="info-label">当前站点ID:</label>
<span class="info-value">{{ palletInfo.currentStationId || '-' }}</span>
</div>
<div class="info-row">
<label class="info-label">当前站点编码:</label>
<span class="info-value">{{ palletInfo.currentStationCode || '-' }}</span>
</div>
<!-- 操作按钮 - rqrq -->
<div class="button-row" style="display: flex; gap: 8px; margin-top: 16px;">
<button
class="action-btn primary"
@click="handleNotifyInbound"
:disabled="notifyLoading || !currentPalletType"
style="flex: 1;">
{{ notifyLoading ? '处理中...' : '通知入库' }}
</button>
<button
class="action-btn primary"
@click="handleInboundAndTransport"
:disabled="transportLoading || !currentPalletType"
style="flex: 1;">
{{ transportLoading ? '处理中...' : '入库并运输' }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {
checkEmptyPallet,
getPalletTypes,
updatePalletTypeAndAutoSort,
notifyEmptyPalletInbound
} from '../../../api/automatedWarehouse/emptyPalletAssembly'
export default {
data() {
return {
site: localStorage.getItem('site'),
// - rqrq
palletCode: '',
palletScanned: false,
palletInfo: {
currentStationId: '',
currentStationCode: '',
palletType: ''
},
// - rqrq
currentPalletType: '',
palletTypeOptions: [],
// - rqrq
notifyLoading: false,
transportLoading: false
};
},
methods: {
// - rqrq
handleBack() {
this.$router.back();
},
// - rqrq
handlePalletScan() {
if (!this.palletCode.trim()) {
this.$message.error('请输入托盘编码');
return;
}
checkEmptyPallet({
site: this.site,
palletId: this.palletCode
}).then(({ data }) => {
if (data.code === 0) {
// - rqrq
this.palletInfo = data.row;
this.currentPalletType = data.row.palletType || '';
this.palletScanned = true;
// palletFamily - rqrq
this.loadPalletTypes(data.row.palletFamily);
} 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();
}
});
}
});
});
},
// palletFamily- rqrq
loadPalletTypes(palletFamily) {
getPalletTypes({
site: this.site,
palletFamily: palletFamily || ''
}).then(({ data }) => {
if (data.code === 0) {
this.palletTypeOptions = data.rows || [];
} else {
this.palletTypeOptions = [];
this.$message.error('获取托盘类型失败');
}
}).catch(error => {
console.error('获取托盘类型失败:', error);
this.palletTypeOptions = [];
});
},
// - rqrq
handlePalletTypeChange() {
// - rqrq
updatePalletTypeAndAutoSort({
site: this.site,
palletId: this.palletCode,
palletType: this.currentPalletType,
autoSort: 'N',
forceFullPalletOut: false
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('更新成功');
} else {
this.$message.error(data.msg || '更新失败');
}
}).catch(error => {
console.error('更新失败:', error);
this.$message.error('更新失败');
});
},
// - rqrq
handleNotifyInbound() {
if (!this.currentPalletType) {
this.$message.error('请先选择托盘类型');
return;
}
this.$confirm('确定要执行通知入库操作吗?', '确认操作', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.notifyLoading = true;
notifyEmptyPalletInbound({
site: this.site,
palletId: this.palletCode,
transportFlag: 'N'
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('通知入库成功');
// - rqrq
this.resetPage();
} else {
this.$alert(data.msg || '通知入库失败', '错误');
}
}).catch(error => {
console.error('通知入库失败:', error);
this.$message.error(error.message || '通知入库失败');
}).finally(() => {
this.notifyLoading = false;
});
}).catch(() => {
//
});
},
// - rqrq
handleInboundAndTransport() {
if (!this.currentPalletType) {
this.$message.error('请先选择托盘类型');
return;
}
this.$confirm('确定要执行入库并运输操作吗?', '确认操作', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.transportLoading = true;
notifyEmptyPalletInbound({
site: this.site,
palletId: this.palletCode,
transportFlag: 'Y'
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('入库并运输成功');
// - rqrq
this.resetPage();
} else {
this.$alert(data.msg || '入库并运输失败', '错误');
}
}).catch(error => {
console.error('入库并运输失败:', error);
this.$message.error(error.message || '入库并运输失败');
}).finally(() => {
this.transportLoading = false;
});
}).catch(() => {
//
});
},
// - rqrq
resetPage() {
this.palletCode = '';
this.palletScanned = false;
this.palletInfo = {
currentStationId: '',
currentStationCode: '',
palletType: ''
};
this.currentPalletType = '';
this.palletTypeOptions = [];
this.$nextTick(() => {
if (this.$refs.palletInput) {
this.$refs.palletInput.focus();
}
});
}
},
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: 120px;
flex-shrink: 0;
}
.info-value {
color: #303133;
font-size: 14px;
}
.button-row {
margin-top: 12px;
}
</style>
Loading…
Cancel
Save