瀏覽代碼

门店拜访任务列表访问速度优化

zhujindu 6 月之前
父節點
當前提交
e47504e0de
共有 2 個文件被更改,包括 9 次插入86 次删除
  1. 7 18
      src/views/deviceOutside/suishenbangOutstoreVisit.vue
  2. 2 68
      src/views/deviceWithin/addStoreVisit.vue

+ 7 - 18
src/views/deviceOutside/suishenbangOutstoreVisit.vue

@@ -203,21 +203,7 @@ export default {
       wuliaoList: [],
     };
   },
-  created() {
-    this.urlParameter = this.$route.query;
-    this.storeId = this.$route.query.storeId + '';
-    this.visitId = this.$route.query.visitId;
-    this.storeCode = this.$route.query.storeCode;
-    this.rdId = this.$route.query.rdId + '';
-    this.addressLine = this.$route.query.addressLine;
-    this.storeCategory = this.$route.query.storeCategory;
-    this.storeName = this.$route.query.storeName;
-    this.contactName = this.$route.query.contactName;
-    this.lat = this.$route.query.lat + '';
-    this.lon = this.$route.query.lon + '';
-    this.visitModel = this.$route.query.visitModel + '';
-    this.uType = localStorage.getItem('uType');
-  },
+  created() {},
   beforeRouteLeave(to, from, next) {
     if (
       (to.path == '/outsidelist/index' && from.path == '/suishenbangOutstoreVisit') ||
@@ -230,6 +216,9 @@ export default {
     next();
   },
   activated() {
+    // 是否请求任务列表接口
+    let getRequestFlage = localStorage.getItem('getRequestFlage');
+    if (getRequestFlage != 'true') return;
     this.urlParameter = this.$route.query;
     this.storeId = this.$route.query.storeId + '';
     this.visitId = this.$route.query.visitId;
@@ -243,9 +232,6 @@ export default {
     this.lon = this.$route.query.lon + '';
     this.visitModel = this.$route.query.visitModel + '';
     this.uType = localStorage.getItem('uType');
-    // 是否请求任务列表接口
-    let getRequestFlage = localStorage.getItem('getRequestFlage');
-    if (getRequestFlage != 'true') return;
     this.list = [];
     if (localStorage.getItem('visitId') != null) {
       this.visitId = localStorage.getItem('visitId');
@@ -515,6 +501,7 @@ export default {
           getVisitTasks(params).then((res) => {
             loading2.clear();
             if (res.code == 200) {
+              debugger;
               localStorage.setItem('visitId', res.data.visitId);
               that.notes = res.data.notes;
               that.visitId = res.data.visitId;
@@ -567,6 +554,7 @@ export default {
               that.startTime = res.data.startTime;
               that.timeN = setInterval(that.animation, 16);
               that.visitsRemarks = res.data.visitsRemarks;
+              console.log(that.visitId);
             } else {
               that.$toast(res.msg);
             }
@@ -576,6 +564,7 @@ export default {
     },
     addStoreVisit(val, index) {
       localStorage.setItem('getRequestFlage', 'false');
+      console.log(this.visitId);
       this.$router.push({
         path: '/addStoreVisit',
         query: {

+ 2 - 68
src/views/deviceWithin/addStoreVisit.vue

@@ -91,72 +91,6 @@
       <p v-if="unManage == 0" class="isTableMust">
         <van-icon name="info-o" />&nbsp;请根据本店实际经营的竞品产品,反馈价格信息!
       </p>
-      <el-table
-        :data="competitortableData"
-        border
-        class="table-headermd"
-        style="width: 100%"
-        v-if="productTitles">
-        <el-table-column label="产品名称" prop="collectionName">
-          <template slot-scope="scope">
-            <span class="tipTitle" @click="tipTitle(scope.row.collectionName)">
-              {{ scope.row.collectionName }}
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column label="品类" prop="level1" />
-        <el-table-column label="档次" prop="grade" />
-        <el-table-column label="品牌" prop="brandName" />
-        <el-table-column label="规格" prop="spec" />
-        <el-table-column
-          v-for="(item, index) in productTitles"
-          :key="index"
-          :prop="item.titleValue">
-          <template slot="header">
-            <span>{{ item.titleName }}</span
-            ><span class="xing">*</span>
-          </template>
-          <template slot-scope="scope"
-            ><van-field
-              v-model="scope.row[item.titleValue]"
-              placeholder="请输入"
-              type="number"
-              @blur="inputblur(item.titleValue, scope.$index, '0')"
-          /></template>
-        </el-table-column>
-        <!-- <el-table-column prop="name">
-          <template slot="header"> <span>进货原价</span><span class="xing">*</span> </template>
-          <template slot-scope="scope"
-            ><van-field
-              v-model="scope.row.xdjhyj"
-              placeholder="请输入"
-              type="number"
-              @blur="inputblur(scope.row.xdjhyj, scope.$index, '0')"
-          /></template>
-        </el-table-column>
-        <el-table-column class="t-center" prop="address">
-          <template slot="header"> <span>促后净价</span><span class="xing">*</span> </template>
-          <template slot-scope="scope">
-            <van-field
-              v-model="scope.row.xdjhchjj"
-              placeholder="请输入"
-              type="number"
-              @blur="inputblurs(scope.row.xdjhchjj, scope.$index, '1')" />
-          </template>
-        </el-table-column>
-        <el-table-column class="t-center" prop="address">
-          <template slot="header" class="t-center">
-            <span>油工拿货价</span><span class="xing">*</span>
-          </template>
-          <template slot-scope="scope"
-            ><van-field
-              v-model="scope.row.ygnhj"
-              placeholder="请输入"
-              type="number"
-              @blur="inputblur(scope.row.ygnhj, scope.$index, '2')"
-          /></template>
-        </el-table-column> -->
-      </el-table>
       <div v-if="unManage == 0" style="margin: 10px">
         <van-checkbox v-model="checked" shape="square">全部不经营</van-checkbox>
       </div>
@@ -2827,6 +2761,7 @@ export default {
       photoIdentifyType: null, //图片识别类型
       pictureSource: '0',
       stillDistribute: false,
+      productTitles: [],
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -3337,12 +3272,11 @@ export default {
       if (this.$route.query.visitId != null) {
         params.id = this.$route.query.visitId;
       }
+      console.log(params.id);
       getCollectionInfos(params).then((res) => {
         loading1.clear();
         this.deviceCode = '';
         this.putInCode = '';
-        // 竞品调查-table动态化数据
-        this.productTitles = res.data.productTitles; //产品类型表头数据
         // this.equipmentCode = res.data.equipmentCode;
         var checkUnManage = res.data;
         var collectionItemLists = res.data.collectionItemList;