index.vue 61 KB

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