Pārlūkot izejas kodu

Merge branch 'uiUpdate0507' into test

wyq 4 gadi atpakaļ
vecāks
revīzija
82c2c35a31

+ 0 - 1
src/components/common/HomePage.vue

@@ -106,7 +106,6 @@ export default {
   methods: {
     collect() {
       this.onshow = !this.onshow;
-      
     },
     getMenuList() {
       api

+ 157 - 78
src/components/knowledgeExtra/AddDiagBase.vue

@@ -1,7 +1,6 @@
 <template>
-  <div style="min-height:100%">
+  <div style="min-height:100%" ref="viewBox">
     <crumbs :title="title" :param="$route.params" linkTo="ZskDiagBase"></crumbs>
-
     <div class="contents">
       <div class="content">
         <el-form
@@ -55,7 +54,7 @@
             :data="form.klDiagnoseTypeVO"
             :row-class-name="tableRowClassName"
             border
-            style="width: 100%"
+            max-height="500"
             :header-cell-style="{background:'#E3EAF4'}"
           >
             <el-table-column label="依据" width="100">
@@ -80,8 +79,7 @@
                     height="18"
                     width="18"
                     class="icon"
-                    :disabled="form.klDiagnoseTypeVO.length===1"
-                    @click="delDiag(scope.$index)"
+                    @click="delDiag(scope.row.depart_id,scope.$index)"
                   />
                 </el-form-item>
               </template>
@@ -133,7 +131,7 @@
                         height="18"
                         width="18"
                         class="icon"
-                        @click="delGroup(scope.$index)"
+                        @click="delGroup(scope.row.depart_id,scope.$index)"
                       />
                     </el-form-item>
                   </div>
@@ -192,10 +190,10 @@
                       <div class="box-2" v-if="v.title == '基础依据类型'">
                         <el-form-item
                           :prop="'klDiagnoseTypeVO.' +
-                        scope.$index +
-                        '.groupVO.' +
-                        index +
-                        '.klDiagnoseDetail.'+i+'.basType'"
+                          scope.$index +
+                          '.groupVO.' +
+                          index +
+                          '.klDiagnoseDetail.'+i+'.basType'"
                           :rules="[{required:true,message:'请选择基础依据类型',trigger:'change'}]"
                         >
                           <el-select
@@ -214,10 +212,10 @@
                       <div class="box-2" v-if="v.title == '基础依据术语类型'">
                         <el-form-item
                           :prop="'klDiagnoseTypeVO.' +
-                        scope.$index +
-                        '.groupVO.' +
-                        index +
-                        '.klDiagnoseDetail.'+i+'.basLibType'"
+                          scope.$index +
+                          '.groupVO.' +
+                          index +
+                          '.klDiagnoseDetail.'+i+'.basLibType'"
                           :rules="[{required:true,message:'请选择基础依据术语类型',trigger:'change'}]"
                           v-if="!items.basNameType"
                         >
@@ -240,14 +238,15 @@
                       <div
                         v-if="v.title == '医学标准术语'"
                         class="box-2"
-                        :class="(items.basType===3 || items.basType===4)? 'tmall' : 'taobao'"
+                        :class="items.basType===3 || items.basType===4? 'tmall' : 'taobao'"
                       >
                         <el-form-item
+                          v-if="items.basType==1 || items.basType==2"
                           :prop="'klDiagnoseTypeVO.' +
-                        scope.$index +
-                        '.groupVO.' +
-                        index +
-                        '.klDiagnoseDetail.'+i+'.basConceptId'"
+                          scope.$index +
+                          '.groupVO.' +
+                          index +
+                          '.klDiagnoseDetail.'+i+'.basConceptId'"
                           :rules="[{required:true,message:'请输入医学标准术语',trigger:'change'}]"
                         >
                           <el-select
@@ -270,10 +269,10 @@
                       <div class="last-box" v-if="v.title == '规则具体内容'">
                         <el-form-item
                           :prop="'klDiagnoseTypeVO.' +
-                        scope.$index +
-                        '.groupVO.' +
-                        index +
-                        '.klDiagnoseDetail.'+i+'.dataType'"
+                          scope.$index +
+                          '.groupVO.' +
+                          index +
+                          '.klDiagnoseDetail.'+i+'.dataType'"
                           :rules="[{required:true,message:'请选择类型',trigger:'change'}]"
                           v-if="items.basType===2&&!items.onlyNumType&&!items.onlyTxtType"
                         >
@@ -302,10 +301,10 @@
                           <div class="last-box-1">
                             <el-form-item
                               :prop="'klDiagnoseTypeVO.' +
-                            scope.$index +
-                            '.groupVO.' +
-                            index +
-                            '.klDiagnoseDetail.'+i+'.maxOperator'"
+                              scope.$index +
+                              '.groupVO.' +
+                              index +
+                              '.klDiagnoseDetail.'+i+'.maxOperator'"
                               :rules="[{required:true,message:'最大值和最小值至少完整填写一个,单位不必填',trigger:'change'}]"
                             >
                               <el-select
@@ -325,15 +324,14 @@
 
                             <el-form-item
                               :prop="'klDiagnoseTypeVO.' +
-                            scope.$index +
-                            '.groupVO.' +
-                            index +
-                            '.klDiagnoseDetail.'+i+'.maxVal'"
+                              scope.$index +
+                              '.groupVO.' +
+                              index +
+                              '.klDiagnoseDetail.'+i+'.maxVal'"
                               :rules="[{required:true,message:'最大值和最小值至少完整填写一个,单位不必填',trigger:'blur'}]"
                             >
                               <el-input v-model="items.maxVal" placeholder="填写数值"></el-input>
                             </el-form-item>
-
                             <el-form-item prop="minUnit">
                               <el-input v-model.trim="items.maxUnit" placeholder="填写单位"></el-input>
                             </el-form-item>
@@ -386,10 +384,10 @@
                         </el-form-item>
                         <el-form-item
                           :prop="'klDiagnoseTypeVO.' +
-                        scope.$index +
-                        '.groupVO.' +
-                        index +
-                        '.klDiagnoseDetail.'+i+'.eqValue'"
+                          scope.$index +
+                          '.groupVO.' +
+                          index +
+                          '.klDiagnoseDetail.'+i+'.eqValue'"
                           :rules="[{required:true,message:'请输入正则表达式',trigger:'blur'}]"
                           v-if="items.basType===4 || items.basType===3"
                           maxlength="200"
@@ -400,10 +398,10 @@
                         </el-form-item>
                         <el-form-item
                           :prop="'klDiagnoseTypeVO.' +
-                        scope.$index +
-                        '.groupVO.' +
-                        index +
-                        '.klDiagnoseDetail.'+i+'.eqValue'"
+                          scope.$index +
+                          '.groupVO.' +
+                          index +
+                          '.klDiagnoseDetail.'+i+'.eqValue'"
                           :rules="[{required:true,message:'不能为空~',trigger:'blur'}]"
                           maxlength="200"
                           v-if="(!items.onlyNumType&&!items.basNameType&&(items.basType===2 || items.basType===1)&&items.dataType==='2')||items.onlyTxtType"
@@ -422,7 +420,7 @@
         </el-form>
 
         <div class="Butn">
-          <el-button class="disclButn" size="small" type="primary" @click="confirm">保存</el-button>
+          <el-button class="disclButn" size="small" type="primary" @click="confirm">确定</el-button>
         </div>
       </div>
     </div>
@@ -444,7 +442,7 @@ export default {
         { title: '基础依据类型', width: 130, istar: true },
         { title: '基础依据术语类型', width: 160, istar: true },
         { title: '医学标准术语', width: 130, istar: true },
-        { title: '规则具体内容', width: 750 }
+        { title: '规则具体内容', width: 850 }
       ],
       dicts: {},
       baseTypes: [], //诊断数据类型
@@ -466,6 +464,7 @@ export default {
             depart_id: 0,
             groupVO: [
               {
+                inx: 0,
                 baseGroup: '',
                 conditionGroup: '',
                 fitNo: '',
@@ -551,7 +550,7 @@ export default {
       spanArr: [],
       list: [], //提交数据数组,
       i: 0,
-      imgshow: false
+      inx: 0
     };
   },
   created() {
@@ -571,6 +570,7 @@ export default {
         info.klDiagnoseTypeVO[i].depart_id = this.i;
         this.i++;
       }
+
       this.form = Object.assign({}, this.form, this.formatData(info));
       if (this.isCopy) {
         this.conceptList = [];
@@ -597,10 +597,10 @@ export default {
                 this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
                   .basType
             );
-
             this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
               k
             ].basLibTypeList = this.baseTermTypeList[index2].subMenuList;
+
             this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
               k
             ].conceptList = [
@@ -628,7 +628,28 @@ export default {
                 k
               ].dataType = '2';
             }
-
+            if (
+              this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
+                .basType == 3 ||
+              this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[k]
+                .basType == 4
+            ) {
+              this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
+                k
+              ].basTypeName = this.form.klDiagnoseTypeVO[i].groupVO[
+                j
+              ].klDiagnoseDetail[k].basLibTypeList[0].name;
+              this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
+                k
+              ].basNameType = true;
+            }else{
+              this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
+                k
+              ].basTypeName = '';
+              this.form.klDiagnoseTypeVO[i].groupVO[j].klDiagnoseDetail[
+                k
+              ].basNameType = false;
+            }
             const onlyNum = this.dicts['onlyNum'] || '&';
             const onlyTxt = this.dicts['onlyTxt'] || '&';
             const codes = onlyNum + ',';
@@ -648,6 +669,7 @@ export default {
       }
     }
   },
+
   computed: {
     numArr() {
       let arr = [];
@@ -724,14 +746,12 @@ export default {
         };
       }
     },
-     tableRowClassName({row, column, rowIndex, columnIndex}) {
-       console.log(row.depart_id & 1)
-        if (row.depart_id & 1) {
-          console.log(3658)
-          return 'success-row';
-        } 
-        return '';
-      },
+    tableRowClassName({ row, column, rowIndex, columnIndex }) {
+      if (row.depart_id & 1) {
+        return 'success-row';
+      }
+      return '';
+    },
     getInitData() {
       this.i++;
       return {
@@ -784,18 +804,45 @@ export default {
       this.i++;
       let temp = JSON.parse(JSON.stringify(this.form.klDiagnoseTypeVO));
       let obj = temp.filter(v => v.depart_id === name);
-
       for (var i in obj.reverse()) {
-        obj[i].depart_id = '复制依据' + this.i; //问题点2
+        obj[i].depart_id = this.i; //问题点2
         this.form.klDiagnoseTypeVO.splice(index, 0, obj[i]);
       }
     },
     //删除依据
     delDiag(i) {
-      this.form.klDiagnoseTypeVO.splice(i, 1);
+      const formData = JSON.parse(JSON.stringify(this.form));
+      let map = {},
+        dest = [];
+      for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
+        let ai = formData.klDiagnoseTypeVO[i];
+        if (!map[ai.depart_id]) {
+          dest.push({
+            depart_id: ai.depart_id,
+            conditionType: ai.conditionType,
+            groupVO: ai.groupVO
+          });
+          map[ai.depart_id] = ai;
+        } else {
+          for (let j = 0; j < dest.length; j++) {
+            var dj = dest[j];
+            if (dj.depart_id == ai.depart_id) {
+              dj.groupVO = dj.groupVO.concat(ai.groupVO);
+              break;
+            }
+          }
+        }
+      }
+      if (dest.length == 1) {
+        return;
+      } else {
+        dest.splice(i, 1);
+      }
+      this.form.klDiagnoseTypeVO = dest;
     },
     //新增组
     addGroup(i) {
+      this.inx++;
       const temp = {
         baseGroup: '',
         conditionGroup: '',
@@ -827,8 +874,34 @@ export default {
       };
       this.form.klDiagnoseTypeVO[i].groupVO.splice(i + 1, 0, temp);
     },
-    delGroup(i) {
-      this.form.klDiagnoseTypeVO.splice(i, 1);
+    delGroup(id, i) {
+      const formData = JSON.parse(JSON.stringify(this.form));
+      let map = {},
+        dest = [];
+      for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
+        let ai = formData.klDiagnoseTypeVO[i];
+        if (!map[ai.depart_id]) {
+          dest.push({
+            depart_id: ai.depart_id,
+            conditionType: ai.conditionType,
+            groupVO: ai.groupVO
+          });
+          map[ai.depart_id] = ai;
+        } else {
+          for (let j = 0; j < dest.length; j++) {
+            var dj = dest[j];
+            if (dj.depart_id == ai.depart_id) {
+              dj.groupVO = dj.groupVO.concat(ai.groupVO);
+              break;
+            }
+          }
+        }
+      }
+      if (dest[id].groupVO.length == 1) {
+        return;
+      } else {
+        this.form.klDiagnoseTypeVO.splice(i, 1);
+      }
     },
     //新增基础依据
     addRule(row, index, i) {
@@ -856,10 +929,17 @@ export default {
       this.form.klDiagnoseTypeVO[index].groupVO[i].klDiagnoseDetail.push(temp);
     },
     delRule(row, inx, index, i) {
-      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail.splice(
-        i,
-        1
-      );
+      if (
+        this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail
+          .length == 1
+      ) {
+        return;
+      } else {
+        this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail.splice(
+          i,
+          1
+        );
+      }
     },
     //诊断依据类型修改
     basTypeChange(val, inx) {
@@ -871,18 +951,18 @@ export default {
       this.baseTermTypeList = this.baseTypes[index2].subMenuList;
     },
     //基础依据类型修改
+    
     baseTermTypeChange(val, inx, index, i) {
       if (!val) {
-        this.basLibTypeList = [];
         return;
       }
       this.basType = val;
       this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
         i
       ].basType = val;
-      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
-        i
-      ].basLibType = '';
+      // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+      //   i
+      // ].basLibType = '';
       this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
         i
       ].dataType = '';
@@ -1142,7 +1222,6 @@ export default {
           }
         }
       }
-
       formData.klDiagnoseTypeVO = dest;
       this.validateForms(function() {
         let params = formData;
@@ -1196,10 +1275,11 @@ export default {
     margin-top: 10px;
     padding: 20px 20px 50px;
     min-height: 600px;
-
-
+    .cell {
+      overflow: initial;
+    }
     .el-table .success-row {
-      background: #DFF7EF;
+      background: #dff7ef;
     }
     .content-2-header {
       padding: 20px 0;
@@ -1280,12 +1360,13 @@ export default {
       }
       .el-form-item__content {
         position: inherit !important;
+        line-height: 32px;
       }
       .last-box-1 {
         display: flex;
         .el-form-item__error {
-          top: 56px;
-          left: 10px;
+          top: 32px;
+          left: 160px;
           white-space: nowrap;
           background: #fff;
         }
@@ -1293,14 +1374,14 @@ export default {
       .last-box-s {
         position: absolute;
         .el-form-item__error {
-          top: 39px;
+          top: 32px;
           left: 0px;
           white-space: nowrap;
           background: #fff;
         }
       }
       .el-form-item__error {
-        top: 56px;
+        top: 32px;
         left: 10px;
         white-space: nowrap;
         background: #fff;
@@ -1309,7 +1390,7 @@ export default {
         display: inline;
         /deep/ .el-input,
         .el-input__inner {
-          width: 100px;
+          width: 80px;
         }
       }
       .inp {
@@ -1320,15 +1401,13 @@ export default {
       }
       .el-form-item {
         margin: 0;
-        width: 100%;
         overflow: hidden;
+        display: flex;
       }
-      .el-form-item__content;
     }
     .add-new-form {
       .el-input,
       .el-input__inner {
-        width: 100px;
         font-size: 12px;
         line-height: 32px;
         height: 32px;

+ 5 - 2
src/components/knowledgeExtra/AddNewRule.vue

@@ -599,7 +599,6 @@ export default {
   watch: {
     "form.klRuleByIdSub": {
       handler(val) {
-        console.log("000000000");
         this.form.klRuleByIdSub.forEach((item, i, arr) => {
           if (i == 0) {
             item.rowIndex = 1;
@@ -609,9 +608,13 @@ export default {
             item.rowIndex = arr[i - 1].rowIndex + 1;
           }
         });
-        console.log(this.form.klRuleByIdSub);
       },
       deep: true
+    },
+    "form.parHasSub"(val) {
+      if (!val || val == 0) {
+        this.form.klRuleByIdSub = [];
+      }
     }
   },
   computed: {

+ 14 - 13
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -96,8 +96,8 @@
     <el-table
       border
       :data="klRuleByIdSub"
-      style="width: 100%"
       size="mini"
+      height="tableHeigth"
       :row-style="rowStyle"
       :header-row-style="{ background: '#E3EAF4' }"
       :cell-style="cellStyle"
@@ -421,6 +421,11 @@
               label-width="100px"
               :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
               :rules="[
+                {
+                  required: true,
+                  message: '请输入' + textName(scope.$index),
+                  trigger: 'blur'
+                },
                 {
                   validator: (rule, value, callback) => {
                     subEqValue(scope, rule, value, callback);
@@ -443,11 +448,16 @@
               label-width="120px"
               style="flex: 2"
               v-if="scope.row.subType === 6"
-              :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
+              :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
               :rules="[
+                {
+                  required: true,
+                  message: '请输入' + textName(scope.$index),
+                  trigger: 'blur'
+                },
                 {
                   validator: (rule, value, callback) => {
-                    subEqValuerule(scope, rule, value, callback);
+                    subEqValue(scope, rule, value, callback);
                   },
                   trigger: 'blur'
                 }
@@ -550,6 +560,7 @@ export default {
     },
     // 医学内容rule
     subEqValue(scope, rule, value, callback) {
+      console.log(value);
       if (value === "") {
         callback(new Error("请输入" + this.textName(scope.$index)));
       } else if (value.length > 200) {
@@ -558,16 +569,6 @@ export default {
         callback();
       }
     },
-    // 正则rule
-    subEqValuerule(scope, rule, value, callback) {
-      if (value === "") {
-        callback(new Error("请输入" + this.textName));
-      } else if (value.length > 200) {
-        callback(new Error(this.textName + "不能超过200字"));
-      } else {
-        callback();
-      }
-    },
     // 判断是否为最后一条规则
     isLastDate(id) {
       const tableLength = this.klRuleByIdSub.filter(

BIN
src/images/icon-copy.png