From aad568f3208cea1f4b66564b51cdf5f6f0c7adb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Fri, 29 May 2026 17:05:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes,wms):=20=E6=96=B0=E5=A2=9E=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E9=80=81=E6=A3=80=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=8F=8A=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增设备送检审批的API接口层 2. 在待办页面添加设备送检审批标签页 3. 完善设备巡检日报的送检提交功能 4. 修复报表模板查询的参数传递问题 5. 优化设备送检审批单的业务逻辑处理 --- ...quipmentInspectionApprovalServiceImpl.java | 12 +- .../mes/eqp/equipmentInspectionApproval.js | 39 +++ klp-ui/src/views/mes/eqp/check/approval.vue | 251 ++++++++++++++++++ klp-ui/src/views/mes/eqp/check/day.vue | 40 ++- .../src/views/wms/report/template/action.vue | 4 +- klp-ui/src/views/wms/todo/index.vue | 5 + 6 files changed, 340 insertions(+), 11 deletions(-) create mode 100644 klp-ui/src/api/mes/eqp/equipmentInspectionApproval.js create mode 100644 klp-ui/src/views/mes/eqp/check/approval.vue diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionApprovalServiceImpl.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionApprovalServiceImpl.java index 736a8993..7f9b1cdb 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionApprovalServiceImpl.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionApprovalServiceImpl.java @@ -81,12 +81,8 @@ public class EqpEquipmentInspectionApprovalServiceImpl implements IEqpEquipmentI @Override public Boolean insertByBo(EqpEquipmentInspectionApprovalBo bo) { EqpEquipmentInspectionApproval add = BeanUtil.toBean(bo, EqpEquipmentInspectionApproval.class); - if (StringUtils.isBlank(bo.getApprovalUser())) { - add.setApprovalUser(LoginHelper.getNickName()); - } - if (bo.getApplyTime() == null) { - add.setApplyTime(new Date()); - } + add.setApplyUser(LoginHelper.getNickName()); + add.setApplyTime(new Date()); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; if (flag) { @@ -101,6 +97,10 @@ public class EqpEquipmentInspectionApprovalServiceImpl implements IEqpEquipmentI @Override public Boolean updateByBo(EqpEquipmentInspectionApprovalBo bo) { EqpEquipmentInspectionApproval update = BeanUtil.toBean(bo, EqpEquipmentInspectionApproval.class); + if (bo.getApprovalStatus() != null && (bo.getApprovalStatus() == 2 || bo.getApprovalStatus() == 3)) { + update.setApprovalUser(LoginHelper.getNickName()); + update.setApprovalTime(new Date()); + } validEntityBeforeSave(update); return baseMapper.updateById(update) > 0; } diff --git a/klp-ui/src/api/mes/eqp/equipmentInspectionApproval.js b/klp-ui/src/api/mes/eqp/equipmentInspectionApproval.js new file mode 100644 index 00000000..66d00011 --- /dev/null +++ b/klp-ui/src/api/mes/eqp/equipmentInspectionApproval.js @@ -0,0 +1,39 @@ +import request from '@/utils/request' + +export function listEquipmentInspectionApproval(query) { + return request({ + url: '/eqp/equipmentInspectionApproval/list', + method: 'get', + params: query + }) +} + +export function getEquipmentInspectionApproval(approvalId) { + return request({ + url: '/eqp/equipmentInspectionApproval/' + approvalId, + method: 'get' + }) +} + +export function addEquipmentInspectionApproval(data) { + return request({ + url: '/eqp/equipmentInspectionApproval', + method: 'post', + data: data + }) +} + +export function updateEquipmentInspectionApproval(data) { + return request({ + url: '/eqp/equipmentInspectionApproval', + method: 'put', + data: data + }) +} + +export function delEquipmentInspectionApproval(approvalId) { + return request({ + url: '/eqp/equipmentInspectionApproval/' + approvalId, + method: 'delete' + }) +} diff --git a/klp-ui/src/views/mes/eqp/check/approval.vue b/klp-ui/src/views/mes/eqp/check/approval.vue new file mode 100644 index 00000000..1f766e11 --- /dev/null +++ b/klp-ui/src/views/mes/eqp/check/approval.vue @@ -0,0 +1,251 @@ + + + diff --git a/klp-ui/src/views/mes/eqp/check/day.vue b/klp-ui/src/views/mes/eqp/check/day.vue index 50d425d8..511f2b2a 100644 --- a/klp-ui/src/views/mes/eqp/check/day.vue +++ b/klp-ui/src/views/mes/eqp/check/day.vue @@ -15,6 +15,9 @@ 查询 + + 送检 + @@ -107,17 +110,25 @@ import { listEquipmentPart } from "@/api/mes/eqp/equipmentPart"; import { listEquipmentInspectionRecord } from "@/api/mes/eqp/equipmentInspectionRecord"; import { listProductionLine } from "@/api/wms/productionLine"; +import { addEquipmentInspectionApproval } from "@/api/mes/eqp/equipmentInspectionApproval"; export default { name: "DailyInspectionReport", data() { + const d = new Date(); + const today = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`; + const routeQuery = this.$route && this.$route.query || {}; + const hasRouteQuery = !!(routeQuery.productionLine || (routeQuery.startDate && routeQuery.endDate)); return { loading: false, - dateRange: [this.getToday(), this.getToday()], - productionLine: 2, + dateRange: (routeQuery.startDate && routeQuery.endDate) + ? [routeQuery.startDate, routeQuery.endDate] + : [today, today], + productionLine: routeQuery.productionLine ? Number(routeQuery.productionLine) : 2, lineList: [], partList: [], records: [], + hasRouteQuery, }; }, computed: { @@ -253,11 +264,34 @@ export default { this.loading = false; } }, + handleSubmitForApproval() { + if (!this.dateRange || this.dateRange.length !== 2) { + this.$modal.msgWarning("请选择时间段"); + return; + } + if (!this.productionLine) { + this.$modal.msgWarning("请选择产线"); + return; + } + this.$modal.confirm('确认将该时间段"' + this.dateRange[0] + '至' + this.dateRange[1] + '"的巡检日报提交审批吗?').then(() => { + this.loading = true; + return addEquipmentInspectionApproval({ + productionLine: this.productionLine, + insStartTime: this.dateRange[0] + ' 00:00:00', + insEndTime: this.dateRange[1] + ' 23:59:59', + }); + }).then(() => { + this.$modal.msgSuccess("送检成功"); + this.loading = false; + }).catch(() => { + this.loading = false; + }); + }, async loadLineList() { try { const res = await listProductionLine({ pageSize: 999 }); if (res.rows) this.lineList = res.rows; - if (this.lineList.length > 0) { + if (!this.hasRouteQuery && this.lineList.length > 0) { const suanYa = this.lineList.find(l => l.lineName === '酸轧线'); this.productionLine = suanYa ? suanYa.lineId : this.lineList[0].lineId; } diff --git a/klp-ui/src/views/wms/report/template/action.vue b/klp-ui/src/views/wms/report/template/action.vue index 7a3f2b45..6e75bb3f 100644 --- a/klp-ui/src/views/wms/report/template/action.vue +++ b/klp-ui/src/views/wms/report/template/action.vue @@ -654,7 +654,7 @@ export default { const [lossRes, outRes] = await Promise.all([ listCoilWithIds({ ...this.queryParams, actionIds: lossActionIds.join(',') || '', startTime: '', endTime: '', selectType: 'raw_material' }), - listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', byCreateTimeStart: this.queryParams.startTime, byCreateTimeEnd: this.queryParams.endTime, selectType: 'product' }), + listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '', byCreateTimeStart: this.queryParams.startTime, byCreateTimeEnd: this.queryParams.endTime, selectType: 'product' }), ]); this.lossList = lossRes.rows.map(item => { @@ -692,7 +692,7 @@ export default { const [lossRes, outRes] = await Promise.all([ listCoilWithIds({ ...this.queryParams, actionIds: lossActionIds.join(',') || '', startTime: '', endTime: '', selectType: 'raw_material' }), - listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '', selectType: 'product' }), + listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '', byCreateTimeStart: this.queryParams.startTime, byCreateTimeEnd: this.queryParams.endTime, selectType: 'product' }), ]); if (this.reportType === 'out') { diff --git a/klp-ui/src/views/wms/todo/index.vue b/klp-ui/src/views/wms/todo/index.vue index 7fc7818b..2ec45127 100644 --- a/klp-ui/src/views/wms/todo/index.vue +++ b/klp-ui/src/views/wms/todo/index.vue @@ -9,6 +9,9 @@ + + + @@ -19,6 +22,7 @@ import TranferCoilTable from '@/views/wms/coil/views/base/tranfer.vue' import InspectionTask from '@/views/mes/qc/inspection/task.vue' import CertificateBook from '@/views/mes/qc/certificate/book.vue' + import EquipmentInspectionApproval from '@/views/mes/eqp/check/approval.vue' export default { name: 'TodoIndex', @@ -26,6 +30,7 @@ TranferCoilTable, InspectionTask, CertificateBook, + EquipmentInspectionApproval, }, data() { return {