| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143 |
- <template>
- <div class="bgcolor home">
- <div class="header">
- <van-nav-bar class="navBar" :title="$route.meta.title">
- <template #left>
- <span @click="login" style="display: block; width: 50px; height: 100%"></span>
- </template>
- <template #right>
- <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
- </template>
- </van-nav-bar>
- <div class="searchDiv">
- <van-search
- v-model="chainsName"
- left-icon="search"
- show-action
- placeholder="搜索名称/编号/地址"
- @clear="clearFn">
- <template #action>
- <div @click="onSearchm">搜索</div>
- </template>
- </van-search>
- </div>
- <van-tabs class="myTab" type="card" v-model="tabVal" color="#0057ba" @change="tabChange">
- <van-tab title="销售部" name="0" :disabled="disabled"></van-tab>
- <van-tab title="我的" name="1" :disabled="disabled"></van-tab>
- </van-tabs>
- </div>
- <div class="content" id="content" @touchmove="handleTouch">
- <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
- <van-list
- class="myList"
- v-model="loading"
- :finished="finished"
- finished-text="--已经到底了--"
- @load="onLoad">
- <div class="cellcontent" v-for="(item, index) in list" :key="index" v-if="list.length">
- <van-cell>
- <div class="card">
- <div class="title titlero">
- <span @click="goOtherSystem(item)" :style="setStroeNameStyle(item)">
- <span>{{ item.chainName }}</span>
- (<span>{{ item.chainCode }}</span
- >)
- </span>
- <span class="btn" :data-clipboard-text="item.chainCode">
- <van-icon
- :name="require('@/assets/icon/paste.png')"
- color="#ee0a24"
- size="20"
- style="top: 6px; margin-left: 4px" />
- </span>
- </div>
- <div class="info">客户分类:{{ verifyChainType(item.typeCode2) }}</div>
- <div class="info">实际经营者:{{ item.customerManager }}</div>
- <div class="info">开户日期:{{ item.openDate }}</div>
- <div class="info">是否冻结:{{ item.freeze }}</div>
- <div class="info">是否关户:{{ item.close }}</div>
- </div>
- <div
- class="statstext"
- v-if="item.stateString == '未拜访'"
- style="background-color: #ed5c68">
- 未拜访
- </div>
- <div
- class="statstext"
- v-if="item.stateString == '拜访中'"
- style="background-color: white">
- <van-icon :name="require('@/assets/icon/times.png')" color="#ee0a24" size="32" />
- </div>
- <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
- <div class="btnbox">
- <van-row>
- <van-col span="5" v-if="item.stateString != '已拜访'" @click="storeVisit(item)">
- <img
- :src="require('@/assets/icon/call.png')"
- style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; font-size: 12px">进入拜访</p>
- </van-col>
- <van-col
- span="5"
- v-if="item.stateString != '已拜访'"
- @click="abnormalVisit(item)">
- <img
- :src="require('@/assets/icon/yichang.png')"
- style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
- 异常拜访
- </p>
- </van-col>
- <!-- <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
- <img
- :src="require('@/assets/icon/bfxx.png')"
- style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
- 拜访信息
- </p>
- </van-col> -->
- <van-col span="5" @click="visitFn(item)">
- <img
- :src="require('@/assets/icon/kehuxinxi-2.png')"
- style="margin: 0 auto; width: 18px; display: block" />
- <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
- 客户门店
- </p>
- </van-col>
- </van-row>
- </div>
- </van-cell>
- <div class="lineGrey"></div>
- </div>
- <van-empty v-if="list.length == 0" />
- </van-list>
- </van-pull-refresh>
- </div>
- <van-popup v-model="showPicker" position="bottom" class="textsize">
- <van-row
- style="
- /* position: fixed; */
- /* top: 0; */
- width: 100%;
- z-index: 998;
- background-color: #fff;
- border-bottom: 1px solid #ccc;
- height: 50px;
- ">
- <van-col span="3" style="text-align: center; margin: 14px 0" @click="showPicker = false">
- <van-icon name="cross" size="20" color="#909399" />
- </van-col>
- <van-col span="13"> </van-col>
- <van-col span="4" style="text-align: center; line-height: 36px" @click="onConfirm">
- <div style="color: #0057ba">
- <van-button type="info" size="small" color="#0057ba">筛选</van-button>
- </div></van-col
- >
- <van-col span="4" style="text-align: center; line-height: 36px" @click="onsets">
- <van-button type="default" size="small" style="height: 28px">重置</van-button>
- </van-col>
- </van-row>
- <!-- <div style="height: 48px; width: 100%"></div> -->
- <div class="searchcheck" @touchmove="handleTouch">
- <p class="searchchecktitle"> 主经销商</p>
- <van-row>
- <van-col span="24">
- <div @click="moreTypeShowFn">
- <van-field
- style="
- margin-top: -6px;
- border-radius: 6px;
- border: 1px solid #ccc;
- overflow: hidden;
- "
- readonly
- v-model="chainName"
- label=""
- placeholder="请选择经销商" />
- </div>
- </van-col>
- </van-row>
- <p class="searchchecktitle" @click="isMonthVisited = !isMonthVisited">
- 本月是否拜访<van-icon name="arrow-down" style="float: right" />
- </p>
- <van-radio-group v-model="monthVisited" direction="horizontal" class="monthVisited">
- <template v-if="isMonthVisited">
- <van-radio name="1">已拜访</van-radio>
- <van-radio name="0">未拜访</van-radio>
- </template>
- </van-radio-group>
- <van-checkbox-group v-model="result" direction="horizontal">
- <p class="searchchecktitle" @click="otherfxdShow = !otherfxdShow">
- 客户分类<van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherfxdShow" style="margin: 0 14px; width: 100%">
- <p class="searchchecktitle1" @click="otherfxdShow1 = !otherfxdShow1">
- 片区经销商<van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherfxdShow1">
- <div v-for="(item1, index1) in PQChain" :key="200 + index1" class="checkbox1">
- <div class="child">
- <van-checkbox :name="item1.dictValue">{{ item1.dictLabel }}</van-checkbox>
- </div>
- </div>
- <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
- </div>
- <p class="searchchecktitle1" @click="otherfxdShow2 = !otherfxdShow2">
- 非片区经销商<van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherfxdShow2">
- <div v-for="(itemlj, indexlj) in FPQChain" :key="400 + indexlj" class="checkbox1">
- <div class="child">
- <van-checkbox :name="itemlj.dictValue">{{ itemlj.dictLabel }}</van-checkbox>
- </div>
- </div>
- <div style="clear: both"></div>
- </div>
- </div>
- <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
- </van-checkbox-group>
- </div>
- </van-popup>
- <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%">
- <van-row style="background-color: #f5f5f5">
- <van-col span="20">
- <van-field
- left-icon="search"
- style="margin-top: 2px; border-radius: 6px; overflow: hidden"
- v-model="CustomerName"
- label=""
- placeholder="请输入关键词"
- clearable />
- </van-col>
- <van-col span="4" style="text-align: center; line-height: 48px" @click="getCustomer">
- <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
- >
- </van-row>
- <van-picker
- show-toolbar
- :columns="chainsData"
- value-key="chainName"
- @confirm="onConfirmChainsList"
- @cancel="moreTypeShow = false"
- visible-item-count="10" />
- </van-popup>
- <!-- 测试用 -->
- <!-- 下单系统 -->
- <div
- class="storeSystem"
- v-if="objectPath"
- style="
- width: 100%;
- height: 100%;
- position: absolute;
- z-index: 9999999;
- display: flex;
- flex-direction: column;
- ">
- <div
- style="
- position: relative;
- z-index: 1;
- display: flex;
- align-items: center;
- height: 46px;
- background-color: #fff;
- font-size: 16px;
- font-weight: bold;
- justify-content: center;
- ">
- 下单系统
- </div>
- <object style="flex: 1" :data="objectPath" type="text/html" width="100%"></object>
- </div>
- </div>
- </template>
- <script>
- import {
- checkVisit,
- addVisitsPosition,
- mobileReposition,
- getStoreTypeListlp,
- getStoreLabels,
- getCustomerList,
- buryingPoint,
- } from '@/api/index';
- import { checkStoreAddressByStoreCode } from '@/api/visitstore';
- import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
- import { mapState } from 'vuex';
- import store from '@/store';
- import { scrollTopMixins } from '@/mixin/scrollTop';
- import {
- queryMyChainsGroupList,
- queryMyChainsGroupListByDept,
- checkChainsAddressByChainCode,
- getMainchains,
- } from '@/api/home';
- export default {
- name: 'outsidelist',
- mixins: [scrollTopMixins],
- computed: {
- ...mapState({
- deviceOutsidePage: (state) => state.isRefreshPage.deviceOutsidePage,
- }),
- },
- data() {
- return {
- otherShow: false,
- chainName: '',
- chainCode: '',
- showPopover: false,
- moreTypeShow: false,
- storeLabelTypes: [],
- disabled: false,
- timer: null,
- flag: true,
- show: false,
- tabVal: '1',
- list: [],
- cont: 0,
- loading: false,
- showPicker: false,
- finished: false,
- otherbqShow: true,
- otherkkdShow: true,
- otherfxdShow: true,
- otherfxdShow2: true,
- otherfxdShow1: true,
- typeName: '搜索',
- visitEndId: '',
- pageSize: 12,
- pageNum: 1,
- listActive: null,
- query: '',
- chainsName: '',
- storeType: '',
- endShow: false,
- storeCategory: '',
- fromValue: {},
- storeTypeList: [],
- PQChain: [],
- FPQChain: [],
- chainsData: [],
- serachstype: '',
- addShow1: false,
- result: [],
- StoreLabels: [],
- CustomerName: '',
- lat: '',
- lon: '',
- objectPath: '',
- isLoading: false,
- monthVisited: '', //本月是否拜访
- isMonthVisited: true,
- num: 1,
- };
- },
- created() {
- if (this.deviceOutsidePage) this.initData();
- store.dispatch('setDeviceOutsidePage', false);
- },
- mounted() {
- localStorage.setItem('tabVal', '1');
- // 上拉边界下拉出现白色空白
- let node = document.getElementsByClassName('home')[0];
- node.addEventListener(
- 'touchmove',
- (e) => {
- if (e._isScroller) return;
- e.preventDefault();
- },
- {
- passive: false,
- }
- );
- },
- methods: {
- onRefresh() {
- this.onSearch();
- this.isLoading = false;
- },
- handleTouch(e) {
- e._isScroller = true;
- },
- initData() {
- // 筛选-门店标签
- if (localStorage.getItem('outvstoreLabelTypes') != null) {
- this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
- } else {
- this.storeLabelTypes = [];
- }
- this.chainName = localStorage.getItem('outvchainName'); //筛选-经销商名称搜索
- this.chainCode = localStorage.getItem('outvchainCode'); //筛选-经销商Code
- // 筛选-店型选择
- if (localStorage.getItem('outvstoreCategoryList') != null) {
- this.result = localStorage.getItem('outvstoreCategoryList').split(',');
- } else {
- this.result = [];
- }
- // 当前tabs,0:销售部;1:我的
- this.tabVal = localStorage.getItem('tabVal') == '0' ? '0' : '1';
- this.query = this.$route.query; // 路由参数
- localStorage.removeItem('visitId');
- if (localStorage.getItem('postType') == 'GZ') {
- this.addShow1 = false;
- this.otherShow = true; //筛选-其他
- } else {
- this.addShow1 = true;
- this.otherShow = false; //筛选-其他
- }
- this.onSearch();
- },
- setStroeNameStyle(item) {
- return { color: '#0057ba', 'text-decoration': 'underline' };
- },
- clearFn() {
- this.chainsName = '';
- localStorage.setItem('outvstoreName', '');
- },
- moreTypeShowFn() {
- this.moreTypeShow = true;
- this.getCustomer();
- },
- buryingPoint(val) {
- buryingPoint(val);
- },
- getCustomer() {
- getMainchains({ mainChainsName: this.CustomerName }).then((request) => {
- this.chainsData = request.data;
- this.chainsData.push({});
- this.chainsData.pop();
- });
- },
- onConfirmChainsList(value) {
- if (value.chainName != undefined) {
- this.chainName = value.chainName;
- this.chainCode = value.chainCode;
- }
- this.showPickerChainsList = false;
- this.moreTypeShow = false;
- },
- getStoreLabels() {
- if (this.StoreLabels.length == 0) {
- getStoreLabels().then((res) => {
- this.StoreLabels = res.data;
- });
- }
- },
- onConfirm(value) {
- this.showPicker = false;
- this.onSearchm();
- },
- onsets() {
- this.result = [];
- this.storeLabelTypes = [];
- this.chainName = '';
- this.chainCode = '';
- this.monthVisited = '';
- this.onSearch();
- },
- setChainTypeList() {
- if (store.getters.chainsType) {
- this.PQChain = store.getters.chainsType.filter((val) => val.remark == 'pq');
- this.FPQChain = store.getters.chainsType.filter((val) => val.remark == 'fp');
- }
- },
- searchFn() {
- //获取门店类型 //获取门店标签
- Promise.all([this.setChainTypeList(), this.getStoreLabels()]).then(() => {
- this.showPicker = true;
- this.CustomerName = '';
- });
- },
- getUserOrgStoreList() {
- this.storeType = localStorage.getItem('storeType');
- this.endShow = false;
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- this.disabled = true;
- this.toastLoading(0, '加载中...', true);
- queryMyChainsGroupListByDept({
- lat: this.lat,
- lon: this.lon,
- pageNum: this.pageNum,
- typeCode2List: this.result,
- pageSize: this.pageSize,
- chainsName: this.chainsName.trim(),
- monthVisited: this.monthVisited, //本月是否拜访1=拜访,0=未拜访
- mainCustomerCode: this.chainCode, //主经销商编号
- }).then((res) => {
- this.disabled = false;
- this.toastLoading().clear();
- this.loading = false;
- if (res.code == 200) {
- if (this.pageNum == '1') {
- this.list = [];
- }
- this.list = this.list.concat(res.rows);
- if (this.list.length >= res.total) {
- this.finished = true;
- } else {
- this.finished = false;
- }
- this.pageNum = this.pageNum + 1;
- this.list.forEach((item) => {
- if (item.stateString.indexOf('拜访中') != -1) {
- this.endShow = true;
- this.visitEndId = item.visitId;
- return;
- }
- });
- } else {
- this.$toast(res.msg);
- }
- });
- },
- getUserOutPlaListFun() {
- this.storeType = localStorage.getItem('storeType');
- this.disabled = true;
- this.toastLoading(0, '加载中...', true);
- this.endShow = false;
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- queryMyChainsGroupList({
- lat: this.lat,
- lon: this.lon,
- pageNum: this.pageNum,
- typeCode2List: this.result,
- pageSize: this.pageSize,
- chainsName: this.chainsName.trim(),
- monthVisited: this.monthVisited, //本月是否拜访1=拜访,0=未拜访
- mainCustomerCode: this.chainCode, //主经销商编号
- }).then((res) => {
- this.disabled = false;
- this.toastLoading().clear();
- this.loading = false;
- if (res.code == 200) {
- this.list = this.list.concat(res.rows);
- if (this.list.length >= res.total) {
- this.finished = true;
- } else {
- this.finished = false;
- }
- this.pageNum = this.pageNum + 1;
- this.list.forEach((item) => {
- if (item.stateString.indexOf('拜访中') != -1) {
- this.endShow = true;
- this.visitEndId = item.visitId;
- return;
- }
- });
- } else {
- this.finished = true;
- this.$toast(res.msg);
- }
- });
- },
- // 进入拜访
- storeVisit(val) {
- this.toastLoading(0, '加载中...', true);
- localStorage.setItem('tabVal', this.tabVal);
- localStorage.removeItem('visitId');
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 1,
- buryingPointValue: val.chainName + '(' + val.chainCode + ')',
- buryingPointName: '进店拜访',
- buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
- });
- if (val.stateString.indexOf('拜访中') != -1) {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.chainName);
- this.toastLoading().clear();
- this.$router.push({
- path: '/visitPage',
- query: {
- typeCode2: val.typeCode2,
- chainId: val.chainId,
- rdId: val.rdId,
- customerManager: val.customerManager,
- openDate: val.openDate,
- close: val.close,
- freeze: val.freeze,
- lat: val.lat,
- lon: val.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- chainName: val.chainName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- chainCode: val.chainCode,
- tabVal: this.tabVal,
- visitModel: '1',
- latNew: val.lat,
- lonNew: val.lon,
- PointSum: '0',
- marklat: val.lat,
- marklon: val.lon,
- from: 'outPlan',
- },
- });
- } else {
- getPosition()
- .then((res) => {
- let { TXisBD, resData } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- localStorage.setItem('lat', this.lat);
- localStorage.setItem('lon', this.lon);
- // var location = this.CJ02BD(res.latitude, res.longitude);
- this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
- })
- .catch((error) => {
- this.toastLoading().clear();
- this.$dialog.alert({
- message: error,
- });
- });
- }
- },
- checkStoreAddressByStoreCodeFun(val, location, res) {
- checkChainsAddressByChainCode({
- chainCode: val.chainCode,
- lon: location.lon,
- lat: location.lat,
- })
- .then((response) => {
- this.toastLoading().clear();
- if (val.lat == '' || val.lat == null) {
- this.lat = location.lat;
- this.lon = location.lon;
- }
- let PointSumval = this.twoPointSum(
- location.lat,
- location.lon,
- location.lat,
- location.lon
- ).toFixed(2);
- // 直接进入拜访 不校验经纬度
- // localStorage.setItem('startTime', new Date());
- // localStorage.setItem('ORGName', val.deptName);
- // localStorage.setItem('chainNameR', val.chainName);
- // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- // return;
- // 门店校验 地址不通过
- if (response.code != 200) {
- // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
- if (response.data.updateAddress == 0) {
- // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
- this.$dialog
- .confirm({
- confirmButtonText: '确定拜访',
- cancelButtonText: '取消拜访',
- title: '系统提示',
- message:
- '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
- closeOnClickOverlay: true,
- })
- .then(() => {
- this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- });
- } else if (response.data.updateAddress == 1) {
- // 同城AB+金牌,去修改地址
- // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
- if (!response.data.addressUpdateTimesOver) {
- this.$dialog
- .confirm({
- title: '系统提示',
- message: response.msg + '请立即修改后再拜访',
- messageAlign: 'left',
- confirmButtonText: '立即修改',
- cancelButtonText: '取消',
- })
- .then(() => {
- this.$router.push({
- path: '/storeDetail',
- query: {
- id: val.chainId,
- type: 'address',
- storeAddressId: val.storeAddressId,
- },
- });
- });
- } else {
- this.$dialog.confirm({
- title: '系统提示',
- message: '已经达到最大修改次数',
- messageAlign: 'left',
- confirmButtonText: '确定',
- });
- }
- } else if (response.data.updateAddress == 2) {
- // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
- this.resetCoord(res, val, location, PointSumval);
- return;
- }
- } else {
- // 门店编码校验门店地址通过 进入拜访
- this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- }
- })
- .catch(() => {
- this.toastLoading().clear();
- });
- },
- // 重置经纬度
- resetCoord(res, val, location, PointSumval) {
- this.$dialog
- .confirm({
- confirmButtonText: '初始化定位',
- cancelButtonText: '取消拜访',
- title: '系统提示',
- message: '偏差过大,不允许拜访。可修改本店定位.',
- closeOnClickOverlay: true,
- })
- .then(() => {
- mobileReposition({
- chainId: val.chainId,
- lat: location.lat,
- lon: location.lon,
- }).then((response) => {
- if (response.code == 200) {
- this.$dialog
- .alert({
- title: '系统提示',
- message: '本信息定位已更新成功!',
- })
- .then(() => {
- this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.chainName);
- } else {
- this.$toast(response.msg);
- }
- });
- });
- },
- // 进入拜访 router.push
- toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
- addVisitsPosition({
- chainId: val.chainId,
- visitsId: '',
- lon: res.longitude,
- lat: res.latitude,
- sourceLon: location.lon,
- sourceLat: location.lat,
- positionDesc: '',
- accuracy: res.accuracy,
- }).then((response) => {
- // 进入拜访之前先刷新页面
- store.dispatch('setDeviceOutsidePage', true);
- this.$router.push({
- path: '/visitPage',
- query: {
- typeCode2: val.typeCode2,
- chainId: val.chainId,
- rdId: val.rdId,
- customerManager: val.customerManager,
- openDate: val.openDate,
- close: val.close,
- freeze: val.freeze,
- lat: location.lat,
- lon: location.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- chainName: val.chainName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- chainCode: val.chainCode,
- tabVal: this.tabVal,
- visitModel: '1',
- latNew: location.lat,
- lonNew: location.lon,
- PointSum: PointSumval,
- marklat: res.latitude,
- marklon: res.longitude,
- from: 'outPlan',
- },
- });
- });
- },
- // 异常拜访
- abnormalVisit(val) {
- localStorage.removeItem('visitId');
- localStorage.setItem('tabVal', this.tabVal);
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 1,
- buryingPointValue: val.chainName + '(' + val.chainCode + ')',
- buryingPointName: '异常拜访',
- buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
- });
- getPosition()
- .then((res) => {
- let { TXisBD, resData } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- localStorage.setItem('lat', this.lat);
- localStorage.setItem('lon', this.lon);
- let PointSum = this.twoPointSum(TXisBD.lat, TXisBD.lon, TXisBD.lat, TXisBD.lon).toFixed(
- 2
- );
- addVisitsPosition({
- chainId: val.chainId,
- visitsId: '',
- lon: resData.longitude,
- lat: resData.latitude,
- sourceLon: location.lon,
- sourceLat: location.lat,
- positionDesc: '',
- accuracy: resData.accuracy,
- }).then((response) => {
- // 进入拜访之前先刷新页面
- store.dispatch('setDeviceOutsidePage', true);
- this.$router.push({
- path: '/visitAbnormal',
- query: {
- chainId: val.chainId,
- rdId: val.rdId,
- lat: this.lat,
- lon: this.lon,
- visitId: val.visitId,
- pageType: 'out',
- visitModel: localStorage.getItem('postType') != 'GZ' ? '5' : '3',
- chainCode: val.chainCode,
- tabVal: this.tabVal,
- latNew: TXisBD.lat,
- lonNew: TXisBD.lon,
- PointSum: PointSum,
- marklat: resData.latitude,
- marklon: resData.longitude,
- },
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.chainName);
- });
- })
- .catch((error) => {
- this.$dialog.alert({
- message: error,
- });
- });
- },
- // 客户门店
- visitFn(val) {
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 1,
- buryingPointValue: val.chainName + '(' + val.chainCode + ')',
- buryingPointName: '客户信息',
- buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
- });
- window.location.href =
- process.env.VUE_APP_SSB_LINK +
- '/order/storeDetail/list?customerCode=' +
- val.chainCode +
- '&status=jxs';
- },
- // 拜访信息
- Visit(val) {
- this.$router.push({
- path: '/historicalDetails',
- query: {
- visitId: val.visitId,
- chainId: val.chainId,
- chainCode: val.chainCode,
- },
- });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- onSearch() {
- this.pageNum = 1;
- this.list = [];
- this.finished = true;
- this.onLoad();
- },
- onSearchm() {
- localStorage.setItem('outvstoreName', this.chainName);
- localStorage.setItem('outvchainName', this.chainName);
- localStorage.setItem('outvstoreLabelTypes', this.storeLabelTypes);
- localStorage.setItem('outvstoreCategoryList', this.result);
- localStorage.setItem('outvchainCode', this.chainCode);
- this.onSearch();
- },
- tabChange(name) {
- this.finished = true;
- this.pageNum = 1;
- this.list = [];
- this.tabVal = name;
- localStorage.setItem('tabVal', name);
- this.onLoad();
- },
- // 滚动条与底部距离小于 offset 时触发 初始化会触发
- onLoad() {
- this.toastLoading(0, '加载中...', true);
- // 授权
- getTicketFun()
- .then(() => {
- getPosition(true)
- .then((res) => {
- let { TXisBD } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- if (this.tabVal == '1') {
- this.getUserOutPlaListFun();
- } else {
- this.getUserOrgStoreList();
- }
- })
- .catch((error) => {
- this.$dialog.alert({
- message: error,
- });
- });
- })
- .catch(() => {
- this.finished = true;
- });
- },
- // 跳转好帮手门店详情
- goOtherSystem(item) {
- if (item.chainCode) {
- window.location.href =
- process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.chainCode;
- } else {
- this.$dialog.alert({
- message: '缺少门店code',
- });
- }
- },
- login() {
- if (this.num > 5) {
- this.$router.push('/login');
- } else {
- this.num = this.num + 1;
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .bgcolor {
- background-color: #f5f5f5;
- }
- .card {
- padding: 10px 16px;
- box-sizing: border-box;
- }
- .card .title {
- font-size: 15px;
- font-weight: bold;
- color: #333;
- line-height: 22px;
- padding-right: 52px;
- }
- .card .info {
- font-size: 14px;
- color: #909090;
- line-height: 26px;
- }
- .btnbox {
- padding-top: 14px;
- border-top: 1px solid #eee;
- margin: 0 10px;
- }
- .statstext {
- background-color: #0057ba;
- position: absolute;
- right: 0;
- top: 6px;
- padding: 2px 6px 2px 12px;
- border-bottom-left-radius: 60px;
- border-top-left-radius: 60px;
- color: #fff;
- }
- .cellcontent .van-cell {
- padding-bottom: 10px;
- }
- .statstext .van-icon__image {
- height: 0.7em;
- }
- .home {
- height: 100%;
- width: 100%;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- .content {
- flex: 1;
- overflow: hidden;
- padding: 10px 0;
- .van-pull-refresh {
- height: 100%;
- overflow-y: auto;
- .van-pull-refresh__track {
- }
- }
- }
- }
- .monthVisited {
- margin: 0px 14px;
- .van-radio {
- width: 50%;
- margin: 0;
- }
- }
- </style>
- <style lang="scss">
- .van-tabs__nav--card .van-tab.van-tab--active {
- background-color: #0057ba !important;
- }
- .zDialog .van-dialog__header {
- padding: 10px;
- border-bottom: 1px solid #f5f5f5;
- }
- .zDialog .infoText {
- margin: 10px;
- font-size: 14px;
- color: #909090;
- width: 98%;
- }
- .visitStoreIco {
- float: left;
- float: left;
- width: 26px;
- text-align: center;
- background-color: #ffba13;
- color: #fff;
- border-radius: 100%;
- margin-left: 14px;
- line-height: 26px;
- height: 26px;
- }
- .searchcheck {
- padding: 0 10px 10px;
- }
- .searchcheck .van-checkbox {
- /*width: 44%;*/
- padding-bottom: 10px;
- }
- .searchcheck .checkbox {
- font-size: 14px;
- display: inline-block;
- width: 50%;
- line-height: 28px;
- }
- .searchcheck .checkbox .van-checkbox {
- margin-bottom: 2px;
- }
- .searchcheck .checkbox1 {
- font-size: 14px;
- float: left;
- line-height: 28px;
- width: 50%;
- }
- .searchcheck .checkbox1 .child {
- width: 100%;
- }
- .searchcheck {
- /* height: 93vh;
- overflow-y: auto; */
- }
- .searchchecktitle {
- width: 100%;
- margin: 20px 0;
- font-size: 16px;
- border-left: 3px solid #0057ba;
- line-height: 18px;
- }
- .searchchecktitle1 {
- width: 100%;
- margin: 20px 0;
- font-size: 16px;
- line-height: 18px;
- }
- .textsize {
- font-size: 14px;
- /* overflow: hidden; */
- display: flex;
- flex-direction: column;
- .searchcheck {
- flex: 1;
- overflow-y: auto;
- margin-bottom: 50px;
- }
- }
- .home {
- .TCFXListItem {
- display: inline-block;
- border: 1px solid #ccc;
- padding: 3px 5px;
- margin: 0 5px;
- border-radius: 6px;
- }
- }
- .van-dialog__confirm,
- .van-dialog__confirm:active {
- color: #0057ba;
- }
- .searchDiv {
- .van-search {
- background: #fff;
- }
- .van-search__action {
- font-size: 14px;
- color: #0057ba;
- font-weight: bold;
- background: #f1f1f1;
- border-bottom-right-radius: 60px;
- border-top-right-radius: 60px;
- border: 1px solid #ccc;
- padding: 0 20px;
- }
- .van-search--show-action {
- padding-right: 12px;
- }
- .van-search__content {
- border: 1px solid #ccc;
- border-bottom-left-radius: 60px;
- border-top-left-radius: 60px;
- background: #f1f1f1;
- border-right: 0;
- }
- }
- .myTab {
- .van-tabs__nav--card {
- margin: 0 !important;
- border-left: 0;
- border-right: 0;
- }
- .van-tabs__wrap,
- .van-tabs__nav--card {
- height: 39px;
- }
- .van-tab {
- line-height: 40px;
- }
- }
- .myList {
- .van-cell {
- padding: 0;
- &:after {
- border-bottom: none;
- }
- }
- }
- </style>
|