Quellcode durchsuchen

渠道客诉填写任务增加上传照片功能

zhujindu vor 11 Monaten
Ursprung
Commit
d856ae4361
1 geänderte Dateien mit 25 neuen und 19 gelöschten Zeilen
  1. 25 19
      src/views/clew/complaintDetail/index.vue

+ 25 - 19
src/views/clew/complaintDetail/index.vue

@@ -391,27 +391,33 @@ export default {
     isRequiredFlag(optionList) {
       // console.log(optionList);
       for (let i = 0; i < optionList.length; i++) {
-        if (
-          (optionList[i].answerType == 'wb' ||
-            optionList[i].answerType == 'sz' ||
-            optionList[i].answerType == 'zp') &&
-          optionList[i].isMust == 0
-        ) {
-          if (!optionList[i].answerValue) {
-            // 必填类型
-            this.requiredFlag = false;
-            this.requiredMessage = optionList[i].remark;
-            return;
-          } else {
-            // 条件校验
-            if (optionList[i].minTextLength) {
-              // 输入内容长度校验
-              if (optionList[i].answerValue.length < optionList[i].minTextLength) {
-                this.requiredFlag = false;
-                this.requiredMessage = optionList[i].remark;
-                return;
+        // 是否必填
+        if (optionList[i].isMust == 0) {
+          // 输入框
+          if (optionList[i].answerType == 'wb' || optionList[i].answerType == 'sz') {
+            if (!optionList[i].answerValue) {
+              // 必填类型
+              this.requiredFlag = false;
+              this.requiredMessage = optionList[i].remark;
+              return;
+            } else {
+              // 条件校验
+              if (optionList[i].minTextLength) {
+                // 输入内容长度校验
+                if (optionList[i].answerValue.length < optionList[i].minTextLength) {
+                  this.requiredFlag = false;
+                  this.requiredMessage = optionList[i].remark;
+                  return;
+                }
               }
             }
+          } else if (optionList[i].answerType == 'zp') {
+            // 照片
+            if (!optionList[i].fileInfoList || !optionList[i].fileInfoList.length) {
+              this.requiredFlag = false;
+              this.requiredMessage = optionList[i].remark;
+              return;
+            }
           }
         }
       }