浏览代码

Merge branch 'bug0818' into test

# Conflicts:
#	src/components/knowledgeExtra/AddNewRule.vue
1178232204@qq.com 2 年之前
父节点
当前提交
14ec9eecbd

+ 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 })

+ 427 - 351
src/components/knowledgeExtra/AddNewRule.vue

@@ -242,38 +242,28 @@
           </div>-->
         </div>
         <!-- 表格 -->
-        <AddNewRuleTable
-          ref="tableView"
-          v-if="form.parHasSub && tableShow"
-          :klRuleByIdSub="form.klRuleByIdSub"
-          :maxNum="subRuleMaxNum"
-          :showMsg="showMsg"
-          :showMsg2="showMsg2"
-          :ruleTermCodeStr="ruleTermCodeStr"
-		  :isStaticChild='isStatic'
-		  :isRedMsgs='isRedMsg'
-          @subTypeChange="subTypeChange"
-          @searchConcept="searchConcept"
-          @addGroup="addGroup"
-          @delGroup="delGroup"
-          @delGroupChild="delGroupChild"
-          @setFormData="setFormData"
-          @editKlRuleByIdSub="editKlRuleByIdSub"
-          @clearValidate="clearValidate"
-          @childClearConcept="childClearConcept"
-          @childClearNumText="childClearNumText"
-          @ChildDataTypeChange="ChildDataTypeChange"
-          @childSubCodeChange="childSubCodeChange"
-        />
-		<AddNewRuleContent 
-			ref='ruleContent'
-			v-if="(!form.parHasSub && !tableShow) || contentRuls" 
-			@ruleContent='ruleContent'
-		    :isContent="isEdit"
-			:formEidtCopy='formEidt'
-			:isError='isErr'
-		>	
-		</AddNewRuleContent>
+        <AddNewRuleTable ref="tableView" v-if="form.parHasSub && tableShow"
+        :klRuleByIdSub="form.klRuleByIdSub" :maxNum="subRuleMaxNum"
+        :showMsg="showMsg" :showMsg2="showMsg2"
+        :ruleTermCodeStr="ruleTermCodeStr" <<<<<<< HEAD
+        :isStaticChild='isStatic' :isRedMsgs='isRedMsg' =======
+        :isStaticChild="isStatic" :isRedMsgs="isRedMsg" >>>>>>> bug0818
+        @subTypeChange="subTypeChange" @searchConcept="searchConcept"
+        @addGroup="addGroup" @delGroup="delGroup" @delGroupChild="delGroupChild"
+        @setFormData="setFormData" @editKlRuleByIdSub="editKlRuleByIdSub"
+        @clearValidate="clearValidate" @childClearConcept="childClearConcept"
+        @childClearNumText="childClearNumText"
+        @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
@@ -297,16 +287,17 @@ export default {
   name: "AddRule",
   data() {
     return {
-	  isRedMsg:[],
-	  isErr:false, //控制护理开单项里面的错误提示
-	  staicData:{    //护理开单项里面的数据
-		  gljtxx:[],
-		  fjxx:''
-	  },
-	  formEidt:{},
-	  isEdit:false, //判断是否是编辑页面
-	  isStatic:false,  //判断关联静态知识的tabel列是否显示
-	  contentRuls:false, //判断规则内容为列表还是表单
+      isRedMsg: [],
+      isErr: false, //控制护理开单项里面的错误提示
+      staicData: {
+        //护理开单项里面的数据
+        gljtxx: [],
+        fjxx: "",
+      },
+      formEidt: {},
+      isEdit: false, //判断是否是编辑页面
+      isStatic: false, //判断关联静态知识的tabel列是否显示
+      contentRuls: false, //判断规则内容为列表还是表单
       title: "规则维护-添加规则",
       ruleTypeList: [], //规则类型列表  1
       ruleTermTypeList: [], //规则术语类型列表  2
@@ -338,8 +329,6 @@ export default {
   created() {
     this.getTypeList();
     this.setDict();
-	
-	
     const param = this.$route.params;
     let info = param.data;
     if (info) {
@@ -352,25 +341,22 @@ export default {
       this.initEdidData();
     }
   },
-  mounted() {
-	
-  },
-  watch:{
-  },
+  mounted() {},
+  watch: {},
   methods: {
-	//护理开单项子组件里面的传过来的值 
-	ruleContent(data){
-		this.staicData=data
-	},
+    //护理开单项子组件里面的传过来的值
+    ruleContent(data) {
+      this.staicData = data;
+    },
     clearValidate(data) {
       this.$refs.ruleForm.clearValidate(data);
     },
     // 编辑初始化
     async initEdidData() {
       // 规则术语类型初始化
-	  this.contentRuls=false;
-	  this.isEdit=false;
-	  this.isRedMsg=[];
+      this.contentRuls = false;
+      this.isEdit = false;
+      this.isRedMsg = [];
       const newruleTermTypeList = await this.ruleTypeList.find(
         (it) => it.id == this.form.parRuleType
       );
@@ -387,58 +373,59 @@ export default {
           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.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
@@ -497,6 +484,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 =
@@ -549,58 +560,59 @@ export default {
               this.$set(item, "baseTermTypeList", screenArr);
             }
           }
-		  
         }
       });
     },
     //药品数据处理
     getDragData(info) {
       let dataArr = [];
-	  //处理修改接口请求的数据
-		//先将数据深拷贝,避免数据污染
-	  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);  
-	  }
-      
+      //处理修改接口请求的数据
+      //先将数据深拷贝,避免数据污染
+      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);
+      }
     },
     getDragData2(info, dataArr) {
       let arr = [];
@@ -618,145 +630,156 @@ export default {
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
-			this.isErr=false;
-			this.isRedMsg=[];
+          this.isErr = false;
+          this.isRedMsg = [];
           let params = JSON.parse(JSON.stringify(this.form));
-		 if(params.klRuleByIdSub){
-			 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;
-			     } 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;
-			 });
-		 }
-		 if (this.parId) {
-		   params.parId = this.isCopy ? undefined : this.parId;
-		   params.parStatus = this.isCopy ? 1 : this.form.parStatus;
-		 }
-		  //改造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;
-		}   
+          if (params.klRuleByIdSub) {
+            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;
+                } 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;
+            });
+          }
+          if (this.parId) {
+            params.parId = this.isCopy ? undefined : this.parId;
+            params.parStatus = this.isCopy ? 1 : this.form.parStatus;
+          }
+          //改造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;
+        }
       });
     },
     // 子集修改父级的数组
@@ -765,14 +788,14 @@ export default {
     },
     // table_form 规则类型选中
     ruleTypeChange(val) {
-	  //先初始化
-	  this.contentRuls=false;
-	  this.isStatic=false;
-	  this.isRedMsg=[]
-	  //是否护理非开单项
-	  if(val===8){
-		  this.isStatic=true
-	  }
+      //先初始化
+      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;
@@ -781,24 +804,24 @@ export default {
     },
     // table_form 规则术语类型选中
     ruleTermChange(val) {
-	  this.contentRuls=false;
-	  this.isRedMsg=[]
+      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()
-		  })	 
-	  }
-	  
+      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();
     },
@@ -864,17 +887,40 @@ export default {
               }
             } else {
               this.$set(item, "disabled", true);
-			  // //因为字典传的时候第三个值没有护理所以重新赋值为9,因为这里后端逻辑问题先注释后面可能有用
-			  // this.baseTypeList.forEach((item)=>{
-				 //  if(item.type==9){
-					//   types[2]='9'
-				 //  }
-			  // })
+              // //因为字典传的时候第三个值没有护理所以重新赋值为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);
@@ -884,10 +930,9 @@ export default {
             }
           });
           this.$set(this.form, "klRuleByIdSub", obj);
-		  if( this.form.parLenCode=='104'&&this.form.parRuleType=='8'){
-		  	   this.form.klRuleByIdSub[0].dataType='1'; 
-		  }
-			
+          if (this.form.parLenCode == "104" && this.form.parRuleType == "8") {
+            this.form.klRuleByIdSub[0].dataType = "1";
+          }
         }
       });
     },
@@ -1005,6 +1050,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],
@@ -1036,19 +1086,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=''
-	  }
+      let dataType = "";
+      if (this.form.parLenCode == "104" && this.form.parRuleType == "8") {
+        dataType = "1";
+      } else {
+        dataType = "";
+      }
       const obj = {
         groupId: date,
         groupChildId: "child" + new Date().valueOf(),
@@ -1069,6 +1119,33 @@ export default {
         subLenCode: "",
         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);
@@ -1112,7 +1189,6 @@ export default {
           }
         }
       } else {
-		 
         // 添加分组 在列表中相同groupId之后添加
         // 添加分组时判断是否需要加disabled和添加默认值
         if (this.form.parHasSub && this.firstPlace) {
@@ -1123,12 +1199,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'	  					  
-		  // 	}			  
-		  // })
+          // //因为字典传的时候第三个值没有护理所以重新赋值为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]);
@@ -1452,19 +1528,19 @@ export default {
   watch: {
     form: {
       handler(val) {
-		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;
-			  }
-			});		  
-		}  
+        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,
+      immediate: true,
       deep: true,
     },
   },
@@ -1517,6 +1593,6 @@ export default {
       return this.dict.indexOf(this.ruleTermCodeStrs) > -1;
     },
   },
-  components: { AddNewRuleTable,AddNewRuleContent },
+  components: { AddNewRuleTable, AddNewRuleContent },
 };
 </script>

+ 2 - 2
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -726,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() {

+ 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 {