Procházet zdrojové kódy

feature_20251117_日报填写内容自定义配置

zhujindu před 2 dny
rodič
revize
6fd7bd65d8
1 změnil soubory, kde provedl 35 přidání a 3 odebrání
  1. 35 3
      src/views/week/reportCustom.vue

+ 35 - 3
src/views/week/reportCustom.vue

@@ -20,7 +20,12 @@
                 :placeholder="item.remark"
                 type="number"
                 @input="numberFn(item, index)"
-                :rules="[{ required: item.isMust == '1' }]"></van-field>
+                :rules="[
+                  {
+                    required: item.isMust == '1',
+                    message: item.remark || '请输入' + item.reportCustomCollectionName,
+                  },
+                ]"></van-field>
             </div>
             <div v-if="item.reportCustomCollectionType == 'wb'" class="formLabel z-cell">
               <van-cell>
@@ -38,7 +43,12 @@
                 type="textarea"
                 maxlength="800"
                 :placeholder="item.remark"
-                :rules="[{ required: item.isMust == '1' }]"></van-field>
+                :rules="[
+                  {
+                    required: item.isMust == '1',
+                    message: item.remark || '请输入' + item.reportCustomCollectionName,
+                  },
+                ]"></van-field>
             </div>
             <div v-if="item.reportCustomCollectionType == 'duox'" class="formLabel z-cell">
               <van-cell>
@@ -124,6 +134,7 @@ export default {
   watch: {
     reportCustomData: {
       handler(val) {
+        this.postName = localStorage.getItem('postName');
         this.filterFromData(val);
       },
       immediate: true,
@@ -133,6 +144,7 @@ export default {
   data() {
     return {
       fromData: null,
+      postName: '',
     };
   },
   methods: {
@@ -144,7 +156,27 @@ export default {
       }
     },
     filterFromData(val) {
-      this.fromData = val;
+      // 公装销售专员 写死 不用填写 未拜访原因
+      if (this.postName == '公装销售专员') {
+        let fromData = JSON.parse(JSON.stringify(val));
+        let reportCustomAnswers = [];
+        for (let i = 0; i < fromData.length; i++) {
+          let arr1 = fromData[i];
+          let sfaReportCustomCollections = [];
+          let customData = fromData[i].sfaReportCustomCollections;
+          for (let x = 0; x < customData.length; x++) {
+            // sameDayWhetherVisit 2 未拜访
+            if (customData[x].sameDayWhetherVisit != '2') {
+              sfaReportCustomCollections.push(customData[x]);
+              arr1.sfaReportCustomCollections = sfaReportCustomCollections;
+            }
+          }
+          reportCustomAnswers.push(arr1);
+        }
+        this.fromData = reportCustomAnswers;
+      } else {
+        this.fromData = val;
+      }
     },
     numberFn(val, index) {
       if (val.answerValue) {