index.vue 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581
  1. <template>
  2. <div class="bgcolor deviceWithin">
  3. <div class="navBarTOP">
  4. <!-- 顶部条-->
  5. <van-nav-bar class="navBar" title="计划内"> </van-nav-bar>
  6. <div class="searchDiv">
  7. <van-search
  8. v-model="storeName"
  9. left-icon="search"
  10. show-action
  11. placeholder="搜索名称/编号/地址">
  12. <template #action>
  13. <div @click="onSearch">搜索</div>
  14. </template>
  15. </van-search>
  16. </div>
  17. <div style="background-color: #dfebf4; padding: 10px" v-if="mapShows">
  18. <div
  19. style="
  20. font-size: 16px;
  21. text-align: center;
  22. margin: 0 auto;
  23. width: 150px;
  24. text-decoration: underline;
  25. font-weight: bold;
  26. color: #222;
  27. "
  28. @click="goFn(1)">
  29. <img
  30. src="./../../assets/Icon/clcik.png"
  31. style="width: 22px; float: left; display: inline-block" />高销额门店推荐
  32. </div>
  33. <van-button
  34. round
  35. type="info"
  36. size="small"
  37. style="position: absolute; top: 108px; right: 10px; height: 28px"
  38. @click="goFn(1)"
  39. >去查看<van-icon name="arrow"
  40. /></van-button>
  41. </div>
  42. <div class="monthNow" v-show="calendarIsshow == false">
  43. <span class="month" @click="show = true">{{ timeData }}</span>
  44. <van-icon class="CalendarIcon" :name="timeico" @click="show = true" />
  45. </div>
  46. </div>
  47. <!-- 主体内容-->
  48. <div class="container content" style="margin-top: 190px" @touchmove="handleTouch">
  49. <div class="cellcontent" v-for="(item, index) in list" :key="index">
  50. <van-cell>
  51. <div class="card">
  52. <div class="title">
  53. <span @click="goOtherSystem(item)" style="color: #0057ba; text-decoration: underline">
  54. <span>{{ item.storeName }}</span>
  55. (<span style="color: #0057ba">{{ item.storeCode }}</span
  56. >)
  57. </span>
  58. <span class="btn" :data-clipboard-text="item.storeCode">
  59. <van-icon
  60. :name="paste"
  61. color="#ee0a24"
  62. size="20"
  63. style="top: 6px; margin-left: 4px" />
  64. </span>
  65. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  66. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  67. <template v-if="item.approvalStatus == 0">
  68. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1">已提交</span>
  69. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  70. >未提交</span
  71. >
  72. </template>
  73. </div>
  74. <div class="info">
  75. 类型:{{ item.storeCategory }} &nbsp;
  76. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  77. <div>
  78. <p>
  79. 本店经营品项指导:
  80. <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
  81. </p>
  82. </div>
  83. <van-icon name="question-o" size="18" slot="reference" />
  84. </el-popover>
  85. </div>
  86. <div class="info" style="position: relative">
  87. 联系人:{{ item.contactName }}
  88. <div style="position: absolute; bottom: 0; right: 14px">
  89. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  90. <div>
  91. <p>
  92. 本店{{ timeData1 }}下单SKU数:<a
  93. @click="linkList(item)"
  94. style="text-decoration: underline"
  95. >点击查看详情</a
  96. >
  97. </p>
  98. </div>
  99. <div
  100. class="visitStoreIco"
  101. v-if="item.storeLabels.zysslNums"
  102. style="background-color: #fff; position: relative"
  103. slot="reference">
  104. <p
  105. style="
  106. width: 100%;
  107. position: absolute;
  108. z-index: 1;
  109. top: 0.2px;
  110. width: 22px;
  111. margin: 0;
  112. margin-left: 3.6px;
  113. text-align: center;
  114. font-size: 12px;
  115. ">
  116. {{ item.storeLabels.zysslNums }}
  117. </p>
  118. <van-icon :name="ord" size="26" />
  119. </div>
  120. </el-popover>
  121. <el-popover popper-class="zpover" placement="bottom" width="200" trigger="click">
  122. <div v-if="item.storeLabels">
  123. <p>已参加:</p>
  124. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
  125. {{ tt }}
  126. </p>
  127. </div>
  128. <div
  129. class="visitStoreIco"
  130. v-if="item.storeLabels.targetOne"
  131. style="background-color: #fff"
  132. slot="reference">
  133. <van-icon :name="targetOne" size="26" />
  134. </div>
  135. </el-popover>
  136. <el-popover
  137. popper-class="zpover"
  138. placement="bottom"
  139. width="200"
  140. trigger="click"
  141. content="同城店近60天未下单">
  142. <div
  143. v-if="item.storeLabels.fxNoOrder"
  144. class="visitStoreIco"
  145. style="background-color: #fff"
  146. slot="reference">
  147. <van-icon :name="order60" size="26" />
  148. </div>
  149. </el-popover>
  150. <el-popover
  151. popper-class="zpover"
  152. placement="bottom"
  153. width="200"
  154. trigger="click"
  155. content="金牌店近30天未下单">
  156. <div
  157. v-if="item.storeLabels.noOrder"
  158. class="visitStoreIco"
  159. style="background-color: #fff"
  160. slot="reference">
  161. <van-icon :name="order" size="26" />
  162. </div>
  163. </el-popover>
  164. <el-popover
  165. popper-class="zpover"
  166. placement="bottom"
  167. width="200"
  168. trigger="click"
  169. content="本店本月进过专业时时丽">
  170. <div
  171. v-if="item.storeLabels.zyssl"
  172. class="visitStoreIco"
  173. style="background-color: #ed5c68"
  174. slot="reference">
  175. </div>
  176. </el-popover>
  177. <el-popover
  178. popper-class="zpover zpover1"
  179. placement="bottom"
  180. width="200"
  181. trigger="click"
  182. content="本店本月进过超好贴">
  183. <div
  184. v-if="item.storeLabels.chtczj"
  185. class="visitStoreIco"
  186. style="background-color: #0057ba"
  187. slot="reference">
  188. </div>
  189. </el-popover>
  190. <el-popover
  191. placement="bottom"
  192. popper-class="zpover zpover1 zpover1sb"
  193. trigger="click"
  194. :disabled="!item.userVisitTimesMap"
  195. :content="'本店本月已拜访过' + item.storeLabels.visitTimes + '次'">
  196. <div
  197. v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
  198. class="visitStoreIco"
  199. slot="reference"
  200. style="background-color: #fff; position: relative">
  201. <p
  202. style="
  203. width: 100%;
  204. position: absolute;
  205. z-index: 10;
  206. top: -2px;
  207. margin: 0;
  208. text-align: center;
  209. font-size: 12px;
  210. ">
  211. {{ item.storeLabels.visitTimes }}
  212. </p>
  213. <van-icon :name="ordernum" size="26" />
  214. </div>
  215. <!-- <div class="tipsTitle">本店本月已拜访过{{ item.storeLabels.visitTimes }}次</div> -->
  216. <el-table :data="item.userVisitTimesMap" border max-height="180px">
  217. <el-table-column label="业务员" prop="userName" />
  218. <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
  219. </el-table>
  220. </el-popover>
  221. </div>
  222. </div>
  223. <div class="info" v-if="item.telephone" @click="buryingPointFn(item)">
  224. 联系电话:<a
  225. style="color: #0057ba; font-weight: bold; text-decoration: underline"
  226. :href="'tel:' + item.telephone"
  227. >{{ item.telephone }}<van-icon name="phone"
  228. /></a>
  229. </div>
  230. <div class="info" v-if="item.addressLine">
  231. 地址:{{ item.addressLine
  232. }}<img
  233. v-if="item.storeLonExist"
  234. style="width: 36px"
  235. :src="sbpmdh"
  236. @click="linkapp(item)" />
  237. </div>
  238. <!-- 分销店 -->
  239. <template
  240. v-if="
  241. item.sfaStoreType &&
  242. item.sfaStoreType.type == 'fxd' &&
  243. item.sfaStoreChainsContactList
  244. ">
  245. <div class="info" v-if="typeShow">
  246. 经销商:
  247. <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
  248. <el-popover
  249. popper-class="zpover zpoverStoreztype"
  250. placement="bottom-start"
  251. trigger="click">
  252. <div>
  253. <div>{{ item.chainCode }}</div>
  254. <div>{{ item.chainName }}</div>
  255. </div>
  256. <div slot="reference" :key="index">
  257. {{ item.categoryDescribe }}
  258. </div>
  259. </el-popover>
  260. </div>
  261. </div>
  262. </template>
  263. <template v-else>
  264. <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
  265. </template>
  266. <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
  267. <div class="info" v-if="item.storeLonExist">距离:{{ Micrometer(item.distance) }}m</div>
  268. </div>
  269. <div
  270. class="statstext"
  271. v-if="item.stateString == '未拜访'"
  272. style="background-color: #ed5c68">
  273. 未拜访
  274. </div>
  275. <div
  276. class="statstext"
  277. v-if="item.stateString == '拜访中'"
  278. style="background-color: white">
  279. <van-icon :name="times" color="#ee0a24" size="32" />
  280. </div>
  281. <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
  282. <div class="btnbox">
  283. <van-row>
  284. <van-col
  285. span="6"
  286. v-if="item.stateString != '已拜访' && item.visitAble && customerVisits"
  287. @click="storeVisit(item)">
  288. <img :src="call" style="margin: 0 auto; height: 18px; display: block" />
  289. <p style="text-align: center; margin: 0">进入拜访</p>
  290. </van-col>
  291. <van-col
  292. span="6"
  293. v-if="item.storeCategory == '公装经销商'"
  294. @click="projectOutVisit(item)">
  295. <img :src="xmgj" style="margin: 0 auto; height: 18px; display: block" />
  296. <p style="text-align: center; margin: 0">项目跟进</p>
  297. <!-- <van-button type="info" size="small" plain class="centerBtn" @click="signAdd(item)">大客户签约</van-button>-->
  298. </van-col>
  299. <van-col
  300. span="6"
  301. v-if="
  302. item.stateString != '已拜访' &&
  303. item.visitAble &&
  304. item.storeCategory != '公装经销商' &&
  305. customerVisits
  306. "
  307. @click="abnormalVisit(item)">
  308. <img :src="yichang" style="margin: 0 auto; height: 18px; display: block" />
  309. <p style="text-align: center; margin: 0; margin-top: 1px">异常拜访</p>
  310. </van-col>
  311. <van-col span="6" v-if="item.showOrderButton" @click="orderFn(item)">
  312. <img :src="xiadan" style="margin: 0 auto; height: 18px; display: block" />
  313. <p style="text-align: center; margin: 0; margin-top: 1px">去下单</p>
  314. </van-col>
  315. <van-col span="6" v-if="item.stateString == '已拜访'" @click="Visit(item)">
  316. <img :src="bfxx" style="margin: 0 auto; height: 18px; display: block" />
  317. <p style="text-align: center; margin: 0; margin-top: 1px">拜访信息</p>
  318. </van-col>
  319. <van-col span="6" @click="visitFn(item)">
  320. <img :src="kehuxinxi" style="margin: 0 auto; height: 18px; display: block" />
  321. <p style="text-align: center; margin: 0; margin-top: 1px">客户信息</p>
  322. </van-col>
  323. </van-row>
  324. </div>
  325. </van-cell>
  326. <div class="lineGrey"></div>
  327. </div>
  328. <p style="text-align: center; color: #888a8e" v-if="list.length > 0">--已经到底了--</p>
  329. <br />
  330. <van-empty description="暂无数据" v-if="list.length == 0" />
  331. </div>
  332. <van-popup v-model="show" position="bottom" :style="{ height: '50%' }">
  333. <van-datetime-picker
  334. v-model="currentDate"
  335. type="date"
  336. title="计划日期"
  337. :min-date="minDate"
  338. :max-date="maxDate"
  339. @confirm="dateeconfirm"
  340. @cancel="show = false" />
  341. </van-popup>
  342. <tab-bar tabBarActive="deviceWithin"></tab-bar>
  343. </div>
  344. </template>
  345. <script>
  346. import tabBar from '@/components/tabBar';
  347. import times from '@/assets/Icon/times.png';
  348. import order60 from '@/assets/order60.png';
  349. import targetOne from '@/assets/targetOne.png';
  350. import visitTimes from '@/assets/visitTimes.png';
  351. import ord from '@/assets/ord.png';
  352. import timeico from '@/assets/Icon/datatims.png';
  353. import sbpmdh from '@/assets/sbpmdh.png';
  354. import {
  355. getUserInPlanList,
  356. checkVisit,
  357. addVisitsPosition,
  358. mobileReposition,
  359. buryingPoint,
  360. ProductItemImge,
  361. } from '@/api/index';
  362. import axios from 'axios';
  363. import paste from '@/assets/paste.png';
  364. import order from '@/assets/order.png';
  365. import ordernum from '@/assets/ordernum.png';
  366. import call from '@/assets/call.png';
  367. import jiarujihua from '@/assets/jiarujihua.png';
  368. import kehuxinxi from '@/assets/kehuxinxi-2.png';
  369. import xiadan from '@/assets/xiadan.png';
  370. import yichang from '@/assets/yichang.png';
  371. import bfxx from '@/assets/bfxx.png';
  372. import xmgj from '@/assets/xmgj.png';
  373. import { getOrderUrlByStoreId } from '@/api/inventory';
  374. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  375. import { getPosition, getTicketFun } from '@/utils/TXApiFun';
  376. export default {
  377. name: 'deviceWithin',
  378. components: { tabBar },
  379. data() {
  380. return {
  381. xmgj: xmgj,
  382. bfxx: bfxx,
  383. yichang: yichang,
  384. xiadan: xiadan,
  385. kehuxinxi: kehuxinxi,
  386. jiarujihua: jiarujihua,
  387. call: call,
  388. times: times,
  389. timeico: timeico,
  390. order60: order60,
  391. sbpmdh: sbpmdh,
  392. ord: ord,
  393. timeData1: '',
  394. targetOne: targetOne,
  395. ordernum: ordernum,
  396. paste: paste,
  397. visitTimess: visitTimes,
  398. show: false,
  399. cont: 0,
  400. timer: null,
  401. flag: true,
  402. order: order,
  403. defaultDate: new Date(),
  404. minDate: new Date(2020, 0, 1),
  405. maxDate: new Date(2025, 10, 1),
  406. showPopoverVNUM: [],
  407. showPopoverC: [],
  408. showPopoverZ: [],
  409. currentDate: new Date(),
  410. searchValue: '',
  411. calendarIsshow: false,
  412. tabVal: 'insidePlan',
  413. list: [],
  414. loading: false,
  415. finished: false,
  416. mapShows: false,
  417. typeShow: false,
  418. storeName: '',
  419. timeData: '',
  420. genDate: '',
  421. listActive: null,
  422. query: '',
  423. lat: '',
  424. lon: '',
  425. storeType: '',
  426. endShow: false,
  427. visitEndId: '',
  428. customerVisits: true,
  429. };
  430. },
  431. watch: {
  432. $route(to, from) {
  433. if (from.path == '/deviceWithin/index' && to.path == '/storeVisitpage') {
  434. localStorage.setItem('startTime', new Date());
  435. }
  436. },
  437. },
  438. activated() {
  439. this.query = this.$route.query;
  440. this.timeData = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  441. this.storeName = localStorage.getItem('deviveStoreName');
  442. this.getMonth();
  443. // 授权
  444. getTicketFun().then(() => {
  445. this.getUserInPlanList();
  446. });
  447. },
  448. mounted() {
  449. // 解决iOS 上拉边界下拉出现白色空白
  450. let node = document.getElementsByClassName('deviceWithin')[0];
  451. node.addEventListener(
  452. 'touchmove',
  453. (e) => {
  454. if (e._isScroller) return;
  455. e.preventDefault();
  456. },
  457. {
  458. passive: false,
  459. }
  460. );
  461. },
  462. methods: {
  463. handleTouch(e) {
  464. e._isScroller = true;
  465. },
  466. linkapp(val) {
  467. var poind = this.gcj02BD(val.lat, val.lon);
  468. let url = window.location.href;
  469. let that = this;
  470. let wx = this.wx;
  471. let qiyeData;
  472. const instance = axios.create();
  473. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  474. instance
  475. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  476. params: {
  477. url: url,
  478. agent: 1,
  479. },
  480. })
  481. .then((response) => {
  482. if (response.status == 200) {
  483. qiyeData = response.data.data;
  484. wx.agentConfig({
  485. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  486. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  487. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  488. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  489. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  490. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  491. success: function (res) {
  492. wx.invoke(
  493. 'launchMiniprogram',
  494. {
  495. appid: 'wx238bbb5f6d958414',
  496. path:
  497. 'pages/relayStation/relayStation?latitude=' +
  498. poind.lat +
  499. '&longitude=' +
  500. poind.lon +
  501. '&name=' +
  502. val.addressLine,
  503. },
  504. function (res) {
  505. if (res.err_msg == 'launchMiniprogram:ok') {
  506. } else {
  507. }
  508. }
  509. );
  510. },
  511. fail: function (res) {
  512. if (res.errMsg.indexOf('function not exist') > -1) {
  513. alert('版本过低请升级');
  514. }
  515. },
  516. });
  517. }
  518. });
  519. },
  520. orderFn(val) {
  521. buryingPoint({
  522. systemModel: '计划内',
  523. buryingPointType: 1,
  524. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  525. buryingPointName: '去下单',
  526. buryingPointPosition: '计划内',
  527. });
  528. getOrderUrlByStoreId({
  529. storeId: val.storeId,
  530. from: 'inPlan',
  531. }).then((res) => {
  532. if (res.code == 200 && res.data) {
  533. window.location.href = res.data;
  534. } else {
  535. this.Toast({
  536. message: res.msg,
  537. duration: 5000,
  538. });
  539. }
  540. });
  541. },
  542. linkList(val) {
  543. this.$router.push({
  544. path: '/pItem',
  545. query: { id: val.storeCode, detilId: 'a' },
  546. });
  547. },
  548. linkimg(val) {
  549. ProductItemImge({ storeId: val.storeId }).then((response) => {
  550. if (response.code == 200) {
  551. if (response.data != undefined) {
  552. window.open(response.data);
  553. } else {
  554. this.$toast(response.msg);
  555. }
  556. } else {
  557. this.$dialog.alert({
  558. title: '系统提示',
  559. message: res.msg,
  560. });
  561. }
  562. });
  563. },
  564. getMonth() {
  565. // 获取当前日期
  566. var currentDate = new Date();
  567. // 获取当前月份
  568. var currentMonth = currentDate.getMonth();
  569. // 获取当前年份
  570. // var currentYear = currentDate.getFullYear();
  571. var previousMonthDate1 = new Date();
  572. if (currentDate.getDate() == 1) {
  573. previousMonthDate1.setMonth(currentMonth - 1);
  574. } else {
  575. }
  576. var previousMonth1 = previousMonthDate1.getMonth();
  577. var previousYear1 = previousMonthDate1.getFullYear();
  578. // 计算前三个月的年份和月份
  579. var previousMonthDate = new Date();
  580. if (currentDate.getDate() == 1) {
  581. previousMonthDate.setMonth(currentMonth - 3);
  582. } else {
  583. previousMonthDate.setMonth(currentMonth - 2);
  584. }
  585. 1;
  586. var previousMonth = previousMonthDate.getMonth();
  587. var previousYear = previousMonthDate.getFullYear();
  588. //前三个月
  589. if (previousYear1 == previousYear) {
  590. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  591. // 格式化年份和月份
  592. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  593. this.timeData1 =
  594. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  595. } else {
  596. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  597. // .toString().padStart(2, '0');
  598. // 格式化年份和月份
  599. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  600. this.timeData1 = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  601. }
  602. },
  603. Visit(val) {
  604. this.$router.push({
  605. path: '/historicalDetails',
  606. query: {
  607. visitId: val.visitId,
  608. storeId: val.storeId,
  609. storeCode: val.storeCode,
  610. },
  611. });
  612. },
  613. dateeconfirm() {
  614. this.show = false;
  615. this.genDate = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
  616. this.timeData = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
  617. this.getUserInPlanList();
  618. },
  619. dataFn() {
  620. this.genDate = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  621. this.timeData = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  622. this.getUserInPlanList();
  623. },
  624. buryingPointFn(val) {
  625. buryingPoint({
  626. systemModel: '计划内',
  627. buryingPointType: 1,
  628. buryingPointValue: val.telephone,
  629. buryingPointName: '点击电话',
  630. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  631. });
  632. },
  633. getUserInPlanList() {
  634. localStorage.setItem('outvstoreName', '');
  635. localStorage.setItem('outvchainName', '');
  636. localStorage.removeItem('outvstoreLabelTypes');
  637. localStorage.removeItem('outvstoreCategoryList');
  638. localStorage.setItem('outvchainCode', '');
  639. localStorage.setItem('outvstoreName', '');
  640. localStorage.setItem('outvsortType', '');
  641. localStorage.setItem('outsortParam', '');
  642. localStorage.setItem('lat', '');
  643. localStorage.setItem('lon', '');
  644. this.list = [];
  645. var postType = localStorage.getItem('postType');
  646. this.customerVisits = localStorage.getItem('customerVisits');
  647. if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
  648. this.mapShows = false;
  649. } else {
  650. this.mapShows = true;
  651. }
  652. if (postType == 'GZ') {
  653. this.typeShow = false;
  654. } else {
  655. this.typeShow = true;
  656. }
  657. this.storeType = localStorage.getItem('storeType');
  658. this.endShow = false;
  659. this.toastLoading(0, '加载中...', true);
  660. localStorage.removeItem('visitId');
  661. getPosition(true)
  662. .then((res) => {
  663. let { TXisBD } = res;
  664. this.getUserInPlanListFun(TXisBD);
  665. })
  666. .catch((error) => {
  667. this.$dialog.alert({
  668. message: error,
  669. });
  670. });
  671. },
  672. getUserInPlanListFun(TXisBD) {
  673. getUserInPlanList({
  674. storeName: this.storeName.trim(),
  675. genDate: this.genDate,
  676. lat: TXisBD.lat,
  677. lon: TXisBD.lon,
  678. }).then((res) => {
  679. this.toastLoading().clear();
  680. if (res.code == 200) {
  681. this.list = res.data;
  682. this.list.forEach((item) => {
  683. if (item.stateString.indexOf('拜访中') != -1) {
  684. this.endShow = true;
  685. this.visitEndId = item.visitId;
  686. return;
  687. }
  688. });
  689. } else {
  690. this.$toast.fail(res.msg);
  691. }
  692. });
  693. },
  694. storeVisit(val) {
  695. var that = this;
  696. localStorage.removeItem('visitId');
  697. checkVisit({ storeId: val.storeId }).then((res) => {
  698. buryingPoint({
  699. systemModel: '计划内',
  700. buryingPointType: 1,
  701. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  702. buryingPointName: '进店拜访',
  703. buryingPointPosition: '计划内',
  704. });
  705. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  706. if (localStorage.getItem('loginType') == 'cs') {
  707. var lat = '';
  708. var lon = '';
  709. if (val.lat == '' || val.lat == null) {
  710. lat = '31.2517820000';
  711. lon = '120.5593090000';
  712. } else {
  713. lat = val.lat;
  714. lon = val.lon;
  715. }
  716. this.$router.push({
  717. path: '/storeVisitpage',
  718. query: {
  719. storeId: val.storeId,
  720. rdId: val.rdId,
  721. lat: lat,
  722. lon: lon,
  723. visitId: val.visitId,
  724. pageType: 'out',
  725. addressLine: val.addressLine,
  726. storeCategory: val.storeCategory,
  727. storeName: val.storeName,
  728. hisTime: val.hisTime,
  729. contactName: val.contactName,
  730. storeCode: val.storeCode,
  731. tabVal: this.tabVal,
  732. visitModel: '1',
  733. latNew: '31.2517820000',
  734. lonNew: '120.5593090000',
  735. PointSum: 0,
  736. marklat: lat,
  737. marklon: lon,
  738. from: 'inPlan',
  739. },
  740. });
  741. localStorage.setItem('startTime', new Date());
  742. localStorage.setItem('ORGName', val.deptName);
  743. localStorage.setItem('chainNameR', val.storeName);
  744. } else {
  745. if (that.flag) {
  746. that.flag = false;
  747. that.timer = null;
  748. that.timer = setTimeout(() => {
  749. that.flag = true;
  750. }, 2000);
  751. if (val.stateString.indexOf('拜访中') != -1) {
  752. that.$router.push({
  753. path: '/storeVisitpage',
  754. query: {
  755. storeId: val.storeId,
  756. rdId: val.rdId,
  757. lat: val.lat,
  758. lon: val.lon,
  759. visitId: val.visitId,
  760. addressLine: val.addressLine,
  761. storeCategory: val.storeCategory,
  762. storeName: val.storeName,
  763. contactName: val.contactName,
  764. genDate: val.hisTime,
  765. storeCode: val.storeCode,
  766. visitModel: '1',
  767. latNew: val.lat,
  768. lonNew: val.lon,
  769. PointSum: '0',
  770. marklat: val.lat,
  771. marklon: val.lon,
  772. from: 'inPlan',
  773. },
  774. });
  775. localStorage.setItem('startTime', new Date());
  776. localStorage.setItem('ORGName', val.deptName);
  777. localStorage.setItem('chainNameR', val.storeName);
  778. } else {
  779. getPosition()
  780. .then((res) => {
  781. let { TXisBD, resData } = res;
  782. this.lat = TXisBD.lat;
  783. this.lon = TXisBD.lon;
  784. localStorage.setItem('lat', this.lat);
  785. localStorage.setItem('lon', this.lon);
  786. this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
  787. })
  788. .catch((error) => {
  789. this.$dialog.alert({
  790. message: error,
  791. });
  792. });
  793. }
  794. }
  795. }
  796. } else {
  797. this.$dialog.alert({
  798. title: '系统提示',
  799. message: res.msg,
  800. });
  801. }
  802. });
  803. },
  804. checkStoreAddressByStoreCodeFun(val, location, res) {
  805. checkStoreAddressByStoreCode({
  806. storeCode: val.storeCode,
  807. lon: location.lon,
  808. lat: location.lat,
  809. }).then((response) => {
  810. // loading1.clear();
  811. if (val.lat == '' || val.lat == null) {
  812. this.lat = location.lat;
  813. this.lon = location.lon;
  814. }
  815. // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
  816. let PointSumval = this.twoPointSum(
  817. location.lat,
  818. location.lon,
  819. location.lat,
  820. location.lon
  821. ).toFixed(2);
  822. // GZ:工装店铺 直接进入拜访
  823. if (localStorage.getItem('postType') == 'GZ') {
  824. localStorage.setItem('startTime', new Date());
  825. localStorage.setItem('ORGName', val.deptName);
  826. localStorage.setItem('chainNameR', val.storeName);
  827. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  828. return;
  829. }
  830. // 门店校验 地址不通过
  831. if (response.code != 200) {
  832. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  833. if (response.data.updateAddress == 0) {
  834. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  835. this.$dialog
  836. .confirm({
  837. confirmButtonText: '确定拜访',
  838. cancelButtonText: '取消拜访',
  839. title: '系统提示',
  840. message:
  841. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  842. closeOnClickOverlay: true,
  843. })
  844. .then(() => {
  845. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  846. });
  847. } else if (response.data.updateAddress == 1) {
  848. // 同城AB+金牌,去修改地址
  849. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  850. if (!response.data.addressUpdateTimesOver) {
  851. this.$dialog
  852. .confirm({
  853. title: '系统提示',
  854. message: response.msg + '请立即修改后再拜访',
  855. messageAlign: 'left',
  856. confirmButtonText: '立即修改',
  857. cancelButtonText: '取消',
  858. })
  859. .then(() => {
  860. this.$router.push({
  861. path: '/storeDetail',
  862. query: {
  863. id: val.storeId,
  864. type: 'address',
  865. storeAddressId: val.storeAddressId,
  866. },
  867. });
  868. });
  869. } else {
  870. this.$dialog.confirm({
  871. title: '系统提示',
  872. message: '已经达到最大修改次数',
  873. messageAlign: 'left',
  874. confirmButtonText: '确定',
  875. });
  876. }
  877. } else if (response.data.updateAddress == 2) {
  878. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  879. this.resetCoord(res, val, location, PointSumval);
  880. return;
  881. }
  882. } else {
  883. // 门店编码校验门店地址通过 进入拜访
  884. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  885. }
  886. });
  887. },
  888. // 重置经纬度
  889. resetCoord(res, val, location, PointSumval) {
  890. this.$dialog
  891. .confirm({
  892. confirmButtonText: '初始化定位',
  893. cancelButtonText: '取消拜访',
  894. title: '系统提示',
  895. message: '偏差过大,不允许拜访。可修改本店定位.',
  896. closeOnClickOverlay: true,
  897. })
  898. .then(() => {
  899. mobileReposition({
  900. storeId: val.storeId,
  901. lat: location.lat,
  902. lon: location.lon,
  903. }).then((response) => {
  904. if (response.code == 200) {
  905. this.$dialog
  906. .alert({
  907. title: '系统提示',
  908. message: '本信息定位已更新成功!',
  909. })
  910. .then(() => {
  911. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  912. });
  913. localStorage.setItem('startTime', new Date());
  914. localStorage.setItem('ORGName', val.deptName);
  915. localStorage.setItem('chainNameR', val.storeName);
  916. } else {
  917. this.$toast(response.msg);
  918. }
  919. });
  920. })
  921. .catch(() => {});
  922. },
  923. // 进入拜访 router.push
  924. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  925. addVisitsPosition({
  926. storeId: val.storeId,
  927. visitsId: '',
  928. lon: res.longitude,
  929. lat: res.latitude,
  930. sourceLon: location.lon,
  931. sourceLat: location.lat,
  932. positionDesc: '',
  933. accuracy: res.accuracy,
  934. }).then(() => {
  935. this.$router.push({
  936. path: '/storeVisitpage',
  937. query: {
  938. storeId: val.storeId,
  939. rdId: val.rdId,
  940. lat: location.lat,
  941. lon: location.lon,
  942. visitId: val.visitId,
  943. addressLine: val.addressLine,
  944. storeCategory: val.storeCategory,
  945. storeName: val.storeName,
  946. contactName: val.contactName,
  947. genDate: val.hisTime,
  948. storeCode: val.storeCode,
  949. visitModel: '1',
  950. latNew: location.lat,
  951. lonNew: location.lon,
  952. PointSum: PointSumval,
  953. marklat: res.latitude,
  954. marklon: res.longitude,
  955. from: 'inPlan',
  956. },
  957. });
  958. });
  959. },
  960. projectOutVisit(val) {
  961. localStorage.setItem('tabVal', this.tabVal);
  962. localStorage.removeItem('visitId');
  963. // checkVisit({storeId:val.storeId}).then(res=>{
  964. // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
  965. if (localStorage.getItem('loginType') == 'cs') {
  966. var lat = '';
  967. var lon = '';
  968. if (val.lat == '' || val.lat == null) {
  969. lat = '31.2517820000';
  970. lon = '120.5593090000';
  971. } else {
  972. lat = val.lat;
  973. lon = val.lon;
  974. }
  975. this.$router.push({
  976. path: '/storeGroup',
  977. query: {
  978. storeId: val.storeId,
  979. rdId: val.rdId,
  980. lat: lat,
  981. lon: lon,
  982. visitId: val.visitId,
  983. pageType: 'out',
  984. addressLine: val.addressLine,
  985. storeCategory: val.storeCategory,
  986. storeName: val.storeName,
  987. hisTime: val.hisTime,
  988. contactName: val.contactName,
  989. storeCode: val.storeCode,
  990. tabVal: this.tabVal,
  991. visitModel: '1',
  992. latNew: '31.2517820000',
  993. lonNew: '120.5593090000',
  994. PointSum: 0,
  995. marklat: lat,
  996. marklon: lon,
  997. },
  998. });
  999. localStorage.setItem('startTime', new Date());
  1000. localStorage.setItem('ORGName', val.deptName);
  1001. localStorage.setItem('chainNameR', val.storeName);
  1002. } else {
  1003. if (this.flag) {
  1004. this.flag = false;
  1005. this.timer = null;
  1006. let that = this;
  1007. this.timer = setTimeout(() => {
  1008. this.flag = true;
  1009. }, 2000);
  1010. if (val.stateString.indexOf('拜访中') != -1) {
  1011. localStorage.setItem('startTime', new Date());
  1012. localStorage.setItem('ORGName', val.deptName);
  1013. localStorage.setItem('chainNameR', val.storeName);
  1014. that.$router.push({
  1015. path: '/storeGroup',
  1016. query: {
  1017. storeId: val.storeId,
  1018. rdId: val.rdId,
  1019. lat: val.lat,
  1020. lon: val.lon,
  1021. visitId: val.visitId,
  1022. pageType: 'out',
  1023. addressLine: val.addressLine,
  1024. storeCategory: val.storeCategory,
  1025. storeName: val.storeName,
  1026. hisTime: val.hisTime,
  1027. contactName: val.contactName,
  1028. storeCode: val.storeCode,
  1029. tabVal: that.tabVal,
  1030. visitModel: '1',
  1031. latNew: val.lat,
  1032. lonNew: val.lon,
  1033. PointSum: '0',
  1034. marklat: val.lat,
  1035. marklon: val.lon,
  1036. },
  1037. });
  1038. } else {
  1039. let loading1 = this.$toast.loading({
  1040. duration: 0,
  1041. message: '加载中...',
  1042. forbidClick: true,
  1043. });
  1044. let url = window.location.href;
  1045. let wx = this.wx;
  1046. let qiyeData;
  1047. const instance = axios.create();
  1048. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1049. instance
  1050. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1051. params: {
  1052. url: url,
  1053. },
  1054. })
  1055. .then((response) => {
  1056. if (response.status == 200) {
  1057. this.cont = 3;
  1058. var flat = true;
  1059. var times = setInterval(() => {
  1060. this.cont--;
  1061. if (this.cont == '0') {
  1062. if (flat) {
  1063. loading1.clear();
  1064. clearInterval(times);
  1065. that.$dialog
  1066. .alert({
  1067. message: '定位失败,请开启企微定位权限',
  1068. })
  1069. .then(() => {});
  1070. } else {
  1071. clearInterval(times);
  1072. }
  1073. }
  1074. }, 1000);
  1075. qiyeData = response.data.data;
  1076. wx.config({
  1077. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1078. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1079. appId: qiyeData.appId, // 必填,企业微信的corpID
  1080. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1081. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1082. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1083. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1084. });
  1085. wx.ready(function () {
  1086. wx.getLocation({
  1087. type: 'gcj02',
  1088. success: function (res) {
  1089. flat = false;
  1090. loading1.clear();
  1091. var location = that.CJ02BD(res.latitude, res.longitude);
  1092. if (val.lat == '' || val.lat == null) {
  1093. that.lat = location.lat;
  1094. that.lon = location.lon;
  1095. }
  1096. let PointSum = that
  1097. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1098. .toFixed(2);
  1099. if (val.lat == '' || val.lat == null) {
  1100. if (localStorage.getItem('postType') != 'GZ') {
  1101. that.$dialog
  1102. .confirm({
  1103. confirmButtonText: '确定拜访',
  1104. cancelButtonText: '取消拜访',
  1105. title: '系统提示',
  1106. message:
  1107. '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
  1108. closeOnClickOverlay: true,
  1109. })
  1110. .then(() => {
  1111. that.$router.push({
  1112. path: '/storeGroup',
  1113. query: {
  1114. storeId: val.storeId,
  1115. rdId: val.rdId,
  1116. lat: that.lat,
  1117. lon: that.lon,
  1118. visitId: val.visitId,
  1119. pageType: 'out',
  1120. addressLine: val.addressLine,
  1121. storeCategory: val.storeCategory,
  1122. storeName: val.storeName,
  1123. contactName: val.contactName,
  1124. hisTime: val.hisTime,
  1125. storeCode: val.storeCode,
  1126. tabVal: that.tabVal,
  1127. visitModel: '1',
  1128. latNew: location.lat,
  1129. lonNew: location.lon,
  1130. PointSum: PointSum,
  1131. marklat: res.latitude,
  1132. marklon: res.longitude,
  1133. },
  1134. });
  1135. });
  1136. } else {
  1137. that.$router.push({
  1138. path: '/storeGroup',
  1139. query: {
  1140. storeId: val.storeId,
  1141. rdId: val.rdId,
  1142. lat: that.lat,
  1143. lon: that.lon,
  1144. visitId: val.visitId,
  1145. pageType: 'out',
  1146. addressLine: val.addressLine,
  1147. storeCategory: val.storeCategory,
  1148. storeName: val.storeName,
  1149. contactName: val.contactName,
  1150. hisTime: val.hisTime,
  1151. storeCode: val.storeCode,
  1152. tabVal: that.tabVal,
  1153. visitModel: '1',
  1154. latNew: location.lat,
  1155. lonNew: location.lon,
  1156. PointSum: PointSum,
  1157. marklat: res.latitude,
  1158. marklon: res.longitude,
  1159. },
  1160. });
  1161. }
  1162. } else {
  1163. that.$router.push({
  1164. path: '/storeGroup',
  1165. query: {
  1166. storeId: val.storeId,
  1167. rdId: val.rdId,
  1168. lat: that.lat,
  1169. lon: that.lon,
  1170. visitId: val.visitId,
  1171. pageType: 'out',
  1172. addressLine: val.addressLine,
  1173. storeCategory: val.storeCategory,
  1174. storeName: val.storeName,
  1175. contactName: val.contactName,
  1176. hisTime: val.hisTime,
  1177. storeCode: val.storeCode,
  1178. tabVal: that.tabVal,
  1179. visitModel: '1',
  1180. latNew: location.lat,
  1181. lonNew: location.lon,
  1182. PointSum: PointSum,
  1183. marklat: res.latitude,
  1184. marklon: res.longitude,
  1185. },
  1186. });
  1187. }
  1188. localStorage.setItem('startTime', new Date());
  1189. localStorage.setItem('ORGName', val.deptName);
  1190. localStorage.setItem('chainNameR', val.storeName);
  1191. addVisitsPosition({
  1192. storeId: val.storeId,
  1193. visitsId: '',
  1194. lon: res.longitude,
  1195. lat: res.latitude,
  1196. sourceLon: location.lon,
  1197. sourceLat: location.lat,
  1198. positionDesc: '',
  1199. accuracy: res.accuracy,
  1200. });
  1201. },
  1202. fail: function () {
  1203. loading1.clear();
  1204. that.$dialog.alert({
  1205. message: 'GPS未开启',
  1206. });
  1207. },
  1208. });
  1209. });
  1210. wx.error(function (res) {
  1211. loading1.clear();
  1212. that.$dialog
  1213. .alert({
  1214. message: '定位失败,请开启企微定位权限',
  1215. })
  1216. .then(() => {});
  1217. });
  1218. }
  1219. });
  1220. }
  1221. }
  1222. }
  1223. // }
  1224. // })
  1225. },
  1226. abnormalVisit(val) {
  1227. localStorage.removeItem('visitId');
  1228. checkVisit({ storeId: val.storeId }).then((res) => {
  1229. buryingPoint({
  1230. systemModel: '计划内',
  1231. buryingPointType: 1,
  1232. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1233. buryingPointName: '异常拜访',
  1234. buryingPointPosition: '计划内',
  1235. });
  1236. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1237. if (localStorage.getItem('loginType') == 'cs') {
  1238. var lat = '';
  1239. var lon = '';
  1240. if (val.lat == '' || val.lat == null) {
  1241. lat = '31.2517820000';
  1242. lon = '120.5593090000';
  1243. } else {
  1244. lat = val.lat;
  1245. lon = val.lon;
  1246. }
  1247. this.$router.push({
  1248. path: '/abnormalVisit',
  1249. query: {
  1250. storeId: val.storeId,
  1251. rdId: val.rdId,
  1252. lat: lat,
  1253. lon: lon,
  1254. visitId: val.visitId,
  1255. pageType: 'out',
  1256. addressLine: val.addressLine,
  1257. storeCategory: val.storeCategory,
  1258. storeName: val.storeName,
  1259. hisTime: val.hisTime,
  1260. contactName: val.contactName,
  1261. storeCode: val.storeCode,
  1262. tabVal: this.tabVal,
  1263. visitModel: '3',
  1264. latNew: '31.2517820000',
  1265. lonNew: '120.5593090000',
  1266. PointSum: 0,
  1267. marklat: lat,
  1268. marklon: lon,
  1269. },
  1270. });
  1271. localStorage.setItem('startTime', new Date());
  1272. localStorage.setItem('ORGName', val.deptName);
  1273. localStorage.setItem('chainNameR', val.storeName);
  1274. } else {
  1275. getPosition()
  1276. .then((res) => {
  1277. let { TXisBD, resData } = res;
  1278. this.lat = TXisBD.lat;
  1279. this.lon = TXisBD.lon;
  1280. localStorage.setItem('lat', this.lat);
  1281. localStorage.setItem('lon', this.lon);
  1282. console.log('异常拜访=' + this.lat);
  1283. console.log('异常拜访=' + this.lon);
  1284. this.$router.push({
  1285. path: '/abnormalVisit',
  1286. query: {
  1287. storeId: val.storeId,
  1288. rdId: val.rdId,
  1289. lat: this.lat,
  1290. lon: this.lon,
  1291. visitModel: localStorage.getItem('postType') != 'GZ' ? '5' : '3',
  1292. visitId: val.visitId,
  1293. genDate: val.genDate,
  1294. storeCode: val.storeCode,
  1295. latNew: location.lat,
  1296. lonNew: location.lon,
  1297. PointSum: PointSum,
  1298. marklat: resData.latitude,
  1299. marklon: resData.longitude,
  1300. },
  1301. });
  1302. localStorage.setItem('startTime', new Date());
  1303. localStorage.setItem('ORGName', val.deptName);
  1304. localStorage.setItem('chainNameR', val.storeName);
  1305. addVisitsPosition({
  1306. storeId: val.storeId,
  1307. visitsId: '',
  1308. lon: resData.longitude,
  1309. lat: resData.latitude,
  1310. sourceLon: location.lon,
  1311. sourceLat: location.lat,
  1312. positionDesc: '',
  1313. accuracy: resData.accuracy,
  1314. });
  1315. })
  1316. .catch((error) => {
  1317. this.$dialog.alert({
  1318. message: error,
  1319. });
  1320. });
  1321. }
  1322. } else {
  1323. this.$dialog.alert({
  1324. title: '系统提示',
  1325. message: res.msg,
  1326. });
  1327. }
  1328. });
  1329. },
  1330. compareDate(dateTime1) {
  1331. var formatDate1 = Date.parse(dateTime1);
  1332. var formatDate2 = Date.parse(this.parseTime(new Date(), '{yy}-{mm}-{dd}'));
  1333. if (formatDate1 == formatDate2) {
  1334. return true;
  1335. } else {
  1336. return false;
  1337. }
  1338. },
  1339. visitFn(val) {
  1340. buryingPoint({
  1341. systemModel: '计划内',
  1342. buryingPointType: 1,
  1343. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1344. buryingPointName: '客户信息',
  1345. buryingPointPosition: '计划内',
  1346. });
  1347. this.$router.push({
  1348. path: '/storeDetail',
  1349. query: { id: val.storeId, detilId: 'a' },
  1350. });
  1351. },
  1352. goFn() {
  1353. this.$router.push({
  1354. path: '/topStore',
  1355. });
  1356. },
  1357. formLink() {
  1358. this.$router.push('/storeVisit/questions');
  1359. },
  1360. onClickLeft() {
  1361. this.$router.go(-1);
  1362. },
  1363. onSearch() {
  1364. localStorage.setItem('deviveStoreName', this.storeName);
  1365. this.getUserInPlanList();
  1366. },
  1367. handelChange(date) {
  1368. var dateF = this.parseTime(date.$d, '{yy}-{mm}-{dd}');
  1369. this.timeData = dateF;
  1370. this.genDate = dateF;
  1371. this.getUserInPlanList();
  1372. },
  1373. onLoad() {
  1374. this.getUserInPlanList();
  1375. },
  1376. listClick(val) {
  1377. this.listActive = val;
  1378. },
  1379. // 跳转好帮手门店详情
  1380. goOtherSystem(item) {
  1381. if (item.storeCode) {
  1382. window.location.href =
  1383. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
  1384. } else {
  1385. this.$dialog.alert({
  1386. message: '缺少门店code',
  1387. });
  1388. }
  1389. },
  1390. },
  1391. };
  1392. </script>
  1393. <style lang="scss">
  1394. .van-dialog__confirm,
  1395. .van-dialog__confirm:active {
  1396. color: #0057ba;
  1397. }
  1398. .searchDiv {
  1399. .van-search {
  1400. background: #fff;
  1401. }
  1402. .van-search__action {
  1403. font-size: 14px;
  1404. color: #0057ba;
  1405. font-weight: bold;
  1406. background: #f1f1f1;
  1407. border-bottom-right-radius: 60px;
  1408. border-top-right-radius: 60px;
  1409. border: 1px solid #c1c1c1;
  1410. padding: 0 20px;
  1411. }
  1412. .van-search--show-action {
  1413. padding-right: 12px;
  1414. }
  1415. .van-search__content {
  1416. border: 1px solid #c1c1c1;
  1417. border-bottom-left-radius: 60px;
  1418. border-top-left-radius: 60px;
  1419. background: #f1f1f1;
  1420. border-right: 0;
  1421. }
  1422. }
  1423. </style>
  1424. <style lang="scss" scoped>
  1425. .bgcolor {
  1426. background-color: #f5f5f5;
  1427. }
  1428. .container {
  1429. padding-bottom: 50px;
  1430. }
  1431. .monthNow {
  1432. height: 48px;
  1433. line-height: 48px;
  1434. text-align: center;
  1435. font-weight: bold;
  1436. padding: 0 15px;
  1437. box-sizing: border-box;
  1438. background-color: #f5f5f5;
  1439. font-size: 16px;
  1440. .CalendarIcon {
  1441. font-size: 24px;
  1442. color: #0057ba;
  1443. position: relative;
  1444. top: 6px;
  1445. margin-left: 10px;
  1446. }
  1447. }
  1448. .card {
  1449. padding: 10px 16px;
  1450. box-sizing: border-box;
  1451. .title {
  1452. font-size: 15px;
  1453. font-weight: bold;
  1454. color: #333;
  1455. line-height: 22px;
  1456. padding-right: 52px;
  1457. /*word-break: break-all;*/
  1458. .statusIcon {
  1459. padding: 3px;
  1460. font-size: 12px;
  1461. margin: 0 3px;
  1462. color: #fff;
  1463. display: inline-block;
  1464. height: 20px;
  1465. line-height: 16px;
  1466. vertical-align: -1px;
  1467. }
  1468. .submit {
  1469. background: #ffba13;
  1470. }
  1471. .noSubmit {
  1472. background: #f11818;
  1473. }
  1474. }
  1475. .info {
  1476. font-size: 14px;
  1477. color: #909090;
  1478. line-height: 26px;
  1479. }
  1480. }
  1481. .navBarTOP {
  1482. position: fixed;
  1483. width: 100%;
  1484. z-index: 2;
  1485. top: 0;
  1486. }
  1487. .cellcontent .centerBtn {
  1488. margin: 0 auto 10px;
  1489. display: block;
  1490. width: 92%;
  1491. border-radius: 5px;
  1492. color: #0057ba;
  1493. border: 1px solid #0057ba;
  1494. }
  1495. .cellcontent .centerBtn1 {
  1496. background-color: #0057ba;
  1497. color: #fff;
  1498. }
  1499. .btnbox {
  1500. padding-top: 14px;
  1501. border-top: 1px solid #eee;
  1502. margin: 0 10px;
  1503. }
  1504. .cellcontent .centerBtn2 {
  1505. margin: 0 auto 10px;
  1506. display: block;
  1507. width: 92%;
  1508. color: #0057ba;
  1509. border-radius: 5px;
  1510. padding: 0;
  1511. }
  1512. .statstext {
  1513. background-color: #0057ba;
  1514. position: absolute;
  1515. right: 0;
  1516. top: 6px;
  1517. padding: 2px 6px 2px 12px;
  1518. border-bottom-left-radius: 60px;
  1519. border-top-left-radius: 60px;
  1520. color: #fff;
  1521. }
  1522. .lineGrey {
  1523. height: 10px;
  1524. width: 100%;
  1525. background: #f1f1f1;
  1526. }
  1527. .cellcontent .van-cell {
  1528. padding: 10px 0;
  1529. }
  1530. .statstext .van-icon__image {
  1531. height: 0.7em;
  1532. }
  1533. .visitStoreIco {
  1534. float: left;
  1535. float: left;
  1536. width: 26px;
  1537. text-align: center;
  1538. background-color: #ffba13;
  1539. color: #fff;
  1540. border-radius: 100%;
  1541. margin-left: 14px;
  1542. line-height: 26px;
  1543. height: 26px;
  1544. }
  1545. .tipsTitle {
  1546. padding: 5px 0;
  1547. text-align: center;
  1548. font-size: 16px;
  1549. font-weight: 600;
  1550. }
  1551. .deviceWithin {
  1552. height: 100%;
  1553. width: 100%;
  1554. display: flex;
  1555. flex-direction: column;
  1556. overflow: hidden;
  1557. .content {
  1558. flex: 1;
  1559. overflow-y: auto;
  1560. }
  1561. .tabBar {
  1562. height: 50px;
  1563. }
  1564. .TCFXListItem {
  1565. display: inline-block;
  1566. border: 1px solid #ccc;
  1567. padding: 3px 5px;
  1568. margin: 0 5px;
  1569. border-radius: 6px;
  1570. }
  1571. }
  1572. </style>