|
@@ -57,6 +57,17 @@ import {patt} from '@utils/tools.js'
|
|
|
mapping.splice(i,1,data)
|
|
|
}
|
|
|
}
|
|
|
+ // 实时更新清空样式
|
|
|
+ if(data.value){
|
|
|
+ this.$emit('check',true)
|
|
|
+ }else{
|
|
|
+ let flag = this.check();
|
|
|
+ if(flag){
|
|
|
+ this.$emit('check',true)
|
|
|
+ }else{
|
|
|
+ this.$emit('check',false)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
saveData(){//存值
|
|
|
this.finished = true;
|
|
@@ -76,10 +87,11 @@ import {patt} from '@utils/tools.js'
|
|
|
}else{
|
|
|
newMsg = msg
|
|
|
}
|
|
|
-
|
|
|
this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
|
|
|
// flag是区分点开已选症状 未点完成
|
|
|
- this.$store.commit('setText',{text:newMsg.replace(patt,''),pId:this.checkDatas.id,type:this.type,flag:true});
|
|
|
+ // this.$store.commit('setText',{text:newMsg.replace(patt,''),pId:this.checkDatas.id,type:this.type,flag:true});
|
|
|
+ // 输入框的值用占位符#{}标识,便于修改
|
|
|
+ this.$store.commit('setText',{text:newMsg.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),pId:this.checkDatas.id,type:this.type,flag:true});
|
|
|
},
|
|
|
clearData(){//清空
|
|
|
const datas = this.checkDatas.questionMapping;
|
|
@@ -99,6 +111,28 @@ import {patt} from '@utils/tools.js'
|
|
|
let msg = this.checkDatas.name;
|
|
|
this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
|
|
|
this.$store.commit('setText',{text:msg,pId:this.checkDatas.id,type:this.type,flag:true});
|
|
|
+ },
|
|
|
+ check(){// 校验是否有已填项
|
|
|
+ const datas = this.checkDatas.questionMapping;
|
|
|
+ let checkArr = [];
|
|
|
+ for(let i in datas){
|
|
|
+ if(datas[i].value){
|
|
|
+ checkArr.push(datas[i]);
|
|
|
+ }
|
|
|
+ let detaiList = datas[i].questionDetailList;
|
|
|
+ if(detaiList.length>0){
|
|
|
+ for(let k in detaiList){
|
|
|
+ if(detaiList[k].select == 1){
|
|
|
+ checkArr.push(detaiList[k]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(checkArr.length>0){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
},
|
|
|
}
|