浏览代码

Merge branch 'feature_20251117_日报填写内容自定义配置' into uat(dev)

zhujindu 1 周之前
父节点
当前提交
73d1e88e33
共有 1 个文件被更改,包括 17 次插入28 次删除
  1. 17 28
      src/views/week/reportCustom.vue

+ 17 - 28
src/views/week/reportCustom.vue

@@ -1,14 +1,16 @@
 <template>
   <div class="reportCustom" v-if="fromData && fromData.length">
     <van-form ref="tabstoreVal" :disabled="disabled">
-      <template v-for="value in fromData">
+      <template v-for="(value, ind) in fromData">
         <template v-if="value.sfaReportCustomCollections">
-          <div v-for="(item, index) in value.sfaReportCustomCollections" :key="index">
+          <div
+            v-for="(item, index) in value.sfaReportCustomCollections"
+            :key="item.reportCustomCollectionId">
             <div v-if="item.reportCustomCollectionType == 'sz'" class="formLabel z-cell">
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ 1 + index + '.' }}
+                  {{ filterIndex(ind) + 1 + index + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -24,7 +26,7 @@
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ 1 + index + '.' }}
+                  {{ filterIndex(ind) + 1 + index + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -41,7 +43,7 @@
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ 1 + index + '.' }}
+                  {{ filterIndex(ind) + 1 + index + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -62,7 +64,7 @@
                     @zSelectVal="zSelectVal"></z-checkbox>
                 </template>
               </van-field>
-              <p style="color: red; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
+              <p style="color: red; font-size: 12px; margin: 0; text-align: right">
                 {{ item.remark }}
               </p>
             </div>
@@ -70,7 +72,7 @@
               <van-cell>
                 <template #title>
                   <span v-if="item.isMust == '1'" class="van-f-red">*</span>
-                  {{ 1 + index + '.' }}
+                  {{ filterIndex(ind) + 1 + index + '.' }}
                   {{ item.reportCustomCollectionName }}
                 </template>
               </van-cell>
@@ -93,7 +95,7 @@
                     @zSelectVal="zSelectVal"></z-radio>
                 </template>
               </van-field>
-              <p style="color: red; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
+              <p style="color: red; font-size: 12px; margin: 0; text-align: right">
                 {{ item.remark }}
               </p>
             </div>
@@ -101,13 +103,6 @@
         </template>
       </template>
     </van-form>
-    <van-calendar
-      v-model="showCalendar"
-      @confirm="onConfirm"
-      color="#0057ba"
-      :min-date="minDate"
-      :max-date="maxDate"
-      :show-confirm="false" />
   </div>
 </template>
 <script>
@@ -137,25 +132,19 @@ export default {
   data() {
     return {
       fromData: null,
-      dateIndex: '',
-      showCalendar: false,
-      minDate: new Date(2020, 0, 1),
-      maxDate: new Date(2090, 0, 31),
     };
   },
   methods: {
+    filterIndex(ind) {
+      if (ind > 0) {
+        return this.fromData[ind - 1].sfaReportCustomCollections.length;
+      } else {
+        return 0;
+      }
+    },
     filterFromData(val) {
       this.fromData = val;
     },
-    showCalendarClick(item, index) {
-      if (!item.allowWriteAgain) return;
-      this.dateIndex = index;
-      this.showCalendar = true;
-    },
-    onConfirm(date) {
-      this.showCalendar = false;
-      this.fromData[this.dateIndex].answerValue = this.formatDate(date);
-    },
     numberFn(val, index) {
       if (val.answerValue) {
         if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(val.answerValue)) {