rangeStore.vue 74 KB

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