From f6a74e58ead3a63e5823ae3a6e83d1f890114e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Mon, 8 Jun 2026 10:22:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor(wms/coil):=20=E6=8A=BD=E8=B1=A1?= =?UTF-8?q?=E6=8E=92=E4=BA=A7=E5=8D=95=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E6=8E=92=E4=BA=A7=E5=8D=95=E5=B1=95=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增PlanSheetViewer通用排产单展示组件,支持图片、excel、普通文件预览和空状态 2. 改造TimeInput组件,修复绑定属性写法 3. 替换typing.vue、stepSplit.vue、split.vue、merge.vue中的旧排产单代码,统一使用新组件 4. 删除冗余的排产单相关API调用和本地数据逻辑 --- klp-ui/src/components/TimeInput.vue | 4 +- .../wms/coil/components/PlanSheetViewer.vue | 162 ++++++++++++++++++ klp-ui/src/views/wms/coil/merge.vue | 96 ++--------- .../src/views/wms/coil/panels/stepSplit.vue | 124 ++------------ klp-ui/src/views/wms/coil/split.vue | 90 +--------- klp-ui/src/views/wms/coil/typing.vue | 88 +--------- 6 files changed, 207 insertions(+), 357 deletions(-) create mode 100644 klp-ui/src/views/wms/coil/components/PlanSheetViewer.vue diff --git a/klp-ui/src/components/TimeInput.vue b/klp-ui/src/components/TimeInput.vue index a96da4ea..3e325741 100644 --- a/klp-ui/src/components/TimeInput.vue +++ b/klp-ui/src/components/TimeInput.vue @@ -2,9 +2,9 @@
@ - + : - + :00 此刻
diff --git a/klp-ui/src/views/wms/coil/components/PlanSheetViewer.vue b/klp-ui/src/views/wms/coil/components/PlanSheetViewer.vue new file mode 100644 index 00000000..76294b19 --- /dev/null +++ b/klp-ui/src/views/wms/coil/components/PlanSheetViewer.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue index 9ae8f9e5..acebb64e 100644 --- a/klp-ui/src/views/wms/coil/merge.vue +++ b/klp-ui/src/views/wms/coil/merge.vue @@ -15,42 +15,8 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - +
+
@@ -210,13 +176,13 @@
- - @@ -400,8 +366,6 @@ import { getMaterialCoil, mergeMaterialCoil } from '@/api/wms/coil'; import { listCoilAbnormal } from '@/api/wms/coilAbnormal'; import { listPendingAction, getPendingAction } from '@/api/wms/pendingAction'; -import { listPlanSheet } from '@/api/aps/planSheet' -import { listPlanDetail } from '@/api/aps/planDetail' import CoilSelector from '@/components/CoilSelector'; import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect"; import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect"; @@ -409,6 +373,7 @@ import ProductSelector from "@/components/KLPService/ProductSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import TimeInput from "@/components/TimeInput"; import AbnormalForm from './components/AbnormalForm'; +import PlanSheetViewer from './components/PlanSheetViewer.vue'; import { generateCoilNoPrefix } from "@/utils/coil/coilNo"; import ContractSelect from "@/components/KLPService/ContractSelect"; import { addCoilContractRel } from "@/api/wms/coilContractRel"; @@ -423,7 +388,8 @@ export default { WarehouseSelect, TimeInput, AbnormalForm, - ContractSelect + ContractSelect, + PlanSheetViewer, }, dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'], data() { @@ -516,11 +482,6 @@ export default { degree: null, remark: null }, - // 排产单相关 - planSheetList: [], - planSheetDetailMap: {}, - planSheetLoading: false, - activePlanSheetId: null, // 异常继承 inheritDialogVisible: false, inheritLoading: false, @@ -556,12 +517,12 @@ export default { }, planSheetLineName() { const mapping = { - 11: '酸轧线', 200: '酸轧线', 520: '酸轧线', - 501: '镀锌线', 521: '镀锌线', - 203: '脱脂线', 502: '脱脂线', 522: '脱脂线', - 204: '拉矫线', 503: '拉矫线', 523: '拉矫线', - 205: '双机架', 504: '双机架', 524: '双机架', - 505: '镀铬线', 525: '镀铬线', + '11': '酸轧线', '200': '酸轧线', '520': '酸轧线', '201': '酸轧线', + '501': '镀锌线', '521': '镀锌线', '202': '镀锌线', + '203': '脱脂线', '502': '脱脂线', '522': '脱脂线', + '204': '拉矫线', '503': '拉矫线', '523': '拉矫线', + '205': '双机架', '504': '双机架', '524': '双机架', + '505': '镀铬线', '525': '镀铬线', '206': '镀铬线', } return mapping[parseInt(this.actionTypeCode)] || '' }, @@ -569,9 +530,6 @@ export default { const d = new Date() return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}` }, - activePlanSheetDetails() { - return this.planSheetDetailMap[this.activePlanSheetId] || [] - }, selectedInheritCount() { let count = 0 for (const parent of this.parentCoils) { @@ -610,7 +568,6 @@ export default { // 保存当前页面的待操作类型 if (actionTypeCode) { this.actionTypeCode = actionTypeCode; - this.fetchPlanSheets(); } // 设置只读模式 @@ -1007,33 +964,6 @@ export default { this.$router.back(); }, - async fetchPlanSheets() { - if (!this.planSheetLineName) return - this.planSheetLoading = true - try { - const res = await listPlanSheet({ - lineName: this.planSheetLineName, - pageSize: 3, pageNum: 1, - }) - this.planSheetList = res.rows || [] - this.planSheetDetailMap = {} - if (this.planSheetList.length > 0) { - this.activePlanSheetId = this.planSheetList[0].planSheetId - for (const sheet of this.planSheetList) { - this.fetchPlanSheetDetail(sheet.planSheetId) - } - } - } catch (e) { console.error('查询排产单失败', e) } - finally { this.planSheetLoading = false } - }, - async fetchPlanSheetDetail(planSheetId) { - try { - const res = await listPlanDetail({ planSheetId, pageSize: 100, pageNum: 1 }) - const details = (res.rows || []).sort((a, b) => (parseInt(a.bizSeqNo) || 0) - (parseInt(b.bizSeqNo) || 0)) - this.$set(this.planSheetDetailMap, planSheetId, details) - } catch (e) { console.error('查询排产单明细失败', e) } - }, - // 新增异常 addAbnormal() { this.currentAbnormalIndex = -1; diff --git a/klp-ui/src/views/wms/coil/panels/stepSplit.vue b/klp-ui/src/views/wms/coil/panels/stepSplit.vue index 41810252..1fb7ce95 100644 --- a/klp-ui/src/views/wms/coil/panels/stepSplit.vue +++ b/klp-ui/src/views/wms/coil/panels/stepSplit.vue @@ -109,56 +109,12 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
+ +
@@ -505,14 +461,13 @@ import { listCoilAbnormal } from '@/api/wms/coilAbnormal' import { completeAction, getPendingAction, updatePendingAction } from '@/api/wms/pendingAction' import { saveCoilCache, getCoilCacheByCoilId, delCoilCache } from '@/api/wms/coilCache' import { getGalvanize1TypingPrefill } from '@/api/pocket/acidTyping' -import { listPlanSheet } from '@/api/aps/planSheet' -import { listPlanDetail } from '@/api/aps/planDetail' import ProductSelect from '@/components/KLPService/ProductSelect' import RawMaterialSelect from '@/components/KLPService/RawMaterialSelect' import WarehouseSelect from '@/components/KLPService/WarehouseSelect' import ActualWarehouseSelect from '@/components/KLPService/ActualWarehouseSelect' import TimeInput from '@/components/TimeInput' import AbnormalForm from '../components/AbnormalForm' +import PlanSheetViewer from '../components/PlanSheetViewer.vue' import { generateCoilNoPrefix } from '@/utils/coil/coilNo' import ProductInfo from '@/components/KLPService/Renderer/ProductInfo' import RawMaterialInfo from '@/components/KLPService/Renderer/RawMaterialInfo' @@ -530,7 +485,8 @@ export default { AbnormalForm, ProductInfo, RawMaterialInfo, - ContractSelect + ContractSelect, + PlanSheetViewer, }, props: { actionId: { @@ -644,11 +600,6 @@ export default { parsedCacheData: null, // 最早的热轧卷板材质 firstHeatMaterial: '', - // 排产单相关 - planSheetList: [], - planSheetDetailMap: {}, - planSheetLoading: false, - activePlanSheetId: null, // 异常继承 inheritDialogVisible: false, inheritLoading: false, @@ -668,7 +619,7 @@ export default { 200: '酸轧线', 520: '酸轧线', - 206: '镀锌线', + 202: '镀锌线', 501: '镀锌线', 521: '镀锌线', @@ -697,10 +648,13 @@ export default { const day = String(d.getDate()).padStart(2, '0') return `${y}-${m}-${day}` }, - activePlanSheetDetails() { - return this.planSheetDetailMap[this.activePlanSheetId] || [] + todayDateStr() { + const d = new Date() + const y = d.getFullYear() + const m = String(d.getMonth() + 1).padStart(2, '0') + const day = String(d.getDate()).padStart(2, '0') + return `${y}-${m}-${day}` }, - // 是否是镀铬操作 isGrindAction() { return this.actionType == 505 || this.actionType == 525 || this.actionType == 206 }, @@ -746,56 +700,10 @@ export default { // 获取镀锌线二级系统数据 this.getZincList() } - if (this.planSheetLineName) { - this.fetchPlanSheets() - } } } }, methods: { - // 查询最近排产单及明细 - async fetchPlanSheets() { - if (!this.planSheetLineName) return - this.planSheetLoading = true - try { - const res = await listPlanSheet({ - lineName: this.planSheetLineName, - pageSize: 3, - pageNum: 1 - }) - this.planSheetList = res.rows || [] - this.planSheetDetailMap = {} - if (this.planSheetList.length > 0) { - this.activePlanSheetId = this.planSheetList[0].planSheetId - for (const sheet of this.planSheetList) { - this.fetchPlanSheetDetail(sheet.planSheetId) - } - } - } catch (e) { - console.error('查询排产单失败', e) - } finally { - this.planSheetLoading = false - } - }, - async fetchPlanSheetDetail(planSheetId) { - try { - const res = await listPlanDetail({ - planSheetId, - pageSize: 100, - pageNum: 1 - }) - const details = res.rows || [] - details.sort((a, b) => { - const na = parseInt(a.bizSeqNo) || 0 - const nb = parseInt(b.bizSeqNo) || 0 - return na - nb - }) - this.$set(this.planSheetDetailMap, planSheetId, details) - } catch (e) { - console.error('查询排产单明细失败', e) - } - }, - // 查询待分条的钢卷信息 async getCoilInfo() { try { diff --git a/klp-ui/src/views/wms/coil/split.vue b/klp-ui/src/views/wms/coil/split.vue index 8207adef..e36d9eb8 100644 --- a/klp-ui/src/views/wms/coil/split.vue +++ b/klp-ui/src/views/wms/coil/split.vue @@ -14,42 +14,8 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - +
+
@@ -211,13 +177,13 @@
- - @@ -404,14 +370,13 @@ import { getMaterialCoil, splitMaterialCoil, getFirstHeatCoilMaterial } from '@/ import { listCoilAbnormal } from '@/api/wms/coilAbnormal'; import { listWarehouse } from '@/api/wms/warehouse'; import { completeAction, getPendingAction } from '@/api/wms/pendingAction'; -import { listPlanSheet } from '@/api/aps/planSheet' -import { listPlanDetail } from '@/api/aps/planDetail' import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect"; import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect"; import ProductSelect from "@/components/KLPService/ProductSelect"; import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import TimeInput from "@/components/TimeInput"; import AbnormalForm from './components/AbnormalForm'; +import PlanSheetViewer from './components/PlanSheetViewer.vue'; import { generateCoilNoPrefix } from "@/utils/coil/coilNo"; import ContractSelect from "@/components/KLPService/ContractSelect"; import { addCoilContractRel } from "@/api/wms/coilContractRel"; @@ -425,7 +390,8 @@ export default { WarehouseSelect, TimeInput, AbnormalForm, - ContractSelect + ContractSelect, + PlanSheetViewer, }, dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'], data() { @@ -508,12 +474,6 @@ export default { }, // 最早热轧卷板材质 firstHeatMaterial: null, - // 排产单相关 - actionTypeCode: '', - planSheetList: [], - planSheetDetailMap: {}, - planSheetLoading: false, - activePlanSheetId: null, // 异常继承 inheritDialogVisible: false, inheritLoading: false, @@ -530,9 +490,6 @@ export default { const d = new Date() return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}` }, - activePlanSheetDetails() { - return this.planSheetDetailMap[this.activePlanSheetId] || [] - }, selectedInheritCount() { let count = 0 for (const parent of this.parentCoils) { @@ -554,12 +511,6 @@ export default { const coilId = this.$route.query.coilId; const actionId = this.$route.query.actionId; const readonly = this.$route.query.readonly; - const actionTypeCode = this.$route.query.actionTypeCode; - - if (actionTypeCode) { - this.actionTypeCode = actionTypeCode; - } - this.fetchPlanSheets(); // 获取待操作详情 getPendingAction(actionId).then(res => { @@ -1012,33 +963,6 @@ export default { return item ? item.label : code; }, - // 查询最近排产单(酸轧线) - async fetchPlanSheets() { - this.planSheetLoading = true - try { - const res = await listPlanSheet({ - lineName: '酸轧线', - pageSize: 3, pageNum: 1, - }) - this.planSheetList = res.rows || [] - this.planSheetDetailMap = {} - if (this.planSheetList.length > 0) { - this.activePlanSheetId = this.planSheetList[0].planSheetId - for (const sheet of this.planSheetList) { - this.fetchPlanSheetDetail(sheet.planSheetId) - } - } - } catch (e) { console.error('查询排产单失败', e) } - finally { this.planSheetLoading = false } - }, - async fetchPlanSheetDetail(planSheetId) { - try { - const res = await listPlanDetail({ planSheetId, pageSize: 100, pageNum: 1 }) - const details = (res.rows || []).sort((a, b) => (parseInt(a.bizSeqNo) || 0) - (parseInt(b.bizSeqNo) || 0)) - this.$set(this.planSheetDetailMap, planSheetId, details) - } catch (e) { console.error('查询排产单明细失败', e) } - }, - // 异常继承 handleInheritAbnormal(subCoilIndex) { const parentId = this.motherCoil.coilId diff --git a/klp-ui/src/views/wms/coil/typing.vue b/klp-ui/src/views/wms/coil/typing.vue index 875917e7..8c1ae2cc 100644 --- a/klp-ui/src/views/wms/coil/typing.vue +++ b/klp-ui/src/views/wms/coil/typing.vue @@ -10,42 +10,11 @@
- - +
{{ currentLineName }}排产计划
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
+
产线名称映射 @@ -455,6 +423,7 @@ export default { ContractSelect, L2MatchPanel, DrMatchPanel, + PlanSheetViewer, }, dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'], data() { @@ -576,11 +545,7 @@ export default { currentCache: null, parsedCacheData: null, itemSelectorQueryParams: {}, - // 排产计划 - planSheetList: [], - planSheetDetailMap: {}, - activePlanSheetId: null, - currentLineName: '', + // 异常继承 inheritDialogVisible: false, inheritLoading: false, @@ -592,8 +557,8 @@ export default { l2HotCoilId() { return (this.currentInfo && this.currentInfo.enterCoilNo) || '' }, - activePlanSheetDetails() { - return this.planSheetDetailMap[this.activePlanSheetId] || [] + currentLineName() { + return actionTypeToLineName[this.actionType] || '' }, /** 是否双机架工序(actionType 504=正常 / 524=修复) */ isDrAction() { @@ -677,8 +642,6 @@ export default { } } - // 加载排产计划 - await this.loadPlanDetails(); }, methods: { /** 双机架计划/道次快捷写入 */ @@ -802,43 +765,6 @@ export default { } }, - // 根据当前actionType加载对应产线的最近3个排产计划 - async loadPlanDetails() { - const lineName = actionTypeToLineName[this.actionType] - if (!lineName) return - this.currentLineName = lineName - try { - const sheetRes = await listPlanSheet({ - lineName, - pageNum: 1, - pageSize: 3, - }) - this.planSheetList = sheetRes.rows || [] - this.planSheetDetailMap = {} - if (this.planSheetList.length > 0) { - this.activePlanSheetId = this.planSheetList[0].planSheetId - for (const sheet of this.planSheetList) { - this.fetchPlanSheetDetail(sheet.planSheetId) - } - } - } catch (error) { - console.error('加载排产计划失败', error) - } - }, - async fetchPlanSheetDetail(planSheetId) { - try { - const detailRes = await listPlanDetail({ - planSheetId, - pageNum: 1, - pageSize: 50, - }) - if (detailRes.rows) { - const details = detailRes.rows.sort((a, b) => (parseInt(a.bizSeqNo) || 0) - (parseInt(b.bizSeqNo) || 0)) - this.$set(this.planSheetDetailMap, planSheetId, details) - } - } catch (e) { console.error('查询排产单明细失败', e) } - }, - // 复制当前信息到更新表单 copyFromCurrent() { // 复制除了指定字段之外的其他字段