Răsfoiți Sursa

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

ZhuJiaHao 5 luni în urmă
părinte
comite
7359e41364

+ 1 - 3
src/views/business/performance/report/precision.vue

@@ -154,9 +154,7 @@ export default {
         ? Object.keys(reportDataDTO)
             .map((k) => ({
               title: k,
-              header:
-                reportDataDTO[k].header ||
-                this.getTableHeader(reportDataDTO[k].list),
+              header:reportDataDTO[k]?.header || this.getTableHeader(reportDataDTO[k]?.list) || '',
               hideHeader: this.$utils.isEmpty(reportDataDTO[k].header),
               list: reportDataDTO[k].list,
               note: reportDataDTO[k].note

+ 87 - 16
src/views/business/performance/xnyzReport.vue

@@ -47,19 +47,19 @@
             {{ form.fangAnLeiXing || '' }}
           </div>
           <experimental-desc
-            :step="form.step || ''"
-            :criterion="form.criterion || ''"
-            :formulas="form.formulas || []"
-            :references="form.references || []"
+            :step="form.configDetailPo.step || ''"
+            :criterion="form.configDetailPo.criterion || ''"
+            :formulas="form.configDetailPo.formulas || []"
+            :references="form.configDetailPo.references || []"
             :readonly="true"
           />
           <basic-info :info="form" :readonly="true" />
           <reagent-info :info="form.reagentPoList" :readonly="true" />
           <param-info
-            v-if="$utils.isNotEmpty(form.params)"
+            v-if="form.shiYanCanShu"
             :form-id="formId"
             :info="form.shiYanCanShu"
-            :config-data="form.params || []"
+            :config-data="form.configDetailPo.params || []"
             :readonly="true"
           />
           <experimental-data
@@ -87,7 +87,7 @@
 </template>
 
 <script>
-import { getExperimentalTree, getExperimental } from '@/api/business/pv'
+import { getExperimentalTree, getExperimental,getConfigDetail } from '@/api/business/pv'
 import ExperimentalDesc from './components/experimental-desc'
 import BasicInfo from './components/basic-info'
 import ReagentInfo from './components/reagent-info'
@@ -117,10 +117,12 @@ export default {
       treeKey: 0,
       form: {
         methodName: '',
-        step: '',
-        criterion: '',
-        formulas: [],
-        references: [],
+        configDetailPo: {
+          step: '',
+          criterion: '',
+          formulas: [], 
+          references: [],
+        },
         reagentPoList: [],
         params: [],
         shiYanCanShu: {},
@@ -191,23 +193,92 @@ export default {
     },
 
     async handleNodeClick(node) {
-      if (node.level === 5) { // 只有第五层是叶子节点,有表单数据
+      if (node.level === 5) {
         try {
           const response = await getExperimental({ id: node.dataId })
-          this.form = response.data
+          let formData = response.data
+          
+          // 确保 configDetailPo 存在
+          if (!formData.configDetailPo) {
+            formData.configDetailPo = {
+              step: '',
+              criterion: '',
+              formulas: [],
+              references: []
+            }
+          }
+          
+          formData.shiYanCanShu = formData.shiYanCanShu
+            ? JSON.parse(formData.shiYanCanShu)
+            : {}
+          formData.shiYanShuJu = formData.shiYanShuJu
+            ? JSON.parse(formData.shiYanShuJu)
+            : []
+            formData.jiSuanJieGuo = formData.jiSuanJieGuo
+            ? JSON.parse(formData.jiSuanJieGuo)
+            : {}
+          // 处理 formulas
+          if (formData.configDetailPo.formulas && typeof formData.configDetailPo.formulas === 'string') {
+            formData.configDetailPo.formulas = this.$utils.isNotEmpty(formData.configDetailPo.formulas)
+              ? JSON.parse(formData.configDetailPo.formulas)
+              : []
+          } else if (!formData.configDetailPo.formulas) {
+            formData.configDetailPo.formulas = []
+          }
+          // 处理 params
+          if (formData.configDetailPo.params && typeof formData.configDetailPo.params === 'string') {
+            formData.configDetailPo.params = this.$utils.isNotEmpty(formData.configDetailPo.params)
+              ? JSON.parse(formData.configDetailPo.params)
+              : []
+          } else if (!formData.configDetailPo.params) {
+            formData.configDetailPo.params = []
+          }
+
+          this.form = formData
+          // 获取配置详情
+          if (formData.zhiBiaoId) {
+            await this.getConfigData({ targetId: formData.zhiBiaoId, methodId: formData.fangFaId })
+          }
           this.showForm = true
         } catch (error) {
-          console.error('Failed to fetch form data:', error)
+          console.error('请求失败', error)
           this.showForm = false
         }
       } else {
         this.showForm = false
       }
     },
-
+    async getConfigData({ targetId, methodId }) {
+      await getConfigDetail({ id: targetId }).then((res) => {
+        const {
+          target,
+          targetKey,
+          experimentalConfigDetailPoList: methods
+        } = res.data || {}
+        const method = methods.find((i) => i.id === methodId) || {}
+        const configData = {
+          target,
+          targetKey,
+          ...method,
+          params: this.$utils.isNotEmpty(method.params)
+            ? JSON.parse(method.params)
+            : [],
+          formulas: this.$utils.isNotEmpty(method.formulas)
+            ? JSON.parse(method.formulas)
+            : []
+        }
+        // 将配置数据合并到form.configDetailPo中
+       // this.form.configDetailPo = { ...this.form.configDetailPo, ...configData }
+       this.$set(this.form, 'configDetailPo', {
+      ...this.form.configDetailPo,
+      ...configData
+    })
+    console.log('数据11111111111111',this.form)
+      })
+    },
     getpdf() {
       const dom = document.querySelector('#pdfDom')
-      const title = this.form.fangAnLeiXing || '表单标题'
+      const title = this.form.fangAnLeiXing || '性能验证报告'
       
       // 隐藏标题和导出按钮
       const headerElement = document.getElementById('pdfHeader')

+ 28 - 14
src/views/component/sjzlpjjhx/sjzlpjjhx.vue

@@ -496,17 +496,17 @@ export default {
         for (let i = 0; i < list.length; i++) {
           list[i].yanZhengLeiXing = list[i].yanZhengLeiXing
             ? list[i].yanZhengLeiXing
-                .replace(/' '/g, '')
-                .replace(/\(/g, '(')
-                .replace(/\)/g, ')')
+                .replaceAll(' ', '')
+                .replaceAll('(', '(')
+                .replaceAll(')', ')')
             : ''
           list[i].canYuRenYuan = list[i].canYuRenYuan
-            ? list[i].canYuRenYuan.replace(/' '/g, '').replace(/,/g, ',')
+            ? list[i].canYuRenYuan.replaceAll(' ', '').replaceAll(',', ',')
             : ''
-          if (list[i].tiGongZhe == '/') {
+          if (list[i].tiGongZhe?.trim() == '/') {
             list[i].tiGongZhe = ''
           }
-          if (list[i].biDuiFang == '/') {
+          if (list[i].biDuiFang?.trim() == '/') {
             list[i].biDuiFang = ''
           }
           const item = list[i]
@@ -518,26 +518,40 @@ export default {
     },
     // 导入验证
     validateItem(item, index) {
-      // console.log(item);
+      console.log(item)
 
       const { userList = [] } = this.$store.getters || {}
       if (
-        item.yanZhengLeiXing &&
-        !['能力验证(PT)', '室间质评(EQA)', '室间比对'].includes(
-          item.yanZhengLeiXing
-        )
+        !item.yanZhengLeiXing ||
+        (item.yanZhengLeiXing &&
+          !['能力验证(PT)', '室间质评(EQA)', '室间比对'].includes(
+            item.yanZhengLeiXing
+          ))
+      ) {
+        this.$message.warning(`第${index + 2}行验证类型为空或不存在!`)
+
+        return false
+      }
+      if (!item.huoDongMing) {
+        this.$message.warning(`第${index + 2}行活动名称不能为空!`)
+        return false
+      }
+      if (
+        (item.tiGongZhe && item.biDuiFang) ||
+        (!item.tiGongZhe && !item.biDuiFang)
       ) {
         this.$message.warning(
-          `第${index + 1}行验证类型不存在,请按照规则填写!`
+          `第${
+            index + 2
+          }行能力验证提供者和室间质评组织方或室间比对方不能为空且只能填写其中一个!`
         )
-
         return false
       }
       if (
         item.canYuRenYuan &&
         !this.checkName(item, userList, 'canYuRenYuan')
       ) {
-        this.$message.warning(`第${index + 1}行参加人员不存在`)
+        this.$message.warning(`第${index + 2}行参加人员不存在!`)
 
         return false
       }