Sfoglia il codice sorgente

Merge branch 'feature_20260413_陈列照片提交后修改' into uat(dev)

# Conflicts:
#	src/api/index.js
#	src/components/deleteUploadImgTaskPhoto.vue
zhujindu 3 giorni fa
parent
commit
319d5bd9f7

+ 9 - 0
src/api/index.js

@@ -1178,3 +1178,12 @@ export function getServiceProviderArchives(query) {
     params: query,
   });
 }
+
+// 查询用户距离拜访门店得距离
+export function selectUserDistanceTheStore(query) {
+  return request({
+    url: 'mobile/storeGroup/selectUserDistanceTheStore',
+    method: 'get',
+    params: query,
+  });
+}

+ 6 - 2
src/components/deleteUploadImgTaskPhoto.vue

@@ -1,9 +1,13 @@
 <template>
   <div class="deleteUploadImgTaskPhoto">
     <van-row gutter="10">
-      <van-col span="6" style="" v-if="insert == 'true' && formData.processStatus != 1">
+      <van-col
+        span="6"
+        style=""
+        v-if="formData.processStatus != 1 || formData.displayRewardTaskEditable">
         <div class="addImg">
           <uploadVNormalTaskPhoto
+            :formData="formData"
             :shouws="true"
             :storeGroupId="storeGroupId"
             :taskList="taskIds.split(',')"
@@ -22,7 +26,7 @@
       <van-col span="6" v-for="(urls, index) in imgArr" :key="index">
         <div class="imgview">
           <van-icon
-            v-if="insert == 'true' && formData.processStatus != 1"
+            v-if="formData.processStatus != 1 || formData.displayRewardTaskEditable"
             name="close"
             size="16"
             v-on:click="deleteImg(index, urls)" />

+ 6 - 0
src/components/uploadVNormalTaskPhoto.vue

@@ -89,6 +89,12 @@ export default {
       type: [String, Number],
       default: '',
     },
+    formData: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
   },
   computed: {
     ...mapState({

+ 40 - 4
src/views/deviceWithin/taskPhotoTaking.vue

@@ -3,7 +3,7 @@
     <van-nav-bar class="navBar" left-arrow title="生动化陈列" @click-left="onClickLeft">
       <template #right v-if="formData">
         <span
-          v-if="isEdit && insert == 'true' && formData.processStatus != 1"
+          v-if="formData.processStatus != 1 || formData.displayRewardTaskEditable"
           @click="onSubmit"
           style="
             color: white;
@@ -126,9 +126,15 @@
   </div>
 </template>
 <script>
-import { getCollectionInfosBatch, addCollectionAnswerBatch, getVisitsDetail } from '@/api/index';
+import {
+  getCollectionInfosBatch,
+  addCollectionAnswerBatch,
+  getVisitsDetail,
+  selectUserDistanceTheStore,
+} from '@/api/index';
 import taskTips from './taskTips';
 import deleteUploadImgTaskPhoto from '@/components/deleteUploadImgTaskPhoto';
+import { getPosition, getTicketFun } from '@/utils/TXApiFun';
 import { mapState } from 'vuex';
 export default {
   name: 'abnortaskPhotoTakingmalVisit',
@@ -140,7 +146,6 @@ export default {
   },
   data() {
     return {
-      isEdit: true,
       formData: null,
       dataList: null,
       taskIds: [],
@@ -163,6 +168,7 @@ export default {
     this.insert = this.$route.query.insert;
     if (this.$route.query.source == 'historicalDetails') {
       this.getVisitsDetailFun();
+      this.getTicketFunfun();
     } else {
       this.getDetaile();
     }
@@ -175,6 +181,36 @@ export default {
   },
   watch: {},
   methods: {
+    // 授权
+    getTicketFunfun() {
+      getTicketFun()
+        .then(() => {
+          getPosition()
+            .then((res) => {
+              let { TXisBD } = res;
+              // this.lat = TXisBD.lat;
+              // this.lon = TXisBD.lon;
+              this.selectUserDistanceTheStoreFun(TXisBD);
+            })
+            .catch((error) => {
+              this.$dialog.alert({
+                message: error,
+              });
+            });
+        })
+        .catch(() => {});
+    },
+    selectUserDistanceTheStoreFun(TXisBD) {
+      selectUserDistanceTheStore({
+        visitsId: this.visitsId, //	Long	拜访id
+        lon: TXisBD.lon, //	String	经度
+        lat: TXisBD.lat, //	String	纬度
+      }).then((res) => {
+        if (res.data) {
+          this.$toast(`您距离门店还有${res.data}米`);
+        }
+      });
+    },
     taskObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
       const cellValue = row[column.property];
       if (cellValue && ['conditionIdentifyNum'].includes(column.property)) {
@@ -268,7 +304,7 @@ export default {
           storeGroupId: this.$route.query.storeGroupId,
           visitsId: this.visitsId,
           taskList: this.taskIds.split(',').map((val) => Number(val)),
-          insert: true,
+          insert: this.insert,
           collectionAnswers: [],
           checkUnManage: 'N',
           deviceCode: '',