1178232204@qq.com 2 سال پیش
والد
کامیت
0d40fe1584

+ 3 - 0
src/api/cdss.js

@@ -777,6 +777,9 @@ export default {
   getRunningStatusByHospitalId(param) {
     return axios.post(urls.getRunningStatusByHospitalId, param);
   },
+  reminder(param) {
+    return axios.post(urls.reminder, param);
+  },
   updateRunningStatus(param) {
     return axios.post(urls.updateRunningStatus, param);
   },

+ 1 - 0
src/api/config.js

@@ -579,6 +579,7 @@ export default {
     'getRunningStatus': '/api/cdssman/test/running/getStatus',   //查看测试用例运行状态
     'getRunningStatusByHospitalId': '/api/cdssman/test/running/getStatusByHospitalId',   //查拉面所有测试用例运行状态
     'updateRunningStatus': '/api/cdssman/test/running/updateStatus',   //更新测试用例运行状态
+    'reminder': '/api/cdssman/test/running/reminder',   //更新测试用例运行状态
     //知识库规则维护
     'zskRuleList': '/api/cdssman/klRule/getKlRuleInfoPage',//规则列表
     'zskAddRule': '/api/cdssman//klRule/saveRuleInfo',//添加规则

+ 1 - 1
src/api/index.js

@@ -3,7 +3,7 @@ import config from './config.js';
 
 axios.default.timeout = 500000;
 axios.defaults.headers.post['Content-Type'] = "application/json;charset=utf-8";
- //axios.defaults.baseURL = 'http://192.168.2.241:5050';
+//  axios.defaults.baseURL = 'http://192.168.2.236:5050';
 // axios.defaults.baseURL = 'http://192.168.2.241';
 // axios.defaults.baseURL = 'http://192.168.3.117:5050';
 

+ 4 - 1
src/api/knowledgeTree.js

@@ -160,6 +160,9 @@ export default {
       contentType: "multipart/form-data",
       data: param,
     })
-  }
+  },
+  reminder(param) {
+    return axios.post(urls.reminder, param);
+  },
 };
 

+ 16 - 0
src/components/autoTest/AutoKnowledgeMapRuleTest.vue

@@ -103,6 +103,7 @@ export default {
     }
   },
   created() {
+    this.reminder()
     this._getHospitalInfoCDSS();
     this.zskgetDict();
     // this._getRunningStatus()   // 进入页面立即确认状态
@@ -122,6 +123,21 @@ export default {
     });
   },
   methods: {
+    reminder() {
+      api
+        .reminder({caseGroup:1})
+        .then((res) => {
+          if (res.data.code == "0") {
+            this.$message({
+              message: res.data.data,
+              type: "error",
+            });
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
     getRunningState() {
       api
         .getRunningState({ caseGroup: 1 })

+ 409 - 75
src/components/knowledgeExtra/AddNewRule.vue

@@ -250,6 +250,8 @@
           :showMsg="showMsg"
           :showMsg2="showMsg2"
           :ruleTermCodeStr="ruleTermCodeStr"
+          :isStaticChild="isStatic"
+          :isRedMsgs="isRedMsg"
           @subTypeChange="subTypeChange"
           @searchConcept="searchConcept"
           @addGroup="addGroup"
@@ -263,6 +265,15 @@
           @ChildDataTypeChange="ChildDataTypeChange"
           @childSubCodeChange="childSubCodeChange"
         />
+        <AddNewRuleContent
+          ref="ruleContent"
+          v-if="(!form.parHasSub && !tableShow) || contentRuls"
+          @ruleContent="ruleContent"
+          :isContent="isEdit"
+          :formEidtCopy="formEidt"
+          :isError="isErr"
+        >
+        </AddNewRuleContent>
         <el-form-item>
           <div class="form_btn">
             <el-button
@@ -281,10 +292,22 @@
 import api from "@api/knowledgeLib.js";
 import { formRules } from "./rules";
 import AddNewRuleTable from "./AddNewRuleTable";
+import AddNewRuleContent from "./AddNewRuleContent";
 export default {
   name: "AddRule",
   data() {
     return {
+      isRedMsg: [],
+      isErr: false, //控制护理开单项里面的错误提示
+      staicData: {
+        //护理开单项里面的数据
+        gljtxx: [],
+        fjxx: "",
+      },
+      formEidt: {},
+      isEdit: false, //判断是否是编辑页面
+      isStatic: false, //判断关联静态知识的tabel列是否显示
+      contentRuls: false, //判断规则内容为列表还是表单
       title: "规则维护-添加规则",
       ruleTypeList: [], //规则类型列表  1
       ruleTermTypeList: [], //规则术语类型列表  2
@@ -316,6 +339,7 @@ export default {
   created() {
     this.getTypeList();
     this.setDict();
+
     const param = this.$route.params;
     let info = param.data;
     if (info) {
@@ -328,13 +352,22 @@ export default {
       this.initEdidData();
     }
   },
+  mounted() {},
+  watch: {},
   methods: {
+    //护理开单项子组件里面的传过来的值
+    ruleContent(data) {
+      this.staicData = data;
+    },
     clearValidate(data) {
       this.$refs.ruleForm.clearValidate(data);
     },
     // 编辑初始化
     async initEdidData() {
       // 规则术语类型初始化
+      this.contentRuls = false;
+      this.isEdit = false;
+      this.isRedMsg = [];
       const newruleTermTypeList = await this.ruleTypeList.find(
         (it) => it.id == this.form.parRuleType
       );
@@ -343,16 +376,67 @@ export default {
       const obj = await this.ruleTermTypeList.find(
         (it1) => it1.code == this.form.parLenCode
       );
-      console.log(obj);
       this.baseTypeList = obj.subMenuList;
       this.subRuleMaxNum = obj.number;
-
       this.conceptList = [
         {
           conceptName: this.form.parlibName,
           conceptId: this.form.parConceptId,
         },
       ];
+      // 加载护理开单项的推送内容
+      if (!this.form.klRuleByIdSub) {
+        this.isEdit = true;
+        this.contentRuls = true;
+        this.formEidt = JSON.parse(JSON.stringify(this.form));
+        return;
+      }
+      //加载护理非开单项的关联静态知识
+      if (this.form.parRuleType == 8) {
+        this.isStatic = true;
+        if (Array.isArray(this.form.klRuleByIdGroup)) {
+          let itemCopy = {}; //用来存放对象
+          let itemsCopy = {};
+          let klRuleByIdSub = []; //中间数组
+          this.form.klRuleByIdGroup.forEach((item, index) => {
+            let obj = {
+              groupType: item.groupType,
+              klRuleStaticSub: item.klRuleStaticSub,
+            };
+            itemCopy = JSON.parse(JSON.stringify(obj));
+            klRuleByIdSub.push(itemCopy);
+          });
+          if (Array.isArray(this.form.klRuleByIdSub)) {
+            this.form.klRuleByIdSub.forEach((item) => {
+              this.$set(item, "ruleStatic", []);
+              this.$set(item, "ruleStaticList", []);
+              this.$set(item, "ruleStaticLists", []);
+            });
+          }
+          this.form.klRuleByIdSub.forEach((item, index) => {
+            klRuleByIdSub.forEach((items) => {
+              if (items.groupType == item.groupType) {
+                this.form.klRuleByIdSub[index].ruleStaticLists =
+                  items.klRuleStaticSub;
+              }
+            });
+          });
+          this.form.klRuleByIdSub.forEach((item, index) => {
+            if (Array.isArray(item.ruleStaticLists)) {
+              item.ruleStaticLists.forEach((items) => {
+                let obj = {
+                  id: items.conceptId,
+                  name: items.name,
+                };
+                itemsCopy = JSON.parse(JSON.stringify(obj));
+                this.form.klRuleByIdSub[index].ruleStaticList.push(itemsCopy);
+                this.form.klRuleByIdSub[index].ruleStatic.push(itemsCopy.id);
+              });
+            }
+          });
+        }
+      }
+      //加载列表规则内容
       if (this.form.parConceptId && this.checkFirstPlace && this.conceptList) {
         this.firstPlace = this.conceptList.find(
           (it) => it.conceptId === this.form.parConceptId
@@ -411,6 +495,30 @@ export default {
             }
           } else {
             this.$set(item, "disabled", true);
+
+            if (this.form.parLenCode == "108" && this.form.parRuleType == "8") {
+              const subobj = this.baseTypeList.find((it) => it.type == "2");
+              subobj.subMenuList.push({
+                code: "108",
+                creator: "0",
+                firstPlace: null,
+                gmtCreate: "1970-01-01 12:00:00",
+                gmtModified: "1970-01-01 12:00:00",
+                id: 27106,
+                isDeleted: "N",
+                modifier: "0",
+                name: "实验室检查子项目",
+                number: null,
+                orderNo: 1,
+                parentId: 27103,
+                planCode: "rule",
+                remark: "",
+                ruleType: 8,
+                subMenuList: [],
+                type: null,
+              });
+              this.$set(item, "baseTermTypeList", subobj.subMenuList);
+            }
           }
         }
         const dragDel =
@@ -463,32 +571,59 @@ export default {
               this.$set(item, "baseTermTypeList", screenArr);
             }
           }
-          console.log(this.form);
         }
       });
     },
     //药品数据处理
     getDragData(info) {
       let dataArr = [];
-      let arr = JSON.parse(JSON.stringify(info.klRuleByIdSub));
-      arr.map((mapItem) => {
-        if (dataArr.length == 0) {
-          dataArr.push({ groupType: mapItem.groupType, List: [mapItem] });
-        } else {
-          let res = dataArr.some((item) => {
-            //判断相同日期,有就添加到当前项
-            if (item.groupType == mapItem.groupType) {
-              item.List.push(mapItem);
-              return true;
-            }
-          });
-          if (!res) {
-            //如果没找相同日期添加一个新对象
+      //处理修改接口请求的数据
+      //先将数据深拷贝,避免数据污染
+      let infoCopy = JSON.parse(JSON.stringify(info));
+      infoCopy.klRuleByIdSubCopy = [];
+      if (info.klRuleByIdGroup.length > 0) {
+        let klRuleByIdSub = {};
+        info.klRuleByIdGroup.forEach((item) => {
+          if (item.klRuleByIdSub && Array.isArray(item.klRuleByIdSub)) {
+            item.klRuleByIdSub.forEach((items) => {
+              klRuleByIdSub = JSON.parse(JSON.stringify(items));
+              infoCopy.klRuleByIdSubCopy.push(klRuleByIdSub);
+            });
+            infoCopy.klRuleByIdSub = [...item.klRuleByIdSub];
+          }
+        });
+      }
+      if (
+        Array.isArray(info.klRuleByIdGroup) &&
+        info.klRuleByIdGroup.length == 0
+      ) {
+        this.form = JSON.parse(JSON.stringify(info));
+        return;
+      }
+      //判断是否存在klRuleByIdSub,没有就是护理开单项直接赋值
+      if (!info.klRuleByIdGroup[0].klRuleByIdSub) {
+        this.form = JSON.parse(JSON.stringify(info));
+      } else {
+        let arr = JSON.parse(JSON.stringify(infoCopy.klRuleByIdSubCopy));
+        arr.map((mapItem) => {
+          if (dataArr.length == 0) {
             dataArr.push({ groupType: mapItem.groupType, List: [mapItem] });
+          } else {
+            let res = dataArr.some((item) => {
+              //判断相同日期,有就添加到当前项
+              if (item.groupType == mapItem.groupType) {
+                item.List.push(mapItem);
+                return true;
+              }
+            });
+            if (!res) {
+              //如果没找相同日期添加一个新对象
+              dataArr.push({ groupType: mapItem.groupType, List: [mapItem] });
+            }
           }
-        }
-      });
-      this.getDragData2(info, dataArr);
+        });
+        this.getDragData2(info, dataArr);
+      }
     },
     getDragData2(info, dataArr) {
       let arr = [];
@@ -506,34 +641,153 @@ export default {
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
+          this.isErr = false;
+          this.isRedMsg = [];
           let params = JSON.parse(JSON.stringify(this.form));
-          params.klRuleInfoSaveSub = params.klRuleByIdSub;
-          delete params.klRuleByIdSub;
-          params.klRuleInfoSaveSub.forEach((item, i, arr) => {
-            if (i === 0) {
-              item.groupType = 1;
-            } else {
-              if (item.groupId == arr[i - 1].groupId) {
-                item.groupType = arr[i - 1].groupType;
-                item.subMsg = arr[i - 1].subMsg;
+          if (params.klRuleByIdSub) {
+            params.klRuleInfoSaveSub = params.klRuleByIdSub;
+            delete params.klRuleByIdSub;
+            params.klRuleInfoSaveSub.forEach((item, i, arr) => {
+              if (i === 0) {
+                item.groupType = 1;
               } else {
-                item.groupType = arr[i - 1].groupType + 1;
+                if (item.groupId == arr[i - 1].groupId) {
+                  item.groupType = arr[i - 1].groupType;
+                  item.subMsg = arr[i - 1].subMsg;
+                } else {
+                  item.groupType = arr[i - 1].groupType + 1;
+                }
               }
-            }
-          });
-          params.klRuleInfoSaveSub.forEach((ite) => {
-            delete ite.groupId;
-            delete ite.groupChildId;
-            delete ite.rowIndex;
-            delete ite.baseTypes;
-            delete ite.baseTermTypeList;
-            delete ite.conceptList;
-          });
+            });
+            params.klRuleInfoSaveSub.forEach((ite) => {
+              delete ite.groupId;
+              delete ite.groupChildId;
+              delete ite.rowIndex;
+              delete ite.baseTypes;
+              delete ite.baseTermTypeList;
+              delete ite.conceptList;
+            });
+          }
           if (this.parId) {
             params.parId = this.isCopy ? undefined : this.parId;
             params.parStatus = this.isCopy ? 1 : this.form.parStatus;
           }
-          this.saveRule(params);
+          //改造params,保存护理开单项类型的
+          let paramsCopy = JSON.parse(JSON.stringify(params));
+          //先遍历子集klRuleInfoSaveSub
+          paramsCopy.klRuleInfoSaveGroup = [];
+          let obj = {
+            groupType: 0,
+            klRuleInfoSaveSub: [],
+          };
+          this.$set(obj, "ruleStatic", []);
+          if (
+            params.klRuleInfoSaveSub &&
+            Array.isArray(params.klRuleInfoSaveSub)
+          ) {
+            if (params.klRuleInfoSaveSub.length > 0) {
+              params.klRuleInfoSaveSub.forEach((item) => {
+                obj.groupType = item.groupType;
+                obj.klRuleInfoSaveSub = [item];
+                let objCopy = JSON.parse(JSON.stringify(obj));
+                //可以处理objCopy,将groupType相同的放入klRuleInfoSaveSub里面
+                paramsCopy.klRuleInfoSaveGroup.push(objCopy);
+              });
+            } else {
+              paramsCopy.klRuleInfoSaveGroup.push(obj);
+            }
+          } else {
+            paramsCopy.klRuleInfoSaveGroup.push(obj);
+          }
+          if (
+            paramsCopy.klRuleInfoSaveSub &&
+            Array.isArray(paramsCopy.klRuleInfoSaveSub)
+          ) {
+            //护理非开单项的关联静态知识的处理
+            paramsCopy.klRuleInfoSaveSub.forEach((item, ind) => {
+              let ruleObj = {};
+              if (Array.isArray(item.ruleStatic)) {
+                item.ruleStatic.forEach((items, index) => {
+                  ruleObj.conceptId = items;
+                  ruleObj.orderNo = index;
+                  let ruleObjCopy = JSON.parse(JSON.stringify(ruleObj));
+                  //将关联静态知识的对象放入数组内
+                  paramsCopy.klRuleInfoSaveGroup[ind].ruleStatic.push(
+                    ruleObjCopy
+                  );
+                });
+              }
+            });
+            //删除第二层的klRuleInfoSaveSub
+            delete paramsCopy.klRuleInfoSaveSub;
+            //清除子集的关联静态知识
+            paramsCopy.klRuleInfoSaveGroup.forEach((item, index) => {
+              if (index + 1 >= paramsCopy.klRuleInfoSaveGroup.length) return;
+              if (
+                item.groupType ==
+                paramsCopy.klRuleInfoSaveGroup[index + 1].groupType
+              ) {
+                paramsCopy.klRuleInfoSaveGroup[index + 1].ruleStatic = [];
+              }
+            });
+          }
+          //判断护理开单是否附加信息和关联静态信息是否都没存在值
+          let flagRule = false;
+          //附加信息
+          if (this.staicData.fjxx) {
+            paramsCopy.klRuleInfoSaveGroup[0].groupType = "1";
+            paramsCopy.parMsg = this.staicData.fjxx;
+            flagRule = true;
+          } else {
+            paramsCopy.parMsg = "";
+          }
+          //关联静态知识
+          if (this.staicData.gljtxx.length > 0) {
+            paramsCopy.klRuleInfoSaveGroup[0].groupType = "1";
+            let rule = {};
+            this.staicData.gljtxx.forEach((item, index) => {
+              rule.conceptId = item;
+              rule.orderNo = index;
+              let ruleCopy = JSON.parse(JSON.stringify(rule));
+              paramsCopy.klRuleInfoSaveGroup[0].ruleStatic.push(ruleCopy);
+            });
+            flagRule = true;
+          }
+          //如果是护理项并且静态知识和附加信息都没有值
+          if (this.contentRuls && !flagRule) {
+            this.isErr = true;
+            return;
+          }
+          //如果护理非开单项关联静态知识和附加信息都没有值
+          if (this.isStatic) {
+            if (Array.isArray(paramsCopy.klRuleInfoSaveGroup)) {
+              paramsCopy.klRuleInfoSaveGroup.forEach((item) => {
+                if (Array.isArray(item.klRuleInfoSaveSub)) {
+                  item.klRuleInfoSaveSub.forEach((items) => {
+                    if (items.ruleStatic && Array.isArray(items.ruleStatic)) {
+                      if (items.ruleStatic.length > 0 || items.subMsg) {
+                        this.isRedMsg.push(false);
+                      } else {
+                        this.isRedMsg.push(true);
+                      }
+                    } else {
+                      this.isRedMsg.push(false);
+                    }
+                  });
+                }
+              });
+            }
+          }
+          //判断护理非开单项里面的附加信息和关联静态知识是否填写
+          if (this.isStatic && this.isRedMsg.length > 0) {
+            let flag = this.isRedMsg.some((item) => {
+              return item;
+            });
+            //都填写了
+            if (!flag) this.saveRule(paramsCopy);
+          } else {
+            this.saveRule(paramsCopy);
+          }
         } else {
           return false;
         }
@@ -545,6 +799,14 @@ export default {
     },
     // table_form 规则类型选中
     ruleTypeChange(val) {
+      //先初始化
+      this.contentRuls = false;
+      this.isStatic = false;
+      this.isRedMsg = [];
+      //是否护理非开单项
+      if (val === 8) {
+        this.isStatic = true;
+      }
       this.form.parLenCode = "";
       const obj = this.ruleTypeList.find((it) => it.id === val);
       this.ruleTermTypeList = obj.subMenuList;
@@ -553,11 +815,24 @@ export default {
     },
     // table_form 规则术语类型选中
     ruleTermChange(val) {
+      this.contentRuls = false;
+      this.isRedMsg = [];
       const obj = this.ruleTermTypeList.find((it) => it.code === val);
       this.form.parLenName = obj.name;
       this.baseTypeList = obj.subMenuList;
       this.subRuleMaxNum = obj.number;
       this.form.parHasSub = obj.subMenuList.length ? 1 : 0;
+      if (!this.form.parHasSub) {
+        this.contentRuls = true;
+      }
+      //初始化护理开单项的输入框
+      if (this.contentRuls) {
+        this.$nextTick(() => {
+          this.isEdit = false;
+          this.$refs.ruleContent.clearFormData();
+        });
+      }
+
       this.isShow = obj.subMenuList.length ? 1 : 0;
       this.setInitGroupData();
     },
@@ -623,10 +898,40 @@ export default {
               }
             } else {
               this.$set(item, "disabled", true);
+              // //因为字典传的时候第三个值没有护理所以重新赋值为9,因为这里后端逻辑问题先注释后面可能有用
+              // this.baseTypeList.forEach((item)=>{
+              //  if(item.type==9){
+              //   types[2]='9'
+              //  }
+              // })
               this.$set(item, "subType", parseInt(types[2]));
               const subobj = this.baseTypeList.find(
                 (it) => it.type == types[2]
               );
+              if (
+                this.form.parLenCode == "108" &&
+                this.form.parRuleType == "8"
+              ) {
+                subobj.subMenuList.push({
+                  code: "108",
+                  creator: "0",
+                  firstPlace: null,
+                  gmtCreate: "1970-01-01 12:00:00",
+                  gmtModified: "1970-01-01 12:00:00",
+                  id: 27106,
+                  isDeleted: "N",
+                  modifier: "0",
+                  name: "实验室检查子项目",
+                  number: null,
+                  orderNo: 1,
+                  parentId: 27103,
+                  planCode: "rule",
+                  remark: "",
+                  ruleType: 8,
+                  subMenuList: [],
+                  type: null,
+                });
+              }
               this.$set(item, "baseTermTypeList", subobj.subMenuList);
               this.$set(item, "subLenCode", types[1]);
               this.$set(item, "subDescription", this.firstPlace.conceptName);
@@ -636,6 +941,9 @@ export default {
             }
           });
           this.$set(this.form, "klRuleByIdSub", obj);
+          if (this.form.parLenCode == "104" && this.form.parRuleType == "8") {
+            this.form.klRuleByIdSub[0].dataType = "1";
+          }
         }
       });
     },
@@ -718,7 +1026,6 @@ export default {
           const list = obj.subMenuList.filter((it) => {
             return it.code == val && it.remark.split("|")[0] == 3;
           });
-          console.log(obj.subMenuList);
           const dragArr = list[0].remark.split("|")[1].split(",");
           this.dragArr = dragArr;
           arr[1].dragArr = arr[2].dragArr = dragArr;
@@ -737,23 +1044,6 @@ export default {
             }
           });
         }
-        // const klRuleByIdSub = this.form.klRuleByIdSub;
-        // klRuleByIdSub.forEach((item, i) => {
-        //   arr.forEach((it) => {
-        //     if (item.groupId == it.groupId) {
-        //       if (key == 0) {
-        //         this.$set(item, "baseTypes", this.baseTypeList);
-        //       } else {
-        //          const arrList = this.baseTypeList.filter((it) => {
-        //           return it.type == 1;
-        //         });
-        //         if (i > 0) {
-        //           this.$set(item, "baseTypes", arrList);
-        //         }
-        //       }
-        //     }
-        //   });
-        // });
       }
       //危急值实验室子项目已选医学标准术语判断
       if (this.form.parHasSub && this.firstPlace) {
@@ -771,6 +1061,11 @@ export default {
             return !types[3].includes(item.code);
           });
         }
+        if (this.form.parLenCode == "108" && this.form.parRuleType == "8") {
+          const subobj = this.baseTypeList.find((it) => it.type == "2");
+          subobj.subMenuList.splice(1, 1);
+          this.$set(obj, "baseTermTypeList", subobj.subMenuList);
+        }
       }
       this.$set(
         this.form.klRuleByIdSub[index],
@@ -802,13 +1097,19 @@ export default {
       // this.form.klRuleByIdSub = data;
     },
     // 添加分组 || 规则
-    addGroup(date, key, arg = { index: null, groupId: null }) {
+    addGroup(date, key, arg = { index: null, groupId: null }, index) {
       /**
        * @params
        *    date:存在则添加规则 不存在则添加分组
        *    arg:{index:添加规则用索引,groupId:添加分组用确切id}
        */
       !date && (date = new Date().valueOf());
+      let dataType = "";
+      if (this.form.parLenCode == "104" && this.form.parRuleType == "8") {
+        dataType = "1";
+      } else {
+        dataType = "";
+      }
       const obj = {
         groupId: date,
         groupChildId: "child" + new Date().valueOf(),
@@ -827,9 +1128,35 @@ export default {
         subMinValue: "",
         subEqValue: "",
         subLenCode: "",
-        dataType: "",
+        dataType: dataType,
       };
-
+      if (
+        this.form.parLenCode == "108" &&
+        this.form.parRuleType == "8" &&
+        index == "1"
+      ) {
+        const subobj = this.baseTypeList.find((it) => it.type == "2");
+        subobj.subMenuList.push({
+          code: "108",
+          creator: "0",
+          firstPlace: null,
+          gmtCreate: "1970-01-01 12:00:00",
+          gmtModified: "1970-01-01 12:00:00",
+          id: 27106,
+          isDeleted: "N",
+          modifier: "0",
+          name: "实验室检查子项目",
+          number: null,
+          orderNo: 1,
+          parentId: 27103,
+          planCode: "rule",
+          remark: "",
+          ruleType: 8,
+          subMenuList: [],
+          type: null,
+        });
+        this.$set(obj, "baseTermTypeList", subobj.subMenuList);
+      }
       if (typeof arg.index == "number") {
         // 添加规则 直接在当前位置之后添加
         this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
@@ -883,6 +1210,12 @@ export default {
               .match(new RegExp(this.firstPlace.checkedType + "-\\d+", "g")) ||
             [];
           const types = dict[0].split("-");
+          // //因为字典传的时候第三个值没有护理所以重新赋值为9,因为这里后端逻辑问题先注释后面可能有用
+          // this.baseTypeList.forEach((item)=>{
+          // 	if(item.type==9){
+          // 		types[2]='9'
+          // 	}
+          // })
           this.$set(obj, "disabled", true);
           this.$set(obj, "subType", parseInt(types[2]));
           const subobj = this.baseTypeList.find((it) => it.type == types[2]);
@@ -1204,18 +1537,21 @@ export default {
     },
   },
   watch: {
-    "form.klRuleByIdSub": {
+    form: {
       handler(val) {
-        this.form.klRuleByIdSub.forEach((item, i, arr) => {
-          if (i == 0) {
-            item.rowIndex = 1;
-          } else if (item.groupId == arr[i - 1].groupId) {
-            item.rowIndex = arr[i - 1].rowIndex;
-          } else {
-            item.rowIndex = arr[i - 1].rowIndex + 1;
-          }
-        });
+        if (val.klRuleByIdSub) {
+          this.form.klRuleByIdSub.forEach((item, i, arr) => {
+            if (i == 0) {
+              item.rowIndex = 1;
+            } else if (item.groupId == arr[i - 1].groupId) {
+              item.rowIndex = arr[i - 1].rowIndex;
+            } else {
+              item.rowIndex = arr[i - 1].rowIndex + 1;
+            }
+          });
+        }
       },
+      immediate: true,
       deep: true,
     },
   },
@@ -1258,8 +1594,6 @@ export default {
       );
     },
     showHasSub() {
-      console.log(this.ruleTermCodeStrs);
-      console.log(this.subDict);
       if (this.ruleTermCodeStrs.length > 2) {
         console.log(this.subDict.indexOf(this.ruleTermCodeStrs) != -1);
         return this.subDict.indexOf(this.ruleTermCodeStrs) != -1;
@@ -1270,6 +1604,6 @@ export default {
       return this.dict.indexOf(this.ruleTermCodeStrs) > -1;
     },
   },
-  components: { AddNewRuleTable },
+  components: { AddNewRuleTable, AddNewRuleContent },
 };
 </script>

+ 134 - 7
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -1,3 +1,4 @@
+
 <style lang="less" scoped>
 #AddNewRuleTable {
   width: 100%;
@@ -5,11 +6,45 @@
   margin-top: 10px;
   padding: 20px;
   box-sizing: border-box;
+  .c_red{
+	  color: red;
+	  font-size: 12px;
+	  margin-bottom: 10px;
+  }
+  .inp_gl{
+  	  /deep/.el-select__tags-text {
+  	      overflow: hidden;
+  	      text-overflow: ellipsis;
+  	      max-width: 82px !important;
+  	  }
+  }
+  .searchStatic{
+	  /deep/.el-select__tags{
+		   max-width: 210px !important;
+		}
+	  /deep/.el-select__tags-text {
+	      overflow: hidden;
+	      text-overflow: ellipsis;
+	      max-width: 90px;
+	  }
+  }
   /deep/ .el-table .el-input--mini .el-input__inner,
   .el-select {
     width: 100%;
     font-size: 12px;
   }
+  .el-form-item.is-success{
+	  .redMsg{
+	  	  /deep/.el-textarea__inner{
+	  		  border-color:#FF0000 !important;
+	  	  }
+	  }
+  }
+  .redMsg{
+  	  /deep/.el-input__inner{
+  		  border-color:#FF0000 !important;
+  	  }
+  }
   .btn_box {
     width: 100%;
     height: 100%;
@@ -123,7 +158,9 @@
 <template>
   <!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
   <div id="AddNewRuleTable">
+	<p v-if='isStaticChild' class="c_red">注:静态信息和附加信息必须填写至少一项!</p>
     <h4 style="margin-bottom: 24px">规则内容:</h4>
+	
     <!-- 隔行换色  :row-style="rowStyle" -->
     <el-table
       border
@@ -169,15 +206,48 @@
             :class="scope.row.subMsg?'form-texarea':''"
             class="texarea-form"
           >
+		 
             <el-input
               type="textarea"
               :autosize="{minRows: 1,maxRows: 2}"
               placeholder="请输入附加信息"
+			  :maxlength='251'
+			  :class="(scope.row.subMsg|| !isRedMsg[scope.$index])?'':'redMsg'"
               v-model.trim="scope.row.subMsg"
+			  @change="subMsgChange(scope.row.subMsg,scope.$index)"
             ></el-input>
           </el-form-item>
         </template>
       </el-table-column>
+	  <el-table-column width="230px" label="关联静态信息" prop="ruleStatic" v-if='isStaticChild'>
+	    <template slot="header" slot-scope="scope">
+	      <div >关联静态信息</div>
+	    </template>
+	    <template slot-scope="scope">
+	     <el-form-item
+	        class="inp_box inp_gl"
+	        :prop="`klRuleByIdSub[${scope.$index}].ruleStatic`"
+			:class="(!isRedMsg[scope.$index])?'':'redMsg'"
+	      >
+	        <el-select
+			  class="searchStatic"
+	          v-model.trim="scope.row.ruleStatic" 
+	          placeholder="请选择" 
+	          multiple 
+	          collapse-tags 
+	          filterable
+	          remote
+	          :multiple-limit="50"
+	          reserve-keyword
+			  @change="ruleStaticChanges(scope.$index)"
+	          :remote-method="(val)=>getStaicTypes(val,scope.row,scope.$index)"
+			  @visible-change="(val)=>changeValue1(val,scope.row,scope.$index)"
+	          >
+	        	<el-option v-for="item in scope.row.ruleStaticList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+	        </el-select>
+	      </el-form-item>
+	    </template>
+	  </el-table-column>
       <el-table-column width="80px" v-if="maxNum && maxNum > 1" label="基础规则" prop="groupType">
         <template slot-scope="scope">
           <div class="btn_box">
@@ -275,9 +345,9 @@
           </el-form-item>
         </template>
       </el-table-column>
-      <el-table-column width="170px" label="医学标准术语" prop="subConceptId">
+      <el-table-column width="170px" label="基础医学标准术语" prop="subConceptId">
         <template slot="header" slot-scope="scope">
-          <div class="custom_table_header">医学标准术语</div>
+          <div class="custom_table_header">基础医学标准术语</div>
         </template>
         <template slot-scope="scope">
           <el-form-item
@@ -480,7 +550,7 @@
               </el-row>
             </el-form-item>
             <!-- v-if="klRuleByIdSub[scope.$index].subType !== 6 && klRuleByIdSub[scope.$index].dataType === '2'" -->
-            <div style="flex: 2" v-if="scope.row.subType != 6 && scope.row.dataType == '2'">
+            <div style="flex: 2" v-if="scope.row.subType != 6 && scope.row.dataType == '2'&& scope.row.subType != 9">
               <el-form-item
                 class="type_content_item"
                 style="width: 100%"
@@ -512,7 +582,7 @@
             </div>
 
             <!-- v-if="groupData.subType === 6" -->
-            <div style="flex: 2" v-if="scope.row.subType == 6">
+            <div style="flex: 2" v-if="scope.row.subType == 6|| scope.row.subType == 9">
               <el-form-item
                 class="type_content_item"
                 label="正则表达式:"
@@ -563,9 +633,49 @@ export default {
       rules: tableRules,
       theRef: null,
       code: "",
+	  isRedMsg:[], //附加信息和关联静态知识显示红色边框的判断值,替代品,修改是不能直接修改prop的值
     };
   },
   methods: {
+	  //护理非开单项时附加信息和关联静态知识输入值时取消红色边框
+	subMsgChange(value,index){
+		if(this.isRedMsgs[index]&&value){
+			this.$set(this.isRedMsg,index,false)
+		}
+	}, 
+	//护理非开单项时附加信息和关联静态知识输入值时取消红色边框
+	ruleStaticChanges(index){
+		if(this.isRedMsgs[index]){
+			this.isRedMsg[index]=false
+		}
+	}, 
+	getStaicTypes(val,row,ind){
+		let param={
+			inputStr: val,
+			types: [9]  
+		}
+		if (val == '') {
+		  return;
+		}
+		if (val){
+			api.getStaicTypes(param).then((res) => {
+			  if (res.data.code == 0) {
+				  this.$set(row,'ruleStaticList',res.data.data)
+				  this.$forceUpdate()
+			  } else {
+			    this.$message({
+			      message: res.data.msg,
+			      type: "warning",
+			    });
+			  }
+			});
+		}
+	},
+	changeValue1(val,row,ind){
+		if(row.ruleStatic.length==0){
+			 this.$set(row,'ruleStaticList',[])
+		}
+	},
     setScrollRight() {
       this.$nextTick(() => {
         this.$refs.table.bodyWrapper.scrollLeft = this.$refs.table.bodyWrapper.scrollWidth;
@@ -616,11 +726,11 @@ export default {
       this.setScrollRight();
     },
     addGroup(scope) {
-      this.$emit("addGroup", null,scope.row.key, { groupId: scope.row.groupId });
+      this.$emit("addGroup", null,scope.row.key, { groupId: scope.row.groupId },1);
       this.$refs.table.bodyWrapper.scrollLeft = 0;
     },
     addChildGroup(scope) {
-      this.$emit("addGroup", scope.row.groupId,scope.row.key, { index: scope.$index });
+      this.$emit("addGroup", scope.row.groupId,scope.row.key, { index: scope.$index },2);
       this.$refs.table.bodyWrapper.scrollLeft = 0;
     },
     scrollFun() {
@@ -639,6 +749,7 @@ export default {
     cellStyle({ row, column, rowIndex, columnIndex }) {
       if (column.label == "组" || column.label == "基础规则") return {};
       if (column.label == "附加信息") return { "padding-top": "14px" };
+	  if (column.label == "关联静态信息") return { "padding-top": "0px" };
       return { "vertical-align": "top", "padding-top": "14px" };
     },
     // 最大值 选择rule
@@ -812,7 +923,7 @@ export default {
           };
         }
       } else {
-        if (columnIndex == 0 || columnIndex == 1) {
+        if (columnIndex == 0 || columnIndex == 1 || column.label==='关联静态信息') {
           const _row = this.spanArr[rowIndex];
           const _col = _row > 0 ? 1 : 0;
           return {
@@ -846,6 +957,7 @@ export default {
   },
   components: {},
   mounted() {
+	  this.isRedMsg=this.isRedMsgs;
     // this.theRef
     // console.log('mounted');
     // let that = this;
@@ -855,6 +967,13 @@ export default {
     //   false
     // );
   },
+  watch:{
+	isRedMsgs:{
+		handler(val){
+			this.isRedMsg=val;
+		}
+	}  
+  },
   created() {
     this.numTypes = localStorage.getItem("zskNumDict");
     this.getSpanArr(this.klRuleByIdSub);
@@ -898,6 +1017,14 @@ export default {
     ruleTermCodeStr: {
       default: null,
     },
+	isStaticChild:{
+		type:Boolean,
+		default: false,
+	},
+	isRedMsgs:{
+		type:Array,
+		default: ()=>[],
+	},
   },
 };
 </script>

+ 18 - 2
src/components/testManager/staticKnowledgeMap/StaticKnowledgeMapTest.vue

@@ -135,6 +135,7 @@ export default {
     },
   },
   created() {
+    this.reminder();
     this._getHospitalInfoCDSS();
     this.timer = setInterval(this._getRunningStatus, 20 * 1000);
     this.timer = setInterval(this.getRunningState, 20 * 1000);
@@ -151,6 +152,21 @@ export default {
     });
   },
   methods: {
+    reminder() {
+      api
+        .reminder({caseGroup:2})
+        .then((res) => {
+          if (res.data.code == "0") {
+            this.$message({
+              message: res.data.data,
+              type: "error",
+            });
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
     getRunningState() {
       api
         .getRunningState({ caseGroup: 2 })
@@ -241,11 +257,11 @@ export default {
 
     // 导入数据
     uploadFile(e) {
-      console.log(this.runningStatusArr,222);
+      console.log(this.runningStatusArr, 222);
       if (this.statusIndex !== "") {
         this.runningStatusArr = this.runningStatusArr.map((item, idx) => {
           console.log(idx);
-          console.log(this.statusIndex,112);
+          console.log(this.statusIndex, 112);
           if (idx === this.statusIndex) {
             return 1;
           } else {