From 1bd55b12ec36bcd5344cfc0222ef0a0490c265a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Mon, 18 May 2026 17:54:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(qc):=20=E6=96=B0=E5=A2=9E=E7=90=86?= =?UTF-8?q?=E5=8C=96=E6=A3=80=E9=AA=8C=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8F=8A=E4=BC=98=E5=8C=96=E8=B4=A8=E6=A3=80=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增化学成分明细和物理性能明细的API与管理页面 2. 在钢卷详情页添加检验信息展示模块 3. 优化质保书预览的签章显示逻辑,仅审批通过后显示 4. 重构质保书列表为表格形式,新增审批流程功能 5. 优化质保书选择弹窗的钢卷查询条件 6. 新增批量新增质保书明细时自动填充理化数据功能 --- klp-ui/src/api/mes/qc/chemicalItem.js | 53 +++ klp-ui/src/api/mes/qc/physicalItem.js | 53 +++ klp-ui/src/views/mes/qc/certificate/book.vue | 370 ++++++---------- .../views/mes/qc/certificate/chemistry.vue | 350 +++++++++++++++ .../components/CertificatePrintPreview.vue | 4 +- klp-ui/src/views/mes/qc/certificate/item.vue | 137 +++--- .../src/views/mes/qc/certificate/physics.vue | 402 ++++++++++++++++++ klp-ui/src/views/wms/coil/info.vue | 121 +++++- 8 files changed, 1177 insertions(+), 313 deletions(-) create mode 100644 klp-ui/src/api/mes/qc/chemicalItem.js create mode 100644 klp-ui/src/api/mes/qc/physicalItem.js create mode 100644 klp-ui/src/views/mes/qc/certificate/chemistry.vue create mode 100644 klp-ui/src/views/mes/qc/certificate/physics.vue diff --git a/klp-ui/src/api/mes/qc/chemicalItem.js b/klp-ui/src/api/mes/qc/chemicalItem.js new file mode 100644 index 00000000..c3da6134 --- /dev/null +++ b/klp-ui/src/api/mes/qc/chemicalItem.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询质量的化学成分明细列表 +export function listChemicalItem(query) { + return request({ + url: '/qc/chemicalItem/list', + method: 'get', + params: query + }) +} + +// 查询质量的化学成分明细详细 +export function getChemicalItem(itemId) { + return request({ + url: '/qc/chemicalItem/' + itemId, + method: 'get' + }) +} + +// 新增质量的化学成分明细 +export function addChemicalItem(data) { + return request({ + url: '/qc/chemicalItem', + method: 'post', + data: data + }) +} + +// 修改质量的化学成分明细 +export function updateChemicalItem(data) { + return request({ + url: '/qc/chemicalItem', + method: 'put', + data: data + }) +} + +// 删除质量的化学成分明细 +export function delChemicalItem(itemId) { + return request({ + url: '/qc/chemicalItem/' + itemId, + method: 'delete' + }) +} + +// 批量新增质量的化学成分明细 +export function batchAddChemicalItem(data) { + return request({ + url: '/qc/chemicalItem/batchImport', + method: 'post', + data: data + }) +} diff --git a/klp-ui/src/api/mes/qc/physicalItem.js b/klp-ui/src/api/mes/qc/physicalItem.js new file mode 100644 index 00000000..b09c7d9d --- /dev/null +++ b/klp-ui/src/api/mes/qc/physicalItem.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询物理性能明细列表 +export function listPhysicalItem(query) { + return request({ + url: '/qc/physicalItem/list', + method: 'get', + params: query + }) +} + +// 查询物理性能明细详细 +export function getPhysicalItem(physicalId) { + return request({ + url: '/qc/physicalItem/' + physicalId, + method: 'get' + }) +} + +// 新增物理性能明细 +export function addPhysicalItem(data) { + return request({ + url: '/qc/physicalItem', + method: 'post', + data: data + }) +} + +// 修改物理性能明细 +export function updatePhysicalItem(data) { + return request({ + url: '/qc/physicalItem', + method: 'put', + data: data + }) +} + +// 删除物理性能明细 +export function delPhysicalItem(physicalId) { + return request({ + url: '/qc/physicalItem/' + physicalId, + method: 'delete' + }) +} + +// 批量新增物理性能明细 +export function batchAddPhysicalItem(data) { + return request({ + url: '/qc/physicalItem/batchImport', + method: 'post', + data: data + }) +} diff --git a/klp-ui/src/views/mes/qc/certificate/book.vue b/klp-ui/src/views/mes/qc/certificate/book.vue index 636aa692..c99f3877 100644 --- a/klp-ui/src/views/mes/qc/certificate/book.vue +++ b/klp-ui/src/views/mes/qc/certificate/book.vue @@ -49,6 +49,14 @@ @keyup.enter.native="handleQuery" /> + + + + + + + + 搜索 重置 @@ -88,65 +96,58 @@ - - - - - - 质量保证书 - | - MES-QC-{{ item.certificateNo || '' }} - - - - No. - {{ item.certificateNo }} - - - - - 合同号 - {{ item.contractNo || '-' }} + + + + + {{ scope.row.certificateNo || '-' }} + + + + + + + + + + {{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }} + + + + + + {{ getStatusText(scope.row.approveStatus) }} + + + + + + + 审批人: {{ scope.row.approveBy || '-' }} + 审批时间: {{ parseTime(scope.row.approveTime, '{y}-{m}-{d} {h}:{i}:{s}') }} - - 产品名称 - {{ item.productName || '-' }} - - - 执行标准 - {{ item.standard || '-' }} - - - 收货单位 - {{ item.consignee || '-' }} - - - 生产厂家 - {{ item.manufacturer || '-' }} - - - 签发日期 - {{ parseTime(item.issueDate, '{y}-{m}-{d}') }} - - - - - - + - + + + + + + 修改 + 删除 + 预览 + 打印 + 提交审批 + 通过 + 驳回 + + + -1) { - this.selectedIds.splice(index, 1); - } else { - this.selectedIds.push(item.certificateId); - } - this.updateSelectionStatus(); - }, - handleCheckboxChange(certificateId, event) { - if (event.target.checked) { - if (!this.selectedIds.includes(certificateId)) { - this.selectedIds.push(certificateId); - } - } else { - const index = this.selectedIds.indexOf(certificateId); - if (index > -1) { - this.selectedIds.splice(index, 1); - } - } - this.updateSelectionStatus(); - }, - updateSelectionStatus() { + handleSelectionChange(val) { + this.selectedIds = val.map(item => item.certificateId); this.ids = [...this.selectedIds]; this.single = this.selectedIds.length !== 1; this.multiple = this.selectedIds.length === 0; @@ -380,7 +383,8 @@ export default { this.buttonLoading = false; }); } else { - addCertificate(this.form).then(response => { + const newForm = { ...this.form, approveStatus: 'PENDING' }; + addCertificate(newForm).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); @@ -391,6 +395,43 @@ export default { } }); }, + /** 提交审批 */ + handleSubmit(row) { + this.$modal.confirm('确认提交审批?').then(() => { + this.loading = true; + const params = { + certificateId: row.certificateId, + approveStatus: 'APPROVING' + }; + updateCertificate(params).then(response => { + this.$modal.msgSuccess("提交成功"); + this.getList(); + }).catch(() => { + }).finally(() => { + this.loading = false; + }); + }); + }, + /** 审批操作 */ + handleApprove(row, status) { + const statusText = status === 'PASSED' ? '通过' : '驳回'; + this.$modal.confirm(`确认${statusText}该审批?`).then(() => { + this.loading = true; + const params = { + certificateId: row.certificateId, + approveStatus: status, + approveBy: this.$store.getters.name, + approveTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}') + }; + updateCertificate(params).then(response => { + this.$modal.msgSuccess(`${statusText}成功`); + this.getList(); + }).catch(() => { + }).finally(() => { + this.loading = false; + }); + }); + }, /** 删除按钮操作 */ handleDelete(row) { const certificateIds = row.certificateId || this.ids; @@ -482,176 +523,19 @@ export default { diff --git a/klp-ui/src/views/mes/qc/certificate/chemistry.vue b/klp-ui/src/views/mes/qc/certificate/chemistry.vue new file mode 100644 index 00000000..1756e396 --- /dev/null +++ b/klp-ui/src/views/mes/qc/certificate/chemistry.vue @@ -0,0 +1,350 @@ + + + + + + + + + + + 搜索 + 重置 + + + + + + 新增 + + + + 批量新增 + + + + 修改 + + + 删除 + + + 导出 + + + + + + + + + + + + + + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 8cc320f7..a7db6687 100644 --- a/klp-ui/src/views/mes/qc/certificate/components/CertificatePrintPreview.vue +++ b/klp-ui/src/views/mes/qc/certificate/components/CertificatePrintPreview.vue @@ -111,10 +111,10 @@ {{ certificate.remark || '/' }} - + 质量负责人: - + diff --git a/klp-ui/src/views/mes/qc/certificate/item.vue b/klp-ui/src/views/mes/qc/certificate/item.vue index d11d173c..711b9049 100644 --- a/klp-ui/src/views/mes/qc/certificate/item.vue +++ b/klp-ui/src/views/mes/qc/certificate/item.vue @@ -24,7 +24,8 @@ 请点击齿轮图标选择质保书 - + @@ -62,7 +63,8 @@ - + @@ -216,9 +218,14 @@ + - - + + + + @@ -236,18 +243,20 @@ - + + - - + @@ -278,9 +287,9 @@ {{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }} - + - @@ -305,7 +314,8 @@ - + @@ -320,20 +330,12 @@ - + - + @@ -341,6 +343,8 @@ import { listCertificateItem, getCertificateItem, delCertificateItem, addCertificateItem, updateCertificateItem } from "@/api/mes/qc/certificateItem"; import { listCertificate, getCertificate, updateCertificate, addCertificate } from "@/api/mes/qc/certificate"; import { listMaterialCoil } from "@/api/wms/coil"; +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 { print as printPdf } from "./lib/printUtils"; @@ -515,13 +519,27 @@ export default { }; this.getCoilList(); }, - handleCoilSelect(row) { + async fetchLatestChemAndPhys(coilId) { + if (!coilId) return {}; + const [chemRes, physRes] = await Promise.all([ + listChemicalItem({ coilId, pageNum: 1, pageSize: 1 }), + listPhysicalItem({ coilId, pageNum: 1, pageSize: 1 }) + ]); + 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 }; + }, + async handleCoilSelect(row) { if (this.currentEditRow) { - this.currentEditRow.coilNo = row.currentCoilNo; - this.currentEditRow.materialType = row.material; - this.currentEditRow.size = row.specification; - this.currentEditRow.weight = row.netWeight; - this.currentEditRow.pieces = 1; + const editRow = this.currentEditRow; + editRow.coilNo = row.currentCoilNo; + editRow.materialType = row.material; + editRow.size = row.specification; + editRow.weight = row.netWeight; + editRow.pieces = 1; + const data = await this.fetchLatestChemAndPhys(row.coilId); + Object.assign(editRow, data); } this.coilDialogVisible = false; this.currentEditRow = null; @@ -556,7 +574,7 @@ export default { openBatchAddDialog() { this.batchAddDialogVisible = true; }, - handleBatchAddConfirm(coils) { + async handleBatchAddConfirm(coils) { if (!coils || coils.length === 0) { this.$message.warning('请选择钢卷'); return; @@ -566,41 +584,36 @@ export default { let successCount = 0; let failCount = 0; - coils.forEach((coil, index) => { - const newRow = { - certificateId: this.currentCertificateId, - itemSeqNo: this.certificateItemList.length + index + 1, - coilNo: coil.currentCoilNo, - materialType: coil.material, - size: coil.specification, - weight: coil.netWeight, - pieces: 1 - }; - - addCertificateItem(newRow).then(() => { + for (let index = 0; index < coils.length; index++) { + const coil = coils[index]; + try { + const data = await this.fetchLatestChemAndPhys(coil.coilId); + const newRow = { + certificateId: this.currentCertificateId, + itemSeqNo: this.certificateItemList.length + index + 1, + coilNo: coil.currentCoilNo, + materialType: coil.material, + size: coil.specification, + weight: coil.netWeight, + pieces: 1, + ...data + }; + await addCertificateItem(newRow); successCount++; - if (successCount + failCount === totalCount) { - this.batchAddDialogVisible = false; - if (successCount === totalCount) { - this.$message.success(`批量新增成功,共新增 ${successCount} 条明细`); - } else { - this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`); - } - this.getList(); - } - }).catch(() => { + } catch { failCount++; - if (successCount + failCount === totalCount) { - this.batchAddDialogVisible = false; - if (failCount === totalCount) { - this.$message.error('批量新增失败'); - } else { - this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`); - } - this.getList(); - } - }); - }); + } + } + + this.batchAddDialogVisible = false; + if (failCount === 0) { + this.$message.success(`批量新增成功,共新增 ${successCount} 条明细`); + } else if (successCount === 0) { + this.$message.error('批量新增失败'); + } else { + this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`); + } + this.getList(); }, handleAddCertificate() { this.certificateForm = { diff --git a/klp-ui/src/views/mes/qc/certificate/physics.vue b/klp-ui/src/views/mes/qc/certificate/physics.vue new file mode 100644 index 00000000..a7584956 --- /dev/null +++ b/klp-ui/src/views/mes/qc/certificate/physics.vue @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + 新增 + + + + 批量新增 + + + + 修改 + + + 删除 + + + 导出 + + + + + + + + + + + + + + + + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/klp-ui/src/views/wms/coil/info.vue b/klp-ui/src/views/wms/coil/info.vue index 4cfd12fb..e076cc57 100644 --- a/klp-ui/src/views/wms/coil/info.vue +++ b/klp-ui/src/views/wms/coil/info.vue @@ -711,7 +711,7 @@ 💰 - 销售信息 + 生产合同信息 @@ -734,7 +734,7 @@ - 未找到相关销售记录 + 未找到相关生产合同信息 @@ -742,7 +742,7 @@ 💰 - 发货单对应的合同信息 + 发货合同信息 @@ -765,7 +765,7 @@ - 未找到相关发货单对应的合同信息记录 + 未找到相关发货合同信息 @@ -807,7 +807,6 @@ - 📋 @@ -878,6 +877,79 @@ + + + + 🔬 + 检验信息 + + + + + + + + + + + + + + + + + + + + {{ parseTime(scope.row.inspectTime, '{y}-{m}-{d}') }} + + + + + + 暂无检验明细 + + + + + + + + + + + 待检验 + 已检验 + 已审核 + {{ scope.row.status }} + + + + + + + + + + + + + - + + + + + + + 未找到相关检验信息 + + + + @@ -969,6 +1041,9 @@ import { getTimingSegByEncoilId, getTimingPlanDetailByHotcoilId, getTimingRealti import AbnormalTable from '@/views/wms/coil/components/AbnormalTable.vue'; import FileList from "@/components/FileList"; import CoilTraceResult from '@/views/wms/coil/panels/CoilTraceResult.vue'; +import { listInspectionTask } from "@/api/mes/qc/inspectionTask"; +import { listInspectionItem } from "@/api/mes/qc/inspectionItem"; +import CurrentCoilNo from "@/components/KLPService/Renderer/CurrentCoilNo.vue"; const TREND_GROUPS = [ { @@ -1087,7 +1162,8 @@ export default { components: { AbnormalTable, FileList, - CoilTraceResult + CoilTraceResult, + CurrentCoilNo }, data() { return { @@ -1131,6 +1207,11 @@ export default { deliveryOrderInfo: {}, // 销售异议信息 salesObjectionInfo: [], + // 检验信息 + inspectionTaskList: [], + inspectionLoading: false, + inspectionItemMap: {}, + inspectionItemLoadingMap: {}, } }, computed: { @@ -1159,6 +1240,7 @@ export default { await this.fetchDeliveryOrderInfo(); this.mergeTransferList(); await this.getSalesObjectionList(); + await this.getInspectionTasks(); // 如果是冷硬卷,加载生产数据 if (this.isColdHardCoil) { @@ -1258,6 +1340,33 @@ export default { }); this.tranferList = list; }, + async getInspectionTasks() { + this.inspectionLoading = true; + try { + const res = await listInspectionTask({ coilIds: this.coilId, pageNum: 1, pageSize: 100 }); + this.inspectionTaskList = res.rows || []; + } catch (e) { + console.error('获取检验任务异常:', e); + this.inspectionTaskList = []; + } finally { + this.inspectionLoading = false; + } + }, + async handleInspectionExpand(row, expandedRows) { + if (!expandedRows || !expandedRows.includes(row)) return; + const taskId = row.taskId; + if (this.inspectionItemMap[taskId]) return; + this.$set(this.inspectionItemLoadingMap, taskId, true); + try { + const res = await listInspectionItem({ taskId, pageNum: 1, pageSize: 100 }); + this.$set(this.inspectionItemMap, taskId, res.rows || []); + } catch (e) { + console.error('获取检验明细异常:', e); + this.$set(this.inspectionItemMap, taskId, []); + } finally { + this.$set(this.inspectionItemLoadingMap, taskId, false); + } + }, formatTime(timeStamp) { if (!timeStamp) return '-'; const date = new Date(timeStamp);
{{ certificate.remark || '/' }}