From 197603483d93d76fb68a0cc39933c2b22996ccba Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 3 Jun 2026 15:50:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=80=81=E8=AE=A2=E5=8D=95=E8=BF=9B=E5=BA=A6=E3=80=81?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=E3=80=81=E4=BB=93=E5=82=A8?= =?UTF-8?q?=E6=B1=87=E6=80=BB=E5=92=8C=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerManagement/index.vue | 8 +- .../OrderProgressOverview/index.vue | 8 + .../SeikoWorkshop/ProductionPlan/index.vue | 161 +++++++++++------- .../WarehouseSummary/index.vue | 2 +- static/config.js | 4 +- 5 files changed, 116 insertions(+), 67 deletions(-) diff --git a/src/views/SalesManagement/CustomerManagement/index.vue b/src/views/SalesManagement/CustomerManagement/index.vue index 83823a35..3d93d5bc 100644 --- a/src/views/SalesManagement/CustomerManagement/index.vue +++ b/src/views/SalesManagement/CustomerManagement/index.vue @@ -102,7 +102,7 @@ @@ -234,7 +234,7 @@ 装配人 {{ detailData[0].装配结束人员 }} +
+ 入库日期 + {{ detailData[0].采购入库日期 }} +
+
+ 入库日期 + {{ detailData[0].自制入库日期 }} +
发货日期 {{ detailData[0].发货日期 }} diff --git a/src/views/SeikoWorkshop/ProductionPlan/index.vue b/src/views/SeikoWorkshop/ProductionPlan/index.vue index e67b97f0..3b31cc96 100644 --- a/src/views/SeikoWorkshop/ProductionPlan/index.vue +++ b/src/views/SeikoWorkshop/ProductionPlan/index.vue @@ -230,6 +230,14 @@ export default { statusValue: '', loading: false, tableData2: [], + processConfig: { + maxProcessCount: 11, + processNamePattern: 'OP0{index}0', + statusRules: { + completed: 100, + dispatching: 0 + } + }, dashboardVisible: false, statusPieChart: null, completionBarChart: null, @@ -354,76 +362,105 @@ export default { this.$message.warning('月份不能为空') } }, - groupByOrder(data) { - const grouped = {} - if (!Array.isArray(data)) { - return [] + // 初始化工序字段 + initializeProcessFields() { + const fields = {} + for (let i = 1; i <= this.processConfig.maxProcessCount; i++) { + const opKey = this.processConfig.processNamePattern.replace('{index}', i) + fields[opKey] = '' } + return fields + }, + // 创建订单分组对象 + createOrderGroup(item) { + return { + 订单号: item.订单号, + MK订单编号: item.MK订单编号, + 收货人: item.MK订单收货人, + 产品名称: item.产品名称, + 零件名称: item.零件名称, + 零件图号: item.零件图号, + 订单数: item.订单数, + 计划数: item.计划数, + 剩余数: item.剩余数, + 状态: item.状态, + 完成率: '', + 投产时间: item.投产时间, + 精工期限: item.精工期限, + 设备: item.设备, + 材料: item.材料, + _totalProcesses: 0, + _completedProcesses: 0, + ...this.initializeProcessFields() + } + }, + // 解析工序索引 + parseProcessIndex(processOrder) { + if (processOrder === null || processOrder === undefined || processOrder === '') { + return null + } + const opIndex = parseInt(processOrder, 10) + if (isNaN(opIndex) || opIndex < 1 || opIndex > this.processConfig.maxProcessCount) { + console.warn('无效的工序顺序: ' + processOrder) + return null + } + return opIndex + }, + // 处理工序数据 + processWorkProcesses(group, item) { + if (!item.工序) return + group._totalProcesses++ + const remainingCount = Number(item.剩余数) || 0 + if (remainingCount <= 0) { + group._completedProcesses++ + } + const opIndex = this.parseProcessIndex(item.工序顺序) + if (opIndex !== null) { + const opKey = this.processConfig.processNamePattern.replace('{index}', opIndex) + group[opKey] = item.工序 + } + }, + // 计算订单状态 + calculateOrderStatus(group) { + var rate = 0 + if (group._totalProcesses > 0) { + rate = Math.round(group._completedProcesses / group._totalProcesses * 100) + } + group.完成率 = rate + '%' + if (rate === this.processConfig.statusRules.completed) { + group.状态 = '已完成' + } else if (rate === this.processConfig.statusRules.dispatching) { + group.状态 = '派工中' + } else { + group.状态 = '生产中' + } + delete group._totalProcesses + delete group._completedProcesses + }, + // 数据分组主逻辑 + groupDataByOrder(data) { + const grouped = {} data.forEach(item => { - if (!item) return + if (!item || !item.订单号) return const orderNo = item.订单号 if (!grouped[orderNo]) { - grouped[orderNo] = { - 订单号: item.订单号, - MK订单编号: item.MK订单编号, - 收货人: item.MK订单收货人, - 产品名称: item.产品名称, - 零件名称: item.零件名称, - 零件图号: item.零件图号, - 订单数: item.订单数, - 计划数: item.计划数, - 剩余数: item.剩余数, - 状态: item.状态, - 完成率: '', - 投产时间: item.投产时间, - 精工期限: item.精工期限, - 设备: item.设备, - 材料: item.材料, - _totalProcesses: 0, - _completedProcesses: 0, - OP010: '', - OP020: '', - OP030: '', - OP040: '', - OP050: '', - OP060: '', - OP070: '', - OP080: '', - OP090: '', - OP100: '', - OP110: '' - } + grouped[orderNo] = this.createOrderGroup(item) } - if (item.工序) { - grouped[orderNo]._totalProcesses++ - if (item.剩余数 <= 0) { - grouped[orderNo]._completedProcesses++ - } - } - const opIndex = parseInt(item.工序顺序) - if (opIndex >= 1 && opIndex <= 11) { - const opKey = `OP0${opIndex}0` - grouped[orderNo][opKey] = item.工序 - } - }) - Object.values(grouped).forEach(group => { - var rate = 0 - if (group._totalProcesses > 0) { - rate = Math.round(group._completedProcesses / group._totalProcesses * 100) - } - group.完成率 = rate + '%' - if (rate === 100) { - group.状态 = '已完成' - } else if (rate === 0) { - group.状态 = '派工中' - } else { - group.状态 = '生产中' - } - delete group._totalProcesses - delete group._completedProcesses + this.processWorkProcesses(grouped[orderNo], item) }) return Object.values(grouped) }, + groupByOrder(data) { + if (!Array.isArray(data)) { + console.warn('生产数据格式错误:期望数组格式') + return [] + } + const groupedData = this.groupDataByOrder(data) + groupedData.forEach(group => { + this.calculateOrderStatus(group) + }) + return groupedData + }, openDashboard() { if (this.tableData2.length === 0) { this.$message.warning('暂无数据,请先查询') diff --git a/src/views/WarehouseManagement/WarehouseSummary/index.vue b/src/views/WarehouseManagement/WarehouseSummary/index.vue index edebed97..94da777a 100644 --- a/src/views/WarehouseManagement/WarehouseSummary/index.vue +++ b/src/views/WarehouseManagement/WarehouseSummary/index.vue @@ -510,7 +510,7 @@ export default { var param = [] var Data = this.CreateData('11', '仓储管理_生产订单_查询', param) this.ExecDatabase(Data).then(response => { - var filtered = response.data.filter(item => item.状态 === '加工中') + var filtered = response.data.filter(item => item.状态 === '加工中' && item.补货数 !== item.入库数) filtered.forEach(item => { item.期限状态 = this.calculateDeadlineStatus(item) item.超期时间 = this.calculateOverdueDays(item) diff --git a/static/config.js b/static/config.js index 5ee68b8c..91d2aef8 100644 --- a/static/config.js +++ b/static/config.js @@ -4,8 +4,8 @@ export const name1_config = `OP1000` export const name3_config = `OP2000` export const name4_config = `OP9999` // -var url = `http://192.168.1.27:8030` // 测试环境 接口端口号 http://192.168.1.27:8031 测试环境管理系统 0001 654321 -// var url = `http://192.168.1.27:8010` // 正式环境 接口端口号 http://192.168.1.27:8001 正式环境管理系统 0000 0000 +// var url = `http://192.168.1.27:8030` // 测试环境 接口端口号 http://192.168.1.27:8031 测试环境管理系统 0001 654321 +var url = `http://192.168.1.27:8010` // 正式环境 接口端口号 http://192.168.1.27:8001 正式环境管理系统 0000 0000 var url1 = `http://192.168.1.27:10006` // 立库数据库的接口端口号 // var url = `http://127.0.0.1:10250` // var url = `http://124.220.15.242:8602`