index.vue 60 KB

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