From 6710a82ba6e5950849a4299a84126cd3b188c1b3 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 3 Nov 2026 16:40:35 +0800 Subject: [PATCH] =?UTF-8?q?2026-11-03=20=E6=A3=80=E9=AA=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/qc/qcTemplate.vue | 154 +++++++++++++++++++++++++++- 1 file changed, 151 insertions(+), 3 deletions(-) diff --git a/src/views/modules/qc/qcTemplate.vue b/src/views/modules/qc/qcTemplate.vue index cb7d81e..591af77 100644 --- a/src/views/modules/qc/qcTemplate.vue +++ b/src/views/modules/qc/qcTemplate.vue @@ -178,7 +178,7 @@ - + @@ -195,6 +195,7 @@
+ + + + + + + + + + + + + + + + + + { this.detailList = data.rows + this.layoutDetailTable() }) this.detailModelFlag = true + this.layoutDetailTable() + }, + layoutDetailTable () { + this.$nextTick(() => { + if (this.$refs.detailTable) { + this.$refs.detailTable.doLayout() + } + }) }, + onTplActualFlagChange (row) { + if (row.actualValueCollectFlag !== 'Y') { + row.actualValueFillRule = '' + row.actualValueQty = '' + } else if (!row.actualValueFillRule) { + row.actualValueFillRule = '自定义数量' + } + }, + onTplActualRuleChange (row) { + if (row.actualValueFillRule !== '自定义数量') { + row.actualValueQty = '' + } + }, + onTplImageFlagChange (row) { + if (row.imageCollectFlag !== 'Y') { + row.imageUploadRule = '' + row.imageQty = '' + } else if (!row.imageUploadRule) { + row.imageUploadRule = '自定义数量' + } + }, + onTplImageRuleChange (row) { + if (row.imageUploadRule !== '自定义数量') { + row.imageQty = '' + } + }, + normalizeTemplateCollect (row) { + if (row.actualValueCollectFlag !== 'Y' && row.actualValueCollectFlag !== 'N') { + row.actualValueCollectFlag = null + row.actualValueFillRule = null + row.actualValueQty = null + } else if (row.actualValueCollectFlag !== 'Y') { + row.actualValueFillRule = null + row.actualValueQty = null + } else if (row.actualValueFillRule !== '自定义数量') { + row.actualValueQty = null + } else { + row.actualValueQty = Number(row.actualValueQty) + } + if (row.imageCollectFlag !== 'Y' && row.imageCollectFlag !== 'N') { + row.imageCollectFlag = null + row.imageUploadRule = null + row.imageQty = null + } else if (row.imageCollectFlag !== 'Y') { + row.imageUploadRule = null + row.imageQty = null + } else if (row.imageUploadRule !== '自定义数量') { + row.imageQty = null + } else { + row.imageQty = Number(row.imageQty) + } + }, // 保存模板项目 saveDetail () { + for (let i = 0; i < this.detailList.length; i++) { + const row = this.detailList[i] + const name = row.itemDesc || row.itemNo + if (row.actualValueCollectFlag === 'Y') { + if (!row.actualValueFillRule) { + this.$message.warning('【' + name + '】请选择实测值填写规则!') + return + } + if (row.actualValueFillRule === '自定义数量' && !(Number(row.actualValueQty) > 0)) { + this.$message.warning('【' + name + '】请输入实测值数量!') + return + } + } + if (row.imageCollectFlag === 'Y') { + if (!row.imageUploadRule) { + this.$message.warning('【' + name + '】请选择图片上传规则!') + return + } + if (row.imageUploadRule === '自定义数量' && !(Number(row.imageQty) > 0)) { + this.$message.warning('【' + name + '】请输入图片数量!') + return + } + } + this.normalizeTemplateCollect(row) + } let tempData = { site: this.detailData.site, buNo: this.detailData.buNo, @@ -1498,6 +1628,7 @@ refreshDetailList () { templateDetailsSearch(this.detailData).then(({data}) => { this.detailList = data.rows + this.layoutDetailTable() }) }, @@ -1567,6 +1698,7 @@ if (data && data.code === 0) { templateDetailsSearch(this.detailData).then(({data}) => { this.detailList = data.rows + this.layoutDetailTable() for (let i = 0; i < this.detailList.length; i++) { if (this.detailList[i].itemNo === this.currentRow.itemNo) { this.$refs.detailTable.setCurrentRow(this.detailList[i]); @@ -1584,6 +1716,7 @@ if (data && data.code === 0) { templateDetailsSearch(this.detailData).then(({data}) => { this.detailList = data.rows + this.layoutDetailTable() for (let i = 0; i td.detail-op-col { + background-color: #f5f7fa; +} +.template-detail-table /deep/ .el-table__fixed-right .el-table__body tr.current-row > td.detail-op-col { + background-color: #ecf5ff; +}