From 47f26a1d4bd1aa5877cbb5ae2771b87018b41477 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Thu, 11 Jun 2026 20:18:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production-plan-cable-cop-task.vue | 54 ++++++++++++++----- .../longtron/production-work-report.vue | 16 +++++- .../longtron/screen-renovation-progress.vue | 3 -- .../longtron/screen-whole-lift-progress.vue | 32 +++-------- 4 files changed, 62 insertions(+), 43 deletions(-) diff --git a/src/views/modules/longtron/production-plan-cable-cop-task.vue b/src/views/modules/longtron/production-plan-cable-cop-task.vue index 23c31695..d545a761 100644 --- a/src/views/modules/longtron/production-plan-cable-cop-task.vue +++ b/src/views/modules/longtron/production-plan-cable-cop-task.vue @@ -281,6 +281,35 @@ export default { this.searchTable() }, methods: { + getExpectedNodeCodeByTaskType(taskType) { + const text = (taskType || '').trim() + if (text.includes('线缆')) return 'lineProduction' + if (text.toUpperCase().includes('COP')) return 'copProduction' + return '' + }, + getExpectedNodeNameByTaskType(taskType) { + const nodeCode = this.getExpectedNodeCodeByTaskType(taskType) + if (nodeCode === 'lineProduction') return '线缆生产' + if (nodeCode === 'copProduction') return 'COP生产' + return '' + }, + getDefaultNodeListByTaskType(taskType) { + const nodeCode = this.getExpectedNodeCodeByTaskType(taskType) + const nodeName = this.getExpectedNodeNameByTaskType(taskType) + if (!nodeCode || !nodeName) { + return [ + { nodeCode: 'lineProduction', nodeName: '线缆生产', status: '未开始' }, + { nodeCode: 'copProduction', nodeName: 'COP生产', status: '未开始' } + ] + } + return [{ nodeCode: nodeCode, nodeName: nodeName, status: '未开始' }] + }, + filterNodeListByTaskType(taskType, nodeList) { + const list = Array.isArray(nodeList) ? nodeList : [] + const expectedNodeCode = this.getExpectedNodeCodeByTaskType(taskType) + if (!expectedNodeCode) return list + return list.filter(item => item && item.nodeCode === expectedNodeCode) + }, searchTable(flag) { if (flag === 'Y') this.pageIndex = 1 const queryData = { @@ -304,7 +333,7 @@ export default { }) }, normalizeRow(row) { - const list = row.nodeList || [] + const list = this.filterNodeListByTaskType(row.taskType, row.nodeList || []) const done = list.filter(item => item.status === '已完成').length const currentNode = (list.find(item => item.status !== '已完成') || {}).nodeName || '全部完成' const assigneeSummary = list.filter(item => item.assigneeUserName).map(item => `${item.nodeName}:${item.assigneeUserName}`).join(';') @@ -321,7 +350,7 @@ export default { nodeList: list, nodeDoneCount: done, nodeTotalCount: list.length, - currentNode: row.currentNode || currentNode, + currentNode: currentNode, reportQty: row.reportQty || 0, assigneeSummary: assigneeSummary || '-' } @@ -344,8 +373,7 @@ export default { finishDate: '', status: '进行中', nodeList: [ - { nodeCode: 'lineProduction', nodeName: '线缆生产', status: '已完成' }, - { nodeCode: 'copProduction', nodeName: 'COP生产', status: '进行中' } + { nodeCode: 'lineProduction', nodeName: '线缆生产', status: '进行中' } ] }, { @@ -364,7 +392,6 @@ export default { finishDate: '', status: '已排产', nodeList: [ - { nodeCode: 'lineProduction', nodeName: '线缆生产', status: '未开始' }, { nodeCode: 'copProduction', nodeName: 'COP生产', status: '未开始' } ] } @@ -418,7 +445,7 @@ export default { }, openEditDialog(row) { this.saveHeaderData = row - ? { ...row, projectNo: row.projectNo || row.taskNo || '', category: row.category || row.sourceProjectNo || '', autoAssignAllUsers: !!row.autoAssignAllUsers, nodeReportMode: row.nodeReportMode || 'PARALLEL' } + ? { ...row, projectNo: row.projectNo || row.taskNo || '', category: row.category || row.sourceProjectNo || '', autoAssignAllUsers: !!row.autoAssignAllUsers, nodeReportMode: row.nodeReportMode || 'PARALLEL', nodeList: this.filterNodeListByTaskType(row.taskType, row.nodeList || []) } : { orderNo: '', projectNo: '', taskType: '线缆自制', category: '新梯', materialName: '', materialSpec: '', reportQty: 0, planFinishDate: '', status: '已排产', autoAssignAllUsers: true, nodeReportMode: 'PARALLEL', nodeList: [] } this.setUp.reviewFlag = true }, @@ -433,6 +460,10 @@ export default { projectNo: this.saveHeaderData.projectNo, sourceProjectNo: this.saveHeaderData.category } + payload.nodeList = this.filterNodeListByTaskType(payload.taskType, payload.nodeList || []) + if (!payload.nodeList.length) { + payload.nodeList = this.getDefaultNodeListByTaskType(payload.taskType) + } delete payload.category this.setUp.saveButton = true saveCableCopTask(payload).then(({data}) => { @@ -449,10 +480,7 @@ export default { const saveData = this.normalizeRow({ ...payload, orderNo: orderNo, - nodeList: payload.nodeList && payload.nodeList.length ? payload.nodeList : [ - { nodeCode: 'lineProduction', nodeName: '线缆生产', status: '未开始' }, - { nodeCode: 'copProduction', nodeName: 'COP生产', status: '未开始' } - ] + nodeList: payload.nodeList && payload.nodeList.length ? payload.nodeList : this.getDefaultNodeListByTaskType(payload.taskType) }) if (index > -1) this.$set(this.dataList, index, saveData) else this.dataList.unshift(saveData) @@ -462,7 +490,8 @@ export default { }) }, openReportDialog(row) { - this.reportNodeOptions = (row.nodeList || []).filter(item => item.status !== '已完成') + const taskNodeList = this.filterNodeListByTaskType(row.taskType, row.nodeList || []) + this.reportNodeOptions = taskNodeList.filter(item => item.status !== '已完成') this.reportData = { orderNo: row.orderNo, taskNo: row.projectNo || row.taskNo, nodeCode: '', reportQty: 1, remark: '' } this.setUp.reportFlag = true }, @@ -471,7 +500,8 @@ export default { this.currentAssignOrder = { orderNo: row.orderNo, orderType: 'CABLE_COP' } getNodeAssigneeList({ orderNo: row.orderNo, orderType: 'CABLE_COP' }).then(({ data }) => { const assignRows = data && data.code === 0 ? (data.rows || []) : [] - this.assignNodeList = assignRows.map(item => ({ ...item, assigneeUserIdList: item.assigneeUserIdList || [], userOptions: [] })) + const filteredAssignRows = this.filterNodeListByTaskType(row.taskType, assignRows) + this.assignNodeList = filteredAssignRows.map(item => ({ ...item, assigneeUserIdList: item.assigneeUserIdList || [], userOptions: [] })) const requests = this.assignNodeList.map(item => getNodeAssigneeUsers({ orderType: 'CABLE_COP', nodeCode: item.nodeCode }).then(({ data: userData }) => { item.userOptions = userData && userData.code === 0 ? (userData.rows || []) : [] diff --git a/src/views/modules/longtron/production-work-report.vue b/src/views/modules/longtron/production-work-report.vue index 0953b9df..89ef440b 100644 --- a/src/views/modules/longtron/production-work-report.vue +++ b/src/views/modules/longtron/production-work-report.vue @@ -105,7 +105,7 @@
{{ getModelFieldLabel(item.orderType) }} - {{ item.modelNo }} + {{ getModelFieldValue(item) }}
计划完工 @@ -460,7 +460,19 @@ export default { return map[orderType] || orderType || '-' }, getModelFieldLabel (orderType) { - return orderType === 'MACHINING' ? '物料号' : '型号' + if (orderType === 'MACHINING') return '物料号' + if (orderType === 'CABLE_COP') return '物料信息' + return '型号' + }, + getModelFieldValue (item) { + if (!item) return '-' + if (item.orderType === 'CABLE_COP') { + const name = item.materialName || '' + const spec = item.materialSpec || '' + if (name && spec) return `${name} / ${spec}` + return name || spec || '-' + } + return item.modelNo || '-' }, resetQuery () { this.searchData = { diff --git a/src/views/modules/longtron/screen-renovation-progress.vue b/src/views/modules/longtron/screen-renovation-progress.vue index debb6f8b..033a389e 100644 --- a/src/views/modules/longtron/screen-renovation-progress.vue +++ b/src/views/modules/longtron/screen-renovation-progress.vue @@ -17,7 +17,6 @@ {{ renovationKpi.finishRate }}% 完工达成率
-
排产 {{ renovationKpi.total }} · 进行中 {{ renovationKpi.processing }} · 已完成 {{ renovationKpi.finished }}
线缆/COP任务
@@ -25,7 +24,6 @@ {{ cableCopKpi.finishRate }}% 完工达成率
-
排产 {{ cableCopKpi.total }} · 进行中 {{ cableCopKpi.processing }} · 已完成 {{ cableCopKpi.finished }}
机加工任务
@@ -33,7 +31,6 @@ {{ machiningKpi.finishRate }}% 完工达成率
-
排产 {{ machiningKpi.total }} · 进行中 {{ machiningKpi.processing }} · 已完成 {{ machiningKpi.finished }}
diff --git a/src/views/modules/longtron/screen-whole-lift-progress.vue b/src/views/modules/longtron/screen-whole-lift-progress.vue index 0dcd05b3..0f475cdd 100644 --- a/src/views/modules/longtron/screen-whole-lift-progress.vue +++ b/src/views/modules/longtron/screen-whole-lift-progress.vue @@ -10,16 +10,9 @@ -
-
排产订单
{{ kpi.total }}
-
进行中
{{ kpi.processing }}
-
已完成
{{ kpi.finished }}
-
完工达成率
{{ kpi.finishRate }}%
-
-
- 已完成 - 未开始 + 已完成报工 + 未开始报工
@@ -28,7 +21,7 @@ - + @@ -56,8 +49,7 @@ export default { currentTime: '', timerId: null, boardTimerId: null, - boardList: [], - kpi: { total: 0, processing: 0, finished: 0, finishRate: 0 } + boardList: [] } }, mounted() { @@ -91,16 +83,14 @@ export default { loadBoardData() { if (this.loading) return this.loading = true - let statusList = ['已排产', '进行中'] + let statusList = ['已排产', '进行中', '已完成'] getHomeLiftOrderList({ page: 1, limit: 300,statusList: statusList}).then(({data}) => { this.loading = false const source = (data && data.code === 0 && data.page && data.page.list) ? data.page.list : this.getMockList() this.boardList = this.buildBoardList(source) - this.buildKpi() }).catch(() => { this.loading = false this.boardList = this.buildBoardList(this.getMockList()) - this.buildKpi() }) }, buildBoardList(sourceList) { @@ -123,12 +113,6 @@ export default { ;(nodeList || []).forEach(node => { map[node.nodeCode] = node.status || '未开始' }) return map }, - buildKpi() { - const total = this.boardList.length - const processing = this.boardList.filter(item => item.status === '进行中').length - const finished = this.boardList.filter(item => item.status === '已完成').length - this.kpi = { total, processing, finished, finishRate: total ? Math.round((finished / total) * 100) : 0 } - }, getNodeCellText(row, code) { return row.nodeStatusMap[code] || '未开始' }, @@ -167,11 +151,7 @@ export default { .title{color:#8fe7ff;font-size:32px;font-weight:800;letter-spacing:3px;line-height:1.05;text-shadow:0 0 14px rgba(79,179,255,.36)} .subtitle{margin-top:4px;color:#c7e8ff;font-size:11px;letter-spacing:1px} .tools{display:flex;align-items:center;gap:12px}.time{color:#89d7ff;font-size:22px;font-weight:600} -.kpi-row{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:12px 0 8px} -.kpi-card{border-radius:10px;padding:12px 14px;background:rgba(14,43,70,.82);border:1px solid rgba(101,157,209,.22)} -.kpi-label{color:#b7d3ee;font-size:14px}.kpi-value{margin-top:6px;font-size:32px;font-weight:700;color:#edf6ff} -.kpi-value.warning{color:#ffd166}.kpi-value.success{color:#74dfa3}.kpi-value.highlight{color:#79d5ff} -.legend-row{display:flex;gap:16px;margin:0 0 10px 2px}.legend-item{display:inline-flex;align-items:center;color:#c7dff4;font-size:13px} +.legend-row{display:flex;gap:16px;margin:10px 0 10px 2px}.legend-item{display:inline-flex;align-items:center;color:#c7dff4;font-size:13px} .dot{width:10px;height:10px;border-radius:50%;margin-right:6px;display:inline-block}.dot.done{background:#69e4a4}.dot.doing{background:#ffd35d}.dot.todo{background:#dbe3ee} .board-table{border-radius:10px;overflow:hidden;border:1px solid rgba(86,140,190,.35);flex:1;min-height:0} .board-table .cell {