rangeStore.vue 76 KB

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