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 @@ + + diff --git a/klp-ui/src/views/mes/qc/certificate/components/templates/ColdHardTemplate.vue b/klp-ui/src/views/mes/qc/certificate/components/templates/ColdHardTemplate.vue new file mode 100644 index 00000000..1173b5d6 --- /dev/null +++ b/klp-ui/src/views/mes/qc/certificate/components/templates/ColdHardTemplate.vue @@ -0,0 +1,356 @@ + + + + + diff --git a/klp-ui/src/views/mes/qc/certificate/components/templates/GalvanizingTemplate.vue b/klp-ui/src/views/mes/qc/certificate/components/templates/GalvanizingTemplate.vue new file mode 100644 index 00000000..84ca61b8 --- /dev/null +++ b/klp-ui/src/views/mes/qc/certificate/components/templates/GalvanizingTemplate.vue @@ -0,0 +1,360 @@ + + + + + diff --git a/klp-ui/src/views/mes/qc/certificate/components/templates/RawMaterialTemplate.vue b/klp-ui/src/views/mes/qc/certificate/components/templates/RawMaterialTemplate.vue new file mode 100644 index 00000000..1bcdd7e2 --- /dev/null +++ b/klp-ui/src/views/mes/qc/certificate/components/templates/RawMaterialTemplate.vue @@ -0,0 +1,378 @@ + + + + + diff --git a/klp-ui/src/views/mes/qc/certificate/components/templates/index.js b/klp-ui/src/views/mes/qc/certificate/components/templates/index.js new file mode 100644 index 00000000..bf0c37f9 --- /dev/null +++ b/klp-ui/src/views/mes/qc/certificate/components/templates/index.js @@ -0,0 +1,20 @@ +import ChromiumTemplate from './ChromiumTemplate.vue'; +import GalvanizingTemplate from './GalvanizingTemplate.vue'; +import ColdHardTemplate from './ColdHardTemplate.vue'; +import RawMaterialTemplate from './RawMaterialTemplate.vue'; + +export const templateMap = { + chromium: ChromiumTemplate, + galvanizing: GalvanizingTemplate, + coldHard: ColdHardTemplate, + rawMaterial: RawMaterialTemplate +}; + +export const templateOptions = [ + { value: 'chromium', label: '镀铬质保书模版' }, + { value: 'galvanizing', label: '镀锌质保书模版' }, + { value: 'coldHard', label: '冷硬质保书模版' }, + { value: 'rawMaterial', label: '原料质保书模版' } +]; + +export default templateMap; diff --git a/klp-ui/src/views/mes/qc/certificate/item.vue b/klp-ui/src/views/mes/qc/certificate/item.vue index 02a728b9..369a3093 100644 --- a/klp-ui/src/views/mes/qc/certificate/item.vue +++ b/klp-ui/src/views/mes/qc/certificate/item.vue @@ -106,6 +106,11 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + :items="printItemsData" :template-type="selectedTemplateType" /> + + + +
+ + +
+ + {{ option.label }} +
+
+
+
+ +
@@ -347,6 +445,7 @@ import { listChemicalItem } from "@/api/mes/qc/chemicalItem"; import { listPhysicalItem } from "@/api/mes/qc/physicalItem"; import CoilSelector from "@/components/CoilSelector/index.vue"; import CertificatePrintPreview from "./components/CertificatePrintPreview.vue"; +import { templateOptions } from "./components/templates"; import { print as printPdf } from "./lib/printUtils"; export default { @@ -362,6 +461,7 @@ export default { }, data() { return { + templateOptions, buttonLoading: false, loading: false, certificateLoading: false, @@ -380,6 +480,9 @@ export default { printComponentVisible: false, printCertificateData: {}, printItemsData: [], + templateDialogVisible: false, + selectedTemplateType: 'chromium', + templateDialogResolve: null, certificateForm: { certificateNo: '', contractNo: '', @@ -527,13 +630,15 @@ export default { ]); const chem = chemRes.rows && chemRes.rows[0] || {}; const phys = physRes.rows && physRes.rows[0] || {}; - const { c, si, mn, p, s, als, yieldStrength, tensileStrength, elongation, hardness, bendingTest, surfaceQuality, surfaceStructure, edgeStatus } = { ...chem, ...phys }; - return { c, si, mn, p, s, als, yieldStrength, tensileStrength, elongation, hardness, bendingTest, surfaceQuality, surfaceStructure, edgeStatus }; + const { c, si, mn, p, s, als, al, ti, cr, ni, cu, n, fe, b } = chem; + const { yieldStrength, tensileStrength, elongation, hardness, bendingTest, surfaceQuality, surfaceStructure, edgeStatus, plasticExtensionStrength, coatingSurfaceStructure, coatingMass, coating, surfaceTreatment, zincCoatingWeight } = phys; + return { c, si, mn, p, s, als, al, ti, cr, ni, cu, n, fe, b, yieldStrength, tensileStrength, elongation, hardness, bendingTest, surfaceQuality, surfaceStructure, edgeStatus, plasticExtensionStrength, coatingSurfaceStructure, coatingMass, coating, surfaceTreatment, zincCoatingWeight }; }, async handleCoilSelect(row) { if (this.currentEditRow) { const editRow = this.currentEditRow; editRow.coilNo = row.currentCoilNo; + editRow.materialNo = row.enterCoilNo; editRow.materialType = row.material; editRow.size = row.specification; editRow.weight = row.netWeight; @@ -718,6 +823,9 @@ export default { }); }, async handlePrint() { + const confirmed = await this.showTemplateDialog(); + if (!confirmed) return; + this.printCertificateData = this.currentCertificateInfo; this.printItemsData = this.certificateItemList || []; this.$nextTick(() => { @@ -725,6 +833,19 @@ export default { console.log(el); printPdf(el); }); + }, + showTemplateDialog() { + return new Promise((resolve) => { + this.templateDialogResolve = resolve; + this.templateDialogVisible = true; + }); + }, + confirmTemplate() { + this.templateDialogVisible = false; + if (this.templateDialogResolve) { + this.templateDialogResolve(true); + this.templateDialogResolve = null; + } } } }; @@ -899,4 +1020,46 @@ export default { ::v-deep .el-table .cell { padding: 0; } + +.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/wms/coil/components/CoilInfo.vue b/klp-ui/src/views/wms/coil/components/CoilInfo.vue index f5f6dc7d..b0bf216b 100644 --- a/klp-ui/src/views/wms/coil/components/CoilInfo.vue +++ b/klp-ui/src/views/wms/coil/components/CoilInfo.vue @@ -1,20 +1,16 @@