From d6620e24491cd081c22f48352a3e55f717ede413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Tue, 2 Jun 2026 13:22:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=B4=A8=E4=BF=9D?= =?UTF-8?q?=E4=B9=A6=E6=A8=A1=E6=9D=BF=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=A0=87=E7=AD=BE=E6=A0=B7=E5=BC=8F=E4=B8=8E=E9=92=A2?= =?UTF-8?q?=E5=8D=B7=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klp-ui/src/components/CoilSelector/data.js | 6 +- klp-ui/src/views/mes/qc/certificate/book.vue | 93 ++++- .../components/CertificatePrintPreview.vue | 342 +--------------- .../components/templates/ChromiumTemplate.vue | 347 ++++++++++++++++ .../components/templates/ColdHardTemplate.vue | 356 +++++++++++++++++ .../templates/GalvanizingTemplate.vue | 360 +++++++++++++++++ .../templates/RawMaterialTemplate.vue | 378 ++++++++++++++++++ .../certificate/components/templates/index.js | 20 + klp-ui/src/views/mes/qc/certificate/item.vue | 169 +++++++- .../views/wms/coil/components/CoilInfo.vue | 67 +++- .../wms/coil/panels/LabelRender/DuGeTag.vue | 7 +- .../panels/LabelRender/ForgeTagPreview.vue | 3 +- .../coil/panels/LabelRender/GalvanizedTag.vue | 7 +- .../coil/panels/LabelRender/MaterialTag.vue | 18 +- .../panels/LabelRender/OuterTagPreview.vue | 7 +- .../LabelRender/SaltSprayTagPreview.vue | 3 +- .../panels/LabelRender/SampleTagPreview.vue | 3 +- .../wms/coil/panels/LabelRender/SplitTag.vue | 8 +- .../wms/coil/panels/LabelRender/TuoZhiTag.vue | 16 +- .../wms/coil/panels/LabelRender/WhereTag.vue | 5 +- .../coil/panels/LabelRender/ZincRawTag.vue | 16 +- .../coil/panels/LabelRender/label-common.css | 3 + .../wms/report/components/setting/columns.vue | 6 +- 23 files changed, 1851 insertions(+), 389 deletions(-) create mode 100644 klp-ui/src/views/mes/qc/certificate/components/templates/ChromiumTemplate.vue create mode 100644 klp-ui/src/views/mes/qc/certificate/components/templates/ColdHardTemplate.vue create mode 100644 klp-ui/src/views/mes/qc/certificate/components/templates/GalvanizingTemplate.vue create mode 100644 klp-ui/src/views/mes/qc/certificate/components/templates/RawMaterialTemplate.vue create mode 100644 klp-ui/src/views/mes/qc/certificate/components/templates/index.js create mode 100644 klp-ui/src/views/wms/coil/panels/LabelRender/label-common.css diff --git a/klp-ui/src/components/CoilSelector/data.js b/klp-ui/src/components/CoilSelector/data.js index 8b267787..bb63d575 100644 --- a/klp-ui/src/components/CoilSelector/data.js +++ b/klp-ui/src/components/CoilSelector/data.js @@ -200,7 +200,11 @@ export const optionalColumns = [ { label: '厂家', value: 'manufacturer' }, { label: '表面处理', value: 'surfaceTreatmentDesc' }, { label: '镀层质量', value: 'zincLayer' }, - { label: '长度', value: 'length' }, + { label: '实测长度', value: 'actualLength' }, + { label: '理论长度', value: 'theoreticalLength' }, + { label: '实测厚度', value: 'actualThickness' }, + { label: '理论厚度', value: 'theoreticalThickness' }, + { label: '实测宽度', value: 'actualWidth' }, { label: '毛重', value: 'grossWeight' }, { label: '净重', value: 'netWeight' }, { label: '创建时间', value: 'createTime' }, diff --git a/klp-ui/src/views/mes/qc/certificate/book.vue b/klp-ui/src/views/mes/qc/certificate/book.vue index c99f3877..c84e3938 100644 --- a/klp-ui/src/views/mes/qc/certificate/book.vue +++ b/klp-ui/src/views/mes/qc/certificate/book.vue @@ -207,7 +207,8 @@ :visible="true" :preview="true" :certificate="previewData" - :items="previewItems" + :items="previewItems" + :template-type="selectedTemplateType" />
@@ -231,6 +251,7 @@ import { listCertificate, getCertificate, delCertificate, addCertificate, updateCertificate } from "@/api/mes/qc/certificate"; import { listCertificateItem } from "@/api/mes/qc/certificateItem"; import CertificatePrintPreview from "./components/CertificatePrintPreview.vue"; +import { templateOptions } from "./components/templates"; import { print as printPdf, downloadPdf } from "./lib/printUtils"; export default { @@ -240,6 +261,7 @@ export default { }, data() { return { + templateOptions, buttonLoading: false, loading: true, ids: [], @@ -258,6 +280,10 @@ export default { printComponentVisible: false, printCertificateData: {}, printItemsData: [], + templateDialogVisible: false, + selectedTemplateType: 'chromium', + templateActionType: 'print', + templateDialogResolve: null, queryParams: { pageNum: 1, pageSize: 10, @@ -449,6 +475,10 @@ export default { }, /** 预览按钮操作 */ async handlePreview(row) { + this.templateActionType = 'preview'; + const confirmed = await this.showTemplateDialog(); + if (!confirmed) return; + const certificateId = row.certificateId; this.loading = true; try { @@ -468,6 +498,10 @@ export default { }, /** 打印按钮操作 */ async handlePrint(row) { + this.templateActionType = 'print'; + const confirmed = await this.showTemplateDialog(); + if (!confirmed) return; + const certificateId = row.certificateId; await this.preparePrintComponent(certificateId); await this.$nextTick(); @@ -517,6 +551,19 @@ export default { } finally { this.loading = false; } + }, + showTemplateDialog() { + return new Promise((resolve) => { + this.templateDialogResolve = resolve; + this.templateDialogVisible = true; + }); + }, + confirmTemplate() { + this.templateDialogVisible = false; + if (this.templateDialogResolve) { + this.templateDialogResolve(true); + this.templateDialogResolve = null; + } } } }; @@ -538,4 +585,46 @@ export default { color: #1f79b9; font-weight: 500; } + +.template-selection { + padding: 20px; +} + +.template-radio-group { + display: flex; + flex-direction: column; + gap: 15px; +} + +.template-radio { + display: flex; + align-items: center; + margin: 0; + padding: 15px; + border: 1px solid #e4e7ed; + border-radius: 8px; + transition: all 0.3s ease; +} + +.template-radio:hover { + border-color: #409eff; + background-color: #ecf5ff; +} + +.template-radio.is-checked { + border-color: #409eff; + background-color: #ecf5ff; +} + +.template-option { + display: flex; + align-items: center; + gap: 10px; + font-size: 14px; +} + +.template-option i { + font-size: 20px; + color: #409eff; +} diff --git a/klp-ui/src/views/mes/qc/certificate/components/CertificatePrintPreview.vue b/klp-ui/src/views/mes/qc/certificate/components/CertificatePrintPreview.vue index a7db6687..9404b26c 100644 --- a/klp-ui/src/views/mes/qc/certificate/components/CertificatePrintPreview.vue +++ b/klp-ui/src/views/mes/qc/certificate/components/CertificatePrintPreview.vue @@ -1,131 +1,18 @@
- | 执行标准(SPECIFICATION): | -{{ certificate.standard || '/' }} | -证明书号(CERTIFICATE NO.): | -{{ certificate.certificateNo || '' }} | -
| 收货单位(CONSIGNEE): | -{{ certificate.consignee || '-' }} | -合同号(CONTRACT NO.): | -{{ certificate.contractNo || '' }} | -
| 产品名称(PRODUCT): | -{{ certificate.productName || '' }} | -签发日期(DATE OF ISSUE): | -{{ formatDate(certificate.issueDate) || '' }} | -
| 序号 | -钢卷号 Coil No. |
- 炉号 Heat No. |
- 材质 Type |
- 规格 Size (mm) |
- 件数 Pieces |
- 重量 Weight(t) |
- 化学成分(%) Chemical Composition |
- 拉伸试验 Tensile Test (G.L=80mm) |
- 硬度试验 Hardness Test |
- 弯曲试验 180° B.T D=0a |
- 表面质量 | -表面结构 | -边缘状态 | -|||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C | -Si | -Mn | -P | -S | -Als | -屈服 RP0.2 Y.S(MPa) |
- 抗拉 T.S (MPa) |
- 伸长率 EL (%) |
- ||||||||||||
| {{ index + 1 }} | -{{ item.coilNo || '' }} | -{{ item.heatNo || '' }} | -{{ item.materialType || '' }} | -{{ item.size || '' }} | -{{ item.pieces || '' }} | -{{ item.weight || '' }} | -{{ item.c || '/' }} | -{{ item.si || '/' }} | -{{ item.mn || '/' }} | -{{ item.p || '/' }} | -{{ item.s || '/' }} | -{{ item.als || '/' }} | -{{ item.yieldStrength || '/' }} | -{{ item.tensileStrength || '/' }} | -{{ item.elongation || '/' }} | -{{ item.hardness || '/' }} | -{{ item.bendingTest || '/' }} | -{{ item.surfaceQuality || '/' }} | -{{ item.surfaceStructure || '/' }} | -{{ item.edgeStatus || '/' }} | -
| 暂无数据 | -||||||||||||||||||||
| 注释 NOTE |
-
- {{ certificate.note || '/' }}
- |
-
| 备注 REMARK |
-
- {{ certificate.remark || '/' }}
-
-
-
-
-
- 质量负责人:
-
- |
-
+ | 执行标准(SPECIFICATION): | +{{ certificate.standard || '/' }} | +证明书号(CERTIFICATE NO.): | +{{ certificate.certificateNo || '' }} | +
| 收货单位(CONSIGNEE): | +{{ certificate.consignee || '-' }} | +合同号(CONTRACT NO.): | +{{ certificate.contractNo || '' }} | +
| 产品名称(PRODUCT): | +{{ certificate.productName || '' }} | +签发日期(DATE OF ISSUE): | +{{ formatDate(certificate.issueDate) || '' }} | +
| 序号 | +钢卷号 Coil No. |
+ 炉号 Heat No. |
+ 材质 Type |
+ 规格 Size (mm) |
+ 件数 Pieces |
+ 重量 Weight(t) |
+ 化学成分(%) Chemical Composition |
+ 拉伸试验 Tensile Test (G.L=80mm) |
+ 硬度试验 Hardness Test |
+ 弯曲试验 180° B.T D=0a |
+ 表面质量 | +表面结构 | +边缘状态 | +|||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C | +Si | +Mn | +P | +S | +Als | +屈服 RP0.2 Y.S(MPa) |
+ 抗拉 T.S (MPa) |
+ 伸长率 EL (%) |
+ ||||||||||||
| {{ index + 1 }} | +{{ item.coilNo || '' }} | +{{ item.heatNo || '' }} | +{{ item.materialType || '' }} | +{{ item.size || '' }} | +{{ item.pieces || '' }} | +{{ item.weight || '' }} | +{{ item.c || '/' }} | +{{ item.si || '/' }} | +{{ item.mn || '/' }} | +{{ item.p || '/' }} | +{{ item.s || '/' }} | +{{ item.als || '/' }} | +{{ item.yieldStrength || '/' }} | +{{ item.tensileStrength || '/' }} | +{{ item.elongation || '/' }} | +{{ item.hardness || '/' }} | +{{ item.bendingTest || '/' }} | +{{ item.surfaceQuality || '/' }} | +{{ item.surfaceStructure || '/' }} | +{{ item.edgeStatus || '/' }} | +
| 暂无数据 | +||||||||||||||||||||
| 注释 NOTE |
+
+ {{ certificate.note || '/' }}
+ |
+
| 备注 REMARK |
+
+ {{ certificate.remark || '/' }}
+
+
+
+
+
+ 质量负责人:
+
+ |
+
+ | 执行标准(SPECIFICATION): | +{{ certificate.standard || '/' }} | +证明书号(CERTIFICATE NO.): | +{{ certificate.certificateNo || '' }} | +
| 收货单位(CONSIGNEE): | +{{ certificate.consignee || '-' }} | +合同号(CONTRACT NO.): | +{{ certificate.contractNo || '' }} | +
| 产品名称(PRODUCT): | +{{ certificate.productName || '' }} | +签发日期(DATE OF ISSUE): | +{{ formatDate(certificate.issueDate) || '' }} | +
| 序号 | +钢卷号 Coil No. |
+ 原料号 Material No. |
+ 材质 Type |
+ 规格 Size (mm) |
+ 件数 Pieces |
+ 重量 Weight(t) |
+ 化学成分(%) Chemical Composition |
+ 拉伸试验 Tensile Test (G.L=80mm) |
+ 镀层弯曲 B.T D=0a |
+ 表面质量 | +表面结构 | +镀层 表面结构 |
+ 表面处理 | +镀层重量COATINGMASS 锌层重量双面三点平均值 (g/m²) |
+ |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C | +Si | +Mn | +P | +S | +Als | +屈服 Y.S |
+ 抗拉 T.S |
+ 伸长率 EL |
+ |||||||||||||
| {{ index + 1 }} | +{{ item.coilNo || '' }} | +{{ item.rawCoilNo || '' }} | +{{ item.materialType || '' }} | +{{ item.size || '' }} | +{{ item.pieces || '' }} | +{{ item.weight || '' }} | +{{ item.c || '/' }} | +{{ item.si || '/' }} | +{{ item.mn || '/' }} | +{{ item.p || '/' }} | +{{ item.s || '/' }} | +{{ item.als || '/' }} | +{{ item.yieldStrength || '/' }} | +{{ item.tensileStrength || '/' }} | +{{ item.elongation || '/' }} | +{{ item.bendingTest || '/' }} | +{{ item.surfaceQuality || '/' }} | +{{ item.surfaceStructure || '/' }} | +{{ item.coatingSurfaceStructure || '/' }} | +{{ item.surfaceTreatment || '/' }} | +
+ {{ item.coatingMass || '/' }}
+ |
+
| 暂无数据 | +|||||||||||||||||||||
| 注释 NOTE |
+
+ {{ certificate.note || '/' }}
+ |
+
| 备注 REMARK |
+
+ {{ certificate.remark || '/' }}
+
+
+
+
+
+ 质量负责人:
+
+ |
+
+ | 执行标准(SPECIFICATION): | +{{ certificate.standard || '/' }} | +证明书号(CERTIFICATE NO.): | +{{ certificate.certificateNo || '' }} | +
| 收货单位(CONSIGNEE): | +{{ certificate.consignee || '-' }} | +合同号(CONTRACT NO.): | +{{ certificate.contractNo || '' }} | +
| 产品名称(PRODUCT): | +{{ certificate.productName || '' }} | +签发日期(DATE OF ISSUE): | +{{ formatDate(certificate.issueDate) || '' }} | +
| 序号 | +钢卷号 Coil No. |
+ 炉号 Heat No. |
+ 材质 Type |
+ 规格 Size (mm) |
+ 件数 Pieces |
+ 重量 Weight(t) |
+ 化学成分(%) Chemical Composition |
+ 拉伸试验 Tensile Test (G.L=80mm) |
+ 硬度试验 Hardness Test |
+ 弯曲试验 180° B.T D=0a |
+ 表面质量 | +表面结构 | +边缘状态 | +规定塑性延伸强度 (MPa) |
+ 镀层表面结构 | +镀层重量 (g/m²) |
+ |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C | +Si | +Mn | +P | +S | +Als | +Al | +Ti | +Cr | +Ni | +Cu | +N | +Fe | +B | +屈服 RP0.2 Y.S(MPa) |
+ 抗拉 T.S (MPa) |
+ 伸长率 EL (%) |
+ |||||||||||||||
| {{ index + 1 }} | +{{ item.coilNo || '' }} | +{{ item.heatNo || '' }} | +{{ item.materialType || '' }} | +{{ item.size || '' }} | +{{ item.pieces || '' }} | +{{ item.weight || '' }} | +{{ item.c || '/' }} | +{{ item.si || '/' }} | +{{ item.mn || '/' }} | +{{ item.p || '/' }} | +{{ item.s || '/' }} | +{{ item.als || '/' }} | +{{ item.al || '/' }} | +{{ item.ti || '/' }} | +{{ item.cr || '/' }} | +{{ item.ni || '/' }} | +{{ item.cu || '/' }} | +{{ item.n || '/' }} | +{{ item.fe || '/' }} | +{{ item.b || '/' }} | +{{ item.yieldStrength || '/' }} | +{{ item.tensileStrength || '/' }} | +{{ item.elongation || '/' }} | +{{ item.hardness || '/' }} | +{{ item.bendingTest || '/' }} | +{{ item.surfaceQuality || '/' }} | +{{ item.surfaceStructure || '/' }} | +{{ item.edgeStatus || '/' }} | +{{ item.plasticExtensionStrength || '/' }} | +{{ item.coatingSurfaceStructure || '/' }} | +{{ item.coatingMass || '/' }} | +
| 暂无数据 | +|||||||||||||||||||||||||||||||
| 注释 NOTE |
+
+ {{ certificate.note || '/' }}
+ |
+
| 备注 REMARK |
+
+ {{ certificate.remark || '/' }}
+
+
+
+
+
+ 质量负责人:
+
+ |
+