Explorar o código

一个模板只能一个上传图片1928

zhouna %!s(int64=6) %!d(string=hai) anos
pai
achega
4f2a164a3c
Modificáronse 1 ficheiros con 19 adicións e 2 borrados
  1. 19 2
      src/components/preTreat/QuestionTagGroup.vue

+ 19 - 2
src/components/preTreat/QuestionTagGroup.vue

@@ -235,7 +235,24 @@ export default {
             this.searchTagList();
             this.$emit('changeActionData',this.rightTagsList, false);
         },
+        toMuchImgs(list){
+          const arr = list.filter((it)=>{
+            return it.tagType==1&&it.controlType ==4;
+          });
+          if(arr.length>1){
+            return true;
+          }
+          return false;
+        },
         toRightList() {
+            if(this.toMuchImgs([...this.rightTagsList,...this.selectLeftTagsList])){
+              this.$message({
+                showClose: true,
+                message: '一个模板最多只能添加一个上传图片类型填写单',
+                type: 'warning'
+              });
+              return ;
+            }
             this.rightTagsList.push(...this.selectLeftTagsList);
 
             for (let i = 0; i < this.rightTagsList.length; i++) {
@@ -259,7 +276,7 @@ export default {
                 "tagName": this.searchVal,
                 "type": this.ascription,
                 "notIds": notIds,
-                "notControlType":['4'],             //图片上传不能添加
+                "notControlType":this.qaType==2||this.ascription!='51'?['4']:[],             //组合填写单或非诊疗情况模版不能添加图片上传
                 "sexType": this.sexType,
                 "tagType":+this.qaType===2?maps[this.type]:['1','6']       //qaType=2:组合填写单,qaType=3模板
             };
@@ -267,7 +284,7 @@ export default {
                 if (res.data.code === '0') {
                     this.leftTagsList = res.data.data;
                     this.selectLeftTagsList = [];
-                    this.selectRightTagsList = [];console.log(this.rightTagsList)
+                    this.selectRightTagsList = [];
                 }
             })