|
|
@@ -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>
|
|
|
@@ -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>
|
|
|
@@ -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)) {
|