Browse Source

Merge branch 'feature_20250722_金牌店档案收集' into uat(dev)

zhujindu 4 months ago
parent
commit
55dda460ca

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

@@ -222,6 +222,24 @@
               {{ 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
+              @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
@@ -2865,6 +2883,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 />
@@ -3004,6 +3032,8 @@ export default {
       isEditSDHCL: true, //是否可以编辑生动化陈列
       time: null, //计时
       timeNum: 0,
+      datetimeShowPicker: false,
+      activatNyrItem: '',
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -3568,7 +3598,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;
@@ -3663,6 +3694,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 =
@@ -4506,7 +4545,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,
@@ -4561,7 +4601,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,
@@ -4630,7 +4671,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,
@@ -4718,7 +4760,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,
@@ -4821,7 +4864,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,
@@ -5118,6 +5162,14 @@ export default {
         }
       });
     },
+    getNyr(item) {
+      this.activatNyrItem = item;
+      this.datetimeShowPicker = true;
+    },
+    datetimeOnConfirm(time) {
+      this.$set(this.activatNyrItem, 'answerValue', this.parseTime(time, '{y}-{m}-{d}'));
+      this.datetimeShowPicker = false;
+    },
     onClickLeft() {
       this.$router.go(-1);
     },

+ 10 - 1
src/views/historicalVisit/hisvistdeils.vue

@@ -105,6 +105,14 @@
               <p class="mg0">{{ item.answerValue }}</p>
             </div>
           </div>
+          <div v-if="item.answerType == 'nyr'" class="formLabel z-cell z-cells">
+            <van-cell>
+              <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
+            </van-cell>
+            <div class="selesetText">
+              <p class="mg0">{{ item.answerValue }}</p>
+            </div>
+          </div>
           <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sz'">
             <van-cell>
               <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
@@ -403,7 +411,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;