rangeStore.vue 83 KB

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