Преглед изворни кода

四川肿瘤检验方法性能评审记录表:选择项目时改为多选

zhonghuizhen пре 7 месеци
родитељ
комит
7203d7d52c
1 измењених фајлова са 52 додато и 18 уклоњено
  1. 52 18
      src/views/business/testMethod/reviewDialog.vue

+ 52 - 18
src/views/business/testMethod/reviewDialog.vue

@@ -35,7 +35,7 @@
           v-model="ruleForm.xiangMuFangFa"
           size="small"
           template-key="nlfwxz"
-          :multiple="false"
+          :multiple="reviewDialogMultiple"
           :disabled="!selectEditchanges"
           type="dialog"
           class="custom-dialog"
@@ -150,6 +150,8 @@
   </el-dialog>
 </template>
 <script>
+import { getSetting } from '@/utils/query'
+
 export default {
   components: {
     IbpsCustomDialog: () =>
@@ -190,6 +192,7 @@ export default {
       isInert: false,
       dynamicParams: {},
       id: '',
+      reviewDialogMultiple: false,
       toolbars: [
         {
           key: 'confirm'
@@ -249,10 +252,12 @@ export default {
       this.id = newValeu
     }
   },
-  created() {
+  async created() {
     if (this.selectEditDatas) {
       this.slectUpdate(this.selectEditDatas)
     }
+    const res = await getSetting('pxSpectacularsOption')
+    this.reviewDialogMultiple = res?.reviewDialogMultiple || false
   },
   methods: {
     handleActionEvent({ key }) {
@@ -299,22 +304,51 @@ export default {
     },
     // 选择检验与方法带出数据
     breakData(newValeu) {
-      // const sql = `select * from neng_li_fan_wei_ where id_='${newValeu}'`
-      this.$common
-        .request('query', {
-          key: 'getNlfwbById',
-          params: [newValeu]
-        })
-        .then((res) => {
-          this.ruleForm.xiangMuMingCheng =
-            res.variables.data[0].jian_yan_xiang_mu
-          this.ruleForm.sheBeiMingCheng = res.variables.data[0].she_bei_
-          this.ruleForm.sheBeiBianHao = res.variables.data[0].she_bei_bian_hao_
-          this.ruleForm.shiJi = res.variables.data[0].shi_ji_
-          this.ruleForm.jiaozhuiPin = res.variables.data[0].yang_pin_lei_xing
-          this.ruleForm.jianYanXiangMu = res.variables.data[0].parent_id_
-          this.ruleForm.xiaoZhunPinJiPiHa = res.variables.data[0].xiao_zhun_wu_
-        })
+      if(this.reviewDialogMultiple){ //四川肿瘤 检验方法需多选
+          const idList = newValeu.split(',')
+          //const idList = newValeu.split(',').map(id => `'${id}'`).join(',')
+           //多选 const sql = `SELECT * FROM neng_li_fan_wei_ WHERE id_ IN (${idList})`
+           this.$common
+          .request('query', {
+            key: 'getNlfwbById1',
+            params: [null]
+          })
+          .then((res) => {
+            if(res.variables.data.length >0){
+              let strList = []
+              idList.forEach(id=>{
+                const obj = res.variables.data.filter(item => item.id_ === id)
+                if(obj.length>0){
+                  strList.push(obj[0].jian_yan_xiang_mu)
+                }
+
+              })
+              const str = strList.join(',')
+              this.ruleForm.xiangMuMingCheng =str
+            }
+          
+          })
+      }else{
+          //单选 const sql = `select * from neng_li_fan_wei_ where id_='${newValeu}'`
+          this.$common
+          .request('query', {
+            key: 'getNlfwbById',
+            params: [newValeu]
+          })
+          .then((res) => {
+            if(res.variables.data.length >0){
+                this.ruleForm.xiangMuMingCheng =res.variables.data[0].jian_yan_xiang_mu
+              this.ruleForm.sheBeiMingCheng = res.variables.data[0].she_bei_
+              this.ruleForm.sheBeiBianHao = res.variables.data[0].she_bei_bian_hao_
+              this.ruleForm.shiJi = res.variables.data[0].shi_ji_
+              this.ruleForm.jiaozhuiPin = res.variables.data[0].yang_pin_lei_xing
+              this.ruleForm.jianYanXiangMu = res.variables.data[0].parent_id_
+              this.ruleForm.xiaoZhunPinJiPiHa = res.variables.data[0].xiao_zhun_wu_
+            }
+          
+          })
+      }
+
     },
 
     // 查阅,修改带出数据