index.vue 67 KB

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