index.vue 67 KB

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