|
@@ -115,7 +115,8 @@
|
|
|
return {
|
|
|
isPlanSet: false, //自查督查负责人操作计划设置
|
|
|
saveType: 'POST',
|
|
|
- editID: '',
|
|
|
+ editID: '',
|
|
|
+ errMsg:'',
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -300,7 +301,8 @@
|
|
|
situationId,
|
|
|
themeName, //情境名
|
|
|
systemSituationType, //系统情境类型 0 个案 1 普通 2自查督查
|
|
|
- }) {
|
|
|
+ }) {
|
|
|
+ this.errMsg='';
|
|
|
this.dispatch('getDictionary').then(res => {
|
|
|
//获取后处理pointset类型
|
|
|
let tmp= res.PointSet.map((item)=>{
|
|
@@ -656,7 +658,7 @@
|
|
|
case 1:
|
|
|
if(this.theme.id == 0){
|
|
|
//创建个案情境
|
|
|
- flage = this.errorHandle(this.condition.conditionIds.length >= this.conditionCard.requireds.length, 1);
|
|
|
+ flage = this.conditionErrHandler(this.checkCondition(this.condition),1);
|
|
|
}else{
|
|
|
flage = this.errorHandle(this.condition.conditionIds.length > 0, 1);
|
|
|
}
|
|
@@ -746,15 +748,7 @@
|
|
|
* @param {Object} index 当前下标
|
|
|
*/
|
|
|
errorHandle: function(conditionflag, index) {
|
|
|
- //add by yfb 20230214 检查子选项选择情况
|
|
|
- if (!this.checkCondition(this.condition)){
|
|
|
- uni.showModal({
|
|
|
- title: '温馨提示',
|
|
|
- content: `请先选择${this.options[1].hint}!`,
|
|
|
- showCancel: false
|
|
|
- });
|
|
|
- return false;
|
|
|
- }
|
|
|
+
|
|
|
if (conditionflag) {
|
|
|
return true;
|
|
|
} else {
|
|
@@ -765,6 +759,19 @@
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
+ },
|
|
|
+ conditionErrHandler:function (flag,index){
|
|
|
+ const results=this.checkCondition(this.condition);
|
|
|
+ //add by yfb 20230214 检查子选项选择情况
|
|
|
+ if (!results.funFlag){
|
|
|
+ uni.showModal({
|
|
|
+ title: '温馨提示',
|
|
|
+ content: `请先选择${this.options[1].hint},`+results.errMsg,
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }else
|
|
|
+ return true;
|
|
|
},
|
|
|
myCommit: function(key, data) {
|
|
|
this.$store.commit({
|
|
@@ -795,18 +802,83 @@
|
|
|
data: show
|
|
|
});
|
|
|
},
|
|
|
- checkCondition:function(condition){
|
|
|
- //console.log('测试',condition);
|
|
|
- // for(var i=0;i<condition.conditionIds.length;i++){
|
|
|
- // // console.log('测试',condition.childContainer[i].list[0].id);
|
|
|
- // let tempdata=condition.options.filter((item) => item. == condition.conditionIds[i]);
|
|
|
- // console.log('选择项测试',tempdata);
|
|
|
- // }
|
|
|
-
|
|
|
- let checklist=condition.options.filter(item=>item.child.length>1);
|
|
|
- //console.log('带监测队列',checklist);
|
|
|
- //checklist.
|
|
|
- return true;
|
|
|
+ checkCondition:function(condition,msg){
|
|
|
+ //console.log('测试',condition);
|
|
|
+
|
|
|
+ let MasterTemp=condition.options.filter(item=>{
|
|
|
+ if (item.required==1){
|
|
|
+ let ichecked=false;
|
|
|
+ //遍历所有子选项,关联主卡片
|
|
|
+ let childCon=condition.childContainer.filter(cc=>{
|
|
|
+ // console.log('childCondition',cc);
|
|
|
+ // console.log('childid',cc.list[0].id);
|
|
|
+ // console.log('item',item.id);
|
|
|
+ //判断主卡片对应子项列表
|
|
|
+ if (item.id==cc.list[0].parentId){
|
|
|
+ let tmp=cc.list[0].child.filter(mi=>{
|
|
|
+ return condition.conditionIds.includes(mi.id);//记录的选项中是否是子项中
|
|
|
+ });
|
|
|
+ //判断子项是否在已选列表内,即已选项中存在当前主卡片选项
|
|
|
+ if (tmp.length>0)
|
|
|
+ {
|
|
|
+ ichecked=true;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //console.log('childCon',childCon);
|
|
|
+ if (childCon.length<=0)
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //判断主卡片
|
|
|
+ if (MasterTemp.length>0){
|
|
|
+ //console.log('123');
|
|
|
+ // this.errMsg=MasterTemp[0].name+'未选择!';
|
|
|
+ // return false;
|
|
|
+ return {
|
|
|
+ errMsg:MasterTemp[0].name+'未选择!',
|
|
|
+ funFlag:false,
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //console.log('test_checkConditionCard',this.condition.CheckConditionCard);
|
|
|
+ //判断子选项,根据存储的卡片信息进行判断,正常情况不过滤,只返回第一个搜索出的未选择项卡片
|
|
|
+ const tmp=this.condition.CheckConditionCard.filter(cards=>{
|
|
|
+ //必填项检查
|
|
|
+ if (cards.required==1){
|
|
|
+ // console.log('cards',cards);
|
|
|
+ //查看该项下选项是否有选项
|
|
|
+ const childlist= cards.child.filter(a=>{
|
|
|
+ // console.log('child',a);
|
|
|
+ return this.condition.conditionIds.includes(a.id);
|
|
|
+ });
|
|
|
+ // console.log('childlist',childlist);
|
|
|
+ //返回未选择选项
|
|
|
+ return childlist.length<=0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //console.log('tmp',tmp);
|
|
|
+ //因为返回未选择项,则未选项列表有数据则返回错误
|
|
|
+ if (tmp.length>0)
|
|
|
+ {
|
|
|
+ // this.errMsg=tmp[0].name+'未选择!';
|
|
|
+ // return false;
|
|
|
+ return {
|
|
|
+ errMsg:'['+tmp[0].name+']未选择!',
|
|
|
+ funFlag:false,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // return true;
|
|
|
+ return {
|
|
|
+ errMsg:'',
|
|
|
+ funFlag:true,
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //return true;
|
|
|
}
|
|
|
},
|
|
|
destroyed() {
|