Selaa lähdekoodia

Merge branch 'feature_20250527_门店拜访任务列表访问速度优化' into release

zhujindu 5 kuukautta sitten
vanhempi
commit
ea813396bc

+ 18 - 0
src/api/index.js

@@ -79,6 +79,24 @@ export function getStoreGroupTask(data) {
     data,
   });
 }
+// 获取门店拜访任务接口
+export function getVisitTasks(data) {
+  return request({
+    url: 'mobile/storeGroup/getVisitTasks',
+    method: 'post',
+    data,
+  });
+}
+
+// 门店拜访获取采集项信息接口
+export function getCollectionInfos(data) {
+  return request({
+    url: 'mobile/storeGroup/getCollectionInfos',
+    method: 'post',
+    data,
+  });
+}
+
 export function restartProcess(query) {
   return request({
     url: 'mobile/storeGroup/restartProcess',

+ 1 - 0
src/store/modules/user.js

@@ -38,6 +38,7 @@ const user = {
             localStorage.setItem('userId', res.data.userId);
             localStorage.setItem('deptIds', JSON.stringify(res.data.deptIds));
             localStorage.setItem('chainUser', res.data.chainUser); //是否经销商用户 true
+            localStorage.setItem('getRequestFlage', 'true');
             // 门店类型
             getDictOption({}, 'sfa_store_type').then((res) => {
               commit('SET_STORE_TYPE', res.data);

+ 5 - 1
src/views/deviceOutside/index.vue

@@ -1196,6 +1196,10 @@ export default {
       });
     },
     storeVisit(val) {
+      if (val.visitSource && val.visitSource == 2) {
+        this.$toast('请先取消异常拜访后再进入正常拜访!');
+        return;
+      }
       localStorage.setItem('tabVal', this.tabVal);
       localStorage.removeItem('visitId');
       checkVisit({ storeId: val.storeId }).then((res) => {
@@ -1829,7 +1833,7 @@ export default {
                               message: '定位失败,请开启企微定位权限',
                             })
                             .then(() => {
-                              this.$router.go(-1);
+                              // this.$router.go(-1);
                             });
                         } else {
                           clearInterval(times);

+ 4 - 0
src/views/deviceOutside/rangeStore.vue

@@ -1657,6 +1657,10 @@ export default {
 
     storeVisit(val) {
       // localStorage.setItem("tabVal",this.tabVal)
+      if (val.visitSource && val.visitSource == 2) {
+        this.$toast('请先取消异常拜访后再进入正常拜访!');
+        return;
+      }
       localStorage.removeItem('visitId');
       var rdId = val.rdId;
       var that = this;

+ 957 - 0
src/views/deviceOutside/suishenbangOutstoreVisit copy.vue

@@ -0,0 +1,957 @@
+<template>
+  <div>
+    <!--        顶部条-->
+    <div class="navBarTOP">
+      <van-nav-bar class="navBar" title="拜访" left-arrow @click-left="onClickLeft" />
+    </div>
+    <!--        主体内容-->
+    <div class="container">
+      <div class="lineGrey"></div>
+      <div class="lineGrey"></div>
+      <div class="lineGrey"></div>
+      <div class="lineGrey"></div>
+      <div class="lineGrey"></div>
+      <div class="card mt10">
+        <div class="title f-blue">
+          {{ storeName }}(<span style="color: #0057ba">{{ urlParameter.storeCode }}</span
+          >)
+        </div>
+        <div class="info1" v-if="addressLine != null">类型:{{ storeCategory }}</div>
+        <div class="info1" v-if="addressLine != 'null'">地址:{{ addressLine }}</div>
+        <div class="info1" v-if="notes != null">上次拜访备注:{{ notes }}</div>
+        <div class="info1">拜访时长:{{ showTime }}</div>
+        <div class="info1">
+          <span v-if="urlParameter.hisTime"
+            >上次拜访时间:{{ parseTime(urlParameter.hisTime) }}</span
+          ><span @click="shows = true" class="f-blue" v-if="visitsRemarks" style="font-weight: bold"
+            ><van-icon name="browsing-history-o" />查看最近三次</span
+          >
+        </div>
+        <van-button
+          type="info"
+          style="background: rgb(0, 87, 186); color: #fff; margin: 10px 0; border-radius: 5px"
+          size="small"
+          plain
+          class="centerBtn"
+          @click="visitFn(urlParameter.storeCode)"
+          >经营情况</van-button
+        >
+        <van-button
+          type="info"
+          style="background: rgb(0, 87, 186); color: #fff; margin: 10px; border-radius: 5px"
+          size="small"
+          plain
+          v-if="showOrderButton"
+          class="centerBtn"
+          @click="overbookingFn(urlParameter)"
+          >去下单</van-button
+        >
+        <van-button
+          type="info"
+          style="background: rgb(0, 87, 186); color: #fff; margin: 10px; border-radius: 5px"
+          size="small"
+          plain
+          class="centerBtn"
+          @click="wuliaoLog(urlParameter)"
+          >物料历史</van-button
+        >
+        <van-button
+          type="info"
+          style="
+            float: right;
+            background: #ed5565;
+            border-color: #ed5565;
+            color: #fff;
+            margin: 10px 0;
+            border-radius: 5px;
+          "
+          size="small"
+          plain
+          class="centerBtn"
+          @click="onstopVisit"
+          >取消拜访</van-button
+        >
+      </div>
+      <div
+        v-if="addShow1"
+        style="color: #999; font-size: 12px; padding: 10px; background-color: #f5f5f5">
+        <van-icon
+          name="info-o" />&nbsp;可控店及金牌店的店招任务中,若拍摄两次仍不通过,允许提交,不影响正常拜访。
+      </div>
+      <div class="card">
+        <div
+          class="info"
+          v-for="(item, index) in list"
+          :key="index"
+          @click="addStoreVisit(item, index)">
+          <span class="must" v-show="item.isMust == '0' || item.isMust == '2'">*</span>
+          <span class="must" v-show="item.isMust != '0' && item.isMust != '2'">&nbsp;</span>
+          <p style="width: 74%; margin: 0; line-height: 24px; display: inline-block">
+            {{ item.taskName }}
+          </p>
+          <span v-show="item.processKey != null" class="processIco">
+            <van-icon :name="sp" size="16" />
+          </span>
+          <span v-show="!item.success" class="arrow" style="background-color: #fff; color: #444"
+            ><van-icon name="arrow"
+          /></span>
+          <span v-show="item.success" class="arrow" tyle="background-color: #0057ba"
+            ><van-icon name="success"
+          /></span>
+        </div>
+      </div>
+    </div>
+    <div class="tc" style="padding: 0 16px">
+      <van-button class="submitBtn" block type="info" color="#0057ba" @click="endVisitsFn"
+        >提交拜访</van-button
+      >
+    </div>
+    <br />
+    <van-dialog v-model="shows">
+      <div class="tipTitleBox" style="padding: 10px">
+        <p class="p">近三次拜访备注</p>
+        <div
+          v-for="item in visitsRemarks"
+          style="border-bottom: 1px solid #e8e8e8; font-size: 14px; padding: 10px 0">
+          <p>拜访时间:{{ item.stopTime }}</p>
+          <p>备注:{{ item.visitRemark }}</p>
+        </div>
+      </div>
+    </van-dialog>
+    <div id="allmap"></div>
+    <!-- 物料历史列表 -->
+    <el-dialog
+      :visible.sync="wuliaoTable"
+      width="90%"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="wuliaoTableClose"
+      custom-class="wuliaoTable">
+      <el-table :data="wuliaoList" border style="width: 100%">
+        <el-table-column label="物料名称" prop="materialDataName" align="center" />
+        <el-table-column label="发放时间" prop="issuerTime" align="center" />
+        <el-table-column label="数量" prop="inventoryNum" width="60" align="center" />
+        <el-table-column label="签收状态" prop="receiptState" width="60" align="center" />
+      </el-table>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import sp from './../../assets/sp.png';
+import {
+  getStoreGroupTask,
+  endVisits,
+  editDwellTime,
+  suishenbangStoreSale,
+  stopVisit,
+  buryingPoint,
+  getMaterialHistory,
+} from '@/api/index';
+import axios from 'axios';
+import { saveVisitsParams, getOrderUrlByStoreId } from '@/api/inventory';
+export default {
+  name: 'suishenbangOutstoreVisit',
+  data() {
+    return {
+      notes: '',
+      visitModel: '1',
+      sp: sp,
+      shows: false,
+      flag: true,
+      questionsshow: false,
+      uploadImgshow: false,
+      imgs: [],
+      uploadImages: [],
+      uploadid1: 'uploadid1',
+      uploadid2: 'uploadid2',
+      iscuxiao: false,
+      text: '',
+      radio: '',
+      uploadImgEditText: '编辑',
+      isEdit: false,
+      storeId: '',
+      rdId: '',
+      lat: '',
+      lon: '',
+      list: [],
+      storeGroupId: '',
+      addShow1: false,
+      visitId: '',
+      addressLine: '',
+      storeCategory: '',
+      storeName: '',
+      contactName: '',
+      urlParameter: '',
+      uType: '-1',
+      showOrderButton: null,
+
+      visitsRemarks: [],
+      location: {
+        lat: '34.6174',
+        lon: '112.44039',
+      },
+      address: '',
+      showTime: '00:00:00',
+      city: '',
+      locationAccuracy: '',
+      id: '89',
+      startTime: null,
+      timeN: null,
+      wuliaoTable: false,
+      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');
+  },
+  beforeRouteLeave(to, from, next) {
+    if (
+      (to.path == '/outsidelist/index' && from.path == '/suishenbangOutstoreVisit') ||
+      (to.path == '/storeAdd' && from.path == '/suishenbangOutstoreVisit')
+    ) {
+      if (this.visitId != null && this.visitId != '') {
+        this.editDwellTimes();
+      }
+    }
+    next();
+  },
+  activated() {
+    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.list = [];
+    this.visitModel = this.$route.query.visitModel + '';
+    this.uType = localStorage.getItem('uType');
+    if (localStorage.getItem('visitId') != null) {
+      this.visitId = localStorage.getItem('visitId');
+      setTimeout(() => {
+        this.addVisits();
+      });
+    } else {
+      setTimeout(() => {
+        this.addVisits();
+      });
+    }
+  },
+  methods: {
+    animation() {
+      //前时间减去上次开启时间减去暂停累计时间
+      var times = new Date().getTime() - new Date(this.startTime).getTime();
+      var house = Math.floor(times / 3600000); //毫秒转化为分钟
+      var minutes = Math.floor(times / 60000 - house * 60); //毫秒转化为分钟
+      var minutes1 = Math.floor(times / 60000); //毫秒转化为分钟
+      var seconds = Math.floor((times - minutes1 * 60000) / 1000); //已知分钟将time减去分钟 除去1000得出 秒
+      var ms = Math.floor((times - minutes1 * 60000 - seconds * 1000) / 10); //
+      this.showTime =
+        (house < 10 ? '0' + house : house) +
+        ':' +
+        (minutes < 10 ? '0' + minutes : minutes) +
+        ':' +
+        (seconds < 10 ? '0' + seconds : seconds);
+      // +":"
+      // +(ms<10 ? "0"+ms : ms);
+    },
+    // 结束拜访
+    onstopVisit() {
+      this.$dialog
+        .confirm({
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          title: '系统提示',
+          message: '取消拜访会清空填写的拜访内容和照片,是否确认?',
+        })
+        .then(() => {
+          stopVisit({ visitsId: this.visitId }).then((res) => {
+            if (res.code == 200) {
+              this.$dialog
+                .alert({
+                  title: '系统提示',
+                  message: '拜访中任务结束成功!',
+                })
+                .then(() => {
+                  // this.$router.replace({});
+                  this.onClickLeft();
+                  // window.location.replace(window.location.origin + '/mobile/outsidelist/index');
+                });
+            } else {
+              this.$dialog.alert({
+                title: '系统提示',
+                message: res.msg,
+              });
+            }
+          });
+        });
+    },
+    overbookingFn(val) {
+      buryingPoint({
+        systemModel: '拜访页',
+        buryingPointType: 1,
+        buryingPointValue: val.storeName + '(' + val.storeCode + ')',
+        buryingPointName: '去下单',
+        buryingPointPosition: '拜访页',
+      });
+      this.toastLoading(0, '加载中...', true);
+      getOrderUrlByStoreId({
+        storeId: this.$route.query.storeId,
+        from: this.$route.query.from,
+      }).then((res) => {
+        this.toastLoading().clear();
+        if (res.code == 200 && res.data) {
+          window.location.href = res.data;
+        } else {
+          this.Toast({
+            message: res.msg,
+            duration: 5000,
+          });
+        }
+      });
+    },
+    visitFn(val) {
+      var that = this;
+      suishenbangStoreSale({ storeCode: val }).then((res) => {
+        if (res.code == 200) {
+          if (res.data.num != '0') {
+            window.location.href =
+              process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + val;
+          } else {
+            that.$toast(res.data.msg);
+          }
+        } else {
+          that.$toast(res.msg);
+        }
+      });
+    },
+    getLocation() {
+      let loading1 = this.$toast.loading({
+        duration: 0,
+        message: '加载中...',
+        forbidClick: true,
+      });
+      this.list = [];
+      let url = window.location.href;
+      let that = this;
+      let wx = this.wx;
+      let qiyeData;
+      const instance = axios.create();
+      instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
+      instance
+        .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
+          params: {
+            url: url,
+          },
+        })
+        .then((response) => {
+          if (response.status == 200) {
+            loading1.clear();
+            qiyeData = response.data.data;
+            wx.config({
+              beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
+              debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+              appId: qiyeData.appId, // 必填,企业微信的corpID
+              timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
+              nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
+              signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
+              jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+            });
+            wx.ready(function () {
+              wx.getLocation({
+                type: 'gcj02',
+                success: function (res) {
+                  var location = that.CJ02BD(res.latitude, res.longitude);
+                  that.location = location;
+                  if (that.urlParameter.lat == '' || that.urlParameter.lat == null) {
+                    that.lat = that.location.lat;
+                    that.lon = that.location.lon;
+                  }
+                  let PointSum = that
+                    .twoPointSum(that.lat, that.lon, location.lat, location.lon)
+                    .toFixed(2);
+                  if (PointSum > 500) {
+                    that.visitModel = '5';
+                    localStorage.setItem('visitModel', '5');
+                    that.$dialog
+                      .confirm({
+                        confirmButtonText: '确定',
+                        cancelButtonText: '重新定位',
+                        title: '系统提示',
+                        message: '距离本店距离差距太大',
+                      })
+                      .then(() => {
+                        that.addVisits();
+                      })
+                      .catch(() => {
+                        that.getLocation();
+                      });
+                  } else {
+                    that.addVisits();
+                  }
+                },
+                fail: function () {
+                  that.$dialog
+                    .alert({
+                      message: 'GPS未开启',
+                    })
+                    .then(() => {
+                      that.getLocation();
+                    });
+                },
+              });
+            });
+          }
+        });
+    },
+    editDwellTimes() {
+      let dwellTime = this.weekend(localStorage.getItem('startTime'), new Date()) + '';
+      editDwellTime({ dwellTime: dwellTime, visitsId: this.visitId }).then((res) => {
+        if (res.code == 200) {
+          localStorage.removeItem('visitId');
+        }
+      });
+    },
+
+    weekend(time1) {
+      var arrtime1 = new Date(time1).getTime();
+      var arrtime2 = new Date().getTime();
+      return Math.round((arrtime2 - arrtime1) / 1000);
+    },
+    addVisits() {
+      var postType = localStorage.getItem('postType');
+      if (postType == 'GZ') {
+        this.addShow1 = false;
+      } else {
+        this.addShow1 = true;
+      }
+      var visitEntry = '';
+      if (this.urlParameter.tabVal == '0') {
+        visitEntry = '2';
+      } else {
+        visitEntry = '1';
+      }
+      if (this.$route.query.shopCode != undefined) {
+        this.storeCode = this.$route.query.shopCode;
+      }
+      var that = this;
+
+      var map = new TMap.Map('allmap', {
+        zoom: 14,
+        center: new TMap.LatLng(39.986785, 116.301012),
+      });
+
+      var geocoder = new TMap.service.Geocoder();
+      var markers = new TMap.MultiMarker({
+        map: map,
+        geometries: [],
+      });
+      markers.setGeometries([]);
+      var input = [that.urlParameter.marklat, that.urlParameter.marklon];
+      var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
+      geocoder.getAddress({ location: location }).then(
+        function (result) {
+          var addresses = result.result.formatted_addresses;
+          let address_component = result.result.address_component;
+          let province = address_component.province;
+          let city = address_component.city;
+          let district = address_component.district;
+          console.log('province=' + province);
+          console.log('city=' + city);
+          console.log('district=' + district);
+          let recommend = '';
+          if (addresses) {
+            recommend = addresses.recommend;
+          }
+          var params = {
+            storeId: that.storeId,
+            storeCode: that.storeCode,
+            visitEntry: visitEntry,
+            lat: that.urlParameter.latNew,
+            lon: that.urlParameter.lonNew,
+            visitModel: that.visitModel,
+            routeDetailsId: that.rdId,
+            visitSource: '1',
+            locationCity: '',
+            locationRemark: recommend,
+            locationAccuracy: that.urlParameter.PointSum,
+            province: address_component.province,
+            city: address_component.city,
+            district: address_component.district,
+          };
+          that.locationAccuracy = that.urlParameter.PointSum;
+          that.city = '';
+          that.address = recommend;
+          localStorage.setItem('address', '');
+          if (that.visitId != null) {
+            params.id = that.visitId;
+          }
+          let loading2 = that.$toast.loading({
+            duration: 0,
+            message: '加载中...',
+            forbidClick: true,
+          });
+          getStoreGroupTask(params).then((res) => {
+            loading2.clear();
+            if (res.code == 200) {
+              localStorage.setItem('visitId', res.data.visitId);
+              that.notes = res.data.notes;
+              that.visitId = res.data.visitId;
+              that.list = res.data.sfaTaskList;
+              that.storeGroupId = res.data.storeGroupId;
+              that.showOrderButton = res.data.showOrderButton;
+              that.startTime = res.data.startTime;
+              that.timeN = setInterval(that.animation, 16);
+              that.visitsRemarks = res.data.visitsRemarks;
+            } else {
+              that.$toast(res.msg);
+            }
+          });
+        },
+        function (err) {
+          var params = {
+            storeId: that.storeId,
+            storeCode: that.storeCode,
+            visitEntry: visitEntry,
+            lat: that.urlParameter.latNew,
+            lon: that.urlParameter.lonNew,
+            visitModel: that.visitModel,
+            routeDetailsId: that.rdId,
+            visitSource: '1',
+            locationCity: '',
+            locationRemark: '',
+            locationAccuracy: that.urlParameter.PointSum,
+          };
+          that.locationAccuracy = that.urlParameter.PointSum;
+          that.city = '';
+          that.address = '';
+          localStorage.setItem('address', '');
+          if (that.visitId != null) {
+            params.id = that.visitId;
+          }
+          let loading2 = that.$toast.loading({
+            duration: 0,
+            message: '加载中...',
+            forbidClick: true,
+          });
+          getStoreGroupTask(params).then((res) => {
+            loading2.clear();
+            if (res.code == 200) {
+              localStorage.setItem('visitId', res.data.visitId);
+              that.notes = res.data.notes;
+              that.visitId = res.data.visitId;
+              that.list = res.data.sfaTaskList;
+              that.storeGroupId = res.data.storeGroupId;
+              that.showOrderButton = res.data.showOrderButton;
+              that.startTime = res.data.startTime;
+              that.timeN = setInterval(that.animation, 16);
+              that.visitsRemarks = res.data.visitsRemarks;
+            } else {
+              that.$toast(res.msg);
+            }
+          });
+        }
+      );
+    },
+    addStoreVisit(val, index) {
+      this.$router.push({
+        path: '/addStoreVisit',
+        query: {
+          storeId: this.storeId,
+          storeCode: this.urlParameter.storeCode,
+          visitId: this.visitId,
+          ids: index,
+          taskId: val.taskId,
+          storeGroupId: this.storeGroupId,
+          taskType: val.taskType,
+          photoType: val.photoType,
+          lat: this.lat,
+          lon: this.lon,
+          visitSource: '1',
+          visitModel: this.visitModel,
+          locationCity: this.city,
+          locationRemark: this.address,
+          locationAccuracy: this.locationAccuracy,
+          photoIdentifyType: val.photoIdentifyType,
+        },
+      });
+    },
+    onClickLeft() {
+      if (this.$route.query.urltype == 1) {
+        window.location.replace(window.location.origin + '/mobile/home');
+      } else {
+        this.$router.go(-1);
+      }
+    },
+    onshouow() {
+      this.uploadshow = false;
+      this.questionsshow = false;
+    },
+    uploadImgEdit() {
+      if (this.uploadImgEditText == '编辑') {
+        this.uploadImgEditText = '完成';
+      } else {
+        this.uploadImgEditText = '编辑';
+        this.uploadImgshow = false;
+      }
+    },
+    deleteImg(index) {
+      this.imgs.splice(index, 1);
+    },
+    questionClick(item) {
+      console.log(item);
+      if (item.isUpload) {
+        this.uploadshow = true;
+      } else if (item.isQuestion) {
+        this.questionsshow = true;
+      }
+    },
+    endVisitsFn() {
+      if (this.list.length == 0) {
+        this.$toast('暂无任务提交');
+        return;
+      }
+      for (var vl = 0; vl < this.list.length; vl++) {
+        if (this.list[vl].isMust == '0') {
+          if (!this.list[vl].success) {
+            this.$toast(this.list[vl].taskName + '任务未完成');
+            return;
+          }
+        }
+      }
+      let loading1 = this.$toast.loading({
+        duration: 0,
+        message: '加载中...',
+        forbidClick: true,
+      });
+      let dwellTime = this.weekend(localStorage.getItem('startTime'), new Date());
+      let storeCode = this.storeCode;
+      if (this.$route.query.shopCode != undefined) {
+        storeCode = this.$route.query.shopCode;
+      }
+      if (this.flag) {
+        this.flag = false;
+        this.timer = null;
+        this.timer = setTimeout(() => {
+          this.flag = true;
+        }, 5000);
+        endVisits({
+          visitSource: '1',
+          storeGroupId: this.storeGroupId,
+          id: this.visitId,
+          storeCode: storeCode,
+          dwellTime: dwellTime,
+          visitModel: this.$route.query.visitModel,
+        }).then((res) => {
+          this.flag = true;
+          loading1.clear();
+          if (res.code == 200) {
+            this.editDwellTimes();
+            if (this.$route.query.linkType == 6) {
+              window.location.replace(window.location.origin + '/mobile/topStore?info=y');
+            } else {
+              if (this.$route.query.urltype == 1) {
+                window.location.replace(window.location.origin + '/mobile/home');
+              } else {
+                this.onClickLeft();
+                // window.location.replace(
+                //   window.location.origin + '/mobile/outsidelist/index?info=y'
+                // );
+              }
+            }
+          } else {
+            this.$toast({
+              message: res.msg,
+              duration: 5000,
+            });
+          }
+        });
+      }
+    },
+    newimgarr1(val) {
+      this.imgs = val;
+    },
+    uploadImgShowFn() {
+      this.uploadImgshow = true;
+      if (this.uploadImages.length <= 0) {
+        this.uploadImgEditText = '';
+      }
+    },
+    previewsImg(index) {
+      ImagePreview({
+        images: this.uploadImages,
+        startPosition: index,
+        onClose() {
+          // do something
+        },
+      });
+    },
+    // 物料历史
+    wuliaoLog() {
+      this.toastLoading(0, '加载中...', true);
+      getMaterialHistory({ storeId: this.storeId })
+        .then((res) => {
+          this.toastLoading().clear();
+          if (res.code == 200 && res.data) {
+            this.wuliaoList = res.data;
+            this.wuliaoTable = true;
+          }
+        })
+        .catch(() => {
+          this.toastLoading().clear();
+        });
+    },
+    wuliaoTableClose() {
+      this.wuliaoTable = false;
+    },
+  },
+  destroyed() {
+    this.timeN = null;
+    clearInterval(this.timeN);
+  },
+};
+</script>
+<style lang="scss" scoped>
+.container {
+  margin-bottom: 10px;
+  background-color: white;
+  /*padding:0 16px;*/
+}
+.navBarOverlay {
+  background: #fff;
+}
+.card {
+  background: #fff;
+  box-sizing: border-box;
+  padding: 10px 16px;
+  .title {
+    line-height: 32px;
+    font-size: 16px;
+    font-weight: bold;
+    color: #333;
+  }
+  .subtitle {
+    line-height: 24px;
+    font-size: 14px;
+    color: #7b7b7b;
+    .status {
+      float: right;
+    }
+  }
+  .info {
+    font-size: 14px;
+    color: #484848;
+    padding: 14px;
+    border-bottom: 1px solid #f1f1f1;
+    position: relative;
+    .arrow {
+      float: right;
+      display: inline-block;
+      height: 20px;
+      width: 20px;
+      line-height: 20px;
+      text-align: center;
+      border-radius: 50%;
+      background: #0057ba;
+      color: #fff;
+      font-weight: bold;
+      font-size: 14px;
+      position: absolute;
+      margin-top: -10px;
+      right: 0;
+      top: 50%;
+    }
+  }
+  .info1 {
+    font-size: 14px;
+    color: #666;
+    line-height: 18px;
+    padding: 4px 0;
+    position: relative;
+    .arrow {
+      float: right;
+      display: inline-block;
+      height: 20px;
+      width: 20px;
+      line-height: 20px;
+      text-align: center;
+      border-radius: 50%;
+      background: #0057ba;
+      color: #fff;
+      font-weight: bold;
+      font-size: 14px;
+      margin-top: 9px;
+      position: absolute;
+      right: 0;
+      top: 50%;
+      margin-top: -10px;
+    }
+  }
+}
+.must {
+  font-size: 18px;
+  color: #f56c6c;
+  margin-right: 2px;
+}
+.zw {
+  display: inline-block;
+  width: 7px;
+  height: 100%;
+}
+.lineGrey {
+  height: 10px;
+  width: 100%;
+  background: #f1f1f1;
+}
+.submitBtn {
+  margin: 16px 0;
+  font-size: 18px;
+}
+.wrapper {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
+  .block {
+    width: 100%;
+    height: 100%;
+    background-color: #fff;
+    overflow: auto;
+  }
+}
+.questionName {
+  font-size: 16px;
+  color: #484848;
+  /*line-height: 40px;*/
+  background: #f4f4f4;
+  padding: 10px 15px;
+  box-sizing: border-box;
+  position: relative;
+  display: flex;
+  justify-content: center;
+  .text {
+    flex: 9;
+  }
+}
+.answerDiv {
+  background: #fff;
+  padding: 0 15px 10px;
+  .answerItem {
+    padding: 10px 0;
+    border-bottom: 1px solid #dedede;
+    .name {
+      line-height: 36px;
+      font-size: 14px;
+      color: #8b8b8b;
+    }
+  }
+}
+.border {
+  border: 1px solid #dedede;
+}
+.ht30 {
+  height: 30px;
+}
+.bodrder-b {
+  border-bottom: 1px solid #dedede;
+}
+.img-box {
+  width: 50%;
+  /*height: 100%;*/
+  position: relative;
+  padding: 10px;
+  display: inline-block;
+  i {
+    position: absolute;
+    right: 2px;
+    top: 2px;
+  }
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}
+.imgNull {
+  text-align: center;
+  padding-top: 100px;
+  i {
+    color: #dedede;
+  }
+  div {
+    padding-top: 30px;
+    font-size: 18px;
+    font-weight: bold;
+  }
+}
+.card .f-blue {
+  color: #0057ba;
+}
+</style>
+<style lang="scss">
+.navBarOverlay .van-nav-bar__left .van-icon {
+  color: #8b8b8b;
+}
+.navBarOverlay .van-nav-bar__right .van-nav-bar__text {
+  color: #333;
+}
+.ht30 .van-radio__label {
+  color: #8b8b8b;
+}
+.van-dialog__confirm,
+.van-dialog__confirm:active {
+  color: #0057ba;
+}
+#allmap {
+  width: 20px;
+  height: 20px;
+  left: -1000px;
+  position: relative;
+}
+.el-dialog__wrapper {
+  z-index: 9999 !important;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background: rgba(0, 0, 0, 0.5) !important;
+  .wuliaoTable {
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
+    max-height: 70%;
+    margin-top: 0 !important;
+    .el-dialog__header {
+      height: 40px;
+      display: flex;
+      justify-content: right;
+      .el-dialog__headerbtn {
+        position: static !important;
+      }
+    }
+    .el-dialog__body {
+      padding: 30px 20px !important;
+      overflow-y: auto;
+      flex: 1;
+    }
+    .cell {
+      font-size: 12px;
+    }
+  }
+}
+</style>

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

@@ -147,6 +147,7 @@ import {
   stopVisit,
   buryingPoint,
   getMaterialHistory,
+  getVisitTasks,
 } from '@/api/index';
 import axios from 'axios';
 import { saveVisitsParams, getOrderUrlByStoreId } from '@/api/inventory';
@@ -202,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') ||
@@ -229,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;
@@ -240,9 +230,9 @@ export default {
     this.contactName = this.$route.query.contactName + '';
     this.lat = this.$route.query.lat + '';
     this.lon = this.$route.query.lon + '';
-    this.list = [];
     this.visitModel = this.$route.query.visitModel + '';
     this.uType = localStorage.getItem('uType');
+    this.list = [];
     if (localStorage.getItem('visitId') != null) {
       this.visitId = localStorage.getItem('visitId');
       setTimeout(() => {
@@ -508,9 +498,10 @@ export default {
             message: '加载中...',
             forbidClick: true,
           });
-          getStoreGroupTask(params).then((res) => {
+          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;
@@ -551,7 +542,7 @@ export default {
             message: '加载中...',
             forbidClick: true,
           });
-          getStoreGroupTask(params).then((res) => {
+          getVisitTasks(params).then((res) => {
             loading2.clear();
             if (res.code == 200) {
               localStorage.setItem('visitId', res.data.visitId);
@@ -563,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);
             }
@@ -571,6 +563,8 @@ export default {
       );
     },
     addStoreVisit(val, index) {
+      localStorage.setItem('getRequestFlage', 'false');
+      console.log(this.visitId);
       this.$router.push({
         path: '/addStoreVisit',
         query: {
@@ -590,10 +584,15 @@ export default {
           locationRemark: this.address,
           locationAccuracy: this.locationAccuracy,
           photoIdentifyType: val.photoIdentifyType,
+          deviceCode: val.deviceCode,
+          putInCode: val.putInCode,
+          equipmentCode: val.equipmentCode,
+          inspectionType: val.inspectionType,
         },
       });
     },
     onClickLeft() {
+      localStorage.setItem('getRequestFlage', 'true');
       if (this.$route.query.urltype == 1) {
         window.location.replace(window.location.origin + '/mobile/home');
       } else {

+ 4 - 0
src/views/deviceOutside/topStore.vue

@@ -1412,6 +1412,10 @@ export default {
       });
     },
     storeVisit(val) {
+      if (val.visitSource && val.visitSource == 2) {
+        this.$toast('请先取消异常拜访后再进入正常拜访!');
+        return;
+      }
       localStorage.setItem('tabVal', this.tabVal);
       localStorage.removeItem('visitId');
       checkVisit({ storeId: val.storeId }).then((res) => {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 3104
src/views/deviceWithin/addStoreVisit copy.vue


+ 222 - 198
src/views/deviceWithin/addStoreVisit.vue

@@ -97,13 +97,6 @@
         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" />
@@ -124,7 +117,16 @@
               @blur="inputblur(item.titleValue, scope.$index, '0')"
           /></template>
         </el-table-column>
-        <!-- <el-table-column prop="name">
+      </el-table>
+      <el-table :data="tableData1" border class="table-headermd" style="width: 100%">
+        <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 prop="name">
           <template slot="header"> <span>进货原价</span><span class="xing">*</span> </template>
           <template slot-scope="scope"
             ><van-field
@@ -155,7 +157,7 @@
               type="number"
               @blur="inputblur(scope.row.ygnhj, scope.$index, '2')"
           /></template>
-        </el-table-column> -->
+        </el-table-column>
       </el-table>
       <div v-if="unManage == 0" style="margin: 10px">
         <van-checkbox v-model="checked" shape="square">全部不经营</van-checkbox>
@@ -330,6 +332,8 @@
             <van-field
               v-model="item.answerValue"
               :formatter="formatter"
+              autosize
+              type="textarea"
               :placeholder="item.text"></van-field>
             <p
               style="
@@ -505,6 +509,8 @@
                       <van-field
                         v-model="childitem.collectionOptionList[0].answerValue"
                         :formatter="formatter"
+                        autosize
+                        type="textarea"
                         :placeholder="childitem.text"></van-field>
                       <p
                         style="
@@ -870,6 +876,8 @@
                                 <van-field
                                   v-model="childitem1.collectionOptionList[0].answerValue"
                                   :formatter="formatter"
+                                  autosize
+                                  type="textarea"
                                   :placeholder="childitem1.text"></van-field>
                                 <p
                                   style="
@@ -1194,6 +1202,8 @@
                                               child33item1.collectionOptionList[0].answerValue
                                             "
                                             :formatter="formatter"
+                                            autosize
+                                            type="textarea"
                                             :placeholder="child33item1.text"></van-field>
                                           <p
                                             style="
@@ -1800,6 +1810,8 @@
                                                           .answerValue
                                                       "
                                                       :formatter="formatter"
+                                                      autosize
+                                                      type="textarea"
                                                       :placeholder="child44item1.text"></van-field>
                                                     <p
                                                       style="
@@ -2722,9 +2734,10 @@
 
 <script>
 import {
+  getStoreGroupTask,
   getPhotoTypeList,
   addCollectionAnswer,
-  getStoreGroupTask,
+  getCollectionInfos,
   editDwellTime,
   deleteTaskAnswer,
   getCollectionShowHistory,
@@ -2826,6 +2839,9 @@ export default {
       photoIdentifyType: null, //图片识别类型
       pictureSource: '0',
       stillDistribute: false,
+      productTitles: null,
+      inspectionType: '',
+      competitortableData: [],
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -2835,6 +2851,7 @@ export default {
     next();
   },
   activated() {
+    this.showCode = false;
     this.flag = false;
     this.link = '3';
     this.wuliaoMust = true;
@@ -2844,7 +2861,11 @@ export default {
     this.visitId = this.$route.query.visitId + '';
     this.taskId = this.$route.query.taskId + '';
     this.storeId = this.$route.query.storeId + '';
-    this.isMust == this.$route.query.isMust + '';
+    this.isMust = this.$route.query.isMust + '';
+    this.deviceCode = this.$route.query.deviceCode;
+    this.putInCode = this.$route.query.putInCode;
+    this.equipmentCode = this.$route.query.equipmentCode;
+    this.inspectionType = this.$route.query.inspectionType;
     this.photoIdentifyType = this.$route.query.photoIdentifyType;
     this.storeGroupId = this.$route.query.storeGroupId + '';
     if (this.$route.query.photoType != null) {
@@ -2874,7 +2895,11 @@ export default {
     this.visitId = this.$route.query.visitId + '';
     this.taskId = this.$route.query.taskId + '';
     this.storeId = this.$route.query.storeId + '';
-    this.isMust == this.$route.query.isMust + '';
+    this.isMust = this.$route.query.isMust + '';
+    this.deviceCode = this.$route.query.deviceCode;
+    this.putInCode = this.$route.query.putInCode;
+    this.equipmentCode = this.$route.query.equipmentCode;
+    this.inspectionType = this.$route.query.inspectionType;
     this.photoIdentifyType = this.$route.query.photoIdentifyType;
     this.storeGroupId = this.$route.query.storeGroupId + '';
     if (this.$route.query.photoType != null) {
@@ -3018,7 +3043,6 @@ export default {
         }
       }
       if (val.type == 'E') {
-        debugger;
         this.collectionItemList[val.index].collectionOptionList[val.index1].collectionItems[
           val.index2
         ].collectionOptionList[val.index3].collectionItems[val.index4].collectionOptionList[
@@ -3210,6 +3234,7 @@ export default {
             taskId: that.$route.query.taskId,
           }).then((res) => {
             if (res.code == 200) {
+              localStorage.setItem('getRequestFlage', 'true');
               that.$dialog
                 .alert({
                   title: '系统提示',
@@ -3294,77 +3319,76 @@ export default {
         insert = true;
       }
       this.insert = insert;
-      if (this.$route.query.type == 'edit') {
-        var params = {
-          storeId: this.$route.query.storeId,
-          storeCode: this.$route.query.storeCode,
-          visitEntry: '0',
-          lat: '',
-          lon: '',
-          visitModel: this.visitModel,
-          routeDetailsId: '',
-          storeGroupId: this.$route.query.storeGroupId,
-          visitSource: '1',
-          insert: insert,
-          locationCity: '',
-          locationRemark: '',
-          locationAccuracy: '',
-        };
-      } else {
-        var params = {
-          storeId: this.storeId,
-          storeCode: this.$route.query.storeCode,
-          visitEntry: '0',
-          lat: this.$route.query.lat,
-          lon: this.$route.query.lon,
-          visitModel: this.$route.query.visitModel,
-          routeDetailsId: this.$route.query.taskId,
-          locationCity: this.$route.query.locationCity,
-          insert: insert,
-          locationRemark: this.$route.query.locationRemark,
-          locationAccuracy: this.$route.query.locationAccuracy,
-          visitSource: this.$route.query.visitSource,
-        };
-      }
+      let params = {
+        storeCode: this.$route.query.storeCode, //	string	门店编码
+        insert: insert, //	boolean	是否为拜访时进入,true-拜访时进入,false-编辑时进入
+        id: '', //	Long	拜访id
+        taskId: this.$route.query.taskId, //	Long	任务id
+      };
+      // if (this.$route.query.type == 'edit') {
+      //   var params = {
+      //     storeId: this.$route.query.storeId,
+      //     storeCode: this.$route.query.storeCode,
+      //     visitEntry: '0',
+      //     lat: '',
+      //     lon: '',
+      //     visitModel: this.visitModel,
+      //     routeDetailsId: '',
+      //     storeGroupId: this.$route.query.storeGroupId,
+      //     visitSource: '1',
+      //     insert: insert,
+      //     locationCity: '',
+      //     locationRemark: '',
+      //     locationAccuracy: '',
+      //   };
+      // } else {
+      //   var params = {
+      //     storeId: this.storeId,
+      //     storeCode: this.$route.query.storeCode,
+      //     visitEntry: '0',
+      //     lat: this.$route.query.lat,
+      //     lon: this.$route.query.lon,
+      //     visitModel: this.$route.query.visitModel,
+      //     routeDetailsId: this.$route.query.taskId,
+      //     locationCity: this.$route.query.locationCity,
+      //     insert: insert,
+      //     locationRemark: this.$route.query.locationRemark,
+      //     locationAccuracy: this.$route.query.locationAccuracy,
+      //     visitSource: this.$route.query.visitSource,
+      //   };
+      // }
       if (this.$route.query.visitId != null) {
         params.id = this.$route.query.visitId;
       }
-      getStoreGroupTask(params).then((res) => {
+      console.log(params.id);
+      getCollectionInfos(params).then((res) => {
         loading1.clear();
-        this.deviceCode = '';
-        this.putInCode = '';
-        // 竞品调查-table动态化数据
-        this.productTitles = res.data.sfaTaskList[this.$route.query.ids].productTitles; //产品类型表头数据
-        // this.equipmentCode = res.data.equipmentCode;
-        var checkUnManage = res.data.sfaTaskList[this.$route.query.ids];
-        var collectionItemLists = res.data.sfaTaskList[this.$route.query.ids].collectionItemList;
+        this.productTitles = res.data.productTitles; //产品类型表头数据
+        var checkUnManage = res.data;
+        var collectionItemLists = res.data.collectionItemList;
         if (checkUnManage.checkUnManage != null && checkUnManage.checkUnManage != 'N') {
           this.checked = true;
         } else {
           this.checked = false;
         }
-        this.unManage = res.data.sfaTaskList[this.$route.query.ids].unManage;
-        this.deviceCode = res.data.sfaTaskList[this.$route.query.ids].deviceCode || ''; // 设备编号
-        this.putInCode = res.data.sfaTaskList[this.$route.query.ids].putInCode || ''; // 投放编号
+        this.unManage = res.data.unManage;
         // 调色机类型:buy-购买类调色机,place-放置类调色机 不显示设备编号和投放编号
-        let inspectionType = res.data.sfaTaskList[this.$route.query.ids].inspectionType;
-        if (inspectionType == 'buy') {
-          this.equipmentCode = res.data.sfaTaskList[this.$route.query.ids].putInCode || '';
+        if (this.inspectionType == 'buy') {
+          this.equipmentCode = this.putInCode || '';
           this.showCode = true;
-        } else if (inspectionType == 'place') {
-          this.equipmentCode = res.data.sfaTaskList[this.$route.query.ids].equipmentCode || '';
+        } else if (this.inspectionType == 'place') {
+          this.equipmentCode = this.equipmentCode || '';
           this.showCode = false;
         }
         if (
-          (res.data.sfaTaskList[this.$route.query.ids].processStatus == 3 &&
-            this.$route.query.types == 'edit') ||
-          res.data.sfaTaskList[this.$route.query.ids].processStatus == undefined
+          (res.data.processStatus == 3 && this.$route.query.types == 'edit') ||
+          res.data.processStatus == undefined
         ) {
           this.processKey = true;
         } else {
           this.processKey = false;
         }
-        this.infoShow = res.data.sfaTaskList[this.$route.query.ids].isMust;
+        this.infoShow = res.data.isMust;
         if (this.$route.query.taskType == 1) {
           for (var q = 0; q < collectionItemLists.length; q++) {
             if (
@@ -3734,44 +3758,46 @@ export default {
             }
           }
           this.collectionItemList = collectionItemLists;
-        } else if (this.$route.query.taskType == 2) {
-          for (var f = 0; f < collectionItemLists.length; f++) {
-            var collectionOptionListarr = collectionItemLists[f].collectionOptionList;
-            for (let p = 0; p < this.productTitles.length; p++) {
-              for (var ff = 0; ff < collectionOptionListarr.length; ff++) {
-                if (
-                  this.productTitles[p].titleValue == collectionOptionListarr[ff].collectionOption
-                ) {
-                  collectionItemLists[f][this.productTitles[p].titleValue] =
-                    collectionOptionListarr[ff].answerValue;
+        } else {
+          if (this.$route.query.taskType == 2 && this.productTitles) {
+            for (var f = 0; f < collectionItemLists.length; f++) {
+              var collectionOptionListarr = collectionItemLists[f].collectionOptionList;
+              for (let p = 0; p < this.productTitles.length; p++) {
+                for (var ff = 0; ff < collectionOptionListarr.length; ff++) {
+                  if (
+                    this.productTitles[p].titleValue == collectionOptionListarr[ff].collectionOption
+                  ) {
+                    collectionItemLists[f][this.productTitles[p].titleValue] =
+                      collectionOptionListarr[ff].answerValue;
+                  }
                 }
               }
             }
-          }
-          this.competitortableData = collectionItemLists;
-        } else {
-          for (var f = 0; f < collectionItemLists.length; f++) {
-            var collectionOptionListarr = collectionItemLists[f].collectionOptionList;
-            for (var ff = 0; ff < collectionOptionListarr.length; ff++) {
-              if (ff == '0') {
-                collectionItemLists[f].xdjhyj = collectionOptionListarr[ff].answerValue;
-                collectionItemLists[f].value = collectionOptionListarr[ff].answerValue;
-                collectionItemLists[f].contrastValue = collectionOptionListarr[ff].answerValue;
-              }
-              if (ff == '1') {
-                collectionItemLists[f].xdjhchjj = collectionOptionListarr[ff].answerValue;
-                if (collectionOptionListarr[ff].answerValue == null) {
-                  collectionItemLists[f].answerVal = 'T';
-                } else {
-                  collectionItemLists[f].answerVal = '';
+            this.competitortableData = collectionItemLists;
+          } else {
+            for (var f = 0; f < collectionItemLists.length; f++) {
+              var collectionOptionListarr = collectionItemLists[f].collectionOptionList;
+              for (var ff = 0; ff < collectionOptionListarr.length; ff++) {
+                if (ff == '0') {
+                  collectionItemLists[f].xdjhyj = collectionOptionListarr[ff].answerValue;
+                  collectionItemLists[f].value = collectionOptionListarr[ff].answerValue;
+                  collectionItemLists[f].contrastValue = collectionOptionListarr[ff].answerValue;
+                }
+                if (ff == '1') {
+                  collectionItemLists[f].xdjhchjj = collectionOptionListarr[ff].answerValue;
+                  if (collectionOptionListarr[ff].answerValue == null) {
+                    collectionItemLists[f].answerVal = 'T';
+                  } else {
+                    collectionItemLists[f].answerVal = '';
+                  }
+                }
+                if (ff == '2') {
+                  collectionItemLists[f].ygnhj = collectionOptionListarr[ff].answerValue;
                 }
-              }
-              if (ff == '2') {
-                collectionItemLists[f].ygnhj = collectionOptionListarr[ff].answerValue;
               }
             }
+            this.tableData1 = collectionItemLists;
           }
-          this.tableData1 = collectionItemLists;
         }
       });
     },
@@ -3779,6 +3805,7 @@ export default {
       this.$toast(val);
     },
     inputblurs(val, index, num) {
+      if (!val) return;
       if ((val + '').trim() == '') {
         this.tableData1[index].xdjhchjj = '';
       } else {
@@ -3803,34 +3830,48 @@ export default {
         }
       }
     },
-    inputblur(itemVal, index) {
-      let value = this.competitortableData[index][itemVal];
-      if (value.split('.')[1] == '' || (value + '').trim() == '') {
+    inputblur(val, index, num) {
+      if (val.split('.')[1] == '' || (val + '').trim() == '') {
         this.$toast('请输入正确格式数字');
-        this.competitortableData[index][itemVal] = '';
+        if (num == '0') {
+          this.tableData1[index].xdjhyj = '';
+        }
+        if (num == '1') {
+          this.tableData1[index].xdjhchjj = '';
+        }
+        if (num == '2') {
+          this.tableData1[index].ygnhj = '';
+        }
       } else {
-        if (!/^\d+(\.\d{1,2})?$/.test(value) || Number(value) > 10000 || Number(value) <= 0) {
+        if (!/^\d+(\.\d{1,2})?$/.test(val) || Number(val) > 10000 || Number(val) <= 0) {
           this.$toast('请输入大于0并且小于10000的两位小数');
-          this.competitortableData[index][itemVal] = '';
-          ff;
+          if (num == '0') {
+            this.tableData1[index].xdjhyj = '';
+          }
+          if (num == '1') {
+            this.tableData1[index].xdjhchjj = '';
+          }
+          if (num == '2') {
+            this.tableData1[index].ygnhj = '';
+          }
         } else {
-          // if (num == '0') {
-          //   if (this.tableData1[index].xdjhyj < this.tableData1[index].xdjhchjj) {
-          //     this.tableData1[index].xdjhyj = '';
-          //     this.$toast('请输入大于等于促后净价的数字');
-          //   }
-          // }
-          // if (num == '1') {
-          //   if (this.tableData1[index].xdjhyj == '') {
-          //     this.tableData1[index].xdjhchjj = '';
-          //     this.$toast('请输入进货原价');
-          //   } else {
-          //     if (Number(val) > Number(this.tableData1[index].xdjhyj)) {
-          //       this.$toast('请输入小于等于进货原价的数字');
-          //       this.tableData1[index].xdjhchjj = '';
-          //     }
-          //   }
-          // }
+          if (num == '0') {
+            if (this.tableData1[index].xdjhyj < this.tableData1[index].xdjhchjj) {
+              this.tableData1[index].xdjhyj = '';
+              this.$toast('请输入大于等于促后净价的数字');
+            }
+          }
+          if (num == '1') {
+            if (this.tableData1[index].xdjhyj == '') {
+              this.tableData1[index].xdjhchjj = '';
+              this.$toast('请输入进货原价');
+            } else {
+              if (Number(val) > Number(this.tableData1[index].xdjhyj)) {
+                this.$toast('请输入小于等于进货原价的数字');
+                this.tableData1[index].xdjhchjj = '';
+              }
+            }
+          }
         }
       }
     },
@@ -4649,92 +4690,73 @@ export default {
           }
         }
       } else if (this.$route.query.taskType == 2) {
-        for (let dy = 0; dy < this.competitortableData.length; dy++) {
-          for (let p = 0; p < this.productTitles.length; p++) {
-            if (this.competitortableData[dy][this.productTitles[p].titleValue] == '') {
+        for (let dy = 0; dy < this.tableData1.length; dy++) {
+          if (this.tableData1[dy].xdjhchjj != '') {
+            if (
+              this.tableData1[dy].xdjhyj == '' ||
+              this.tableData1[dy].ygnhj == '' ||
+              this.tableData1[dy].xdjhchjj.split('.')[1] == ''
+            ) {
               this.$dialog.alert({
                 title: '系统提示',
-                message: '请完善' + this.competitortableData[dy].collectionName + '信息',
+                message: '请完善' + this.tableData1[dy].collectionName + '信息或促后竞价格式不正确',
+              });
+              return false;
+            }
+          }
+          if (this.tableData1[dy].xdjhyj != '') {
+            if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].ygnhj == '') {
+              this.$dialog.alert({
+                title: '系统提示',
+                message: '请完善' + this.tableData1[dy].collectionName + '信息',
+              });
+              return false;
+            }
+          }
+          if (this.tableData1[dy].ygnhj != '') {
+            if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].xdjhyj == '') {
+              this.$dialog.alert({
+                title: '系统提示',
+                message: '请完善' + this.tableData1[dy].collectionName + '信息',
               });
               return false;
             }
           }
-          // if (this.tableData1[dy].xdjhchjj != '') {
-          //   if (
-          //     this.tableData1[dy].xdjhyj == '' ||
-          //     this.tableData1[dy].ygnhj == '' ||
-          //     this.tableData1[dy].xdjhchjj.split('.')[1] == ''
-          //   ) {
-          //     this.$dialog.alert({
-          //       title: '系统提示',
-          //       message: '请完善' + this.tableData1[dy].collectionName + '信息或促后竞价格式不正确',
-          //     });
-          //     return false;
-          //   }
-          // }
-          // if (this.tableData1[dy].xdjhyj != '') {
-          //   if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].ygnhj == '') {
-          //     this.$dialog.alert({
-          //       title: '系统提示',
-          //       message: '请完善' + this.tableData1[dy].collectionName + '信息',
-          //     });
-          //     return false;
-          //   }
-          // }
-          // if (this.tableData1[dy].ygnhj != '') {
-          //   if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].xdjhyj == '') {
-          //     this.$dialog.alert({
-          //       title: '系统提示',
-          //       message: '请完善' + this.tableData1[dy].collectionName + '信息',
-          //     });
-          //     return false;
-          //   }
-          // }
         }
-        for (var d = 0; d < this.competitortableData.length; d++) {
-          for (let p = 0; p < this.productTitles.length; p++) {
-            formData.collectionAnswers.push({
-              collectionId: this.competitortableData[d].collectionId,
-              itemName: this.competitortableData[d].collectionName,
-              collectionType: 'chanpin',
-              collectionOptionId:
-                this.competitortableData[d].collectionOptionList[p].collectionOptionId,
-              answerType: 'sz',
-              answerValue: this.competitortableData[d][this.productTitles[p].titleValue],
-            });
+        for (var d = 0; d < this.tableData1.length; d++) {
+          for (var dd = 0; dd < this.tableData1[d].collectionOptionList.length; dd++) {
+            if (dd == 0) {
+              formData.collectionAnswers.push({
+                collectionId: this.tableData1[d].collectionId,
+                itemName: this.tableData1[d].collectionName,
+                collectionType: 'chanpin',
+                collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
+                answerType: 'sz',
+                answerValue: this.tableData1[d].xdjhyj,
+              });
+            }
+            if (dd == 1) {
+              formData.collectionAnswers.push({
+                collectionId: this.tableData1[d].collectionId,
+                itemName: this.tableData1[d].collectionName,
+                collectionType: 'chanpin',
+                collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
+                answerType: 'sz',
+                answerValue: this.tableData1[d].xdjhchjj,
+              });
+            }
+            debugger;
+            if (dd == 2) {
+              formData.collectionAnswers.push({
+                collectionId: this.tableData1[d].collectionId,
+                itemName: this.tableData1[d].collectionName,
+                collectionType: 'chanpin',
+                collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
+                answerType: 'sz',
+                answerValue: this.tableData1[d].ygnhj,
+              });
+            }
           }
-          // for (var dd = 0; dd < this.tableData1[d].collectionOptionList.length; dd++) {
-          // if (dd == 0) {
-          //   formData.collectionAnswers.push({
-          //     collectionId: this.tableData1[d].collectionId,
-          //     itemName: this.tableData1[d].collectionName,
-          //     collectionType: 'chanpin',
-          //     collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
-          //     answerType: 'sz',
-          //     answerValue: this.tableData1[d].xdjhyj,
-          //   });
-          // }
-          // if (dd == 1) {
-          //   formData.collectionAnswers.push({
-          //     collectionId: this.tableData1[d].collectionId,
-          //     itemName: this.tableData1[d].collectionName,
-          //     collectionType: 'chanpin',
-          //     collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
-          //     answerType: 'sz',
-          //     answerValue: this.tableData1[d].xdjhchjj,
-          //   });
-          // }
-          // if (dd == 2) {
-          //   formData.collectionAnswers.push({
-          //     collectionId: this.tableData1[d].collectionId,
-          //     itemName: this.tableData1[d].collectionName,
-          //     collectionType: 'chanpin',
-          //     collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
-          //     answerType: 'sz',
-          //     answerValue: this.tableData1[d].ygnhj,
-          //   });
-          // }
-          // }
         }
       } else {
         for (var d = 0; d < this.tableData1.length; d++) {
@@ -4776,6 +4798,7 @@ export default {
             telName = item.itemName + '格式错误';
           }
         });
+        debugger;
         if (!telVerify) {
           this.$toast(telName);
         } else {
@@ -4788,6 +4811,7 @@ export default {
           }
           addCollectionAnswer(formData).then((res) => {
             if (res.code == 200) {
+              localStorage.setItem('getRequestFlage', 'true');
               this.$router.go(-1);
             } else {
               if (res.data) {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4983 - 0
src/views/deviceWithin/addStoreVisit111.vue


+ 4 - 0
src/views/deviceWithin/index.vue

@@ -735,6 +735,10 @@ export default {
       });
     },
     storeVisit(val) {
+      if (val.visitSource && val.visitSource == 2) {
+        this.$toast('请先取消异常拜访后再进入正常拜访!');
+        return;
+      }
       var that = this;
       localStorage.removeItem('visitId');
       checkVisit({ storeId: val.storeId }).then((res) => {

+ 30 - 18
src/views/deviceWithin/storeVisit.vue

@@ -161,6 +161,7 @@ import {
   restartProcess,
   buryingPoint,
   getMaterialHistory,
+  getVisitTasks,
 } from '@/api/index';
 import axios from 'axios';
 import sp from './../../assets/sp.png';
@@ -212,22 +213,23 @@ export default {
       restartProcessButtion: false,
       wuliaoTable: false,
       wuliaoList: [],
+      urlParameter: {},
     };
   },
   created() {
-    this.urlParameter = this.$route.query;
-    this.storeId = this.$route.query.storeId + '';
-    this.visitId = this.$route.query.visitId;
-    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.visitModel = this.$route.query.visitModel + '';
-    this.lat = this.$route.query.lat + '';
-    this.lon = this.$route.query.lon + '';
-    sessionStorage.setItem('visitModel', '1');
-    this.uType = localStorage.getItem('uType');
+    // this.urlParameter = this.$route.query;
+    // this.storeId = this.$route.query.storeId + '';
+    // this.visitId = this.$route.query.visitId;
+    // 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.visitModel = this.$route.query.visitModel + '';
+    // this.lat = this.$route.query.lat + '';
+    // this.lon = this.$route.query.lon + '';
+    // sessionStorage.setItem('visitModel', '1');
+    // this.uType = localStorage.getItem('uType');
   },
   beforeRouteLeave(to, from, next) {
     if (to.path == '/deviceWithin/index' && from.path == '/storeVisitpage') {
@@ -238,6 +240,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;
@@ -249,8 +254,9 @@ export default {
     this.visitModel = this.$route.query.visitModel + '';
     this.lat = this.$route.query.lat + '';
     this.lon = this.$route.query.lon + '';
-    this.list = [];
+    // this.list = [];
     this.uType = localStorage.getItem('uType');
+    this.list = [];
     if (this.$route.query.type != 'edit') {
       this.timeShow = true;
       if (localStorage.getItem('visitId') != null) {
@@ -443,7 +449,7 @@ export default {
               forbidClick: true,
             });
             that.list = [];
-            getStoreGroupTask(params).then((res) => {
+            getVisitTasks(params).then((res) => {
               loading2.clear();
               if (res.code == 200) {
                 that.notes = res.data.notes;
@@ -491,7 +497,7 @@ export default {
               forbidClick: true,
             });
             that.list = [];
-            getStoreGroupTask(params).then((res) => {
+            getVisitTasks(params).then((res) => {
               loading2.clear();
               if (res.code == 200) {
                 that.notes = res.data.notes;
@@ -541,7 +547,7 @@ export default {
               forbidClick: true,
             });
             that.list = [];
-            getStoreGroupTask(params).then((res) => {
+            getVisitTasks(params).then((res) => {
               loading2.clear();
               if (res.code == 200) {
                 that.notes = res.data.notes;
@@ -588,7 +594,7 @@ export default {
               forbidClick: true,
             });
             that.list = [];
-            getStoreGroupTask(params).then((res) => {
+            getVisitTasks(params).then((res) => {
               loading2.clear();
               if (res.code == 200) {
                 that.notes = res.data.notes;
@@ -701,6 +707,7 @@ export default {
         this.timer = setTimeout(() => {
           this.flag = true;
         }, 2000);
+        localStorage.setItem('getRequestFlage', 'false');
         this.$router.push({
           path: '/addStoreVisit',
           query: {
@@ -723,6 +730,10 @@ export default {
             locationAccuracy: this.locationAccuracy,
             insert: this.insert,
             photoIdentifyType: val.photoIdentifyType,
+            deviceCode: val.deviceCode,
+            putInCode: val.putInCode,
+            equipmentCode: val.equipmentCode,
+            inspectionType: val.inspectionType,
           },
         });
       }
@@ -731,6 +742,7 @@ export default {
       // localStorage.setItem('collectionItemList', JSON.stringify(val.collectionItemList));
     },
     onClickLeft() {
+      localStorage.setItem('getRequestFlage', 'true');
       if (this.$route.query.urltype == 2) {
         window.location.replace(window.location.origin + '/mobile/home');
       } else {

+ 1 - 0
src/views/historicalVisit/historAllVisit.vue

@@ -312,6 +312,7 @@ export default {
       this.endminDate = new Date(this.getDay(-7));
     },
     detilsFn(val) {
+      console.log(val.id);
       this.$router.push({
         path: '/historicalDetails',
         query: {

+ 4 - 7
src/views/historicalVisit/historicalDetails.vue

@@ -231,12 +231,6 @@ export default {
       AIResultOption: [],
     };
   },
-  created() {
-    this.visitsId = this.$route.query.visitId;
-    this.dataform.visitsId = this.$route.query.visitId;
-    this.getVisitsDetailFn();
-    this.getPhotoTypeList();
-  },
   // watch: {
   //   $route(to, from) {
   //     console.log(to.path)
@@ -246,11 +240,14 @@ export default {
   //   }
   // },
   activated() {
+    this.visitsId = this.$route.query.visitId;
+    this.dataform.visitsId = this.$route.query.visitId;
     this.getVisitsDetailFn();
     // 获取店招异常原因字典
     getDictOption({}, 'feedback_error_msg').then((res) => {
       this.AIResultOption = res.data;
     });
+    this.getPhotoTypeList();
   },
   methods: {
     resultCorrect(resultCorrect) {
@@ -350,7 +347,7 @@ export default {
       });
     },
     getVisitsDetailFn() {
-      getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
+      getVisitsDetail({ visitsId: this.$route.query.visitId }).then((res) => {
         if (res.code == 200) {
           this.list = res.data;
           if (res.data.visitSource != 2) {

+ 5 - 12
src/views/historicalVisit/hisvistdeils.vue

@@ -304,19 +304,10 @@ export default {
       putInCode: '',
     };
   },
-  // watch: {
-  //   $route(to, from) {
-  //     if (from.path == "/historicalDetails" && to.path == "/historiStoreVisit") {
-  //       this.getPhotoTypeList()
-  //       this.info()
-  //     }
-  //   }
-  // },
   activated() {
-    this.getPhotoTypeList();
-    this.info();
-  },
-  created() {
+    this.taskType = 1;
+    this.tableData1 = [];
+    this.collectionItemList = [];
     this.taskType = this.$route.query.taskType;
     this.PhotoType = this.$route.query.photoType;
     this.visitId = this.$route.query.visitId + '';
@@ -377,7 +368,9 @@ export default {
       return arrc.join(',');
     },
     info() {
+      this.toastLoading(0, '加载中...', true);
       getVisitsDetail({ visitsId: this.visitId }).then((res) => {
+        this.toastLoading().clear();
         this.infoData = res.data;
         var collectionItemLists = res.data.sfaTaskList[this.$route.query.ids].collectionItemList;
         if (res.data.sfaTaskList[this.$route.query.ids].checkUnManage == 'Y') {

+ 4 - 0
src/views/home/hintTabPage/noVisit.vue

@@ -137,6 +137,10 @@ export default {
     tabChange(val) {},
     // 进入拜访
     storeVisit(val) {
+      if (val.visitSource && val.visitSource == 2) {
+        this.$toast('请先取消异常拜访后再进入正常拜访!');
+        return;
+      }
       if (!this.clickIsFlage) return;
       this.clickIsFlage = false;
       this.toastLoading(0, '加载中...', true);

+ 344 - 232
src/views/signApproval/index.vue

@@ -2,21 +2,25 @@
   <div class="bgcolor">
     <!--        顶部条-->
     <div class="navBarTOP">
-      <van-nav-bar
-          class="navBar"
-          title="流程审批"
-          left-arrow
-          @click-left="onClickLeft"
-      >
+      <van-nav-bar class="navBar" title="流程审批" left-arrow @click-left="onClickLeft">
         <template #right>
           <!--        <span class="navRightBtn"  @click="editorFn">批量审批</span>-->
         </template>
       </van-nav-bar>
       <div class="serchInput">
-        <van-cell  class="monthNow selectcell" :title="companyName"  is-link arrow-direction="down" @click="RegionShow=true"/>
+        <van-cell
+          class="monthNow selectcell"
+          :title="companyName"
+          is-link
+          arrow-direction="down"
+          @click="RegionShow = true" />
       </div>
       <div class="searchDiv">
-        <van-search v-model="param" left-icon="search" show-action placeholder="搜索名称/编号/业务员">
+        <van-search
+          v-model="param"
+          left-icon="search"
+          show-action
+          placeholder="搜索名称/编号/业务员">
           <template #action>
             <div @click="onSearchm">搜索</div>
           </template>
@@ -24,15 +28,23 @@
       </div>
       <van-row>
         <van-col span="18">
-          <van-tabs v-model="isHandle" color="#0057ba"  @change="tabChange">
-            <van-tab title="待审批" name="0" :disabled="disabled"></van-tab>
-            <van-tab title="已审批" name="1" :disabled="disabled"></van-tab>
+          <van-tabs v-model="isHandle" color="#0057ba" @change="tabChange">
+            <van-tab
+              title="待审批"
+              name="0"
+              :disabled="disabled"
+              v-if="userDeptLevel != '4'"></van-tab>
+            <van-tab
+              title="已审批"
+              name="1"
+              :disabled="disabled"
+              v-if="userDeptLevel != '4'"></van-tab>
             <van-tab title="我发起的" name="2" :disabled="disabled"></van-tab>
           </van-tabs>
         </van-col>
-        <van-col span="6" style="text-align: center;margin-top: 10px;" @click="sortFN">
-          <van-icon name="ascending"  v-if="orderByStr=='asc'"  color="#0057ba" size="24"/>
-          <van-icon name="descending" v-if="orderByStr=='desc'"  color="#0057ba" size="24"/>
+        <van-col span="6" style="text-align: center; margin-top: 10px" @click="sortFN">
+          <van-icon name="ascending" v-if="orderByStr == 'asc'" color="#0057ba" size="24" />
+          <van-icon name="descending" v-if="orderByStr == 'desc'" color="#0057ba" size="24" />
         </van-col>
       </van-row>
     </div>
@@ -56,242 +68,322 @@
       <div class="lineGrey"></div>
       <div class="lineGrey"></div>
       <div class="lineGrey"></div>
-      <van-list  v-model="loading" :finished="finished" finished-text="--已经到底了--" @load="onLoad">
+      <van-list
+        v-model="loading"
+        :finished="finished"
+        finished-text="--已经到底了--"
+        @load="onLoad">
         <van-checkbox-group v-model="radio">
-          <div class="cellcontent brud weekList" v-for="(item,index) in  list" :key="index">
+          <div class="cellcontent brud weekList" v-for="(item, index) in list" :key="index">
             <van-cell is-link>
               <div class="cardContent" @click="approveFn(item)">
-                <div class="title" >
-                  <p class="textLeft" >{{item.storeName}}({{item.storeCode}})</p>
-                  <p class="textRight" v-if="isHandle==0">审批</p></div>
-                <div class="info">类型:{{selectDictLabel(storeTypeList, item.storeCategory)}}</div>
+                <div class="title">
+                  <p class="textLeft">{{ item.storeName }}({{ item.storeCode }})</p>
+                  <p class="textRight" v-if="isHandle == 0">审批</p>
+                </div>
+                <div class="info">
+                  类型:{{ selectDictLabel(storeTypeList, item.storeCategory) }}
+                </div>
                 <div class="info">地址:{{ item.addressLine }}</div>
-                <div class="info">流程类型:{{item.modelName}}</div>
-                <div class="info">提交人:{{item.applyUserName}}</div>
-                <div class="info" v-if="item.isHandle==0">提交时间:{{item.applyTime}}
-                  <van-tag plain type="primary" size="medium" v-if="item.status==1" style="float: right">待审批</van-tag>
-                  <van-tag plain type="success"  size="medium" v-if="item.status==2" style="float: right">审批通过</van-tag>
-                  <van-tag plain type="danger"  size="medium" v-if="item.status==3" style="float: right">审批拒绝</van-tag>
+                <div class="info">流程类型:{{ item.modelName }}</div>
+                <div class="info">提交人:{{ item.applyUserName }}</div>
+                <div class="info" v-if="item.isHandle == 0">
+                  提交时间:{{ item.applyTime }}
+                  <van-tag
+                    plain
+                    type="primary"
+                    size="medium"
+                    v-if="item.status == 1"
+                    style="float: right"
+                    >待审批</van-tag
+                  >
+                  <van-tag
+                    plain
+                    type="success"
+                    size="medium"
+                    v-if="item.status == 2"
+                    style="float: right"
+                    >审批通过</van-tag
+                  >
+                  <van-tag
+                    plain
+                    type="danger"
+                    size="medium"
+                    v-if="item.status == 3"
+                    style="float: right"
+                    >审批拒绝</van-tag
+                  >
                 </div>
-                <div class="info" v-if="item.isHandle==1">审批时间:{{item.todoTime}}
-                  <van-tag plain type="primary" size="medium" v-if="item.status==1" style="float: right">待审批</van-tag>
-                  <van-tag plain type="success"  size="medium" v-if="item.status==2" style="float: right">审批通过</van-tag>
-                  <van-tag plain type="danger"  size="medium" v-if="item.status==3" style="float: right">审批拒绝</van-tag>
+                <div class="info" v-if="item.isHandle == 1">
+                  审批时间:{{ item.todoTime }}
+                  <van-tag
+                    plain
+                    type="primary"
+                    size="medium"
+                    v-if="item.status == 1"
+                    style="float: right"
+                    >待审批</van-tag
+                  >
+                  <van-tag
+                    plain
+                    type="success"
+                    size="medium"
+                    v-if="item.status == 2"
+                    style="float: right"
+                    >审批通过</van-tag
+                  >
+                  <van-tag
+                    plain
+                    type="danger"
+                    size="medium"
+                    v-if="item.status == 3"
+                    style="float: right"
+                    >审批拒绝</van-tag
+                  >
                 </div>
                 <!--            <van-checkbox :name="item" v-if="isHandle=='0'"  shape="square" style="float: right"></van-checkbox>-->
               </div>
             </van-cell>
           </div>
         </van-checkbox-group>
-        <van-empty description="" v-if="list.length==0"/>
+        <van-empty description="" v-if="list.length == 0" />
       </van-list>
     </div>
-    <van-popup
-        v-model="submitShow"
-        position="bottom"
-        closeable
-        :style="{ height: '50%' }"
-    >
+    <van-popup v-model="submitShow" position="bottom" closeable :style="{ height: '50%' }">
       <div>
-        <p style="text-align: center;padding-bottom: 16px;border-bottom: 1px solid #f5f5f5;font-size: 16px;">审批意见</p>
-        <van-field
-            v-model="blackReason"
-            rows="6"
-            type="textarea"
-            placeholder="请输入审批意见"
-        />
-        <br>
-        <van-row gutter="20" style="padding: 10px;">
+        <p
+          style="
+            text-align: center;
+            padding-bottom: 16px;
+            border-bottom: 1px solid #f5f5f5;
+            font-size: 16px;
+          ">
+          审批意见
+        </p>
+        <van-field v-model="blackReason" rows="6" type="textarea" placeholder="请输入审批意见" />
+        <br />
+        <van-row gutter="20" style="padding: 10px">
           <van-col span="12">
-            <van-button style="width:100%;" plain type="info" class=" E-bgBlue BtnBorder" @click="outFn">驳回</van-button>
+            <van-button
+              style="width: 100%"
+              plain
+              type="info"
+              class="E-bgBlue BtnBorder"
+              @click="outFn"
+              >驳回</van-button
+            >
           </van-col>
           <van-col span="12">
-            <van-button style="width: 100%;" plain type="info" class=" E-bgBlue Btn" @click="submit">同意</van-button>
+            <van-button style="width: 100%" plain type="info" class="E-bgBlue Btn" @click="submit"
+              >同意</van-button
+            >
           </van-col>
         </van-row>
       </div>
     </van-popup>
     <van-popup v-model="RegionShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="moduleList"
-          value-key="name"
-          @confirm="onregionConfirm"
-          @cancel="RegionShow = false"
-      />
+        show-toolbar
+        :columns="moduleList"
+        value-key="name"
+        @confirm="onregionConfirm"
+        @cancel="RegionShow = false" />
     </van-popup>
   </div>
 </template>
 
 <script>
-import {getCWStoreTypeList, getTodoItemList, completeAll, getStoreTypeList, getTodoItemMyList} from "@/api/index";
-import {moduleList} from "@/api/inventory";
+import {
+  getCWStoreTypeList,
+  getTodoItemList,
+  completeAll,
+  getStoreTypeList,
+  getTodoItemMyList,
+} from '@/api/index';
+import { moduleList } from '@/api/inventory';
 export default {
-  name: "MyHistoricalWeekly",
+  name: 'MyHistoricalWeekly',
   data() {
     return {
-      isHandle:"0",
-      disabled:false,
-      pageNum:1,
-      pageSize:10,
+      isHandle: '0',
+      disabled: false,
+      pageNum: 1,
+      pageSize: 10,
       loading: false,
       finished: false,
-      RegionShow:false,
-      storeTypeList:[],
-      list:[],
-      radio:[],
-      blackReason:"",
-      param:"",
-      submitShow:false,
-      orderByStr:'desc',
-      moduleList:[],
-      module:"",
-      companyName:"全部流程"
-    }
+      RegionShow: false,
+      storeTypeList: [],
+      list: [],
+      radio: [],
+      blackReason: '',
+      param: '',
+      submitShow: false,
+      orderByStr: 'desc',
+      moduleList: [],
+      module: '',
+      companyName: '全部流程',
+      userDeptLevel: '',
+    };
   },
   created() {
-    this.radio=[]
-    getStoreTypeList({}).then(res => {
-      this.storeTypeList = res.data
-    })
-    moduleList({}).then(res => {
-      var moduleList=[{key:"",name:"全部流程"}]
-      this.moduleList = moduleList.concat(res.rows)
-    })
+    // userDeptLevel用户部门等级字段,0-总部,1-公司,2-大区,3-销售部,4-业务员
+    this.userDeptLevel = localStorage.getItem('userDeptLevel');
+    if (this.userDeptLevel == '4') {
+      this.isHandle = '2';
+    }
+    this.radio = [];
+    getStoreTypeList({}).then((res) => {
+      this.storeTypeList = res.data;
+    });
+    moduleList({}).then((res) => {
+      var moduleList = [{ key: '', name: '全部流程' }];
+      this.moduleList = moduleList.concat(res.rows);
+    });
     // this.approveList()
   },
   watch: {
     $route(to, from) {
-      this.powerGrade = localStorage.getItem("powerGrade")
-      this.pageNum=1
-      this.radio=[]
-      if(to.path=="/signApprovalList"&&from.path=="/home"){
-        window.scrollTo(0,0)
-        this.approveList()
+      this.powerGrade = localStorage.getItem('powerGrade');
+      this.pageNum = 1;
+      this.radio = [];
+      if (to.path == '/signApprovalList' && from.path == '/home') {
+        window.scrollTo(0, 0);
+        this.approveList();
       }
-      if(to.path=="/signApprovalList"&&from.path=="/signApproval"){
-        this.pageNum=1
-        this.tabChange()
+      if (to.path == '/signApprovalList' && from.path == '/signApproval') {
+        this.pageNum = 1;
+        this.tabChange();
       }
-    }
+    },
   },
   methods: {
-    onregionConfirm(val){
-      this.module =val.key
-      this.companyName =val.name
-      this.RegionShow=false
+    onregionConfirm(val) {
+      this.module = val.key;
+      this.companyName = val.name;
+      this.RegionShow = false;
     },
-    sortFN(){
-      if(this.orderByStr=='asc'){
-        this.orderByStr='desc'
-      }else{
-        this.orderByStr='asc'
+    sortFN() {
+      if (this.orderByStr == 'asc') {
+        this.orderByStr = 'desc';
+      } else {
+        this.orderByStr = 'asc';
       }
-      this.tabChange()
+      this.tabChange();
     },
-    editorFn(){
-      if(this.radio.length==0){
-        this.$toast("请选择审批项!");
-        return
+    editorFn() {
+      if (this.radio.length == 0) {
+        this.$toast('请选择审批项!');
+        return;
       }
-      this.blackReason=""
-      this.submitShow=true
+      this.blackReason = '';
+      this.submitShow = true;
     },
-    outFn(){
-      if(this.blackReason.trim()==""){
-        this.$toast("请输入审批意见!");
-        return
+    outFn() {
+      if (this.blackReason.trim() == '') {
+        this.$toast('请输入审批意见!');
+        return;
       }
-      var taskIds=[]
-      var instanceIds=[]
-      for(var i=0;i<this.radio.length;i++){
-        taskIds.push(this.radio[i].taskId)
-        instanceIds.push(this.radio[i].instanceId)
+      var taskIds = [];
+      var instanceIds = [];
+      for (var i = 0; i < this.radio.length; i++) {
+        taskIds.push(this.radio[i].taskId);
+        instanceIds.push(this.radio[i].instanceId);
       }
-      var dormData={
-        taskIds:taskIds.join(","),
-        instanceIds:instanceIds.join(","),
-        variables:JSON.stringify({
-          "comment":this.blackReason,
-          "pass":false
+      var dormData = {
+        taskIds: taskIds.join(','),
+        instanceIds: instanceIds.join(','),
+        variables: JSON.stringify({
+          comment: this.blackReason,
+          pass: false,
+        }),
+      };
+      this.$dialog
+        .confirm({
+          message: '确认提交审批?',
         })
-      }
-      this.$dialog.confirm({
-        message: '确认提交审批?',
-      }).then(() => {
-        completeAll(dormData).then(res=>{
-          if(res.code==200){
-            this.submitShow=false
-            this.radio=[]
-            this.$toast("驳回成功!");
-            this.pageNum=1
-            this.approveList()
-          }else{
-            this.$toast(res.msg);
-          }
-        })
-      })
+        .then(() => {
+          completeAll(dormData).then((res) => {
+            if (res.code == 200) {
+              this.submitShow = false;
+              this.radio = [];
+              this.$toast('驳回成功!');
+              this.pageNum = 1;
+              this.approveList();
+            } else {
+              this.$toast(res.msg);
+            }
+          });
+        });
     },
-    submit(){
-      var taskIds=[]
-      var instanceIds=[]
-      for(var i=0;i<this.radio.length;i++){
-        taskIds.push(this.radio[i].taskId)
-        instanceIds.push(this.radio[i].instanceId)
-      }
-      var dormData={
-        taskIds:taskIds.join(","),
-        instanceIds:instanceIds.join(","),
-        variables:JSON.stringify({
-          "comment":this.blackReason,
-          "pass":true
-        })
+    submit() {
+      var taskIds = [];
+      var instanceIds = [];
+      for (var i = 0; i < this.radio.length; i++) {
+        taskIds.push(this.radio[i].taskId);
+        instanceIds.push(this.radio[i].instanceId);
       }
-      this.$dialog.confirm({
-        message: '确认提交审批?',
-      }).then(() => {
-        completeAll(dormData).then(res=>{
-          if(res.code==200){
-            this.radio=[]
-            this.$toast("提交成功!");
-            this.submitShow=false;
-            this.pageNum=1;
-            this.approveList();
-          }else{
-            this.$toast(res.msg);
-          }
+      var dormData = {
+        taskIds: taskIds.join(','),
+        instanceIds: instanceIds.join(','),
+        variables: JSON.stringify({
+          comment: this.blackReason,
+          pass: true,
+        }),
+      };
+      this.$dialog
+        .confirm({
+          message: '确认提交审批?',
         })
-      })
+        .then(() => {
+          completeAll(dormData).then((res) => {
+            if (res.code == 200) {
+              this.radio = [];
+              this.$toast('提交成功!');
+              this.submitShow = false;
+              this.pageNum = 1;
+              this.approveList();
+            } else {
+              this.$toast(res.msg);
+            }
+          });
+        });
     },
-    onLoad(){
+    onLoad() {
       this.disabled = true;
-      if(this.isHandle==2){
-        this.approveMyList()
-      }else{
-        this.approveList()
+      if (this.isHandle == 2) {
+        this.approveMyList();
+      } else {
+        this.approveList();
       }
     },
-    onSearchm(){
-      this.tabChange()
+    onSearchm() {
+      this.tabChange();
     },
-    approveFn(row){
-      this.list=[];
+    approveFn(row) {
+      this.list = [];
       this.$router.push({
-        path: "/signApproval",
-        query: {signId: row.signId,addressLine:row.addressLine,type:this.isHandle,itemType:row.itemType,taskId:row.taskId,instanceId:row.instanceId,visitsId:row.visitsId}
-      })
+        path: '/signApproval',
+        query: {
+          signId: row.signId,
+          addressLine: row.addressLine,
+          type: this.isHandle,
+          itemType: row.itemType,
+          taskId: row.taskId,
+          instanceId: row.instanceId,
+          visitsId: row.visitsId,
+        },
+      });
     },
     tabChange() {
-      window.scrollTo(0,0)
+      window.scrollTo(0, 0);
       this.disabled = true;
-      this.list=[];
-      this.pageNum=1
-      if(this.isHandle==2){
-        this.approveMyList()
-      }else{
-        this.approveList()
+      this.list = [];
+      this.pageNum = 1;
+      if (this.isHandle == 2) {
+        this.approveMyList();
+      } else {
+        this.approveList();
       }
-
     },
     approveMyList() {
       let loading1 = this.$toast.loading({
@@ -303,22 +395,28 @@ export default {
         this.list = [];
         this.refreshing = false;
       }
-      getTodoItemMyList({pageNum:this.pageNum,module:this.module, pageSize:this.pageSize,param:this.param,orderByStr:this.orderByStr}).then(res => {
-        loading1.clear()
+      getTodoItemMyList({
+        pageNum: this.pageNum,
+        module: this.module,
+        pageSize: this.pageSize,
+        param: this.param,
+        orderByStr: this.orderByStr,
+      }).then((res) => {
+        loading1.clear();
         this.disabled = false;
         this.loading = false;
-        if(this.pageNum==1){
-          this.list=[];
-          this.refreshing =false;
+        if (this.pageNum == 1) {
+          this.list = [];
+          this.refreshing = false;
         }
-        this.list = this.list.concat(res.rows)
-        if(this.list.length >=res.total) {
+        this.list = this.list.concat(res.rows);
+        if (this.list.length >= res.total) {
           this.finished = true;
-        }else{
+        } else {
           this.finished = false;
         }
-        this.pageNum=this.pageNum+1
-      })
+        this.pageNum = this.pageNum + 1;
+      });
     },
     approveList() {
       let loading1 = this.$toast.loading({
@@ -330,35 +428,42 @@ export default {
         this.list = [];
         this.refreshing = false;
       }
-      getTodoItemList({isHandle: this.isHandle,module:this.module, pageNum:this.pageNum, pageSize:this.pageSize,param:this.param,orderByStr:this.orderByStr}).then(res => {
-        loading1.clear()
+      getTodoItemList({
+        isHandle: this.isHandle,
+        module: this.module,
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        param: this.param,
+        orderByStr: this.orderByStr,
+      }).then((res) => {
+        loading1.clear();
         this.disabled = false;
         this.loading = false;
-        if(this.pageNum==1){
-          this.list=[];
-          this.refreshing =false;
+        if (this.pageNum == 1) {
+          this.list = [];
+          this.refreshing = false;
         }
-        this.list = this.list.concat(res.rows)
-        if(this.list.length >=res.total) {
+        this.list = this.list.concat(res.rows);
+        if (this.list.length >= res.total) {
           this.finished = true;
-        }else{
+        } else {
           this.finished = false;
         }
-        this.pageNum=this.pageNum+1
-      })
+        this.pageNum = this.pageNum + 1;
+      });
     },
     onClickLeft() {
-      this.$router.push("/home")
-    }
-  }
-}
+      this.$router.push('/home');
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
 .bgcolor {
   background-color: #f5f5f5;
 }
-.serchInput{
-  padding: 0 14px ;
+.serchInput {
+  padding: 0 14px;
   margin-top: 14px;
 }
 
@@ -375,7 +480,8 @@ export default {
   position: relative;
   color: #333;
   font-size: 14px;
-  .van-cell__left-icon, .van-cell__right-icon{
+  .van-cell__left-icon,
+  .van-cell__right-icon {
     line-height: 34px;
   }
   .CalendarIcon {
@@ -390,7 +496,7 @@ export default {
     }
   }
 }
-.monthNowpro{
+.monthNowpro {
   color: #ccc;
 }
 .cardContent {
@@ -412,7 +518,7 @@ export default {
 
 .cardContent .title p {
   padding: 0;
-  margin: 0
+  margin: 0;
 }
 
 .cardContent .title .textLeft {
@@ -434,8 +540,8 @@ export default {
   border-radius: 8px;
   overflow: hidden;
 }
-.weekList{
-  border-radius:0;
+.weekList {
+  border-radius: 0;
 }
 .Btn {
   margin: 0 auto 10px;
@@ -445,28 +551,32 @@ export default {
   color: #fff !important;
   background-color: #0057ba;
   border: 1px solid #0057ba;
-  height: 36px
+  height: 36px;
 }
-.BtnBorder{
+.BtnBorder {
   margin: 0 auto 10px;
   display: block;
   width: 90%;
   border-radius: 5px;
   border: 1px solid #0057ba;
-  color:#0057ba;
-  height: 36px
+  color: #0057ba;
+  height: 36px;
+}
+.weekList .van-cell {
+  border-radius: 6px;
+  overflow: hidden;
+}
+.weekList .cardContent .title {
+  line-height: 32px;
 }
-.weekList .van-cell{border-radius: 6px;
-  overflow: hidden;}
-.weekList .cardContent .title{line-height: 32px}
-.weekList .van-cell__right-icon{
-  top:4px;
+.weekList .van-cell__right-icon {
+  top: 4px;
 }
-.searchDiv{
-  .van-search{
+.searchDiv {
+  .van-search {
     background: #fff;
   }
-  .van-search__action{
+  .van-search__action {
     font-size: 14px;
     color: #0057ba;
     font-weight: bold;
@@ -476,8 +586,10 @@ export default {
     border: 1px solid #ccc;
     padding: 0 20px;
   }
-  .van-search--show-action{padding-right: 12px}
-  .van-search__content{
+  .van-search--show-action {
+    padding-right: 12px;
+  }
+  .van-search__content {
     border: 1px solid #ccc;
     border-bottom-left-radius: 60px;
     border-top-left-radius: 60px;
@@ -485,4 +597,4 @@ export default {
     border-right: 0;
   }
 }
-</style>
+</style>

+ 1 - 0
src/views/storeManagement/storeDetail.vue

@@ -650,6 +650,7 @@ export default {
     },
   },
   activated() {
+    this.cityABStore = false;
     // 下单成功后点击上传陈列照直接跳转到编辑页面
     let id = localStorage.getItem('successStoreId');
     if (id) {