ソースを参照

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

zhujindu 12 時間 前
コミット
4db602ccca
1 ファイル変更11 行追加10 行削除
  1. 11 10
      src/views/week/reportCustom.vue

+ 11 - 10
src/views/week/reportCustom.vue

@@ -10,7 +10,7 @@
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ filterIndex(ind) + 1 + index + '.' }}
+                  {{ filterIndex(ind, index) + 1 + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -31,7 +31,7 @@
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ filterIndex(ind) + 1 + index + '.' }}
+                  {{ filterIndex(ind, index) + 1 + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -54,7 +54,7 @@
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ filterIndex(ind) + 1 + index + '.' }}
+                  {{ filterIndex(ind, index) + 1 + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -83,7 +83,7 @@
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ filterIndex(ind) + 1 + index + '.' }}
+                  {{ filterIndex(ind, index) + 1 + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -148,12 +148,12 @@ export default {
     };
   },
   methods: {
-    filterIndex(ind) {
-      if (ind > 0) {
-        return this.fromData[ind - 1].sfaReportCustomCollections.length;
-      } else {
-        return 0;
+    filterIndex(index, subIndex) {
+      let count = 0;
+      for (let i = 0; i < index; i++) {
+        count += this.fromData[i].sfaReportCustomCollections.length;
       }
+      return count + subIndex;
     },
     filterFromData(val) {
       // 公装销售专员 写死 不用填写 未拜访原因
@@ -168,11 +168,12 @@ export default {
             // sameDayWhetherVisit 2 未拜访
             if (customData[x].sameDayWhetherVisit != '2') {
               sfaReportCustomCollections.push(customData[x]);
-              arr1.sfaReportCustomCollections = sfaReportCustomCollections;
             }
           }
+          arr1.sfaReportCustomCollections = sfaReportCustomCollections;
           reportCustomAnswers.push(arr1);
         }
+        console.log(reportCustomAnswers);
         this.fromData = reportCustomAnswers;
       } else {
         this.fromData = val;