rangeStore.vue 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429
  1. <template>
  2. <div class="rangeStore">
  3. <div id="container"></div>
  4. <div class="navBarTOP">
  5. <van-nav-bar class="navBar" title="附近客户信息" left-arrow @click-left="onClickLeft">
  6. <template #right>
  7. <span v-if="tabVal == 6 || tabVal == 0 || tabVal == 1" @click="searchFn"
  8. >筛选<van-icon name="arrow-down"
  9. /></span>
  10. </template>
  11. </van-nav-bar>
  12. <van-checkbox-group
  13. v-model="resultmap"
  14. direction="horizontal"
  15. class="mapCheckbox"
  16. @change="selectMapIco">
  17. <van-grid :column-num="5" class="icoImgMAP">
  18. <van-grid-item>
  19. <div slot="text" class="titleico">
  20. <van-checkbox name="jinpai_ccm">
  21. <van-icon :name="storeCCMmap" size="32" />
  22. <p class="p">有布机</p>
  23. <p>金牌店</p>
  24. </van-checkbox>
  25. </div>
  26. </van-grid-item>
  27. <van-grid-item>
  28. <div slot="text" class="titleico">
  29. <van-checkbox name="jinpai">
  30. <van-icon :name="storeGoldmap" size="32" />
  31. <p class="p">无布机</p>
  32. <p>金牌店</p>
  33. </van-checkbox>
  34. </div>
  35. </van-grid-item>
  36. <van-grid-item>
  37. <div slot="text" class="titleico">
  38. <van-checkbox name="tcfx_tl">
  39. <van-icon :name="storeAmap" size="32" />
  40. <p class="p">非金牌</p>
  41. <p>涂料店</p>
  42. </van-checkbox>
  43. </div>
  44. </van-grid-item>
  45. <van-grid-item>
  46. <div slot="text" class="titleico">
  47. <van-checkbox name="tcfx_cw">
  48. <van-icon :name="storeBCZmap" size="32" />
  49. <p class="p">非金牌</p>
  50. <p>厨卫店</p>
  51. </van-checkbox>
  52. </div>
  53. </van-grid-item>
  54. <van-grid-item>
  55. <div slot="text" class="titleico">
  56. <van-checkbox name="qita">
  57. <van-icon :name="othermap" size="32" />
  58. <p class="p">非金牌</p>
  59. <p>其他店</p>
  60. </van-checkbox>
  61. </div>
  62. </van-grid-item>
  63. <!-- <van-grid-item v-if="filterTCFX(item)" v-for="(item, index) in storeType" :key="index">
  64. <div slot="text" class="titleico">
  65. {{ index }}
  66. <van-checkbox :name="'TCFX_' + index" v-if="index == 0">
  67. <van-icon :name="require('@/assets/' + 'TCFX_' + index)" size="32" />
  68. <p class="p">{{ item.dictLabel }}</p>
  69. </van-checkbox>
  70. </div>
  71. </van-grid-item> -->
  72. <!-- <van-grid-item>
  73. <div slot="text" class="titleico">
  74. <van-checkbox name="tcfx_B_fs">
  75. <van-icon :name="storeBFSmap" size="32" />
  76. <p class="p">瓷砖店</p>
  77. </van-checkbox>
  78. </div>
  79. </van-grid-item>
  80. <van-grid-item>
  81. <div slot="text" class="titleico">
  82. <van-checkbox name="tcfx_B_cz">
  83. <van-icon :name="storeBCZmap" size="32" />
  84. <p class="p">防水店</p>
  85. </van-checkbox>
  86. </div>
  87. </van-grid-item>
  88. <van-grid-item>
  89. <div slot="text" class="titleico">
  90. <van-checkbox name="tcfx_B_qt">
  91. <van-icon :name="storeBOthermap" size="32" />
  92. <p class="p">黄沙</p>
  93. <p>水泥店</p>
  94. </van-checkbox>
  95. </div>
  96. </van-grid-item> -->
  97. </van-grid>
  98. </van-checkbox-group>
  99. <div class="searchDiv">
  100. <van-search
  101. v-model="storeName"
  102. left-icon="search"
  103. show-action
  104. placeholder="搜索名称/编号/地址">
  105. <template #action>
  106. <div @click="onSearch">搜索</div>
  107. </template>
  108. </van-search>
  109. </div>
  110. </div>
  111. <!-- 主体内容-->
  112. <div class="container">
  113. <div class="lineGrey"></div>
  114. <baidu-map
  115. @touchend="end"
  116. @dragend="dragend"
  117. @touchmove="touchmove"
  118. class="map"
  119. :style="{ height: heifhgts }"
  120. :center="{ lng: lon1, lat: lat1 }"
  121. :zoom="zoom"
  122. :dragging="dragging"
  123. :scroll-wheel-zoom="true"
  124. ak="n4CW0ajDw1LBUIj1RTlwd1bbTTXuN8v6"
  125. @zoomend="zoomend"
  126. :min-zoom="12"
  127. @ready="handler"
  128. @reload="reload"
  129. :key="baiduMapKey"
  130. ref="myMap">
  131. <!-- :minClusterSize="minClusterSize"-->
  132. <bml-marker-clusterer :averageCenter="false" :styles="styless">
  133. <bm-marker
  134. v-for="(marker, index) of listData"
  135. :key="new Date().getTime() + index"
  136. :position="{ lng: marker.lon, lat: marker.lat }"
  137. @click="infoShow(marker, index)"
  138. :icon="{ url: mpFn(marker, 2), size: { width: 34, height: 40 } }"></bm-marker>
  139. </bml-marker-clusterer>
  140. <bm-marker :position="{ lng: lonmy, lat: latmy }"></bm-marker>
  141. <!-- +0.00003-->
  142. <bm-marker
  143. :position="{ lng: info.lon, lat: info.lat }"
  144. :top="true"
  145. :icon="{ url: checkIco, size: { width: 34, height: 40 } }"
  146. @click="infoShow(info)"></bm-marker>
  147. <bm-label
  148. @click="zoomFn(marker, index)"
  149. v-for="(marker, index) of poINData"
  150. :key="index"
  151. :content="marker.childrenStoreCount"
  152. :position="{ lng: marker.lon, lat: marker.lat }"
  153. :labelStyle="{
  154. color: '#fff',
  155. borderColor: 'rgba(0,0,255)',
  156. fontSize: '14px',
  157. borderRadius: '1000px',
  158. background: 'rgba(0,0,255,0.5)',
  159. width: '50px',
  160. height: '50px',
  161. textAlign: 'center',
  162. lineHeight: '50px',
  163. }"
  164. :offset="{ width: -10, height: -10 }" />
  165. <!-- <bm-geolocation @locationSuccess="locationSuccess" anchor="BMAP_ANCHOR_BOTTOM_RIGHT" :showAddressBar="true" :autoLocation="true" :offset="{width:5,height:280}"></bm-geolocation>-->
  166. </baidu-map>
  167. <img src="./../../assets/list.png" @click="onClickLeft" class="mapimg" />
  168. <img src="./../../assets/sbpm.png" @click="onMaps" class="mapimg" style="bottom: 286px" />
  169. <div v-if="show" class="mapStoreList">
  170. <van-icon
  171. name="close"
  172. style="float: right; padding: 10px; top: -6px"
  173. size="20"
  174. @click="closeFn" />
  175. <div class="maplit" :class="{ maplitactive: listpoint.length > 1 }">
  176. <div v-for="(info, index) in listpoint" :key="index" class="maplistitem">
  177. <p style="font-weight: bold; font-size: 16px">
  178. <template v-if="info.storeLabels">
  179. <!-- 金牌店ABC -->
  180. <img
  181. class="JPABC"
  182. :src="require('@/assets/Icon/storeA.png')"
  183. v-if="info.storeLabels.storeA" />
  184. <img
  185. class="JPABC"
  186. :src="require('@/assets/Icon/storeB.png')"
  187. v-if="info.storeLabels.storeB" />
  188. <img
  189. class="JPABC"
  190. :src="require('@/assets/Icon/storeC.png')"
  191. v-if="info.storeLabels.storeC" />
  192. <img
  193. class="JPABC"
  194. :src="require('@/assets/Icon/storeD.png')"
  195. v-if="info.storeLabels.storeD" />
  196. <img
  197. class="JPABC"
  198. :src="require('@/assets/Icon/storeE.png')"
  199. v-if="info.storeLabels.storeE" />
  200. </template>
  201. <span @click="goOtherSystem(info)" :style="setStroeNameStyle(info)">
  202. <span>{{ info.storeName }}</span>
  203. (<span> {{ info.storeCode }} </span>)
  204. <!-- <span @click="checkfn(info)">{{ info.storeName }}</span>
  205. (<span @click="checkfn(info)"> {{ info.storeCode }} </span>) -->
  206. </span>
  207. <span class="btn" :data-clipboard-text="info.storeCode">
  208. <van-icon
  209. :name="paste"
  210. color="#ee0a24"
  211. size="20"
  212. style="top: 6px; margin-left: 4px" />
  213. </span>
  214. </p>
  215. <p class="text">
  216. <span v-if="tabVal == 3 || tabVal == 4">类型:{{ info.storeCategoryName }}</span>
  217. <span v-if="tabVal == 0 || tabVal == 1 || tabVal == 6"
  218. >类型:{{ info.storeCategory }}</span
  219. >
  220. &nbsp;
  221. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  222. <div>
  223. <p>
  224. 本店经营品项指导:
  225. <a @click="linkimg(info)" style="text-decoration: underline">点击查看</a>
  226. </p>
  227. </div>
  228. <van-icon name="question-o" size="18" slot="reference" />
  229. </el-popover>
  230. </p>
  231. <div class="text" style="position: relative">
  232. 联系人:{{ info.contactName }}
  233. <div style="position: absolute; bottom: 0px; right: 10px; display: inline-block">
  234. <el-popover
  235. popper-class="zpover"
  236. placement="bottom"
  237. width="120"
  238. trigger="click"
  239. content="该客户为凤凰客户">
  240. <div
  241. v-if="info.storeLabels.fhCustomer"
  242. class="visitStoreIco"
  243. style="background-color: #fff"
  244. slot="reference">
  245. <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
  246. </div>
  247. </el-popover>
  248. <el-popover popper-class="zpover zpover6" placement="top-start" trigger="click">
  249. <div>
  250. <p>
  251. 本店{{ timeData }}下单SKU数<a
  252. @click="linkList(info)"
  253. style="text-decoration: underline"
  254. >点击查看详情</a
  255. >
  256. </p>
  257. </div>
  258. <div
  259. class="visitStoreIco"
  260. v-if="info.storeLabels.zysslNums !== false"
  261. style="background-color: #fff; position: relative"
  262. slot="reference">
  263. <p
  264. style="
  265. width: 100%;
  266. position: absolute;
  267. z-index: 9999;
  268. top: 0.2px;
  269. width: 22px;
  270. margin: 0;
  271. margin-left: 3.6px;
  272. text-align: center;
  273. font-size: 12px;
  274. ">
  275. {{ info.storeLabels.zysslNums }}
  276. </p>
  277. <van-icon :name="ord" size="26" />
  278. </div>
  279. </el-popover>
  280. <el-popover
  281. popper-class="zpover zpover5"
  282. placement="top"
  283. width="200"
  284. trigger="click">
  285. <div v-if="info.storeLabels">
  286. <p>已参加:</p>
  287. <p v-for="tt in (info.storeLabels.targetOne + '').split(';')">
  288. {{ tt }}
  289. </p>
  290. </div>
  291. <div
  292. class="visitStoreIco"
  293. v-if="info.storeLabels.targetOne"
  294. style="background-color: #fff"
  295. slot="reference">
  296. <van-icon :name="targetOne" size="26" />
  297. </div>
  298. </el-popover>
  299. <el-popover
  300. popper-class="zpover"
  301. placement="top"
  302. width="120"
  303. trigger="click"
  304. content="调色机7天未调色">
  305. <div
  306. v-if="info.storeLabels.stopColorMixerSeven"
  307. class="visitStoreIco"
  308. style="background-color: #fff"
  309. slot="reference">
  310. <van-icon :name="Network" size="26" />
  311. </div>
  312. </el-popover>
  313. <el-popover popper-class="zpover" placement="bottom" width="120" trigger="click"
  314. content="调色机当月未调色">
  315. <div v-if="info.storeLabels.stopColorMixerMonth" class="visitStoreIco"
  316. style="background-color: #fff" slot="reference">
  317. <van-icon :name="WiFi" size="26" />
  318. </div>
  319. </el-popover>
  320. <el-popover
  321. popper-class="zpover"
  322. placement="top"
  323. width="200"
  324. trigger="click"
  325. content="同城店近60天未下单">
  326. <div
  327. v-if="info.storeLabels.fxNoOrder"
  328. class="visitStoreIco"
  329. style="background-color: #fff"
  330. slot="reference">
  331. <van-icon :name="order60" size="26" />
  332. </div>
  333. </el-popover>
  334. <el-popover
  335. popper-class="zpover"
  336. placement="top"
  337. width="200"
  338. trigger="click"
  339. content="金牌店近30天未下单">
  340. <div
  341. v-if="info.storeLabels.noOrder"
  342. class="visitStoreIco"
  343. style="background-color: #fff"
  344. slot="reference">
  345. <van-icon :name="order" size="26" />
  346. </div>
  347. </el-popover>
  348. <el-popover
  349. popper-class="zpover"
  350. placement="top"
  351. width="200"
  352. trigger="click"
  353. content="本店本月进过专业时时丽">
  354. <div
  355. class="visitStoreIco"
  356. v-if="info.storeLabels.zyssl"
  357. style="background-color: #ed5c68"
  358. slot="reference">
  359. </div>
  360. </el-popover>
  361. <el-popover
  362. popper-class="zpover zpover1"
  363. placement="top"
  364. width="200"
  365. trigger="click"
  366. content="本店本月进过超好贴">
  367. <div
  368. v-if="info.storeLabels.chtczj"
  369. class="visitStoreIco"
  370. style="background-color: #0057ba"
  371. slot="reference">
  372. </div>
  373. </el-popover>
  374. <!-- <el-popover-->
  375. <!-- placement="bottom"-->
  376. <!-- width="200"-->
  377. <!-- popper-class="zpover zpover2"-->
  378. <!-- trigger="click"-->
  379. <!-- content="本月未被拜访的信息">-->
  380. <!-- <div v-if="item.storeLabels.noVisit" class="visitStoreIco" style="background-color: #fff" slot="reference">-->
  381. <!-- <van-icon :name="visitTimess" size="26" /></div>-->
  382. <!-- </el-popover>-->
  383. <el-popover
  384. placement="top"
  385. width="200"
  386. popper-class="zpover zpover2 zpover1sb"
  387. trigger="click"
  388. :disabled="!info.userVisitTimesMap"
  389. :content="'本店本月已拜访过' + info.storeLabels.visitTimes + '次'">
  390. <div
  391. v-if="info.storeLabels.visitTimes && info.storeLabels.visitTimes > 0"
  392. class="visitStoreIco"
  393. slot="reference"
  394. style="background-color: #fff; position: relative">
  395. <p
  396. style="
  397. width: 100%;
  398. position: absolute;
  399. z-index: 9999;
  400. top: -2px;
  401. margin: 0;
  402. text-align: center;
  403. font-size: 12px;
  404. ">
  405. {{ info.storeLabels.visitTimes }}
  406. </p>
  407. <!-- A级金牌店拜访次数少于2 -->
  408. <van-icon
  409. :name="require('@/assets/ordernumRed.png')"
  410. size="26"
  411. v-if="
  412. info.storeLabels.storeA &&
  413. info.needVisitNum &&
  414. info.storeLabels.visitTimes < info.needVisitNum
  415. " />
  416. <van-icon :name="require('@/assets/ordernum.png')" size="26" v-else />
  417. </div>
  418. <p style="text-align: center; background: #fff; color: #000; padding: 5px 0">
  419. 本店本月已拜访过{{ info.storeLabels.visitTimes }}次
  420. </p>
  421. <p
  422. v-if="info.storeLabels.storeA && info.needVisitNum"
  423. style="text-align: center; background: #fff; color: red; padding: 5px 0">
  424. A级金牌店拜访标准:1月{{ info.needVisitNum }}次
  425. </p>
  426. <el-table :data="info.userVisitTimesMap" border max-height="180px">
  427. <el-table-column label="业务员" prop="userName" />
  428. <el-table-column label="拜访次数" prop="visitTimes" width="90px" />
  429. </el-table>
  430. </el-popover>
  431. </div>
  432. </div>
  433. <p class="text" @click="buryingPointFn(info)">
  434. 电&nbsp;话:<a
  435. style="color: #0057ba; font-weight: bold; text-decoration: underline"
  436. :href="'tel:' + info.telephone"
  437. >{{ info.telephone }}</a
  438. ><van-icon name="phone" size="16" color="#1989fa" />
  439. </p>
  440. <!-- 潜在店不显示经销商 -->
  441. <template v-if="info.sfaStoreType.type != 'qzd'">
  442. <!-- 分销店 -->
  443. <template
  444. v-if="
  445. info.sfaStoreType &&
  446. info.sfaStoreType.type == 'fxd' &&
  447. info.sfaStoreChainsContactList
  448. ">
  449. <div class="text">
  450. 经销商:
  451. <div class="TCFXListItem" v-for="(item, index) in info.sfaStoreChainsContactList">
  452. <el-popover
  453. popper-class="zpover zpoverStoreztype"
  454. placement="bottom-start"
  455. trigger="click">
  456. <div>
  457. <div>{{ item.chainCode }}</div>
  458. <div>{{ item.chainName }}</div>
  459. </div>
  460. <div slot="reference" :key="index">
  461. {{ item.categoryDescribe }}
  462. </div>
  463. </el-popover>
  464. </div>
  465. </div>
  466. </template>
  467. <template v-else>
  468. <p class="text">经销商:{{ info.chainName }}</p>
  469. </template>
  470. </template>
  471. <p class="text">地址:{{ info.addressLine }}</p>
  472. <div class="text" style="height: 24px">
  473. <!-- <van-button @click="linkapp(info)" style="float: right;margin-top: -36px;" type="info" size="small" plain class="centerBtn centerBtn1">-->
  474. <!-- <van-icon :name="mapzb" size="22" /><span style="float: right;margin-top: 6px;">导航</span></van-button> margin-right:76px-->
  475. <div v-if="tabVal == 0 || tabVal == 1 || tabVal == 6" style="float: right">
  476. <van-button
  477. v-if="customerVisits && info.stateString != '已拜访'"
  478. :disabled="!customerVisits"
  479. type="info"
  480. size="small"
  481. plain
  482. class="centerBtn centerBtn1"
  483. @click="storeVisit(info)"
  484. >进入拜访</van-button
  485. >
  486. </div>
  487. </div>
  488. </div>
  489. </div>
  490. </div>
  491. </div>
  492. <div
  493. style="
  494. position: fixed;
  495. top: 192px;
  496. width: 310px;
  497. left: 50%;
  498. background-color: black;
  499. border-radius: 100px;
  500. color: rgb(255, 255, 255);
  501. padding: 6px 12px;
  502. margin-left: -155px;
  503. text-align: center;
  504. "
  505. v-if="msgshow">
  506. {{ msg }}
  507. </div>
  508. <van-popup v-model="showPicker" position="bottom" class="textsize">
  509. <van-row
  510. style="
  511. position: fixed;
  512. top: 0;
  513. width: 100%;
  514. z-index: 998;
  515. background-color: #fff;
  516. border-bottom: 1px solid #ccc;
  517. ">
  518. <van-col span="3" style="text-align: center; margin: 14px 0" @click="showPicker = false">
  519. <van-icon name="cross" size="20" color="#909399" />
  520. </van-col>
  521. <van-col span="13">
  522. <!-- <van-field style=" margin-top: 2px;-->
  523. <!-- border-radius: 6px;-->
  524. <!-- overflow: hidden;" v-model="serachstype" label="" placeholder="请输入关键词" clearable @input="searchType"/>-->
  525. </van-col>
  526. <van-col span="4" style="text-align: center; line-height: 36px" @click="onConfirm">
  527. <div style="color: #0057ba">
  528. <van-button type="info" size="small" color="#0057ba">筛选</van-button>
  529. </div></van-col
  530. >
  531. <van-col span="4" style="text-align: center; line-height: 36px" @click="onsets">
  532. <van-button type="default" size="small" style="height: 28px">重置</van-button>
  533. </van-col>
  534. </van-row>
  535. <div style="height: 48px; width: 100%"></div>
  536. <!-- <van-picker show-toolbar :columns="storeTypeLists" value-key="dictLabel" @confirm="onConfirm" @cancel="showPicker = false"/> -->
  537. <div class="searchcheck">
  538. <p class="searchchecktitle">&nbsp;经销商</p>
  539. <van-row>
  540. <van-col span="24">
  541. <div @click="moreTypeShowFn">
  542. <van-field
  543. style="
  544. margin-top: -6px;
  545. border-radius: 6px;
  546. border: 1px solid #ccc;
  547. overflow: hidden;
  548. "
  549. readonly
  550. v-model="chainName"
  551. label=""
  552. placeholder="请选择经销商" />
  553. </div>
  554. </van-col>
  555. <!-- <van-col span="4"><van-button type="default" native-type="button" @click="moreTypeShowclearableFn">清空</van-button></van-col>-->
  556. </van-row>
  557. <p class="searchchecktitle" @click="otherbqShow = !otherbqShow">
  558. &nbsp;门店标签<van-icon name="arrow-down" style="float: right" />
  559. </p>
  560. <van-checkbox-group v-model="storeLabelTypes" direction="horizontal">
  561. <div v-if="otherbqShow" style="width: 100%">
  562. <div class="checkbox" v-for="(item, index) in StoreLabels" :key="index">
  563. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  564. </div>
  565. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  566. </div>
  567. </van-checkbox-group>
  568. <van-checkbox-group v-model="result" direction="horizontal">
  569. <p class="searchchecktitle" @click="otherkkdShow = !otherkkdShow">
  570. &nbsp;可控店<van-icon name="arrow-down" style="float: right" />
  571. </p>
  572. <div v-if="otherkkdShow">
  573. <div v-for="(item, index) in storeTypeLists" :key="index" class="checkbox1">
  574. <div v-if="item.groupType == 'kkd'" class="child">
  575. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  576. </div>
  577. </div>
  578. </div>
  579. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  580. <p class="searchchecktitle" @click="otherfxdShow = !otherfxdShow">
  581. &nbsp;分销店<van-icon name="arrow-down" style="float: right" />
  582. </p>
  583. <div v-if="otherfxdShow" style="margin: 0 14px; width: 100%">
  584. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  585. <p class="searchchecktitle1" @click="otherfxdShow1 = !otherfxdShow1">
  586. 金牌店<van-icon name="arrow-down" style="float: right" />
  587. </p>
  588. <div v-if="otherfxdShow1">
  589. <div v-for="(item1, index1) in storeTypeLists" :key="200 + index1" class="checkbox1">
  590. <div v-if="item1.groupType == 'fxd' && item1.remark == 'jp'" class="child">
  591. <van-checkbox :name="item1.dictValue">{{ item1.dictLabel }}</van-checkbox>
  592. </div>
  593. </div>
  594. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  595. </div>
  596. <p class="searchchecktitle1" @click="otherfxdShow2 = !otherfxdShow2">
  597. 同城分销店<van-icon name="arrow-down" style="float: right" />
  598. </p>
  599. <div v-if="otherfxdShow2">
  600. <div
  601. v-for="(itemlj, indexlj) in storeTypeLists"
  602. :key="400 + indexlj"
  603. class="checkbox1">
  604. <div v-if="itemlj.groupType == 'fxd' && itemlj.remark == 'tcfx'" class="child">
  605. <van-checkbox :name="itemlj.dictValue">{{ itemlj.dictLabel }}</van-checkbox>
  606. </div>
  607. </div>
  608. <div style="clear: both"></div>
  609. </div>
  610. </div>
  611. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  612. <template v-if="postType != 'GZ' && postType != 'JZ'">
  613. <p class="searchchecktitle" @click="isCompetingStores = !isCompetingStores">
  614. &nbsp;潜在客户<van-icon name="arrow-down" style="float: right" />
  615. </p>
  616. <div v-if="isCompetingStores" style="width: 100%">
  617. <div class="checkbox1" v-for="(item, index) in storeTypeLists" :key="index">
  618. <div v-if="item.groupType == 'qzd'" class="child">
  619. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  620. </div>
  621. </div>
  622. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  623. </div>
  624. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  625. </template>
  626. <p class="searchchecktitle" @click="otherShow = !otherShow">
  627. &nbsp;其他 <van-icon name="arrow-down" style="float: right" />
  628. </p>
  629. <div v-if="otherShow">
  630. <div v-for="(item2, index2) in storeTypeLists" :key="100 + index2" class="checkbox1">
  631. <div v-if="item2.groupType == 'other'" class="child">
  632. <van-checkbox :name="item2.dictValue">{{ item2.dictLabel }}</van-checkbox>
  633. </div>
  634. </div>
  635. </div>
  636. </van-checkbox-group>
  637. </div>
  638. </van-popup>
  639. <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%">
  640. <van-row style="background-color: #f5f5f5">
  641. <van-col span="20">
  642. <van-field
  643. left-icon="search"
  644. style="margin-top: 2px; border-radius: 6px; overflow: hidden"
  645. v-model="CustomerName"
  646. label=""
  647. placeholder="请输入关键词"
  648. clearable />
  649. </van-col>
  650. <van-col span="4" style="text-align: center; line-height: 48px" @click="getCustomer">
  651. <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
  652. >
  653. </van-row>
  654. <van-picker
  655. show-toolbar
  656. :columns="chainsData"
  657. value-key="chainName"
  658. @confirm="onConfirmChainsList"
  659. @cancel="moreTypeShow = false"
  660. visible-item-count="10" />
  661. </van-popup>
  662. </div>
  663. </template>
  664. <script>
  665. import {
  666. BaiduMap,
  667. BmLabel,
  668. BmMarker,
  669. BmlMarkerClusterer,
  670. BmInfoWindow,
  671. BmGeolocation,
  672. } from 'vue-baidu-map';
  673. import mapzb from './../../assets/mapzb.png';
  674. import other from './../../assets/other.svg';
  675. import othermap from './../../assets/othermap.png';
  676. import storeA from './../../assets/storeA.svg';
  677. import storeBCZ from './../../assets/storeBCZ.svg';
  678. import storeBFS from './../../assets/storeBFS.svg';
  679. import storeBOther from './../../assets/storeBOther.svg';
  680. import storeGold from './../../assets/storeGold.svg';
  681. import storeCCM from './../../assets/storeCCM.svg';
  682. import storeAactive from './../../assets/storeAactive.svg';
  683. import storeBCZactive from './../../assets/storeBCZactive.svg';
  684. import storeBFSactive from './../../assets/storeBFSactive.svg';
  685. import storeBOtheractive from './../../assets/storeBOtheractive.svg';
  686. import storeGoldactive from './../../assets/storeGoldactive.svg';
  687. import storeCCMactive from './../../assets/storeCCMactive.svg';
  688. import otheractive from './../../assets/otheractive.svg';
  689. import storeAmap from './../../assets/storeAmap.png';
  690. import storeBCZmap from './../../assets/storeBCZmap.png';
  691. import storeBFSmap from './../../assets/storeBFSmap.png';
  692. import storeBOthermap from './../../assets/storeBOthermap.png';
  693. import storeGoldmap from './../../assets/storeGoldmap.png';
  694. import storeCCMmap from './../../assets/storeCCMmap.png';
  695. import positinon from './../../assets/positinon.svg';
  696. import times from '@/assets/Icon/times.png';
  697. import order60 from '@/assets/order60.png';
  698. import targetOne from '@/assets/targetOne.png';
  699. import Network from '@/assets/Network.png';
  700. import WiFi from '@/assets/WiFi.png';
  701. import timeico from '@/assets/Icon/datatims.png';
  702. import paste from '@/assets/paste.png';
  703. import visitTimes from '@/assets/visitTimes.png';
  704. import mpimg from '@/assets/mpimg.png';
  705. import mapmarker from '@/components/mapMarkerDouble';
  706. import order from '@/assets/order.png';
  707. import mp from './../../assets/mp.png';
  708. import mp1 from './../../assets/mp1.png';
  709. import {
  710. addVisitsPosition,
  711. buryingPoint,
  712. checkVisit,
  713. getCustomerList,
  714. getStoreLabels,
  715. getStoreMapInfo,
  716. getStoreTypeListlp,
  717. getUserOrgStoreList,
  718. getUserOutPlaList,
  719. mobileReposition,
  720. ProductItemImge,
  721. storeList,
  722. storeMyList,
  723. getDictOption,
  724. } from '@/api';
  725. import axios from 'axios';
  726. import ord from '@/assets/ord.png';
  727. import check from './../../assets/check.svg';
  728. import { topStore } from '@/api/inventory';
  729. import { gcj02BD } from '@/utils';
  730. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  731. import { mapState } from 'vuex';
  732. export default {
  733. name: 'rangeStore',
  734. components: {
  735. BaiduMap,
  736. BmMarker,
  737. BmLabel,
  738. BmlMarkerClusterer,
  739. BmInfoWindow,
  740. BmGeolocation,
  741. },
  742. computed: {
  743. ...mapState({
  744. storeType: (state) => state.user.storeType,
  745. }),
  746. },
  747. data() {
  748. return {
  749. moreTypeShow: false,
  750. chainsData: [],
  751. result: [],
  752. resultmap: [],
  753. check: check,
  754. mp1: mp1,
  755. times: times,
  756. msg: '',
  757. msgshow: false,
  758. mapmarker: mapmarker,
  759. paste: paste,
  760. visitTimess: visitTimes,
  761. timeico: timeico,
  762. mpimg: mpimg,
  763. order: order,
  764. mapShow: false,
  765. otherShow: false,
  766. Network: Network,
  767. WiFi: WiFi,
  768. order60: order60,
  769. ord: ord,
  770. targetOne: targetOne,
  771. other: other,
  772. othermap: othermap,
  773. storeA: storeA,
  774. storeBCZ: storeBCZ,
  775. storeBFS: storeBFS,
  776. storeBOther: storeBOther,
  777. positinon: positinon,
  778. storeCCM: storeCCM,
  779. storeGold: storeGold,
  780. storeCCMmap: storeCCMmap,
  781. storeGoldmap: storeGoldmap,
  782. storeAmap: storeAmap,
  783. storeBCZmap: storeBCZmap,
  784. storeBFSmap: storeBFSmap,
  785. storeBOthermap: storeBOthermap,
  786. storeBOtheractive: storeBOtheractive,
  787. storeCCMactive: storeCCMactive,
  788. storeGoldactive: storeGoldactive,
  789. storeAactive: storeAactive,
  790. storeBCZactive: storeBCZactive,
  791. storeBFSactive: storeBFSactive,
  792. otheractive: otheractive,
  793. checkIco: otheractive,
  794. minClusterSize: 5,
  795. mp: mp,
  796. mapzb: mapzb,
  797. info: {
  798. lon: 0,
  799. lat: 0,
  800. storeName: '',
  801. storeCategory: '',
  802. chainName: '',
  803. addressLine: '',
  804. },
  805. show: false,
  806. first: 1,
  807. text: '3000米',
  808. zoom: 18,
  809. storeName: '',
  810. showMap: true,
  811. timeData: '',
  812. styless: [
  813. {
  814. url: positinon,
  815. size: {
  816. width: 48,
  817. height: 48,
  818. },
  819. textColor: '#fff',
  820. textSize: 18,
  821. opt_textSize: '200px',
  822. },
  823. ],
  824. range: 10000,
  825. lon1: '112.45359397440227',
  826. lat1: '34.62171814576471',
  827. lon: '112.45359397440227',
  828. lat: '34.62171814576471',
  829. showTownPicker: false,
  830. list: [],
  831. listData: [],
  832. cont: 0,
  833. shows: false,
  834. indexs: 0,
  835. flag: true,
  836. tabVal: 4,
  837. dragging: true,
  838. poINData: [],
  839. isZoom: true,
  840. geocoder: '',
  841. lonsave: '112.45359397440227',
  842. latsave: '34.62171814576471',
  843. latmy: '34.62171814576471',
  844. lonmy: '112.45359397440227',
  845. mapk: '',
  846. mapks: '',
  847. customerVisits: true,
  848. StoreLabels: [],
  849. chainName: '',
  850. chainCode: '',
  851. otherbqShow: true,
  852. otherkkdShow: true,
  853. otherfxdShow: true,
  854. otherfxdShow2: true,
  855. otherfxdShow1: true,
  856. storeTypeList: [],
  857. storeTypeLists: [],
  858. storeLabelTypes: [],
  859. showPicker: false,
  860. CustomerName: '',
  861. listpoint: [],
  862. heifhgts: '200px',
  863. mapRange: [], //地图范围
  864. baiduMapKey: new Date().getTime(),
  865. isCompetingStores: true,
  866. postType: '',
  867. };
  868. },
  869. created() {
  870. this.heifhgts = window.innerHeight - 190 + 'px';
  871. // 好邦手接入拜访系统地图功能
  872. // 获取url参数 userId
  873. let userId = this.$route.query.userId || '';
  874. console.log(this.$route);
  875. console.log(window.location.href);
  876. if (userId) {
  877. localStorage.setItem('loginName', userId);
  878. }
  879. },
  880. activated() {
  881. this.postType = localStorage.getItem('postType');
  882. this.listData = [];
  883. this.baiduMapKey = new Date().getTime();
  884. this.closeFn();
  885. // 获取地图范围 字典
  886. this.getMapRange();
  887. this.resultmap = [];
  888. this.tabVal = this.$route.query.tabVal;
  889. this.customerVisits = localStorage.getItem('customerVisits');
  890. this.initialize();
  891. this.range = 10000;
  892. this.zoom = 20;
  893. this.first = 1;
  894. this.msg = '';
  895. this.msgshow = false;
  896. this.storeName = localStorage.getItem('outvstoreName');
  897. if (localStorage.getItem('outvchainName') && localStorage.getItem('outvchainName') != 'null') {
  898. this.chainName = localStorage.getItem('outvchainName');
  899. }
  900. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  901. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  902. } else {
  903. this.storeLabelTypes = [];
  904. }
  905. if (localStorage.getItem('outvstoreCategoryList') != null) {
  906. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  907. this.storeCategoryList = localStorage.getItem('outvstoreCategoryList');
  908. } else {
  909. this.result = [];
  910. }
  911. this.chainCode = localStorage.getItem('outvchainCode');
  912. this.storeName = localStorage.getItem('outvstoreName');
  913. this.getMonth();
  914. this.getStoreTypeList();
  915. this.getStoreLabels();
  916. this.getposition();
  917. },
  918. methods: {
  919. setStroeNameStyle(item) {
  920. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  921. if (
  922. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  923. item.approvalStatus == null ||
  924. item.approvalStatus == 0
  925. ) {
  926. return {};
  927. } else {
  928. return { color: '#0057ba', 'text-decoration': 'underline' };
  929. }
  930. },
  931. async getMapRange() {
  932. let mapRangeOption = await getDictOption({}, 'out_plan_map_range');
  933. this.mapRange = mapRangeOption.data || [];
  934. // dictValue
  935. },
  936. // 设置地图获取范围提示文字
  937. setMapRangeTitle(total) {
  938. let leftRange = this.mapRange[0] ? (this.mapRange[0].dictValue / 1000).toFixed(1) : '10';
  939. let rightRange = this.mapRange[1] ? (this.mapRange[1].dictValue / 1000).toFixed(1) : '5';
  940. let msg =
  941. '当前区域' +
  942. leftRange +
  943. '公里内共' +
  944. total +
  945. '家门店,展示附近' +
  946. rightRange +
  947. '公里的门店';
  948. console.log(msg);
  949. return msg;
  950. },
  951. closeFn() {
  952. this.show = false;
  953. // this.info.lon=0
  954. // this.info.lat=0
  955. },
  956. closeFns() {
  957. this.show = false;
  958. this.info.lon = 0;
  959. this.info.lat = 0;
  960. },
  961. linkList(val) {
  962. this.$router.push({
  963. path: '/pItem',
  964. query: {
  965. id: val.storeId,
  966. detilId: 'a',
  967. from: 'outPlan',
  968. storeCode: val.storeCode,
  969. showOrderButton: val.showOrderButton,
  970. },
  971. });
  972. },
  973. linkimg(val) {
  974. ProductItemImge({ storeId: val.storeId }).then((response) => {
  975. if (response.code == 200) {
  976. if (response.data != undefined) {
  977. window.open(response.data);
  978. } else {
  979. this.$toast(response.msg);
  980. }
  981. }
  982. });
  983. },
  984. onMaps() {
  985. this.closeFns();
  986. // this.mapk.clearOverlays()
  987. this.getposition();
  988. },
  989. getStoreTypeList() {
  990. getStoreTypeListlp({}).then((res) => {
  991. this.storeTypeLists = res.data;
  992. this.storeTypeList = res.data;
  993. });
  994. },
  995. onsets() {
  996. this.result = [];
  997. this.resultmap = [];
  998. this.zyssl = [];
  999. this.chtczj = [];
  1000. this.noVisit = [];
  1001. this.noOrder = [];
  1002. this.fxNoOrder = [];
  1003. this.storeLabelTypes = [];
  1004. this.storeCategoryList = this.result.join(',');
  1005. this.chainName = '';
  1006. this.chainCode = '';
  1007. // this.typeName=value.dictLabel
  1008. this.onSearch();
  1009. },
  1010. searchFn() {
  1011. this.showPicker = true;
  1012. this.CustomerName = '';
  1013. },
  1014. moreSearch() {
  1015. this.onSearch();
  1016. this.$refs.item.toggle();
  1017. },
  1018. onConfirmChainsList(value) {
  1019. if (value.chainName != undefined) {
  1020. this.chainName = value.chainName;
  1021. this.chainCode = value.chainCode;
  1022. }
  1023. this.showPickerChainsList = false;
  1024. this.moreTypeShow = false;
  1025. },
  1026. getStoreLabels() {
  1027. getStoreLabels().then((res) => {
  1028. this.StoreLabels = res.data;
  1029. });
  1030. },
  1031. onConfirm(value) {
  1032. this.storeCategoryList = this.result.join(',');
  1033. // this.typeName=value.dictLabel
  1034. this.showPicker = false;
  1035. this.onSearch();
  1036. },
  1037. moreTypeShowFn() {
  1038. this.moreTypeShow = true;
  1039. // this.CustomerName=""
  1040. // this.chainsData=[]
  1041. this.getCustomer();
  1042. },
  1043. getCustomer() {
  1044. var name = '';
  1045. if (this.tabVal != 1) {
  1046. name = 'org';
  1047. } else {
  1048. name = 'my';
  1049. }
  1050. getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
  1051. this.chainsData = request.data;
  1052. this.chainsData.push({});
  1053. this.chainsData.pop();
  1054. });
  1055. },
  1056. getMonth() {
  1057. var currentDate = new Date();
  1058. var currentMonth = currentDate.getMonth();
  1059. var previousMonthDate1 = new Date();
  1060. if (currentDate.getDate() == 1) {
  1061. previousMonthDate1.setMonth(currentMonth - 1);
  1062. } else {
  1063. }
  1064. var previousMonth1 = previousMonthDate1.getMonth();
  1065. var previousYear1 = previousMonthDate1.getFullYear();
  1066. var previousMonthDate = new Date();
  1067. if (currentDate.getDate() == 1) {
  1068. previousMonthDate.setMonth(currentMonth - 3);
  1069. } else {
  1070. previousMonthDate.setMonth(currentMonth - 2);
  1071. }
  1072. var previousMonth = previousMonthDate.getMonth();
  1073. var previousYear = previousMonthDate.getFullYear();
  1074. if (previousYear1 == previousYear) {
  1075. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  1076. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  1077. this.timeData =
  1078. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  1079. } else {
  1080. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  1081. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  1082. this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  1083. }
  1084. },
  1085. selectMapIco() {
  1086. if (this.resultmap.length > 0) {
  1087. this.closeFn();
  1088. this.listData = [];
  1089. var listData = [];
  1090. this.list.forEach((item) => {
  1091. if (this.resultmap.indexOf(item.iconName) != -1) {
  1092. listData.push(item);
  1093. }
  1094. });
  1095. this.listData = listData;
  1096. if (listData.length < 1) {
  1097. this.$toast('暂无客户信息');
  1098. }
  1099. } else {
  1100. this.listData = [];
  1101. this.listData = this.list;
  1102. }
  1103. },
  1104. reload() {
  1105. debugger;
  1106. },
  1107. handler({ BMap, map }) {
  1108. this.mapk = map;
  1109. this.mapks = BMap;
  1110. },
  1111. zoomFn(val, index) {
  1112. this.lat1 = val.lat;
  1113. this.lon1 = val.lon;
  1114. if (val.level == 1) {
  1115. this.zoom = 8;
  1116. } else if (val.level == 2) {
  1117. this.zoom = 10;
  1118. } else if (val.level == 3) {
  1119. this.zoom = 20;
  1120. }
  1121. },
  1122. initialize() {
  1123. this.isZoom = true;
  1124. var map = new TMap.Map('container', {
  1125. zoom: this.zoom,
  1126. center: new TMap.LatLng(39.986785, 116.301012),
  1127. });
  1128. this.geocoder = new TMap.service.Geocoder();
  1129. },
  1130. dragend(e) {
  1131. this.getMapposition(e, '2', this.$route.query.tabVal);
  1132. },
  1133. zoomend(e) {
  1134. this.getMapposition(e, '1', this.$route.query.tabVal);
  1135. },
  1136. getMapposition(e, type, listType) {
  1137. debugger;
  1138. var that = this;
  1139. var typeList = -1;
  1140. var input = [e.target.re.lat, e.target.re.lng];
  1141. var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
  1142. var Zoom = e.target.getZoom();
  1143. if (listType == 1) {
  1144. typeList = 1;
  1145. } else if (listType == 3) {
  1146. typeList = 4;
  1147. } else if (listType == 4) {
  1148. typeList = 3;
  1149. } else {
  1150. typeList = 2;
  1151. }
  1152. // that.latsave=input[0]
  1153. // that.lonsave=input[1]
  1154. if (Zoom > 5 && this.isZoom && type != 2) {
  1155. this.isZoom = false;
  1156. this.range = 10000;
  1157. this.getUserOutPlaList();
  1158. }
  1159. if (type == 2) {
  1160. var lon = this.mapk.getCenter().lng;
  1161. var lat = this.mapk.getCenter().lat;
  1162. var PointSum = that.twoPointSum(lat, lon, that.latsave, that.lonsave).toFixed(2);
  1163. this.lon = this.mapk.getCenter().lng;
  1164. this.lat = this.mapk.getCenter().lat;
  1165. if (PointSum > 3000) {
  1166. setTimeout(() => {
  1167. this.getUserOutPlaList();
  1168. }, 1000);
  1169. }
  1170. }
  1171. },
  1172. getStoreMapInfo(val) {
  1173. this.poINData = [];
  1174. this.list = [];
  1175. this.listData = [];
  1176. getStoreMapInfo(val).then((res) => {
  1177. if (res.code == 200) {
  1178. this.poINData = res.data;
  1179. } else {
  1180. this.$toast(res.msg);
  1181. }
  1182. });
  1183. },
  1184. touchmove() {
  1185. this.dragging = true;
  1186. },
  1187. end(e) {
  1188. this.dragging = false;
  1189. },
  1190. mpFn(row, tyle) {
  1191. if (row.iconName == 'qita') {
  1192. // 非金牌-其他
  1193. if (tyle == 1) {
  1194. this.checkIco = otheractive;
  1195. } else {
  1196. return this.other;
  1197. }
  1198. } else if (row.iconName == 'tcfx_tl') {
  1199. // 非金牌-涂料店
  1200. if (tyle == 1) {
  1201. this.checkIco = storeAactive;
  1202. } else {
  1203. return this.storeA;
  1204. }
  1205. } else if (row.iconName == 'tcfx_cw') {
  1206. // 非金牌-厨卫
  1207. if (tyle == 1) {
  1208. this.checkIco = storeBCZactive;
  1209. } else {
  1210. return this.storeBCZ;
  1211. }
  1212. } else if (row.iconName == 'tcfx_B_fs') {
  1213. // 同城分销-瓷砖店
  1214. if (tyle == 1) {
  1215. this.checkIco = storeBFSactive;
  1216. } else {
  1217. return this.storeBFS;
  1218. }
  1219. } else if (row.iconName == 'tcfx_B_qt') {
  1220. // 同城分销-黄沙-水泥
  1221. if (tyle == 1) {
  1222. this.checkIco = storeBOtheractive;
  1223. } else {
  1224. return this.storeBOther;
  1225. }
  1226. } else if (row.iconName == 'jinpai') {
  1227. // 无布机-金牌店
  1228. if (tyle == 1) {
  1229. this.checkIco = storeGoldactive;
  1230. } else {
  1231. return this.storeGold;
  1232. }
  1233. } else if (row.iconName == 'jinpai_ccm') {
  1234. if (tyle == 1) {
  1235. this.checkIco = storeCCMactive;
  1236. } else {
  1237. return this.storeCCM;
  1238. }
  1239. } else {
  1240. if (tyle == 1) {
  1241. this.checkIco = mpactive;
  1242. } else {
  1243. return this.mp;
  1244. }
  1245. }
  1246. },
  1247. storeDetails(val) {
  1248. // designerStore 是否为设计师招募门店,true-是,false-否
  1249. if (val.designerStore) {
  1250. this.$router.push({
  1251. path: '/addDesignerDetail',
  1252. query: { id: val.storeId },
  1253. });
  1254. return;
  1255. } else {
  1256. this.$router.push({
  1257. path: '/storeDetail',
  1258. query: { id: val.storeId },
  1259. });
  1260. }
  1261. },
  1262. locationSuccess(point) {
  1263. this.lon1 = point.point.lng;
  1264. this.lat1 = point.point.lat;
  1265. this.lon = point.point.lng;
  1266. this.lat = point.point.lat;
  1267. this.zoom = 19;
  1268. this.onSearch();
  1269. },
  1270. onSearch() {
  1271. // this.getposition()
  1272. this.resultmap = [];
  1273. this.closeFns();
  1274. this.lon = this.mapk.getCenter().lng;
  1275. this.lat = this.mapk.getCenter().lat;
  1276. this.getUserOutPlaList('1');
  1277. },
  1278. getposition() {
  1279. this.resultmap = [];
  1280. let loading1 = this.$toast.loading({
  1281. duration: 0,
  1282. message: '加载中...',
  1283. forbidClick: true,
  1284. });
  1285. let url = window.location.href;
  1286. let wx = this.wx;
  1287. var that = this;
  1288. let qiyeData;
  1289. const instance = axios.create();
  1290. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1291. instance
  1292. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1293. params: {
  1294. url: url,
  1295. },
  1296. })
  1297. .then((response) => {
  1298. if (response.status == 200) {
  1299. this.cont = 3;
  1300. var flat = true;
  1301. var times = setInterval(() => {
  1302. this.cont--;
  1303. if (this.cont == '0') {
  1304. if (flat) {
  1305. loading1.clear();
  1306. clearInterval(times);
  1307. that.$dialog
  1308. .alert({
  1309. message: '定位失败,请开启企微定位权限',
  1310. })
  1311. .then(() => {});
  1312. } else {
  1313. clearInterval(times);
  1314. }
  1315. }
  1316. }, 1000);
  1317. qiyeData = response.data.data;
  1318. wx.config({
  1319. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1320. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1321. appId: qiyeData.appId, // 必填,企业微信的corpID
  1322. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1323. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1324. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1325. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1326. });
  1327. wx.ready(function () {
  1328. wx.getLocation({
  1329. type: 'gcj02',
  1330. success: function (res) {
  1331. flat = false;
  1332. loading1.clear();
  1333. var location = that.CJ02BD(res.latitude, res.longitude);
  1334. that.lat = location.lat;
  1335. that.lon = location.lon;
  1336. that.latsave = location.lat;
  1337. that.lonsave = location.lon;
  1338. that.lat1 = location.lat;
  1339. that.lon1 = location.lon;
  1340. that.latmy = location.lat;
  1341. that.lonmy = location.lon;
  1342. that.mapk.centerAndZoom(new BMap.Point(location.lon, location.lat), 18);
  1343. that.onSearch();
  1344. // that.getUserOutPlaList('2');
  1345. // setTimeout(()=>{
  1346. // that.getUserOutPlaList()
  1347. // },2000)
  1348. },
  1349. });
  1350. });
  1351. }
  1352. });
  1353. },
  1354. onClickLeft1() {
  1355. this.lon1 = '0';
  1356. this.lat1 = '0';
  1357. },
  1358. checkfn(row) {
  1359. this.info = row;
  1360. this.mpFn(row, 1);
  1361. },
  1362. infoShow(row, index) {
  1363. // for(var i=0;i<this.listData.length;i++){
  1364. // this.listData[i].select=false
  1365. // }
  1366. // this.listData[index].select=true
  1367. this.mpFn(row, 1);
  1368. this.info = row;
  1369. this.listpoint = [];
  1370. this.show = false;
  1371. var name = '我的';
  1372. var title = '客户信息';
  1373. var storeCategory = row.storeCategoryName;
  1374. if (this.tabVal != 1 && this.tabVal != 4) {
  1375. name = '销售部';
  1376. }
  1377. if (this.tabVal != 3 && this.tabVal != 4) {
  1378. storeCategory = row.storeCategory;
  1379. title = '计划外';
  1380. }
  1381. buryingPoint({
  1382. systemModel: title + name,
  1383. buryingPointType: 4,
  1384. buryingPointValue: storeCategory,
  1385. buryingPointName: row.storeCode,
  1386. buryingPointPosition: '地图',
  1387. });
  1388. this.getpointList(row);
  1389. },
  1390. getpointList(val) {
  1391. debugger;
  1392. var that = this;
  1393. let loading3 = this.$toast.loading({
  1394. duration: 0,
  1395. message: '加载中...',
  1396. forbidClick: true,
  1397. });
  1398. if (this.$route.query.tabVal == 1) {
  1399. getUserOutPlaList({
  1400. storeCode: val.storeCode,
  1401. type: 1,
  1402. lon: val.lon,
  1403. lat: val.lat,
  1404. range: 20,
  1405. storeName: this.storeName.trim(),
  1406. chainCode: this.chainCode,
  1407. storeLabelTypes: this.storeLabelTypes.join(','),
  1408. pageNum: this.pageNum,
  1409. storeCategoryList: this.storeCategoryList,
  1410. }).then((res) => {
  1411. if (res.code == 200) {
  1412. loading3.clear();
  1413. this.listpoint = res.rows;
  1414. this.show = true;
  1415. } else {
  1416. this.$toast(res.msg);
  1417. }
  1418. });
  1419. } else if (this.$route.query.tabVal == 3) {
  1420. storeList({
  1421. storeCode: val.storeCode,
  1422. type: 4,
  1423. lon: val.lon,
  1424. lat: val.lat,
  1425. range: 20,
  1426. storeName: this.storeName.trim(),
  1427. }).then((res) => {
  1428. if (res.code == 200) {
  1429. loading3.clear();
  1430. this.listpoint = res.rows;
  1431. this.show = true;
  1432. } else {
  1433. this.$toast(res.msg);
  1434. }
  1435. });
  1436. } else if (this.$route.query.tabVal == 4) {
  1437. storeMyList({
  1438. storeCode: val.storeCode,
  1439. type: 3,
  1440. lon: val.lon,
  1441. lat: val.lat,
  1442. range: 20,
  1443. storeName: this.storeName.trim(),
  1444. }).then((res) => {
  1445. if (res.code == 200) {
  1446. loading3.clear();
  1447. this.listpoint = res.rows;
  1448. this.show = true;
  1449. } else {
  1450. this.$toast(res.msg);
  1451. }
  1452. });
  1453. } else if (this.$route.query.tabVal == 6) {
  1454. topStore({
  1455. storeCode: val.storeCode,
  1456. lon: val.lon,
  1457. lat: val.lat,
  1458. range: 20,
  1459. storeName: this.storeName.trim(),
  1460. chainCode: this.chainCode,
  1461. storeLabelTypes: this.storeLabelTypes.join(','),
  1462. pageNum: this.pageNum,
  1463. storeCategoryList: this.storeCategoryList,
  1464. }).then((res) => {
  1465. if (res.code == 200) {
  1466. loading3.clear();
  1467. this.listpoint = res.data.storeList;
  1468. this.show = true;
  1469. } else {
  1470. this.$toast(res.msg);
  1471. }
  1472. });
  1473. } else {
  1474. getUserOrgStoreList({
  1475. storeCode: val.storeCode,
  1476. type: 2,
  1477. lon: val.lon,
  1478. lat: val.lat,
  1479. range: 20,
  1480. storeName: this.storeName.trim(),
  1481. chainCode: this.chainCode,
  1482. storeLabelTypes: this.storeLabelTypes.join(','),
  1483. pageNum: this.pageNum,
  1484. storeCategoryList: this.storeCategoryList,
  1485. }).then((res) => {
  1486. if (res.code == 200) {
  1487. loading3.clear();
  1488. this.listpoint = res.rows;
  1489. this.show = true;
  1490. } else {
  1491. this.$toast(res.msg);
  1492. }
  1493. });
  1494. }
  1495. },
  1496. onClickLeft() {
  1497. this.$router.go(-1);
  1498. },
  1499. buryingPointFn(val) {
  1500. buryingPoint({
  1501. systemModel: '地图',
  1502. buryingPointType: 4,
  1503. buryingPointValue: val.telephone,
  1504. buryingPointName: '点击电话',
  1505. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  1506. });
  1507. },
  1508. onTownConfirm(val, zoom) {
  1509. this.range = val;
  1510. this.zoom = zoom;
  1511. this.getUserOutPlaList('1');
  1512. },
  1513. getUserOutPlaList(val) {
  1514. this.poINData = [];
  1515. var that = this;
  1516. this.list = [];
  1517. this.listData = [];
  1518. var types = '';
  1519. if (val == 1) {
  1520. types = '1';
  1521. } else {
  1522. types = '';
  1523. }
  1524. let loading3 = this.$toast.loading({
  1525. duration: 0,
  1526. message: '加载中...',
  1527. forbidClick: true,
  1528. });
  1529. if (this.$route.query.tabVal == 1) {
  1530. getUserOutPlaList({
  1531. type: 1,
  1532. lon: this.lon,
  1533. lat: this.lat,
  1534. range: this.range,
  1535. storeName: this.storeName.trim(),
  1536. chainCode: this.chainCode,
  1537. storeLabelTypes: this.storeLabelTypes.join(','),
  1538. pageNum: this.pageNum,
  1539. storeCategoryList: this.storeCategoryList,
  1540. }).then((res) => {
  1541. if (res.code == 200) {
  1542. loading3.clear();
  1543. this.listData = res.rows;
  1544. setTimeout(() => {
  1545. this.list = res.rows;
  1546. }, 2000);
  1547. // if(res.rows.length>0&&types==1){
  1548. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1549. // this.lon1="";
  1550. // this.lat1="";
  1551. // setTimeout(()=>{
  1552. // this.lon1=res.rows[0].lon;
  1553. // this.lat1=res.rows[0].lat;
  1554. // })
  1555. // }
  1556. // }
  1557. if (res.rows.length < 1) {
  1558. this.$toast('附近无客户信息');
  1559. this.show = false;
  1560. }
  1561. if (res.total > 50) {
  1562. this.msg = this.setMapRangeTitle(res.total);
  1563. this.msgshow = true;
  1564. this.show = false;
  1565. }
  1566. if (this.first < 2) {
  1567. this.zoom = 18;
  1568. this.first = 2;
  1569. }
  1570. } else {
  1571. this.$toast(res.msg);
  1572. }
  1573. });
  1574. } else if (this.$route.query.tabVal == 3) {
  1575. storeList({
  1576. type: 4,
  1577. lon: this.lon,
  1578. lat: this.lat,
  1579. range: this.range,
  1580. storeName: this.storeName.trim(),
  1581. }).then((res) => {
  1582. if (res.code == 200) {
  1583. loading3.clear();
  1584. // this.list = res.rows
  1585. this.listData = res.rows;
  1586. setTimeout(() => {
  1587. this.list = res.rows;
  1588. }, 2000);
  1589. // if(res.rows.length>0&&types==1){
  1590. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1591. // this.lon1="";
  1592. // this.lat1="";
  1593. // setTimeout(()=>{
  1594. // this.lon1=res.rows[0].lon;
  1595. // this.lat1=res.rows[0].lat;
  1596. // })
  1597. // }
  1598. // }
  1599. if (res.rows.length < 1) {
  1600. this.$toast('附近无客户信息');
  1601. this.show = false;
  1602. }
  1603. if (res.total > 50) {
  1604. this.msg = this.setMapRangeTitle(res.total);
  1605. this.msgshow = true;
  1606. this.show = false;
  1607. }
  1608. if (this.first < 2) {
  1609. this.zoom = 18;
  1610. this.first = 2;
  1611. }
  1612. } else {
  1613. this.$toast(res.msg);
  1614. }
  1615. });
  1616. } else if (this.$route.query.tabVal == 4) {
  1617. storeMyList({
  1618. type: 3,
  1619. lon: this.lon,
  1620. lat: this.lat,
  1621. range: this.range,
  1622. storeName: this.storeName.trim(),
  1623. }).then((res) => {
  1624. if (res.code == 200) {
  1625. loading3.clear();
  1626. // this.list = res.rows
  1627. this.listData = res.rows;
  1628. setTimeout(() => {
  1629. this.list = res.rows;
  1630. }, 2000);
  1631. // if(res.rows.length>0&&types==1){
  1632. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1633. // this.lon1="";
  1634. // this.lat1="";
  1635. // setTimeout(()=>{
  1636. // this.lon1=res.rows[0].lon;
  1637. // this.lat1=res.rows[0].lat;
  1638. // })
  1639. // }
  1640. // }
  1641. if (res.rows.length < 1) {
  1642. this.$toast('附近无客户信息');
  1643. this.show = false;
  1644. }
  1645. if (res.total > 50) {
  1646. this.msg = this.setMapRangeTitle(res.total);
  1647. this.msgshow = true;
  1648. this.show = false;
  1649. }
  1650. if (this.first < 2) {
  1651. this.zoom = 18;
  1652. this.first = 2;
  1653. }
  1654. } else {
  1655. this.$toast(res.msg);
  1656. }
  1657. });
  1658. } else if (this.$route.query.tabVal == 6) {
  1659. topStore({
  1660. lat: this.lat,
  1661. lon: this.lon,
  1662. range: this.range,
  1663. storeName: this.storeName.trim(),
  1664. chainCode: this.chainCode,
  1665. storeLabelTypes: this.storeLabelTypes.join(','),
  1666. pageNum: this.pageNum,
  1667. storeCategoryList: this.storeCategoryList,
  1668. }).then((res) => {
  1669. if (res.code == 200) {
  1670. loading3.clear();
  1671. this.listData = res.data.storeList;
  1672. setTimeout(() => {
  1673. this.list = res.data.storeList;
  1674. }, 2000);
  1675. // if(res.data.storeList.length>0&&types==1){
  1676. // if(res.data.storeList[0].lon!=null&&res.data.storeList[0].lon!=""&&res.data.storeList[0].lon!=undefined){
  1677. // this.lon1=res.data.storeList[0].lon
  1678. // this.lat1=res.data.storeList[0].lat
  1679. // }
  1680. // }
  1681. if (res.data.storeList.length < 1) {
  1682. this.$toast('附近无客户信息');
  1683. this.show = false;
  1684. }
  1685. if (this.first < 2) {
  1686. this.zoom = 18;
  1687. this.first = 2;
  1688. }
  1689. } else {
  1690. this.$toast(res.msg);
  1691. }
  1692. });
  1693. } else {
  1694. debugger;
  1695. getUserOrgStoreList({
  1696. type: 2,
  1697. lon: this.lon,
  1698. lat: this.lat,
  1699. range: this.range,
  1700. storeName: this.storeName.trim(),
  1701. chainCode: this.chainCode,
  1702. storeLabelTypes: this.storeLabelTypes.join(','),
  1703. pageNum: this.pageNum,
  1704. storeCategoryList: this.storeCategoryList,
  1705. }).then((res) => {
  1706. if (res.code == 200) {
  1707. loading3.clear();
  1708. // this.list = res.rows
  1709. this.listData = res.rows;
  1710. setTimeout(() => {
  1711. this.list = res.rows;
  1712. }, 2000);
  1713. // if(res.rows.length>0&&types==1){
  1714. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1715. // this.lon1="";
  1716. // this.lat1="";
  1717. // setTimeout(()=>{
  1718. // this.lon1=res.rows[0].lon;
  1719. // this.lat1=res.rows[0].lat;
  1720. // })
  1721. // }
  1722. // }
  1723. if (res.rows.length < 1) {
  1724. this.$toast('附近无客户信息');
  1725. this.show = false;
  1726. }
  1727. if (res.total > 50) {
  1728. this.msg = this.setMapRangeTitle(res.total);
  1729. this.msgshow = true;
  1730. this.show = false;
  1731. }
  1732. if (this.first < 2) {
  1733. this.zoom = 18;
  1734. this.first = 2;
  1735. }
  1736. } else {
  1737. this.$toast(res.msg);
  1738. }
  1739. });
  1740. }
  1741. },
  1742. storeVisit(val) {
  1743. // localStorage.setItem("tabVal",this.tabVal)
  1744. if (val.visitSource && val.visitSource == 2) {
  1745. this.$toast('请先取消异常拜访后再进入正常拜访!');
  1746. return;
  1747. }
  1748. localStorage.removeItem('visitId');
  1749. var rdId = val.rdId;
  1750. var that = this;
  1751. if (this.$route.query.tabVal != 3 || this.$route.query.tabVal != 4) {
  1752. rdId = null;
  1753. }
  1754. checkVisit({ storeId: val.storeId }).then((res) => {
  1755. buryingPoint({
  1756. systemModel: val.storeCategory,
  1757. buryingPointType: 5,
  1758. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1759. buryingPointName: '进店拜访',
  1760. buryingPointPosition: '地图客户信息',
  1761. });
  1762. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1763. if (localStorage.getItem('loginType') == 'cs') {
  1764. var lat = '';
  1765. var lon = '';
  1766. if (val.lat == '' || val.lat == null) {
  1767. lat = '31.2517820000';
  1768. lon = '120.5593090000';
  1769. } else {
  1770. lat = val.lat;
  1771. lon = val.lon;
  1772. }
  1773. this.$router.push({
  1774. path: '/suishenbangOutstoreVisit',
  1775. query: {
  1776. storeId: val.storeId,
  1777. rdId: val.rdId,
  1778. lat: lat,
  1779. lon: lon,
  1780. visitId: val.visitId,
  1781. pageType: 'out',
  1782. addressLine: val.addressLine,
  1783. storeCategory: val.storeCategory,
  1784. storeName: val.storeName,
  1785. hisTime: val.hisTime,
  1786. contactName: val.contactName,
  1787. storeCode: val.storeCode,
  1788. tabVal: that.$route.query.tabVal,
  1789. visitModel: '1',
  1790. latNew: '31.2517820000',
  1791. lonNew: '120.5593090000',
  1792. PointSum: 0,
  1793. marklat: lat,
  1794. marklon: lon,
  1795. linkType: that.$route.query.tabVal,
  1796. from: 'outPlan',
  1797. },
  1798. });
  1799. localStorage.setItem('startTime', new Date());
  1800. localStorage.setItem('ORGName', val.deptName);
  1801. localStorage.setItem('chainNameR', val.storeName);
  1802. } else {
  1803. if (this.flag) {
  1804. this.flag = false;
  1805. this.timer = null;
  1806. let that = this;
  1807. this.timer = setTimeout(() => {
  1808. this.flag = true;
  1809. }, 2000);
  1810. if (val.stateString.indexOf('拜访中') != -1) {
  1811. localStorage.setItem('startTime', new Date());
  1812. localStorage.setItem('ORGName', val.deptName);
  1813. localStorage.setItem('chainNameR', val.storeName);
  1814. that.$router.push({
  1815. path: '/suishenbangOutstoreVisit',
  1816. query: {
  1817. storeId: val.storeId,
  1818. rdId: rdId,
  1819. lat: val.lat,
  1820. lon: val.lon,
  1821. visitId: val.visitId,
  1822. pageType: 'out',
  1823. addressLine: val.addressLine,
  1824. storeCategory: val.storeCategory,
  1825. storeName: val.storeName,
  1826. hisTime: val.hisTime,
  1827. contactName: val.contactName,
  1828. storeCode: val.storeCode,
  1829. tabVal: that.$route.query.tabVal,
  1830. visitModel: '1',
  1831. latNew: val.lat,
  1832. lonNew: val.lon,
  1833. PointSum: '0',
  1834. marklat: val.lat,
  1835. marklon: val.lon,
  1836. linkType: that.$route.query.tabVal,
  1837. from: 'outPlan',
  1838. },
  1839. });
  1840. } else {
  1841. let loading1 = this.$toast.loading({
  1842. duration: 0,
  1843. message: '加载中...',
  1844. forbidClick: true,
  1845. });
  1846. let url = window.location.href;
  1847. let wx = this.wx;
  1848. let qiyeData;
  1849. const instance = axios.create();
  1850. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1851. instance
  1852. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1853. params: {
  1854. url: url,
  1855. },
  1856. })
  1857. .then((response) => {
  1858. if (response.status == 200) {
  1859. this.cont = 3;
  1860. var flat = true;
  1861. var times = setInterval(() => {
  1862. this.cont--;
  1863. if (this.cont == '0') {
  1864. if (flat) {
  1865. loading1.clear();
  1866. clearInterval(times);
  1867. that.$dialog
  1868. .alert({
  1869. message: '定位失败,请开启企微定位权限',
  1870. })
  1871. .then(() => {});
  1872. } else {
  1873. clearInterval(times);
  1874. }
  1875. }
  1876. }, 1000);
  1877. qiyeData = response.data.data;
  1878. wx.config({
  1879. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1880. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1881. appId: qiyeData.appId, // 必填,企业微信的corpID
  1882. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1883. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1884. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1885. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1886. });
  1887. wx.ready(() => {
  1888. wx.getLocation({
  1889. type: 'gcj02',
  1890. success: (res) => {
  1891. flat = false;
  1892. var location = that.CJ02BD(res.latitude, res.longitude);
  1893. checkStoreAddressByStoreCode({
  1894. storeCode: val.storeCode,
  1895. lon: location.lon,
  1896. lat: location.lat,
  1897. }).then((response) => {
  1898. loading1.clear();
  1899. if (val.lat == '' || val.lat == null) {
  1900. that.lat = location.lat;
  1901. that.lon = location.lon;
  1902. } else {
  1903. that.lat = val.lat;
  1904. that.lon = val.lon;
  1905. }
  1906. let PointSum = that
  1907. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1908. .toFixed(2);
  1909. let PointSumval = that
  1910. .twoPointSum(location.lat, location.lon, location.lat, location.lon)
  1911. .toFixed(2);
  1912. // GZ:工装店铺 直接进入拜访
  1913. if (localStorage.getItem('postType') == 'GZ') {
  1914. localStorage.setItem('startTime', new Date());
  1915. localStorage.setItem('ORGName', val.deptName);
  1916. localStorage.setItem('chainNameR', val.storeName);
  1917. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1918. return;
  1919. }
  1920. // 门店编码校验门店地址不通过
  1921. if (response.code != 200) {
  1922. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1923. if (response.data.updateAddress == 0) {
  1924. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1925. this.$dialog
  1926. .confirm({
  1927. confirmButtonText: '确定拜访',
  1928. cancelButtonText: '取消拜访',
  1929. title: '系统提示',
  1930. message:
  1931. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1932. closeOnClickOverlay: true,
  1933. })
  1934. .then(() => {
  1935. this.toSuishenbangOutstoreVisit(
  1936. res,
  1937. val,
  1938. location,
  1939. PointSumval
  1940. );
  1941. });
  1942. } else if (response.data.updateAddress == 1) {
  1943. // 同城AB+金牌,去修改地址
  1944. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1945. if (!response.data.addressUpdateTimesOver) {
  1946. this.$dialog
  1947. .confirm({
  1948. title: '系统提示',
  1949. message: response.msg + '请立即修改后再拜访',
  1950. messageAlign: 'left',
  1951. confirmButtonText: '立即修改',
  1952. cancelButtonText: '取消',
  1953. })
  1954. .then(() => {
  1955. this.$router.push({
  1956. path: '/storeDetail',
  1957. query: {
  1958. id: val.storeId,
  1959. type: 'address',
  1960. storeAddressId: val.storeAddressId,
  1961. },
  1962. });
  1963. });
  1964. } else {
  1965. this.$dialog.confirm({
  1966. title: '系统提示',
  1967. message: '已经达到最大修改次数',
  1968. messageAlign: 'left',
  1969. confirmButtonText: '确定',
  1970. });
  1971. }
  1972. } else if (response.data.updateAddress == 2) {
  1973. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1974. this.resetCoord(res, val, location, PointSumval);
  1975. return;
  1976. }
  1977. } else {
  1978. // 门店编码校验门店地址通过 进入拜访
  1979. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1980. }
  1981. });
  1982. },
  1983. fail: function () {
  1984. loading1.clear();
  1985. that.$dialog.alert({
  1986. message: 'GPS未开启',
  1987. });
  1988. },
  1989. });
  1990. });
  1991. wx.error(function (res) {
  1992. loading1.clear();
  1993. that.$dialog
  1994. .alert({
  1995. message: '定位失败,请开启企微定位权限',
  1996. })
  1997. .then(() => {});
  1998. });
  1999. }
  2000. });
  2001. }
  2002. }
  2003. }
  2004. } else if (res.code == 500) {
  2005. this.$dialog
  2006. .alert({
  2007. message: res.msg,
  2008. })
  2009. .then(() => {});
  2010. }
  2011. });
  2012. },
  2013. // 重置经纬度
  2014. resetCoord(res, val, location, PointSumval) {
  2015. this.$dialog
  2016. .confirm({
  2017. confirmButtonText: '初始化定位',
  2018. cancelButtonText: '取消拜访',
  2019. title: '系统提示',
  2020. message: '偏差过大,不允许拜访。可修改本店定位.',
  2021. closeOnClickOverlay: true,
  2022. })
  2023. .then(() => {
  2024. mobileReposition({
  2025. storeId: val.storeId,
  2026. lat: location.lat,
  2027. lon: location.lon,
  2028. }).then((response) => {
  2029. if (response.code == 200) {
  2030. this.$dialog
  2031. .alert({
  2032. title: '系统提示',
  2033. message: '本信息定位已更新成功!',
  2034. })
  2035. .then(() => {
  2036. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  2037. });
  2038. localStorage.setItem('startTime', new Date());
  2039. localStorage.setItem('ORGName', val.deptName);
  2040. localStorage.setItem('chainNameR', val.storeName);
  2041. } else {
  2042. this.$toast(response.msg);
  2043. }
  2044. });
  2045. });
  2046. },
  2047. // 进入拜访 router.push
  2048. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  2049. addVisitsPosition({
  2050. storeId: val.storeId,
  2051. visitsId: '',
  2052. lon: res.longitude,
  2053. lat: res.latitude,
  2054. sourceLon: location.lon,
  2055. sourceLat: location.lat,
  2056. positionDesc: '',
  2057. accuracy: res.accuracy,
  2058. });
  2059. this.$router.push({
  2060. path: '/suishenbangOutstoreVisit',
  2061. query: {
  2062. storeId: val.storeId,
  2063. rdId: val.rdId,
  2064. lat: location.lat,
  2065. lon: location.lon,
  2066. visitId: val.visitId,
  2067. pageType: 'out',
  2068. addressLine: val.addressLine,
  2069. storeCategory: val.storeCategory,
  2070. storeName: val.storeName,
  2071. hisTime: val.hisTime,
  2072. contactName: val.contactName,
  2073. storeCode: val.storeCode,
  2074. tabVal: this.$route.query.tabVal,
  2075. visitModel: '1',
  2076. latNew: location.lat,
  2077. lonNew: location.lon,
  2078. PointSum: PointSumval,
  2079. marklat: res.latitude,
  2080. marklon: res.longitude,
  2081. linkType: this.$route.query.tabVal,
  2082. from: 'outPlan',
  2083. },
  2084. });
  2085. },
  2086. linkapp(val) {
  2087. var poind = this.gcj02BD(val.lat, val.lon);
  2088. let url = window.location.href;
  2089. let that = this;
  2090. let wx = this.wx;
  2091. let qiyeData;
  2092. const instance = axios.create();
  2093. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2094. instance
  2095. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2096. params: {
  2097. url: url,
  2098. agent: 1,
  2099. },
  2100. })
  2101. .then((response) => {
  2102. if (response.status == 200) {
  2103. qiyeData = response.data.data;
  2104. // wx.config({
  2105. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2106. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2107. // appId: qiyeData.appId, // 必填,企业微信的corpID
  2108. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2109. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2110. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2111. // jsApiList: ["ready", "invoke"]
  2112. // });
  2113. // wx.ready(function() {
  2114. // wx.checkJsApi({
  2115. // jsApiList: ["agentConfig", "launchMiniprogram"], // 需要检测的JS接口列表
  2116. // success: function(res) {}})})
  2117. wx.agentConfig({
  2118. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  2119. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  2120. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2121. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2122. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  2123. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  2124. success: function (res) {
  2125. wx.invoke(
  2126. 'launchMiniprogram',
  2127. {
  2128. appid: 'wx238bbb5f6d958414',
  2129. path:
  2130. 'pages/relayStation/relayStation?latitude=' +
  2131. poind.lat +
  2132. '&longitude=' +
  2133. poind.lon +
  2134. '&name=' +
  2135. val.addressLine,
  2136. },
  2137. function (res) {
  2138. if (res.err_msg == 'launchMiniprogram:ok') {
  2139. } else {
  2140. }
  2141. }
  2142. );
  2143. },
  2144. fail: function (res) {
  2145. if (res.errMsg.indexOf('function not exist') > -1) {
  2146. alert('版本过低请升级');
  2147. }
  2148. },
  2149. });
  2150. }
  2151. });
  2152. },
  2153. // 跳转好帮手门店详情
  2154. goOtherSystem(item) {
  2155. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  2156. if (
  2157. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  2158. item.approvalStatus == null ||
  2159. item.approvalStatus == 0
  2160. ) {
  2161. return false;
  2162. }
  2163. if (item.storeCode) {
  2164. window.location.href =
  2165. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
  2166. } else {
  2167. this.$dialog.alert({
  2168. message: '缺少门店code',
  2169. });
  2170. }
  2171. },
  2172. filterTCFX(item) {
  2173. if (!item.remark) return false;
  2174. let remark = JSON.parse(item.remark);
  2175. return remark.tcfx ? true : false;
  2176. },
  2177. },
  2178. };
  2179. </script>
  2180. <style scoped lang="scss">
  2181. .map {
  2182. width: 100%;
  2183. height: 79.3vh;
  2184. margin-top: 180px;
  2185. }
  2186. .text {
  2187. font-size: 14px;
  2188. color: #909090;
  2189. margin: 6px 0;
  2190. }
  2191. #container {
  2192. width: 20px;
  2193. height: 20px;
  2194. position: fixed;
  2195. left: -888px;
  2196. }
  2197. .mapimg {
  2198. position: fixed;
  2199. bottom: 235px;
  2200. right: 2px;
  2201. width: 38px;
  2202. }
  2203. .mapStoreList {
  2204. position: fixed;
  2205. width: 96%;
  2206. bottom: 10px;
  2207. background-color: white;
  2208. border-radius: 6px;
  2209. padding: 10px 0 14px;
  2210. overflow: hidden;
  2211. margin: 0 2%;
  2212. max-height: 330px;
  2213. }
  2214. .maplit {
  2215. width: 100%;
  2216. margin-top: -10px;
  2217. overflow-y: auto;
  2218. border-top: 1px solid #eeeeee;
  2219. padding: 0 14px;
  2220. }
  2221. .maplitactive {
  2222. height: 270px;
  2223. }
  2224. .maplistitem {
  2225. padding-bottom: 14px;
  2226. border-bottom: 1px solid #eeeeee;
  2227. .JPABC {
  2228. width: 20px;
  2229. position: relative;
  2230. top: 4px;
  2231. margin-right: 3px;
  2232. }
  2233. }
  2234. .maplistitem:last-child {
  2235. border: 0;
  2236. }
  2237. .tipsTitle {
  2238. padding: 5px 0;
  2239. text-align: center;
  2240. font-size: 16px;
  2241. font-weight: 600;
  2242. }
  2243. </style>
  2244. <style lang="scss">
  2245. .icoImgMAP {
  2246. background-color: #fff;
  2247. text-align: center;
  2248. padding: 0 2px;
  2249. }
  2250. .icoImgMAP .van-grid-item__icon {
  2251. font-size: 40px;
  2252. margin: 0 auto;
  2253. }
  2254. .icoImgMAP .van-grid-item__content {
  2255. font-size: 10px;
  2256. margin: 0;
  2257. padding: 0;
  2258. color: #666;
  2259. justify-content: normal;
  2260. }
  2261. .icoImgMAP .van-grid-item__content:after {
  2262. border: 0;
  2263. }
  2264. .icoImgMAP .van-grid-item__text {
  2265. font-size: 14px;
  2266. width: 48px;
  2267. }
  2268. .icoImgMAP .titleico {
  2269. margin-top: 8px;
  2270. }
  2271. .icoImgMAP .titleico p {
  2272. font-size: 14px;
  2273. margin: 0;
  2274. }
  2275. .icoImgMAP .titleico .p {
  2276. margin-top: -4px;
  2277. }
  2278. .textc .van-grid-item__content,
  2279. .textc .van-grid-item__text {
  2280. color: red;
  2281. }
  2282. .visitStoreIco {
  2283. float: left;
  2284. float: left;
  2285. width: 26px;
  2286. text-align: center;
  2287. background-color: #ffba13;
  2288. color: #fff;
  2289. border-radius: 100%;
  2290. margin-left: 14px;
  2291. line-height: 26px;
  2292. height: 26px;
  2293. }
  2294. .van-tabs__nav--card .van-tab.van-tab--active {
  2295. background-color: #0057ba !important;
  2296. }
  2297. .visitSearch {
  2298. width: 68px;
  2299. color: #0057ba;
  2300. font-size: 14px;
  2301. }
  2302. .visitSearch .van-dropdown-menu__bar {
  2303. box-shadow: 0 0 0 #fff;
  2304. height: 52px;
  2305. }
  2306. .visitSearch .van-dropdown-menu__item {
  2307. justify-content: normal;
  2308. }
  2309. .visitSearch .van-dropdown-menu__title {
  2310. border-left: 1px solid #ccc;
  2311. }
  2312. .visitSearch .van-cell {
  2313. border: 1px solid #ccc;
  2314. border-radius: 5px;
  2315. padding: 6px;
  2316. }
  2317. .positionContent {
  2318. position: fixed;
  2319. color: #666;
  2320. display: inline-block;
  2321. box-shadow: 0px 2px 7px -5px #000;
  2322. border-radius: 100px;
  2323. overflow: hidden;
  2324. right: 14px;
  2325. cursor: pointer;
  2326. bottom: 96px;
  2327. background-color: white;
  2328. }
  2329. .positionContent .img {
  2330. border-radius: 100px;
  2331. float: left;
  2332. }
  2333. .positionContent .img .van-icon__image {
  2334. border-radius: 100px;
  2335. }
  2336. .zDialog .van-dialog__header {
  2337. padding: 10px;
  2338. border-bottom: 1px solid #f5f5f5;
  2339. }
  2340. .zDialog .infoText {
  2341. margin: 10px;
  2342. font-size: 14px;
  2343. color: #909090;
  2344. width: 98%;
  2345. }
  2346. .visitStoreIco {
  2347. float: right;
  2348. width: 26px;
  2349. text-align: center;
  2350. background-color: #ffba13;
  2351. color: #fff;
  2352. border-radius: 100%;
  2353. margin-left: 10px;
  2354. line-height: 26px;
  2355. height: 26px;
  2356. }
  2357. .searchcheck {
  2358. padding: 0 10px 10px;
  2359. }
  2360. .searchcheck .van-checkbox {
  2361. /*width: 44%;*/
  2362. padding-bottom: 10px;
  2363. }
  2364. .searchcheck .checkbox {
  2365. font-size: 14px;
  2366. display: inline-block;
  2367. width: 50%;
  2368. line-height: 28px;
  2369. }
  2370. .searchcheck .checkbox .van-checkbox {
  2371. margin-bottom: 2px;
  2372. }
  2373. .searchcheck .checkbox1 {
  2374. font-size: 14px;
  2375. float: left;
  2376. line-height: 28px;
  2377. width: 50%;
  2378. }
  2379. .searchcheck .checkbox1 .child {
  2380. width: 100%;
  2381. }
  2382. .searchcheck {
  2383. height: 93vh;
  2384. overflow-y: auto;
  2385. }
  2386. .searchchecktitle {
  2387. width: 100%;
  2388. margin: 20px 0;
  2389. font-size: 16px;
  2390. border-left: 3px solid #0057ba;
  2391. line-height: 18px;
  2392. }
  2393. .searchchecktitle1 {
  2394. width: 100%;
  2395. margin: 20px 0;
  2396. font-size: 16px;
  2397. line-height: 18px;
  2398. }
  2399. .textsize {
  2400. font-size: 14px;
  2401. }
  2402. .rangeStore {
  2403. .JPVisitNum {
  2404. position: relative;
  2405. top: -26px;
  2406. font-size: 10px;
  2407. }
  2408. .TCFXListItem {
  2409. display: inline-block;
  2410. border: 1px solid #ccc;
  2411. padding: 3px 5px;
  2412. margin: 0 5px;
  2413. border-radius: 6px;
  2414. }
  2415. }
  2416. </style>