Explorar el Código

feature_20250926_数字题型&单行文本题型

zhujindu hace 2 meses
padre
commit
46b9f5defe
Se han modificado 1 ficheros con 364 adiciones y 15 borrados
  1. 364 15
      src/views/deviceWithin/addStoreVisit.vue

+ 364 - 15
src/views/deviceWithin/addStoreVisit.vue

@@ -424,6 +424,52 @@
               :photoIdentifyType="photoIdentifyType"
               :imgs="item.fileInfoList"></delete-upload-img>
           </div>
+          <div v-if="item.answerType == 'dhwb'" class="formLabel z-cell">
+            <van-cell>
+              <template #title
+                ><span v-if="item.isMust == 0" class="van-f-red">*</span>
+                <span>{{ 1 + index + '.' }}</span>
+                {{ item.collectionName }}
+                <!-- 操作说明图片和电话 -->
+                <taskTips
+                  v-if="item.contactPhone || item.examplePhoto"
+                  :contactPhone="item.contactPhone"
+                  :examplePhoto="item.examplePhoto">
+                </taskTips
+              ></template>
+              <template #right-icon>
+                <span v-if="item.isMustPicture == '0'" class="van-f-red">*</span>
+                <van-icon
+                  v-if="item.isPicture == 0"
+                  color="#666"
+                  name="photograph"
+                  size="24"
+                  @click="imgClick(item, 'A', index)" />
+              </template>
+            </van-cell>
+            <van-field
+              v-model="item.answerValue"
+              :formatter="formatter"
+              :placeholder="item.collectionOptionList[0].collectionOption"></van-field>
+            <p
+              style="
+                color: #444;
+                font-size: 12px;
+                margin: 0;
+                text-align: right;
+                position: relative;
+              ">
+              <span
+                style="color: #00afff; position: absolute; top: 8px; right: 0px"
+                v-if="item.showHistory == 1"
+                @click="getCollectionShowHistory(item)"
+                >回显历史</span
+              >
+            </p>
+            <delete-upload-img
+              :photoIdentifyType="photoIdentifyType"
+              :imgs="item.fileInfoList"></delete-upload-img>
+          </div>
           <div v-if="item.answerType == 'duox'" class="formLabel z-cell">
             <van-cell>
               <template #title
@@ -687,6 +733,55 @@
                         :photoIdentifyType="photoIdentifyType"
                         :imgs="childitem.fileInfoList"></delete-upload-img>
                     </div>
+                    <div v-if="childitem.answerType == 'dhwb'" class="formLabel z-cell">
+                      <van-cell>
+                        <template #title>
+                          <span v-if="childitem.isMust == 0" class="van-f-red">*</span>
+                          <span>{{ 1 + index + '.' }}</span>
+                          <span>{{ 1 + childIndex + '.' }}</span>
+                          {{ childitem.collectionName }}
+                          <!-- 操作说明图片和电话 -->
+                          <taskTips
+                            v-if="childitem.contactPhone || childitem.examplePhoto"
+                            :contactPhone="childitem.contactPhone"
+                            :examplePhoto="childitem.examplePhoto">
+                          </taskTips>
+                        </template>
+                        <template #right-icon>
+                          <span v-if="childitem.isMustPicture == '0'" class="van-f-red">*</span>
+                          <van-icon
+                            v-if="childitem.isPicture == 0"
+                            color="#666"
+                            name="photograph"
+                            size="24"
+                            @click="imgClick(childitem, 'B', index, childIndex)" />
+                        </template>
+                      </van-cell>
+                      <van-field
+                        v-model="childitem.collectionOptionList[0].answerValue"
+                        :formatter="formatter"
+                        :placeholder="
+                          childitem.collectionOptionList[0].collectionOption
+                        "></van-field>
+                      <p
+                        style="
+                          color: #444;
+                          font-size: 12px;
+                          margin: 0;
+                          text-align: right;
+                          position: relative;
+                        ">
+                        <span
+                          style="color: #00afff; position: absolute; top: 8px; right: 0px"
+                          v-if="childitem.showHistory == 1"
+                          @click="getCollectionShowHistory(childitem)"
+                          >回显历史</span
+                        >
+                      </p>
+                      <delete-upload-img
+                        :photoIdentifyType="photoIdentifyType"
+                        :imgs="childitem.fileInfoList"></delete-upload-img>
+                    </div>
                     <div v-if="childitem.answerType == 'sz'" class="formLabel z-cell">
                       <van-cell>
                         <template #title>
@@ -1039,6 +1134,68 @@
                                   :photoIdentifyType="photoIdentifyType"
                                   :imgs="childitem1.fileInfoList"></delete-upload-img>
                               </div>
+                              <div v-if="childitem1.answerType == 'dhwb'" class="formLabel z-cell">
+                                <van-cell>
+                                  <template #title
+                                    ><span v-if="childitem1.isMust == 0" class="van-f-red">*</span>
+                                    <span>{{ 1 + index + '.' }}</span>
+                                    <span>{{ 1 + childIndex + '.' }}</span>
+                                    <span>{{ 1 + childIndex1 + '.' }}</span>
+                                    {{ childitem1.collectionName }}
+                                    <!-- 操作说明图片和电话 -->
+                                    <taskTips
+                                      v-if="childitem1.contactPhone || childitem1.examplePhoto"
+                                      :contactPhone="childitem1.contactPhone"
+                                      :examplePhoto="childitem1.examplePhoto">
+                                    </taskTips
+                                  ></template>
+                                  <template #right-icon>
+                                    <span v-if="childitem1.isMustPicture == '0'" class="van-f-red"
+                                      >*</span
+                                    >
+                                    <van-icon
+                                      v-if="childitem1.isPicture == 0"
+                                      color="#666"
+                                      name="photograph"
+                                      size="24"
+                                      @click="
+                                        imgClick(
+                                          childitem1,
+                                          'C',
+                                          index,
+                                          childIndex,
+                                          indexc,
+                                          indexc1,
+                                          childIndex1
+                                        )
+                                      " />
+                                  </template>
+                                </van-cell>
+                                <van-field
+                                  v-model="childitem1.collectionOptionList[0].answerValue"
+                                  :formatter="formatter"
+                                  :placeholder="
+                                    childitem1.collectionOptionList[0].collectionOption
+                                  "></van-field>
+                                <p
+                                  style="
+                                    color: #444;
+                                    font-size: 12px;
+                                    margin: 0;
+                                    text-align: right;
+                                    position: relative;
+                                  ">
+                                  <span
+                                    style="color: #00afff; position: absolute; top: 8px; right: 0px"
+                                    v-if="childitem1.showHistory == 1"
+                                    @click="getCollectionShowHistory(childitem1)"
+                                    >回显历史</span
+                                  >
+                                </p>
+                                <delete-upload-img
+                                  :photoIdentifyType="photoIdentifyType"
+                                  :imgs="childitem1.fileInfoList"></delete-upload-img>
+                              </div>
                               <div v-if="childitem1.answerType == 'date'" class="formLabel z-cell">
                                 <van-cell>
                                   <template #title>
@@ -1383,6 +1540,89 @@
                                             :photoIdentifyType="photoIdentifyType"
                                             :imgs="child33item1.fileInfoList"></delete-upload-img>
                                         </div>
+                                        <div
+                                          v-if="child33item1.answerType == 'dhwb'"
+                                          class="formLabel z-cell">
+                                          <van-cell>
+                                            <template #title>
+                                              <span
+                                                v-if="child33item1.isMust == 0"
+                                                class="van-f-red"
+                                                >*</span
+                                              >
+                                              <span>{{ 1 + index + '.' }}</span>
+                                              <span>{{ 1 + childIndex + '.' }}</span>
+                                              <span>{{ 1 + childIndex1 + '.' }}</span>
+                                              <span>{{ 1 + child33Index1 + '.' }}</span>
+                                              {{ child33item1.collectionName }}
+                                              <!-- 操作说明图片和电话 -->
+                                              <taskTips
+                                                v-if="
+                                                  child33item1.contactPhone ||
+                                                  child33item1.examplePhoto
+                                                "
+                                                :contactPhone="child33item1.contactPhone"
+                                                :examplePhoto="child33item1.examplePhoto">
+                                              </taskTips
+                                            ></template>
+                                            <template #right-icon>
+                                              <span
+                                                v-if="child33item1.isMustPicture == '0'"
+                                                class="van-f-red"
+                                                >*</span
+                                              >
+                                              <van-icon
+                                                v-if="child33item1.isPicture == 0"
+                                                color="#666"
+                                                name="photograph"
+                                                size="24"
+                                                @click="
+                                                  imgClick(
+                                                    child33item1,
+                                                    'D',
+                                                    index,
+                                                    childIndex,
+                                                    indexc,
+                                                    indexc1,
+                                                    childIndex1,
+                                                    indexc33,
+                                                    child33Index1
+                                                  )
+                                                " />
+                                            </template>
+                                          </van-cell>
+                                          <van-field
+                                            v-model="
+                                              child33item1.collectionOptionList[0].answerValue
+                                            "
+                                            :formatter="formatter"
+                                            :placeholder="
+                                              child33item1.collectionOptionList[0].collectionOption
+                                            "></van-field>
+                                          <p
+                                            style="
+                                              color: #444;
+                                              font-size: 12px;
+                                              margin: 0;
+                                              text-align: right;
+                                              position: relative;
+                                            ">
+                                            <span
+                                              style="
+                                                color: #00afff;
+                                                position: absolute;
+                                                top: 8px;
+                                                right: 0px;
+                                              "
+                                              v-if="child33item1.showHistory == 1"
+                                              @click="getCollectionShowHistory(child33item1)"
+                                              >回显历史</span
+                                            >
+                                          </p>
+                                          <delete-upload-img
+                                            :photoIdentifyType="photoIdentifyType"
+                                            :imgs="child33item1.fileInfoList"></delete-upload-img>
+                                        </div>
                                         <div
                                           v-if="child33item1.answerType == 'date'"
                                           class="formLabel z-cell">
@@ -2050,6 +2290,98 @@
                                                         child44item1.fileInfoList
                                                       "></delete-upload-img>
                                                   </div>
+                                                  <div
+                                                    v-if="child44item1.answerType == 'dhwb'"
+                                                    class="formLabel z-cell">
+                                                    <van-cell>
+                                                      <template #title
+                                                        ><span
+                                                          v-if="child44item1.isMust == 0"
+                                                          class="van-f-red"
+                                                          >*</span
+                                                        >
+                                                        <span>{{ 1 + index + '.' }}</span>
+                                                        <span>{{ 1 + childIndex + '.' }}</span>
+                                                        <span>{{ 1 + childIndex1 + '.' }}</span>
+                                                        <span>{{ 1 + child33Index1 + '.' }}</span>
+                                                        <span>{{ 1 + child44Index1 + '.' }}</span>
+                                                        {{ child44item1.collectionName }}
+                                                        <!-- 操作说明图片和电话 -->
+                                                        <taskTips
+                                                          v-if="
+                                                            child44item1.contactPhone ||
+                                                            child44item1.examplePhoto
+                                                          "
+                                                          :contactPhone="child44item1.contactPhone"
+                                                          :examplePhoto="child44item1.examplePhoto">
+                                                        </taskTips
+                                                      ></template>
+                                                      <template #right-icon>
+                                                        <span
+                                                          v-if="child44item1.isMustPicture == '0'"
+                                                          class="van-f-red"
+                                                          >*</span
+                                                        >
+                                                        <van-icon
+                                                          v-if="child44item1.isPicture == 0"
+                                                          color="#666"
+                                                          name="photograph"
+                                                          size="24"
+                                                          @click="
+                                                            imgClick(
+                                                              child44item1,
+                                                              'E',
+                                                              index,
+                                                              childIndex,
+                                                              indexc,
+                                                              indexc1,
+                                                              childIndex1,
+                                                              indexc33,
+                                                              child33Index1,
+                                                              indexc44,
+                                                              child44Index1
+                                                            )
+                                                          " />
+                                                      </template>
+                                                    </van-cell>
+                                                    <van-field
+                                                      v-model="
+                                                        child44item1.collectionOptionList[0]
+                                                          .answerValue
+                                                      "
+                                                      :formatter="formatter"
+                                                      :placeholder="
+                                                        child44item1.collectionOptionList[0]
+                                                          .collectionOption
+                                                      "></van-field>
+                                                    <p
+                                                      style="
+                                                        color: #444;
+                                                        font-size: 12px;
+                                                        margin: 0;
+                                                        text-align: right;
+                                                        position: relative;
+                                                      ">
+                                                      <span
+                                                        style="
+                                                          color: #00afff;
+                                                          position: absolute;
+                                                          top: 8px;
+                                                          right: 0px;
+                                                        "
+                                                        v-if="child44item1.showHistory == 1"
+                                                        @click="
+                                                          getCollectionShowHistory(child44item1)
+                                                        "
+                                                        >回显历史</span
+                                                      >
+                                                    </p>
+                                                    <delete-upload-img
+                                                      :photoIdentifyType="photoIdentifyType"
+                                                      :imgs="
+                                                        child44item1.fileInfoList
+                                                      "></delete-upload-img>
+                                                  </div>
                                                   <div
                                                     v-if="child44item1.answerType == 'date'"
                                                     class="formLabel z-cell">
@@ -3587,18 +3919,26 @@ export default {
         }
         // 最大值
         let maxValue = this.collectionItemList[index].collectionOptionList[0].maxValue;
-        if (maxValue) {
-          if (value > maxValue) {
-            this.collectionItemList[index].answerValue = value.slice(0, -1);
-            this.$toast(this.collectionItemList[index].collectionName + '输入内容不合法');
+        if (maxValue && maxValue != '') {
+          if (value > Number(maxValue)) {
+            // this.collectionItemList[index].answerValue = value.slice(0, -1);
+            // this.$toast(
+            //   this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
+            // );
+            this.collectionItemList[index].answerValue = '';
+            this.$toast('输入内容不合法');
           }
         }
         //最小值
         let minValue = this.collectionItemList[index].collectionOptionList[0].minValue;
-        if (minValue) {
-          if (value < minValue) {
-            this.collectionItemList[index].answerValue = minValue;
-            this.$toast(this.collectionItemList[index].collectionName + '输入内容不合法');
+        if (minValue && minValue != '') {
+          if (value < Number(minValue)) {
+            // this.collectionItemList[index].answerValue = minValue;
+            // this.$toast(
+            //   this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
+            // );
+            this.collectionItemList[index].answerValue = '';
+            this.$toast('输入内容不合法');
           }
         }
       }
@@ -3712,7 +4052,8 @@ export default {
               collectionItemLists[q].answerType == 'date' ||
               collectionItemLists[q].answerType == 'tel_send_code' ||
               collectionItemLists[q].answerType == 'check_code' ||
-              collectionItemLists[q].answerType == 'nyr'
+              collectionItemLists[q].answerType == 'nyr' ||
+              collectionItemLists[q].answerType == 'dhwb'
             ) {
               collectionItemLists[q].answerValue =
                 collectionItemLists[q].collectionOptionList[0].answerValue;
@@ -3757,7 +4098,10 @@ export default {
                             listchild[qq1].collectionOptionList[0].answerValue;
                         }
                       }
-                      if (listchild[qq1].answerType == 'wb') {
+                      if (
+                        listchild[qq1].answerType == 'wb' ||
+                        listchild[qq1].answerType == 'dhwb'
+                      ) {
                         if (listchild[qq1].collectionOptionList[0].answerValue != null) {
                           listchild[qq1].answerValue =
                             listchild[qq1].collectionOptionList[0].answerValue;
@@ -4667,7 +5011,8 @@ export default {
             this.collectionItemList[b].answerType == 'date' ||
             this.collectionItemList[b].answerType == 'tel_send_code' ||
             this.collectionItemList[b].answerType == 'check_code' ||
-            this.collectionItemList[b].answerType == 'nyr'
+            this.collectionItemList[b].answerType == 'nyr' ||
+            this.collectionItemList[b].answerType == 'dhwb'
           ) {
             formData.collectionAnswers.push({
               collectionId: this.collectionItemList[b].collectionId,
@@ -4723,7 +5068,8 @@ export default {
                     listDatas[f2].answerType == 'date' ||
                     listDatas[f2].answerType == 'tel_send_code' ||
                     listDatas[f2].answerType == 'check_code' ||
-                    listDatas[f2].answerType == 'nyr'
+                    listDatas[f2].answerType == 'nyr' ||
+                    listDatas[f2].answerType == 'dhwb'
                   ) {
                     formData.collectionAnswers.push({
                       collectionId: listDatas[f2].collectionId,
@@ -4793,7 +5139,8 @@ export default {
                             listDatas2[f10].answerType == 'tel' ||
                             listDatas2[f10].answerType == 'tel_send_code' ||
                             listDatas2[f10].answerType == 'check_code' ||
-                            listDatas2[f10].answerType == 'nyr'
+                            listDatas2[f10].answerType == 'nyr' ||
+                            listDatas2[f10].answerType == 'dhwb'
                           ) {
                             formData.collectionAnswers.push({
                               collectionId: listDatas2[f10].collectionId,
@@ -4882,7 +5229,8 @@ export default {
                                     listc4[fc4].answerType == 'tel' ||
                                     listc4[fc4].answerType == 'tel_send_code' ||
                                     listc4[fc4].answerType == 'check_code' ||
-                                    listc4[fc4].answerType == 'nyr'
+                                    listc4[fc4].answerType == 'nyr' ||
+                                    listc4[fc4].answerType == 'dhwb'
                                   ) {
                                     formData.collectionAnswers.push({
                                       collectionId: listc4[fc4].collectionId,
@@ -4986,7 +5334,8 @@ export default {
                                             listc5[fc5].answerType == 'tel' ||
                                             listc5[fc5].answerType == 'tel_send_code' ||
                                             listc5[fc5].answerType == 'check_code' ||
-                                            listc5[fc5].answerType == 'nyr'
+                                            listc5[fc5].answerType == 'nyr' ||
+                                            listc5[fc5].answerType == 'dhwb'
                                           ) {
                                             formData.collectionAnswers.push({
                                               collectionId: listc5[fc5].collectionId,