|
@@ -251,6 +251,7 @@
|
|
|
:showMsg2="showMsg2"
|
|
|
:ruleTermCodeStr="ruleTermCodeStr"
|
|
|
:isStaticChild='isStatic'
|
|
|
+ :isRedMsgs='isRedMsg'
|
|
|
@subTypeChange="subTypeChange"
|
|
|
@searchConcept="searchConcept"
|
|
|
@addGroup="addGroup"
|
|
@@ -296,6 +297,7 @@ export default {
|
|
|
name: "AddRule",
|
|
|
data() {
|
|
|
return {
|
|
|
+ isRedMsg:[],
|
|
|
isErr:false, //控制护理开单项里面的错误提示
|
|
|
staicData:{ //护理开单项里面的数据
|
|
|
gljtxx:[],
|
|
@@ -359,7 +361,6 @@ export default {
|
|
|
//护理开单项子组件里面的传过来的值
|
|
|
ruleContent(data){
|
|
|
this.staicData=data
|
|
|
- console.log('staicData',this.staicData)
|
|
|
},
|
|
|
clearValidate(data) {
|
|
|
this.$refs.ruleForm.clearValidate(data);
|
|
@@ -369,6 +370,7 @@ export default {
|
|
|
// 规则术语类型初始化
|
|
|
this.contentRuls=false;
|
|
|
this.isEdit=false;
|
|
|
+ this.isRedMsg=[];
|
|
|
const newruleTermTypeList = await this.ruleTypeList.find(
|
|
|
(it) => it.id == this.form.parRuleType
|
|
|
);
|
|
@@ -387,13 +389,35 @@ export default {
|
|
|
];
|
|
|
// 加载护理开单项的推送内容
|
|
|
if(!this.form.klRuleByIdSub){
|
|
|
- console.log(this.form)
|
|
|
this.isEdit=true;
|
|
|
this.contentRuls=true;
|
|
|
this.formEidt=JSON.parse(JSON.stringify(this.form))
|
|
|
return
|
|
|
}
|
|
|
- console.log('form',this.form)
|
|
|
+
|
|
|
+ //加载护理非开单项的关联静态知识
|
|
|
+ if(this.form.parRuleType==8){
|
|
|
+ this.isStatic=true;
|
|
|
+ if(Array.isArray(this.form.klRuleByIdGroup)){
|
|
|
+ let itemCopy={}
|
|
|
+ this.form.klRuleByIdGroup.forEach((item,index)=>{
|
|
|
+ if(Array.isArray(item.klRuleStaticSub)){
|
|
|
+ item.klRuleStaticSub.forEach((items,ind)=>{
|
|
|
+ this.$set(this.form.klRuleByIdSub[index],'ruleStatic',[])
|
|
|
+ this.$set(this.form.klRuleByIdSub[index],'ruleStaticList',[])
|
|
|
+ let obj={
|
|
|
+ id:items.conceptId,
|
|
|
+ name:items.name
|
|
|
+ }
|
|
|
+ itemCopy=JSON.parse(JSON.stringify(obj))
|
|
|
+ this.form.klRuleByIdSub[index].ruleStatic.push(itemCopy.id);
|
|
|
+ this.form.klRuleByIdSub[index].ruleStaticList.push(itemCopy)
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
//加载列表规则内容
|
|
|
if (this.form.parConceptId && this.checkFirstPlace && this.conceptList) {
|
|
|
this.firstPlace = this.conceptList.find(
|
|
@@ -505,7 +529,7 @@ export default {
|
|
|
this.$set(item, "baseTermTypeList", screenArr);
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.form);
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -528,7 +552,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- console.log('infoCopy',infoCopy)
|
|
|
//判断是否存在klRuleByIdSub,没有就是护理开单项直接赋值
|
|
|
if(!info.klRuleByIdGroup[0].klRuleByIdSub){
|
|
|
this.form = JSON.parse(JSON.stringify(info));
|
|
@@ -572,6 +595,7 @@ export default {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.isErr=false;
|
|
|
+ this.isRedMsg=[];
|
|
|
let params = JSON.parse(JSON.stringify(this.form));
|
|
|
if(params.klRuleByIdSub){
|
|
|
params.klRuleInfoSaveSub = params.klRuleByIdSub;
|
|
@@ -596,7 +620,6 @@ export default {
|
|
|
delete ite.baseTermTypeList;
|
|
|
delete ite.conceptList;
|
|
|
});
|
|
|
- console.log(params)
|
|
|
}
|
|
|
if (this.parId) {
|
|
|
params.parId = this.isCopy ? undefined : this.parId;
|
|
@@ -611,22 +634,42 @@ export default {
|
|
|
klRuleInfoSaveSub:[],
|
|
|
}
|
|
|
this.$set(obj,'ruleStatic',[])
|
|
|
+ debugger
|
|
|
if(params.klRuleInfoSaveSub&&Array.isArray(params.klRuleInfoSaveSub)){
|
|
|
- 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)
|
|
|
- })
|
|
|
+ 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)
|
|
|
}
|
|
|
-
|
|
|
- //删除第二层的klRuleInfoSaveSub
|
|
|
- if(paramsCopy.klRuleInfoSaveSub){
|
|
|
+ debugger
|
|
|
+ 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
|
|
|
}
|
|
|
+ debugger
|
|
|
//判断护理开单是否附加信息和关联静态信息是否都没存在值
|
|
|
let flagRule=false;
|
|
|
//附加信息
|
|
@@ -654,7 +697,27 @@ export default {
|
|
|
this.isErr=true
|
|
|
return;
|
|
|
}
|
|
|
- this.saveRule(paramsCopy);
|
|
|
+ debugger
|
|
|
+ //如果护理非开单项关联静态知识和附加信息都没有值
|
|
|
+ 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)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.saveRule(paramsCopy);
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
@@ -669,6 +732,7 @@ export default {
|
|
|
//先初始化
|
|
|
this.contentRuls=false;
|
|
|
this.isStatic=false;
|
|
|
+ this.isRedMsg=[]
|
|
|
//是否护理非开单项
|
|
|
if(val===8){
|
|
|
this.isStatic=true
|
|
@@ -682,6 +746,7 @@ 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;
|
|
@@ -764,13 +829,12 @@ 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]
|
|
@@ -785,7 +849,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.$set(this.form, "klRuleByIdSub", obj);
|
|
|
- console.log(this.form)
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -868,7 +931,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;
|
|
@@ -962,7 +1024,6 @@ export default {
|
|
|
subLenCode: "",
|
|
|
dataType: "",
|
|
|
};
|
|
|
-
|
|
|
if (typeof arg.index == "number") {
|
|
|
// 添加规则 直接在当前位置之后添加
|
|
|
this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
|
|
@@ -1006,6 +1067,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+
|
|
|
// 添加分组 在列表中相同groupId之后添加
|
|
|
// 添加分组时判断是否需要加disabled和添加默认值
|
|
|
if (this.form.parHasSub && this.firstPlace) {
|
|
@@ -1016,6 +1078,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]);
|
|
@@ -1394,8 +1462,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;
|