From 3d0c4b76ed927c203ea9d9865195d7cc61e0a32d Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 15 Jun 2026 11:08:24 +0800 Subject: [PATCH] =?UTF-8?q?2026-06-15=20Lab=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/lab/labRecord.vue | 124 +++++++++++++++++++++++++--- 1 file changed, 112 insertions(+), 12 deletions(-) diff --git a/src/views/modules/lab/labRecord.vue b/src/views/modules/lab/labRecord.vue index 21297d0..c9e22c9 100644 --- a/src/views/modules/lab/labRecord.vue +++ b/src/views/modules/lab/labRecord.vue @@ -294,23 +294,43 @@
- + - + - - + + - + - - + + + +
+ + 点击“测试报告”上传附件 +
+
+
+ + @@ -320,7 +340,7 @@
- + @@ -330,12 +350,12 @@
- - + + - - + + + + + + + @@ -607,7 +652,9 @@ export default { modalFlag: false, judgeCriteriaDialogVisible: false, testSpecDialogVisible: false, + testReportDialogVisible: false, judgeCriteriaFileList: [], + testReportFileList: [], judgeCriteriaFileColumnList: [ { columnProp: 'fileName', @@ -806,6 +853,7 @@ export default { return } this.testSpecDialogVisible = false + this.testReportDialogVisible = false this.modalData.customerId = '' this.modalData.customerName = '' this.modalData.projectId = '' @@ -813,6 +861,7 @@ export default { this.modalData.projectIdFlag = true this.$set(this.modalData, 'propertyItemList', []) this.judgeCriteriaFileList = [] + this.testReportFileList = [] this.searchProjectData.site = site }, loadNodeAuthority (site, stepId) { @@ -920,6 +969,12 @@ export default { ref.handleQuery() } }, + refreshTestReportOssTable () { + const ref = this.$refs.testReportOss + if (ref && typeof ref.handleQuery === 'function') { + ref.handleQuery() + } + }, refreshJudgeCriteriaFileList () { if (!this.modalData.site || !this.modalData.referenceNo) { this.judgeCriteriaFileList = [] @@ -940,6 +995,26 @@ export default { this.judgeCriteriaFileList = [] }) }, + refreshTestReportFileList () { + if (!this.modalData.site || !this.modalData.referenceNo) { + this.testReportFileList = [] + return Promise.resolve() + } + const params = { + orderRef1: this.modalData.site, + orderRef2: this.modalData.referenceNo, + orderRef3: 'testReport' + } + return queryOss(params).then(({data}) => { + if (data && data.code === 0 && Array.isArray(data.rows)) { + this.testReportFileList = data.rows + } else { + this.testReportFileList = [] + } + }).catch(() => { + this.testReportFileList = [] + }) + }, openJudgeCriteriaDialog () { if (!this.modalData.site) { this.$message.warning('请先选择申请工厂') @@ -969,12 +1044,30 @@ export default { this.refreshTestSpecOssTable() }) }, + openTestReportDialog () { + if (!this.modalData.site) { + this.$message.warning('请先选择申请工厂') + return + } + if (!this.modalData.referenceNo) { + this.$message.warning('单据编号为空,无法上传附件') + return + } + this.testReportDialogVisible = true + this.refreshTestReportFileList() + this.$nextTick(() => { + this.refreshTestReportOssTable() + }) + }, handleJudgeCriteriaDialogClose () { this.refreshJudgeCriteriaFileList() }, handleTestSpecDialogClose () { // placeholder to align with dialog close event and keep lifecycle symmetric }, + handleTestReportDialogClose () { + this.refreshTestReportFileList() + }, previewJudgeCriteriaFile (row) { if (!this.authFilePreview) { this.$message.warning('没有附件预览权限') @@ -1008,6 +1101,9 @@ export default { this.$message.error('文件预览失败') }) }, + previewTestReportFile (row) { + this.previewJudgeCriteriaFile(row) + }, resolvePropertyDefaultValue (item) { if (item && item.defaultValue !== null && item.defaultValue !== undefined && String(item.defaultValue).trim() !== '') { return String(item.defaultValue).trim() @@ -1474,10 +1570,12 @@ export default { this.loadModalButtonCondition() this.loadNodeAuthority(this.modalData.site || row.site, this.modalData.stepId !== null && this.modalData.stepId !== undefined ? this.modalData.stepId : 10) this.refreshJudgeCriteriaFileList() + this.refreshTestReportFileList() } }).catch(() => { this.loadNodeAuthority(row.site, row.stepId !== null && row.stepId !== undefined ? row.stepId : 10) this.judgeCriteriaFileList = [] + this.testReportFileList = [] }) } else { this.modalTitle = 'Lab 新增' @@ -1502,6 +1600,7 @@ export default { this.$set(this.modalData, 'propertyItemList', []) this.$set(this.modalData, 'testerList', []) this.judgeCriteriaFileList = [] + this.testReportFileList = [] this.searchProjectData.site = defaultSite this.nodeAuthorityLoaded = true this.loadNodeAuthority(this.modalData.site, 10) @@ -1532,6 +1631,7 @@ export default { handleModalClose () { this.judgeCriteriaDialogVisible = false this.testSpecDialogVisible = false + this.testReportDialogVisible = false this.modalFlag = false }, buildLabPayload (source) {