rangeStore.vue 77 KB

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