From 57d6702c99e7f6cd369149893381995bc32470a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Tue, 12 May 2026 11:21:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms):=20=E6=96=B0=E5=A2=9E=E5=BA=94?= =?UTF-8?q?=E6=94=B6=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86=E5=8F=8A=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=A0=A1=E9=AA=8C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增receivePlan.js API文件,实现应收货物计划的增删改查和钢卷校验接口 2. 入库页面新增签收前校验功能,支持差异弹窗确认后强行收货 3. 新增收货计划明细管理页面,支持增删改查、Excel导入导出和差异对比 --- klp-ui/src/api/wms/receivePlan.js | 53 + klp-ui/src/views/wms/coil/do/warehousing.vue | 146 ++- klp-ui/src/views/wms/receive/plan/index.vue | 974 ++++++++++++++++++- 3 files changed, 1093 insertions(+), 80 deletions(-) create mode 100644 klp-ui/src/api/wms/receivePlan.js diff --git a/klp-ui/src/api/wms/receivePlan.js b/klp-ui/src/api/wms/receivePlan.js new file mode 100644 index 00000000..48ca3419 --- /dev/null +++ b/klp-ui/src/api/wms/receivePlan.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询应收货物计划列表 +export function listReceivePlan(query) { + return request({ + url: '/wms/receivePlan/list', + method: 'get', + params: query + }) +} + +// 查询应收货物计划详细 +export function getReceivePlan(receiveId) { + return request({ + url: '/wms/receivePlan/' + receiveId, + method: 'get' + }) +} + +// 新增应收货物计划 +export function addReceivePlan(data) { + return request({ + url: '/wms/receivePlan', + method: 'post', + data: data + }) +} + +// 修改应收货物计划 +export function updateReceivePlan(data) { + return request({ + url: '/wms/receivePlan', + method: 'put', + data: data + }) +} + +// 删除应收货物计划 +export function delReceivePlan(receiveId) { + return request({ + url: '/wms/receivePlan/' + receiveId, + method: 'delete' + }) +} + +// 校验要签收的钢卷是否在代收计划中 +export function checkReceivePlan(data) { + return request({ + url: '/wms/receivePlan/validateCoil', + method: 'post', + data: data + }) +} diff --git a/klp-ui/src/views/wms/coil/do/warehousing.vue b/klp-ui/src/views/wms/coil/do/warehousing.vue index 4cddca14..124e4521 100644 --- a/klp-ui/src/views/wms/coil/do/warehousing.vue +++ b/klp-ui/src/views/wms/coil/do/warehousing.vue @@ -137,8 +137,10 @@ - - + +
请先选择材料类型
@@ -170,8 +172,10 @@ + - 查询 + 在签收前校验 + 查询 @@ -249,7 +253,8 @@ @@ -259,7 +264,24 @@ - + + + + + + + + + + + + + @@ -366,9 +388,7 @@ import { listDeliveryPlan } from '@/api/wms/deliveryPlan' import handleCoil, { COIL_ACTIONS } from '../js/coilActions' import LabelRender from '../panels/LabelRender/index.vue' import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue"; -import { delCoilWarehouseOperationLogByCoilId } from '@/api/wms/coilWarehouseOperationLog' - -// 键值为[400, 500), 不包含在字典中,但后续可以加入的特殊操作,这类操作录入后会立刻完成,例如入库(401)和发货(402) +import { checkReceivePlan } from '@/api/wms/receivePlan' export default { components: { @@ -455,20 +475,15 @@ export default { ], currentCoilNo: [ { required: true, message: "当前钢卷号不能为空", trigger: "blur" }, - // 远程校验,当前钢卷号不能重复 - // { - // validator: (rule, value, callback) => { - // checkCoilNo({ currentCoilNo: value, coilId: this.form.coilId }).then(res => { - // const { duplicateType } = res.data; - // if (duplicateType === 'current' || duplicateType === 'both') { - // // alert('当前钢卷号重复,请重新输入'); - // callback(new Error('当前钢卷号重复,请重新输入')); - // } else { - // callback(); - // } - // }) - // }, trigger: 'blur' - // }, + { + validator: (rule, value, callback) => { + if (!/^\d{8}$/.test(value)) { + callback(new Error('当前钢卷号必须是8位的阿拉伯数字')); + } else { + callback(); + } + }, trigger: 'blur' + }, ], supplierCoilNo: [ { required: true, message: "厂家原料卷号不能为空", trigger: "blur" }, @@ -529,13 +544,21 @@ export default { }, coilInfo: {}, todayPlanId: null, + // 是否在签收前进行验证 + validateBeforeReceipt: false, editCoil: { form: { }, dialogVisible: false, loading: false, - } + }, + // 差异确认相关数据 + differenceModalVisible: false, + differenceMessage: '', + differenceTableData: [], + dbData: null, + checkResult: null } }, mounted() { @@ -693,20 +716,62 @@ export default { }) }, // 确认收货 - confirmReceipt() { + async confirmReceipt() { + await this.$modal.confirm("确认收货后刚钢卷会进入库存并占用所选的实际库区,是否继续?") // 二次确认 - this.$modal.confirm("收货后刚钢卷会进入库存并占用所选的实际库区,是否继续?").then(() => { + try { this.buttonLoading = true; - // 更新操作记录状态 actionStatus: 2 - handleCoil(COIL_ACTIONS.STORE, this.coilInfo, this.receiptForm) - .then(_ => { - this.$message.success("确认收货成功"); - this.getList() - this.receiptModalVisible = false; - }).finally(() => { + if (this.validateBeforeReceipt) { + // 先检验是否在代收卷中存在当前的信息 + const res = await checkReceivePlan(this.coilInfo) + const { found, message, differences, dbData } = res.data + this.checkResult = res.data + if (!found) { this.buttonLoading = false; - }); - }) + this.$modal.msgError("钢卷不在代收计划中"); + return; + } + // 检查是否有差异 + if (differences && Object.keys(differences).length > 0) { + // 有差异,展示差异弹窗 + this.differenceMessage = message || '钢卷信息存在差异,请确认后继续收货' + // 处理差异数据,转换为表格格式 + this.differenceTableData = Object.entries(differences).map(([field, value]) => { + // 使用正则表达式提取前端值和数据库值 + const regex = /前端值[::]\s*(.+?)\s*[,,]\s*数据库值[::]\s*(.+)/ + const match = value.match(regex) + const frontendValue = match ? match[1] : '' + const databaseValue = match ? match[2] : '' + return { field, frontendValue, databaseValue } + }) + this.dbData = dbData + this.buttonLoading = false + this.differenceModalVisible = true + return + } + } + // 没有差异或不需要校验,直接收货 + this.doReceipt() + } catch (error) { + this.buttonLoading = false; + } + }, + // 执行收货操作 + doReceipt() { + this.buttonLoading = true; + handleCoil(COIL_ACTIONS.STORE, this.coilInfo, this.receiptForm) + .then(_ => { + this.$message.success("确认收货成功"); + this.getList() + this.receiptModalVisible = false; + this.differenceModalVisible = false; + }).finally(() => { + this.buttonLoading = false; + }); + }, + // 确认差异并继续收货 + confirmDifference() { + this.doReceipt() }, handleReject(row) { this.$modal.confirm("确认拒签吗?", "拒签确认", { @@ -812,14 +877,11 @@ export default { }) }, // 检查钢卷号是否合法(后端检查) - checkCoilNo() { - checkCoilNo({ currentCoilNo: this.form.currentCoilNo, entryCoilNo: this.form.enterCoilNo }).then(res => { - console.log(res) - // if (res.data) { - // this.$modal.msgError("钢卷号已存在"); - // } - }) - }, + // checkCoilNo() { + // checkCoilNo({ currentCoilNo: this.form.currentCoilNo, entryCoilNo: this.form.enterCoilNo }).then(res => { + // console.log(res) + // }) + // }, // 取消操作 cancel() { this.form = {}; diff --git a/klp-ui/src/views/wms/receive/plan/index.vue b/klp-ui/src/views/wms/receive/plan/index.vue index e01de7df..fef0361b 100644 --- a/klp-ui/src/views/wms/receive/plan/index.vue +++ b/klp-ui/src/views/wms/receive/plan/index.vue @@ -60,6 +60,8 @@
修改 + 导入 + 明细 删除
@@ -89,37 +91,338 @@ 取 消
+ + + + + + + + 新增 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + 计划有实际无(少收) + {{ missingCoils.length }} +
+ + + + + + + +
暂无少收卷
+
+
+ +
+
+ + 实际有计划无(多收) + {{ extraCoils.length }} +
+ + + + + + + +
暂无多收卷
+
+
+
+ +
+
+ + 字段不一致 + {{ diffCoils.length }} +
+ + + + + + +
暂无字段不一致的卷
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + 选择Excel文件 + + + + 校验数据 + + + 开始导入 + + + 重置 + +
+ +
+ 下载导入模板 + 请按照模板格式填写数据 +
+ +
+ + + + + +
+ +
+ + + + + + + + + + + + + + +
+ +
+ + +

已导入 {{ importedCount }} / {{ totalCount }} 条数据

+
+ +
+ +
+ +
+ +
+
+