فهرست منبع

feature_20250722_金牌店档案收集

zhujindu 4 ماه پیش
والد
کامیت
a4cee022ea
1فایلهای تغییر یافته به همراه60 افزوده شده و 6 حذف شده
  1. 60 6
      src/views/deviceWithin/addStoreVisit.vue

+ 60 - 6
src/views/deviceWithin/addStoreVisit.vue

@@ -222,6 +222,25 @@
               {{ item.collectionOptionList[0].collectionOption }}
             </p>
           </div>
+          <div v-if="item.answerType == 'nyr'" class="formLabel z-cell">
+            <van-cell>
+              <template #title>
+                <span v-if="item.isMust == 0" class="van-f-red">*</span>
+                {{ item.collectionName }}
+              </template>
+            </van-cell>
+            <van-field
+              v-model="item.answerValue"
+              :placeholder="item.text"
+              readonly
+              type="textarea"
+              @click="getNyr(item)"></van-field>
+            <p
+              style="color: red; font-size: 14px; margin: 0; padding: 10px 0; text-align: right"
+              v-if="item.collectionOptionList[0].collectionOption">
+              {{ item.collectionOptionList[0].collectionOption }}
+            </p>
+          </div>
           <div v-if="item.answerType == 'sz'" class="formLabel z-cell">
             <van-cell>
               <template #title
@@ -2825,6 +2844,16 @@
         @cancel="showPicker = false"
         @confirm="onConfirm" />
     </van-popup>
+    <!-- 时间选择 -->
+    <van-popup v-model="datetimeShowPicker" position="bottom">
+      <van-datetime-picker
+        type="date"
+        title="选择年月日"
+        :min-date="new Date(1945, 0, 1)"
+        :max-date="new Date()"
+        @confirm="datetimeOnConfirm"
+        @cancel="datetimeShowPicker = false" />
+    </van-popup>
     <van-dialog v-model="logshow" show-cancel-button title="系统提示"> 是否保存信息? </van-dialog>
     <br />
     <br />
@@ -2963,6 +2992,8 @@ export default {
       competitortableData: [],
       time: null, //计时
       timeNum: 0,
+      datetimeShowPicker: false,
+      activatNyrItem: '',
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -3521,7 +3552,8 @@ export default {
               collectionItemLists[q].answerType == 'tel' ||
               collectionItemLists[q].answerType == 'date' ||
               collectionItemLists[q].answerType == 'tel_send_code' ||
-              collectionItemLists[q].answerType == 'check_code'
+              collectionItemLists[q].answerType == 'check_code' ||
+              collectionItemLists[q].answerType == 'nyr'
             ) {
               collectionItemLists[q].answerValue =
                 collectionItemLists[q].collectionOptionList[0].answerValue;
@@ -3616,6 +3648,14 @@ export default {
                           listchild[qq1].answerValue = '';
                         }
                       }
+                      if (listchild[qq1].answerType == 'nyr') {
+                        if (listchild[qq1].collectionOptionList[0].answerValue != null) {
+                          listchild[qq1].answerValue =
+                            listchild[qq1].collectionOptionList[0].answerValue;
+                        } else {
+                          listchild[qq1].answerValue = '';
+                        }
+                      }
                       if (listchild[qq1].answerType == 'date') {
                         if (listchild[qq1].collectionOptionList[0].answerValue != null) {
                           listchild[qq1].answerValue =
@@ -4459,7 +4499,8 @@ export default {
             this.collectionItemList[b].answerType == 'tel' ||
             this.collectionItemList[b].answerType == 'date' ||
             this.collectionItemList[b].answerType == 'tel_send_code' ||
-            this.collectionItemList[b].answerType == 'check_code'
+            this.collectionItemList[b].answerType == 'check_code' ||
+            this.collectionItemList[b].answerType == 'nyr'
           ) {
             formData.collectionAnswers.push({
               collectionId: this.collectionItemList[b].collectionId,
@@ -4514,7 +4555,8 @@ export default {
                     listDatas[f2].answerType == 'tel' ||
                     listDatas[f2].answerType == 'date' ||
                     listDatas[f2].answerType == 'tel_send_code' ||
-                    listDatas[f2].answerType == 'check_code'
+                    listDatas[f2].answerType == 'check_code' ||
+                    listDatas[f2].answerType == 'nyr'
                   ) {
                     formData.collectionAnswers.push({
                       collectionId: listDatas[f2].collectionId,
@@ -4583,7 +4625,8 @@ export default {
                             listDatas2[f10].answerType == 'date' ||
                             listDatas2[f10].answerType == 'tel' ||
                             listDatas2[f10].answerType == 'tel_send_code' ||
-                            listDatas2[f10].answerType == 'check_code'
+                            listDatas2[f10].answerType == 'check_code' ||
+                            listDatas2[f10].answerType == 'nyr'
                           ) {
                             formData.collectionAnswers.push({
                               collectionId: listDatas2[f10].collectionId,
@@ -4671,7 +4714,8 @@ export default {
                                     listc4[fc4].answerType == 'date' ||
                                     listc4[fc4].answerType == 'tel' ||
                                     listc4[fc4].answerType == 'tel_send_code' ||
-                                    listc4[fc4].answerType == 'check_code'
+                                    listc4[fc4].answerType == 'check_code' ||
+                                    listc4[fc4].answerType == 'nyr'
                                   ) {
                                     formData.collectionAnswers.push({
                                       collectionId: listc4[fc4].collectionId,
@@ -4774,7 +4818,8 @@ export default {
                                             listc5[fc5].answerType == 'date' ||
                                             listc5[fc5].answerType == 'tel' ||
                                             listc5[fc5].answerType == 'tel_send_code' ||
-                                            listc5[fc5].answerType == 'check_code'
+                                            listc5[fc5].answerType == 'check_code' ||
+                                            listc5[fc5].answerType == 'nyr'
                                           ) {
                                             formData.collectionAnswers.push({
                                               collectionId: listc5[fc5].collectionId,
@@ -5071,6 +5116,15 @@ export default {
         }
       });
     },
+    getNyr(item) {
+      this.activatNyrItem = item;
+      this.datetimeShowPicker = true;
+    },
+    datetimeOnConfirm(time) {
+      debugger;
+      this.$set(this.activatNyrItem, 'answerValue', time);
+      this.datetimeShowPicker = false;
+    },
     onClickLeft() {
       this.$router.go(-1);
     },