فهرست منبع

edit 规则维护 :表格基本联动

reaper 4 سال پیش
والد
کامیت
c7fad7591d
2فایلهای تغییر یافته به همراه50 افزوده شده و 13 حذف شده
  1. 7 3
      src/components/knowledgeExtra/AddNewRule.vue
  2. 43 10
      src/components/knowledgeExtra/AddNewRuleTable.vue

+ 7 - 3
src/components/knowledgeExtra/AddNewRule.vue

@@ -152,7 +152,6 @@
         <AddNewRuleTable
           v-if="form.parHasSub === 1"
           :klRuleInfoSaveSub="form.klRuleInfoSaveSub"
-          :baseTypes="baseTypeList"
           :baseTermTypeList="baseTermTypeList"
           :maxNum="subRuleMaxNum"
           @subTypeChange="subTypeChange"
@@ -236,6 +235,8 @@ export default {
         {
           groupId: date,
           groupChildId: "child" + new Date().valueOf(),
+          baseTypes: this.baseTypeList,
+          baseTermTypeList: [],
           subDescription: "",
           parRuleType: "",
           subConceptId: "",
@@ -267,8 +268,9 @@ export default {
     subTypeChange(val, index) {
       // index
       const obj = this.baseTypeList.find((it) => it.type === val);
-      console.log("??", val, this.baseTypeList, obj);
-      this.baseTermTypeList = obj.subMenuList;
+      console.log("subMenuList", obj.subMenuList);
+      console.log("baseTermTypeList", this.form.klRuleInfoSaveSub[index]);
+      this.form.klRuleInfoSaveSub[index].baseTermTypeList = obj.subMenuList;
       this.form.klRuleInfoSaveSub[index].subLenCode = "";
       this.form.klRuleInfoSaveSub[index].dataType = "";
       this.clearConcept(index);
@@ -299,6 +301,8 @@ export default {
       const obj = {
         groupId: date,
         groupChildId: "child" + new Date().valueOf(),
+        baseTypes: this.baseTypeList,
+        baseTermTypeList: [],
         subDescription: "",
         parRuleType: "",
         subConceptId: "",

+ 43 - 10
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -52,6 +52,7 @@
 <template>
   <!-- :prop="`klRuleInfoSaveSub[${scope.$index}].subDescription`" -->
   <div class="AddNewRuleTable">
+    <h4 style="marginBottom:20px">规则内容</h4>
     <el-table
       border
       :data="klRuleInfoSaveSub"
@@ -83,7 +84,7 @@
       </el-table-column>
       <el-table-column
         width="80px"
-        v-if="maxNum"
+        v-if="maxNum && maxNum > 1"
         label="基础规则"
         prop="groupType"
       >
@@ -139,7 +140,7 @@
               @change="subTypeChange($event, scope.$index)"
             >
               <el-option
-                v-for="item in baseTypes"
+                v-for="item in scope.row.baseTypes"
                 :key="item.id"
                 :label="item.name"
                 :value="item.type"
@@ -156,9 +157,13 @@
             :prop="`klRuleInfoSaveSub[${scope.$index}].subLenCode`"
             :rules="rules.subLenCode"
           >
-            <el-select v-model="scope.row.subLenCode" placeholder="请选择">
+            <el-select
+              v-model="scope.row.subLenCode"
+              placeholder="请选择"
+              @change="subCodeChange($event, scope.$index)"
+            >
               <el-option
-                v-for="item in baseTermTypeList"
+                v-for="item in scope.row.baseTermTypeList"
                 :key="item.id"
                 :label="item.name"
                 :value="item.code"
@@ -194,12 +199,12 @@
           </el-form-item>
         </template>
       </el-table-column>
-      <el-table-column label="规则具体内容" width="800px" prop="">
+      <el-table-column label="规则具体内容" min-width="800px" prop="">
         <template slot-scope="scope">
           <div class="type_content">
             <el-form-item
               class="type_content_item"
-              style="flex: 1.5"
+              style="width:240px;marginRight:20px"
               label="选择类型:"
               label-width="100px"
               :prop="`klRuleInfoSaveSub[${scope.$index}].dataType`"
@@ -498,6 +503,7 @@ export default {
   data() {
     return {
       conceptList: [],
+      numTypes: "",
       subConceptIdIndex: "",
       operMaxList: [
         { name: "<=", key: "<=" },
@@ -529,6 +535,31 @@ export default {
     subTypeChange(e, index) {
       this.$emit("subTypeChange", e, index);
     },
+    // 规则术语类型
+    subCodeChange(val, index) {
+      //基础规则术语类型修改
+      if ((this.numTypes + ",").indexOf(val + ",") > -1) {
+        this.klRuleInfoSaveSub[index].dataType = "1";
+      } else {
+        this.klRuleInfoSaveSub[index].dataType = "";
+      }
+      this.clearConcept(index);
+      this.clearNumText(index);
+    },
+    clearConcept(index) {
+      this.klRuleInfoSaveSub[index].subConceptId = "";
+      this.conceptList = [];
+    },
+    clearNumText(index) {
+      this.klRuleInfoSaveSub[index].subMaxOperator = "";
+      this.klRuleInfoSaveSub[index].subMaxValue = "";
+      this.klRuleInfoSaveSub[index].subMaxUnit = "";
+      this.klRuleInfoSaveSub[index].subMinOperator = "";
+      this.klRuleInfoSaveSub[index].subMinValue = "";
+      this.klRuleInfoSaveSub[index].subMinUnit = "";
+      this.klRuleInfoSaveSub[index].subEqValue = "";
+      this.klRuleInfoSaveSub[index].subEqOperator = "";
+    },
     //医学标准术语change
     subConceptIdfocus(index) {
       this.subConceptIdIndex = "";
@@ -612,7 +643,9 @@ export default {
     }
   },
   created() {
+    this.numTypes = localStorage.getItem("zskNumDict");
     this.getSpanArr(this.klRuleInfoSaveSub);
+    console.log("maxNum", this.maxNum);
   },
   beforeUpdate() {
     this.getSpanArr(this.klRuleInfoSaveSub);
@@ -635,10 +668,10 @@ export default {
       // subLenCode: "",
       // dataType: ""
     },
-    baseTypes: {
-      type: Array,
-      default: []
-    },
+    // baseTypes: {
+    //   type: Array,
+    //   default: []
+    // },
     baseTermTypeList: {
       type: Array,
       default: []