rangeStore.vue 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197
  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="120"
  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. getDictOption,
  595. } from '@/api';
  596. import axios from 'axios';
  597. import ordernum from '@/assets/ordernum.png';
  598. import ord from '@/assets/ord.png';
  599. import check from './../../assets/check.svg';
  600. import { topStore } from '@/api/inventory';
  601. import { gcj02BD } from '@/utils';
  602. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  603. export default {
  604. name: 'rangeStore',
  605. components: {
  606. BaiduMap,
  607. BmMarker,
  608. BmLabel,
  609. BmlMarkerClusterer,
  610. BmInfoWindow,
  611. BmGeolocation,
  612. },
  613. data() {
  614. return {
  615. moreTypeShow: false,
  616. chainsData: [],
  617. result: [],
  618. resultmap: [],
  619. check: check,
  620. mp1: mp1,
  621. times: times,
  622. msg: '',
  623. msgshow: false,
  624. ordernum: ordernum,
  625. mapmarker: mapmarker,
  626. paste: paste,
  627. visitTimess: visitTimes,
  628. timeico: timeico,
  629. mpimg: mpimg,
  630. order: order,
  631. mapShow: false,
  632. otherShow: false,
  633. Network: Network,
  634. order60: order60,
  635. ord: ord,
  636. targetOne: targetOne,
  637. other: other,
  638. othermap: othermap,
  639. storeA: storeA,
  640. storeBCZ: storeBCZ,
  641. storeBFS: storeBFS,
  642. storeBOther: storeBOther,
  643. positinon: positinon,
  644. storeCCM: storeCCM,
  645. storeGold: storeGold,
  646. storeCCMmap: storeCCMmap,
  647. storeGoldmap: storeGoldmap,
  648. storeAmap: storeAmap,
  649. storeBCZmap: storeBCZmap,
  650. storeBFSmap: storeBFSmap,
  651. storeBOthermap: storeBOthermap,
  652. storeBOtheractive: storeBOtheractive,
  653. storeCCMactive: storeCCMactive,
  654. storeGoldactive: storeGoldactive,
  655. storeAactive: storeAactive,
  656. storeBCZactive: storeBCZactive,
  657. storeBFSactive: storeBFSactive,
  658. otheractive: otheractive,
  659. checkIco: otheractive,
  660. minClusterSize: 5,
  661. mp: mp,
  662. mapzb: mapzb,
  663. info: {
  664. lon: 0,
  665. lat: 0,
  666. storeName: '',
  667. storeCategory: '',
  668. chainName: '',
  669. addressLine: '',
  670. },
  671. show: false,
  672. first: 1,
  673. text: '3000米',
  674. zoom: 18,
  675. storeName: '',
  676. showMap: true,
  677. timeData: '',
  678. styless: [
  679. {
  680. url: positinon,
  681. size: {
  682. width: 48,
  683. height: 48,
  684. },
  685. textColor: '#fff',
  686. textSize: 18,
  687. opt_textSize: '200px',
  688. },
  689. ],
  690. range: 10000,
  691. lon1: '112.45359397440227',
  692. lat1: '34.62171814576471',
  693. lon: '112.45359397440227',
  694. lat: '34.62171814576471',
  695. showTownPicker: false,
  696. list: [],
  697. listData: [],
  698. cont: 0,
  699. shows: false,
  700. indexs: 0,
  701. flag: true,
  702. tabVal: 4,
  703. dragging: true,
  704. poINData: [],
  705. isZoom: true,
  706. geocoder: '',
  707. lonsave: '112.45359397440227',
  708. latsave: '34.62171814576471',
  709. latmy: '34.62171814576471',
  710. lonmy: '112.45359397440227',
  711. mapk: '',
  712. mapks: '',
  713. customerVisits: true,
  714. StoreLabels: [],
  715. chainName: '',
  716. chainCode: '',
  717. otherbqShow: true,
  718. otherkkdShow: true,
  719. otherfxdShow: true,
  720. otherfxdShow2: true,
  721. otherfxdShow1: true,
  722. storeTypeList: [],
  723. storeTypeLists: [],
  724. storeLabelTypes: [],
  725. showPicker: false,
  726. CustomerName: '',
  727. listpoint: [],
  728. heifhgts: '200px',
  729. mapRange: [], //地图范围
  730. };
  731. },
  732. created() {
  733. this.heifhgts = window.innerHeight - 190 + 'px';
  734. // 好邦手接入拜访系统地图功能
  735. // 获取url参数 userId
  736. let userId = this.$route.query.userId || '';
  737. console.log(this.$route);
  738. console.log(window.location.href);
  739. if (userId) {
  740. localStorage.setItem('loginName', userId);
  741. }
  742. },
  743. activated() {
  744. // 获取地图范围 字典
  745. this.getMapRange();
  746. this.resultmap = [];
  747. this.tabVal = this.$route.query.tabVal;
  748. this.customerVisits = localStorage.getItem('customerVisits');
  749. this.initialize();
  750. this.range = 10000;
  751. this.zoom = 20;
  752. this.first = 1;
  753. this.msg = '';
  754. this.msgshow = false;
  755. this.storeName = localStorage.getItem('outvstoreName');
  756. this.chainName = localStorage.getItem('outvchainName');
  757. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  758. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  759. } else {
  760. this.storeLabelTypes = [];
  761. }
  762. if (localStorage.getItem('outvstoreCategoryList') != null) {
  763. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  764. this.storeCategoryList = localStorage.getItem('outvstoreCategoryList');
  765. } else {
  766. this.result = [];
  767. }
  768. this.chainCode = localStorage.getItem('outvchainCode');
  769. this.storeName = localStorage.getItem('outvstoreName');
  770. this.getMonth();
  771. this.getStoreTypeList();
  772. this.getStoreLabels();
  773. this.$nextTick(() => {
  774. // this.onClickLeft1();
  775. this.getposition();
  776. });
  777. },
  778. methods: {
  779. async getMapRange() {
  780. let mapRangeOption = await getDictOption({}, 'out_plan_map_range');
  781. this.mapRange = mapRangeOption.data || [];
  782. // dictValue
  783. },
  784. // 设置地图获取范围提示文字
  785. setMapRangeTitle(total) {
  786. let leftRange = this.mapRange[0] ? (this.mapRange[0].dictValue / 1000).toFixed(1) : '10';
  787. let rightRange = this.mapRange[1] ? (this.mapRange[1].dictValue / 1000).toFixed(1) : '5';
  788. let msg =
  789. '当前区域' +
  790. leftRange +
  791. '公里内共' +
  792. total +
  793. '家门店,展示附近' +
  794. rightRange +
  795. '公里的门店';
  796. console.log(msg);
  797. return msg;
  798. },
  799. closeFn() {
  800. this.show = false;
  801. // this.info.lon=0
  802. // this.info.lat=0
  803. },
  804. closeFns() {
  805. this.show = false;
  806. this.info.lon = 0;
  807. this.info.lat = 0;
  808. },
  809. linkList(val) {
  810. this.$router.push({
  811. path: '/pItem',
  812. query: { id: val.storeCode, detilId: 'a' },
  813. });
  814. },
  815. linkimg(val) {
  816. ProductItemImge({ storeId: val.storeId }).then((response) => {
  817. if (response.code == 200) {
  818. if (response.data != undefined) {
  819. window.open(response.data);
  820. } else {
  821. this.$toast(response.msg);
  822. }
  823. }
  824. });
  825. },
  826. onMaps() {
  827. this.closeFns();
  828. // this.mapk.clearOverlays()
  829. this.getposition();
  830. },
  831. getStoreTypeList() {
  832. getStoreTypeListlp({}).then((res) => {
  833. this.storeTypeLists = res.data;
  834. this.storeTypeList = res.data;
  835. });
  836. },
  837. onsets() {
  838. this.result = [];
  839. this.resultmap = [];
  840. this.zyssl = [];
  841. this.chtczj = [];
  842. this.noVisit = [];
  843. this.noOrder = [];
  844. this.fxNoOrder = [];
  845. this.storeLabelTypes = [];
  846. this.storeCategoryList = this.result.join(',');
  847. this.chainName = '';
  848. this.chainCode = '';
  849. // this.typeName=value.dictLabel
  850. this.onSearch();
  851. },
  852. searchFn() {
  853. this.showPicker = true;
  854. this.CustomerName = '';
  855. },
  856. moreSearch() {
  857. this.onSearch();
  858. this.$refs.item.toggle();
  859. },
  860. onConfirmChainsList(value) {
  861. if (value.chainName != undefined) {
  862. this.chainName = value.chainName;
  863. this.chainCode = value.chainCode;
  864. }
  865. this.showPickerChainsList = false;
  866. this.moreTypeShow = false;
  867. },
  868. getStoreLabels() {
  869. getStoreLabels().then((res) => {
  870. this.StoreLabels = res.data;
  871. });
  872. },
  873. onConfirm(value) {
  874. this.storeCategoryList = this.result.join(',');
  875. // this.typeName=value.dictLabel
  876. this.showPicker = false;
  877. this.onSearch();
  878. },
  879. moreTypeShowFn() {
  880. this.moreTypeShow = true;
  881. // this.CustomerName=""
  882. // this.chainsData=[]
  883. this.getCustomer();
  884. },
  885. getCustomer() {
  886. var name = '';
  887. if (this.tabVal != 1) {
  888. name = 'org';
  889. } else {
  890. name = 'my';
  891. }
  892. getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
  893. this.chainsData = request.data;
  894. this.chainsData.push({});
  895. this.chainsData.pop();
  896. });
  897. },
  898. getMonth() {
  899. var currentDate = new Date();
  900. var currentMonth = currentDate.getMonth();
  901. var previousMonthDate1 = new Date();
  902. if (currentDate.getDate() == 1) {
  903. previousMonthDate1.setMonth(currentMonth - 1);
  904. } else {
  905. }
  906. var previousMonth1 = previousMonthDate1.getMonth();
  907. var previousYear1 = previousMonthDate1.getFullYear();
  908. var previousMonthDate = new Date();
  909. if (currentDate.getDate() == 1) {
  910. previousMonthDate.setMonth(currentMonth - 3);
  911. } else {
  912. previousMonthDate.setMonth(currentMonth - 2);
  913. }
  914. var previousMonth = previousMonthDate.getMonth();
  915. var previousYear = previousMonthDate.getFullYear();
  916. if (previousYear1 == previousYear) {
  917. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  918. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  919. this.timeData =
  920. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  921. } else {
  922. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  923. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  924. this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  925. }
  926. },
  927. selectMapIco() {
  928. if (this.resultmap.length > 0) {
  929. this.closeFn();
  930. this.listData = [];
  931. var listData = [];
  932. this.list.forEach((item) => {
  933. if (this.resultmap.indexOf(item.iconName) != -1) {
  934. listData.push(item);
  935. }
  936. });
  937. this.listData = listData;
  938. if (listData.length < 1) {
  939. this.$toast('暂无客户信息');
  940. }
  941. } else {
  942. this.listData = [];
  943. this.listData = this.list;
  944. }
  945. },
  946. handler({ BMap, map }) {
  947. this.mapk = map;
  948. this.mapks = BMap;
  949. },
  950. zoomFn(val, index) {
  951. this.lat1 = val.lat;
  952. this.lon1 = val.lon;
  953. if (val.level == 1) {
  954. this.zoom = 8;
  955. } else if (val.level == 2) {
  956. this.zoom = 10;
  957. } else if (val.level == 3) {
  958. this.zoom = 20;
  959. }
  960. },
  961. initialize() {
  962. this.isZoom = true;
  963. var map = new TMap.Map('container', {
  964. zoom: this.zoom,
  965. center: new TMap.LatLng(39.986785, 116.301012),
  966. });
  967. this.geocoder = new TMap.service.Geocoder();
  968. },
  969. dragend(e) {
  970. this.getMapposition(e, '2', this.$route.query.tabVal);
  971. },
  972. zoomend(e) {
  973. this.getMapposition(e, '1', this.$route.query.tabVal);
  974. },
  975. getMapposition(e, type, listType) {
  976. var that = this;
  977. var typeList = -1;
  978. var input = [e.target.re.lat, e.target.re.lng];
  979. var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
  980. var Zoom = e.target.getZoom();
  981. if (listType == 1) {
  982. typeList = 1;
  983. } else if (listType == 3) {
  984. typeList = 4;
  985. } else if (listType == 4) {
  986. typeList = 3;
  987. } else {
  988. typeList = 2;
  989. }
  990. // that.latsave=input[0]
  991. // that.lonsave=input[1]
  992. if (Zoom > 5 && this.isZoom && type != 2) {
  993. this.isZoom = false;
  994. this.range = 10000;
  995. this.getUserOutPlaList();
  996. }
  997. if (type == 2) {
  998. var lon = this.mapk.getCenter().lng;
  999. var lat = this.mapk.getCenter().lat;
  1000. var PointSum = that.twoPointSum(lat, lon, that.latsave, that.lonsave).toFixed(2);
  1001. this.lon = this.mapk.getCenter().lng;
  1002. this.lat = this.mapk.getCenter().lat;
  1003. if (PointSum > 3000) {
  1004. setTimeout(() => {
  1005. this.getUserOutPlaList();
  1006. }, 1000);
  1007. }
  1008. }
  1009. },
  1010. getStoreMapInfo(val) {
  1011. this.poINData = [];
  1012. this.list = [];
  1013. this.listData = [];
  1014. getStoreMapInfo(val).then((res) => {
  1015. if (res.code == 200) {
  1016. this.poINData = res.data;
  1017. } else {
  1018. this.$toast(res.msg);
  1019. }
  1020. });
  1021. },
  1022. touchmove() {
  1023. this.dragging = true;
  1024. },
  1025. end(e) {
  1026. this.dragging = false;
  1027. },
  1028. mpFn(row, tyle) {
  1029. if (row.iconName == 'qita') {
  1030. if (tyle == 1) {
  1031. this.checkIco = otheractive;
  1032. } else {
  1033. return this.other;
  1034. }
  1035. } else if (row.iconName == 'tcfx_A') {
  1036. if (tyle == 1) {
  1037. this.checkIco = storeAactive;
  1038. } else {
  1039. return this.storeA;
  1040. }
  1041. } else if (row.iconName == 'tcfx_B_cz') {
  1042. if (tyle == 1) {
  1043. this.checkIco = storeBCZactive;
  1044. } else {
  1045. return this.storeBCZ;
  1046. }
  1047. } else if (row.iconName == 'tcfx_B_fs') {
  1048. if (tyle == 1) {
  1049. this.checkIco = storeBFSactive;
  1050. } else {
  1051. return this.storeBFS;
  1052. }
  1053. } else if (row.iconName == 'tcfx_B_qt') {
  1054. if (tyle == 1) {
  1055. this.checkIco = storeBOtheractive;
  1056. } else {
  1057. return this.storeBOther;
  1058. }
  1059. } else if (row.iconName == 'jinpai') {
  1060. if (tyle == 1) {
  1061. this.checkIco = storeGoldactive;
  1062. } else {
  1063. return this.storeGold;
  1064. }
  1065. } else if (row.iconName == 'jinpai_ccm') {
  1066. if (tyle == 1) {
  1067. this.checkIco = storeCCMactive;
  1068. } else {
  1069. return this.storeCCM;
  1070. }
  1071. } else {
  1072. if (tyle == 1) {
  1073. this.checkIco = mpactive;
  1074. } else {
  1075. return this.mp;
  1076. }
  1077. }
  1078. },
  1079. storeDetails(val) {
  1080. this.$router.push({
  1081. path: '/storeDetail',
  1082. query: { id: val.storeId },
  1083. });
  1084. },
  1085. locationSuccess(point) {
  1086. this.lon1 = point.point.lng;
  1087. this.lat1 = point.point.lat;
  1088. this.lon = point.point.lng;
  1089. this.lat = point.point.lat;
  1090. this.zoom = 19;
  1091. this.onSearch();
  1092. },
  1093. onSearch() {
  1094. // this.getposition()
  1095. this.resultmap = [];
  1096. this.closeFns();
  1097. this.lon = this.mapk.getCenter().lng;
  1098. this.lat = this.mapk.getCenter().lat;
  1099. this.getUserOutPlaList('1');
  1100. },
  1101. getposition() {
  1102. this.resultmap = [];
  1103. let loading1 = this.$toast.loading({
  1104. duration: 0,
  1105. message: '加载中...',
  1106. forbidClick: true,
  1107. });
  1108. let url = window.location.href;
  1109. let wx = this.wx;
  1110. var that = this;
  1111. let qiyeData;
  1112. const instance = axios.create();
  1113. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1114. instance
  1115. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1116. params: {
  1117. url: url,
  1118. },
  1119. })
  1120. .then((response) => {
  1121. if (response.status == 200) {
  1122. this.cont = 3;
  1123. var flat = true;
  1124. var times = setInterval(() => {
  1125. this.cont--;
  1126. if (this.cont == '0') {
  1127. if (flat) {
  1128. loading1.clear();
  1129. clearInterval(times);
  1130. that.$dialog
  1131. .alert({
  1132. message: '定位失败,请开启企微定位权限',
  1133. })
  1134. .then(() => {});
  1135. } else {
  1136. clearInterval(times);
  1137. }
  1138. }
  1139. }, 1000);
  1140. qiyeData = response.data.data;
  1141. wx.config({
  1142. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1143. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1144. appId: qiyeData.appId, // 必填,企业微信的corpID
  1145. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1146. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1147. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1148. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1149. });
  1150. wx.ready(function () {
  1151. wx.getLocation({
  1152. type: 'gcj02',
  1153. success: function (res) {
  1154. flat = false;
  1155. loading1.clear();
  1156. var location = that.CJ02BD(res.latitude, res.longitude);
  1157. that.lat = location.lat;
  1158. that.lon = location.lon;
  1159. that.latsave = location.lat;
  1160. that.lonsave = location.lon;
  1161. that.lat1 = location.lat;
  1162. that.lon1 = location.lon;
  1163. that.latmy = location.lat;
  1164. that.lonmy = location.lon;
  1165. that.mapk.centerAndZoom(new BMap.Point(location.lon, location.lat), 18);
  1166. that.getUserOutPlaList('2');
  1167. // setTimeout(()=>{
  1168. // that.getUserOutPlaList()
  1169. // },2000)
  1170. },
  1171. });
  1172. });
  1173. }
  1174. });
  1175. },
  1176. onClickLeft1() {
  1177. this.lon1 = '0';
  1178. this.lat1 = '0';
  1179. },
  1180. checkfn(row) {
  1181. this.info = row;
  1182. this.mpFn(row, 1);
  1183. },
  1184. infoShow(row, index) {
  1185. // for(var i=0;i<this.listData.length;i++){
  1186. // this.listData[i].select=false
  1187. // }
  1188. // this.listData[index].select=true
  1189. this.mpFn(row, 1);
  1190. this.info = row;
  1191. this.listpoint = [];
  1192. this.show = false;
  1193. var name = '我的';
  1194. var title = '客户信息';
  1195. var storeCategory = row.storeCategoryName;
  1196. if (this.tabVal != 1 && this.tabVal != 4) {
  1197. name = '销售部';
  1198. }
  1199. if (this.tabVal != 3 && this.tabVal != 4) {
  1200. storeCategory = row.storeCategory;
  1201. title = '计划外';
  1202. }
  1203. buryingPoint({
  1204. systemModel: title + name,
  1205. buryingPointType: 4,
  1206. buryingPointValue: storeCategory,
  1207. buryingPointName: row.storeCode,
  1208. buryingPointPosition: '地图',
  1209. });
  1210. this.getpointList(row);
  1211. },
  1212. getpointList(val) {
  1213. var that = this;
  1214. let loading3 = this.$toast.loading({
  1215. duration: 0,
  1216. message: '加载中...',
  1217. forbidClick: true,
  1218. });
  1219. if (this.$route.query.tabVal == 1) {
  1220. getUserOutPlaList({
  1221. storeCode: val.storeCode,
  1222. type: 1,
  1223. lon: val.lon,
  1224. lat: val.lat,
  1225. range: 20,
  1226. storeName: this.storeName.trim(),
  1227. chainCode: this.chainCode,
  1228. storeLabelTypes: this.storeLabelTypes.join(','),
  1229. pageNum: this.pageNum,
  1230. storeCategoryList: this.storeCategoryList,
  1231. }).then((res) => {
  1232. if (res.code == 200) {
  1233. loading3.clear();
  1234. this.listpoint = res.rows;
  1235. this.show = true;
  1236. } else {
  1237. this.$toast(res.msg);
  1238. }
  1239. });
  1240. } else if (this.$route.query.tabVal == 3) {
  1241. storeList({
  1242. storeCode: val.storeCode,
  1243. type: 4,
  1244. lon: val.lon,
  1245. lat: val.lat,
  1246. range: 20,
  1247. storeName: this.storeName.trim(),
  1248. }).then((res) => {
  1249. if (res.code == 200) {
  1250. loading3.clear();
  1251. this.listpoint = res.rows;
  1252. this.show = true;
  1253. } else {
  1254. this.$toast(res.msg);
  1255. }
  1256. });
  1257. } else if (this.$route.query.tabVal == 4) {
  1258. storeMyList({
  1259. storeCode: val.storeCode,
  1260. type: 3,
  1261. lon: val.lon,
  1262. lat: val.lat,
  1263. range: 20,
  1264. storeName: this.storeName.trim(),
  1265. }).then((res) => {
  1266. if (res.code == 200) {
  1267. loading3.clear();
  1268. this.listpoint = res.rows;
  1269. this.show = true;
  1270. } else {
  1271. this.$toast(res.msg);
  1272. }
  1273. });
  1274. } else if (this.$route.query.tabVal == 6) {
  1275. topStore({
  1276. storeCode: val.storeCode,
  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.data.storeList;
  1289. this.show = true;
  1290. } else {
  1291. this.$toast(res.msg);
  1292. }
  1293. });
  1294. } else {
  1295. getUserOrgStoreList({
  1296. storeCode: val.storeCode,
  1297. type: 2,
  1298. lon: val.lon,
  1299. lat: val.lat,
  1300. range: 20,
  1301. storeName: this.storeName.trim(),
  1302. chainCode: this.chainCode,
  1303. storeLabelTypes: this.storeLabelTypes.join(','),
  1304. pageNum: this.pageNum,
  1305. storeCategoryList: this.storeCategoryList,
  1306. }).then((res) => {
  1307. if (res.code == 200) {
  1308. loading3.clear();
  1309. this.listpoint = res.rows;
  1310. this.show = true;
  1311. } else {
  1312. this.$toast(res.msg);
  1313. }
  1314. });
  1315. }
  1316. },
  1317. onClickLeft() {
  1318. this.$router.go(-1);
  1319. },
  1320. buryingPointFn(val) {
  1321. buryingPoint({
  1322. systemModel: '地图',
  1323. buryingPointType: 4,
  1324. buryingPointValue: val.telephone,
  1325. buryingPointName: '点击电话',
  1326. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  1327. });
  1328. },
  1329. onTownConfirm(val, zoom) {
  1330. this.range = val;
  1331. this.zoom = zoom;
  1332. this.getUserOutPlaList('1');
  1333. },
  1334. getUserOutPlaList(val) {
  1335. this.poINData = [];
  1336. var that = this;
  1337. this.list = [];
  1338. this.listData = [];
  1339. var types = '';
  1340. if (val == 1) {
  1341. types = '1';
  1342. } else {
  1343. types = '';
  1344. }
  1345. let loading3 = this.$toast.loading({
  1346. duration: 0,
  1347. message: '加载中...',
  1348. forbidClick: true,
  1349. });
  1350. if (this.$route.query.tabVal == 1) {
  1351. getUserOutPlaList({
  1352. type: 1,
  1353. lon: this.lon,
  1354. lat: this.lat,
  1355. range: this.range,
  1356. storeName: this.storeName.trim(),
  1357. chainCode: this.chainCode,
  1358. storeLabelTypes: this.storeLabelTypes.join(','),
  1359. pageNum: this.pageNum,
  1360. storeCategoryList: this.storeCategoryList,
  1361. }).then((res) => {
  1362. if (res.code == 200) {
  1363. loading3.clear();
  1364. this.listData = res.rows;
  1365. setTimeout(() => {
  1366. this.list = res.rows;
  1367. }, 2000);
  1368. // if(res.rows.length>0&&types==1){
  1369. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1370. // this.lon1="";
  1371. // this.lat1="";
  1372. // setTimeout(()=>{
  1373. // this.lon1=res.rows[0].lon;
  1374. // this.lat1=res.rows[0].lat;
  1375. // })
  1376. // }
  1377. // }
  1378. if (res.rows.length < 1) {
  1379. this.$toast('附近无客户信息');
  1380. this.show = false;
  1381. }
  1382. if (res.total > 50) {
  1383. this.msg = this.setMapRangeTitle(res.total);
  1384. this.msgshow = true;
  1385. this.show = false;
  1386. }
  1387. if (this.first < 2) {
  1388. this.zoom = 18;
  1389. this.first = 2;
  1390. }
  1391. } else {
  1392. this.$toast(res.msg);
  1393. }
  1394. });
  1395. } else if (this.$route.query.tabVal == 3) {
  1396. storeList({
  1397. type: 4,
  1398. lon: this.lon,
  1399. lat: this.lat,
  1400. range: this.range,
  1401. storeName: this.storeName.trim(),
  1402. }).then((res) => {
  1403. if (res.code == 200) {
  1404. loading3.clear();
  1405. // this.list = res.rows
  1406. this.listData = res.rows;
  1407. setTimeout(() => {
  1408. this.list = res.rows;
  1409. }, 2000);
  1410. // if(res.rows.length>0&&types==1){
  1411. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1412. // this.lon1="";
  1413. // this.lat1="";
  1414. // setTimeout(()=>{
  1415. // this.lon1=res.rows[0].lon;
  1416. // this.lat1=res.rows[0].lat;
  1417. // })
  1418. // }
  1419. // }
  1420. if (res.rows.length < 1) {
  1421. this.$toast('附近无客户信息');
  1422. this.show = false;
  1423. }
  1424. if (res.total > 50) {
  1425. this.msg = this.setMapRangeTitle(res.total);
  1426. this.msgshow = true;
  1427. this.show = false;
  1428. }
  1429. if (this.first < 2) {
  1430. this.zoom = 18;
  1431. this.first = 2;
  1432. }
  1433. } else {
  1434. this.$toast(res.msg);
  1435. }
  1436. });
  1437. } else if (this.$route.query.tabVal == 4) {
  1438. storeMyList({
  1439. type: 3,
  1440. lon: this.lon,
  1441. lat: this.lat,
  1442. range: this.range,
  1443. storeName: this.storeName.trim(),
  1444. }).then((res) => {
  1445. if (res.code == 200) {
  1446. loading3.clear();
  1447. // this.list = res.rows
  1448. this.listData = res.rows;
  1449. setTimeout(() => {
  1450. this.list = res.rows;
  1451. }, 2000);
  1452. // if(res.rows.length>0&&types==1){
  1453. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1454. // this.lon1="";
  1455. // this.lat1="";
  1456. // setTimeout(()=>{
  1457. // this.lon1=res.rows[0].lon;
  1458. // this.lat1=res.rows[0].lat;
  1459. // })
  1460. // }
  1461. // }
  1462. if (res.rows.length < 1) {
  1463. this.$toast('附近无客户信息');
  1464. this.show = false;
  1465. }
  1466. if (res.total > 50) {
  1467. this.msg = this.setMapRangeTitle(res.total);
  1468. this.msgshow = true;
  1469. this.show = false;
  1470. }
  1471. if (this.first < 2) {
  1472. this.zoom = 18;
  1473. this.first = 2;
  1474. }
  1475. } else {
  1476. this.$toast(res.msg);
  1477. }
  1478. });
  1479. } else if (this.$route.query.tabVal == 6) {
  1480. topStore({
  1481. lat: this.lat,
  1482. lon: this.lon,
  1483. range: this.range,
  1484. storeName: this.storeName.trim(),
  1485. chainCode: this.chainCode,
  1486. storeLabelTypes: this.storeLabelTypes.join(','),
  1487. pageNum: this.pageNum,
  1488. storeCategoryList: this.storeCategoryList,
  1489. }).then((res) => {
  1490. if (res.code == 200) {
  1491. loading3.clear();
  1492. this.listData = res.data.storeList;
  1493. setTimeout(() => {
  1494. this.list = res.data.storeList;
  1495. }, 2000);
  1496. // if(res.data.storeList.length>0&&types==1){
  1497. // if(res.data.storeList[0].lon!=null&&res.data.storeList[0].lon!=""&&res.data.storeList[0].lon!=undefined){
  1498. // this.lon1=res.data.storeList[0].lon
  1499. // this.lat1=res.data.storeList[0].lat
  1500. // }
  1501. // }
  1502. if (res.data.storeList.length < 1) {
  1503. this.$toast('附近无客户信息');
  1504. this.show = false;
  1505. }
  1506. if (this.first < 2) {
  1507. this.zoom = 18;
  1508. this.first = 2;
  1509. }
  1510. } else {
  1511. this.$toast(res.msg);
  1512. }
  1513. });
  1514. } else {
  1515. getUserOrgStoreList({
  1516. type: 2,
  1517. lon: this.lon,
  1518. lat: this.lat,
  1519. range: this.range,
  1520. storeName: this.storeName.trim(),
  1521. chainCode: this.chainCode,
  1522. storeLabelTypes: this.storeLabelTypes.join(','),
  1523. pageNum: this.pageNum,
  1524. storeCategoryList: this.storeCategoryList,
  1525. }).then((res) => {
  1526. if (res.code == 200) {
  1527. loading3.clear();
  1528. // this.list = res.rows
  1529. this.listData = res.rows;
  1530. setTimeout(() => {
  1531. this.list = res.rows;
  1532. }, 2000);
  1533. // if(res.rows.length>0&&types==1){
  1534. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1535. // this.lon1="";
  1536. // this.lat1="";
  1537. // setTimeout(()=>{
  1538. // this.lon1=res.rows[0].lon;
  1539. // this.lat1=res.rows[0].lat;
  1540. // })
  1541. // }
  1542. // }
  1543. if (res.rows.length < 1) {
  1544. this.$toast('附近无客户信息');
  1545. this.show = false;
  1546. }
  1547. if (res.total > 50) {
  1548. this.msg = this.setMapRangeTitle(res.total);
  1549. this.msgshow = true;
  1550. this.show = false;
  1551. }
  1552. if (this.first < 2) {
  1553. this.zoom = 18;
  1554. this.first = 2;
  1555. }
  1556. } else {
  1557. this.$toast(res.msg);
  1558. }
  1559. });
  1560. }
  1561. },
  1562. storeVisit(val) {
  1563. // localStorage.setItem("tabVal",this.tabVal)
  1564. localStorage.removeItem('visitId');
  1565. var rdId = val.rdId;
  1566. var that = this;
  1567. if (this.$route.query.tabVal != 3 || this.$route.query.tabVal != 4) {
  1568. rdId = null;
  1569. }
  1570. checkVisit({ storeId: val.storeId }).then((res) => {
  1571. buryingPoint({
  1572. systemModel: val.storeCategory,
  1573. buryingPointType: 5,
  1574. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1575. buryingPointName: '进店拜访',
  1576. buryingPointPosition: '地图客户信息',
  1577. });
  1578. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1579. if (localStorage.getItem('loginType') == 'cs') {
  1580. var lat = '';
  1581. var lon = '';
  1582. if (val.lat == '' || val.lat == null) {
  1583. lat = '31.2517820000';
  1584. lon = '120.5593090000';
  1585. } else {
  1586. lat = val.lat;
  1587. lon = val.lon;
  1588. }
  1589. this.$router.push({
  1590. path: '/suishenbangOutstoreVisit',
  1591. query: {
  1592. storeId: val.storeId,
  1593. rdId: val.rdId,
  1594. lat: lat,
  1595. lon: lon,
  1596. visitId: val.visitId,
  1597. pageType: 'out',
  1598. addressLine: val.addressLine,
  1599. storeCategory: val.storeCategory,
  1600. storeName: val.storeName,
  1601. hisTime: val.hisTime,
  1602. contactName: val.contactName,
  1603. storeCode: val.storeCode,
  1604. tabVal: that.$route.query.tabVal,
  1605. visitModel: '1',
  1606. latNew: '31.2517820000',
  1607. lonNew: '120.5593090000',
  1608. PointSum: 0,
  1609. marklat: lat,
  1610. marklon: lon,
  1611. linkType: that.$route.query.tabVal,
  1612. from: 'outPlan',
  1613. },
  1614. });
  1615. localStorage.setItem('startTime', new Date());
  1616. localStorage.setItem('ORGName', val.deptName);
  1617. localStorage.setItem('chainNameR', val.storeName);
  1618. } else {
  1619. if (this.flag) {
  1620. this.flag = false;
  1621. this.timer = null;
  1622. let that = this;
  1623. this.timer = setTimeout(() => {
  1624. this.flag = true;
  1625. }, 2000);
  1626. if (val.stateString.indexOf('拜访中') != -1) {
  1627. localStorage.setItem('startTime', new Date());
  1628. localStorage.setItem('ORGName', val.deptName);
  1629. localStorage.setItem('chainNameR', val.storeName);
  1630. that.$router.push({
  1631. path: '/suishenbangOutstoreVisit',
  1632. query: {
  1633. storeId: val.storeId,
  1634. rdId: rdId,
  1635. lat: val.lat,
  1636. lon: val.lon,
  1637. visitId: val.visitId,
  1638. pageType: 'out',
  1639. addressLine: val.addressLine,
  1640. storeCategory: val.storeCategory,
  1641. storeName: val.storeName,
  1642. hisTime: val.hisTime,
  1643. contactName: val.contactName,
  1644. storeCode: val.storeCode,
  1645. tabVal: that.$route.query.tabVal,
  1646. visitModel: '1',
  1647. latNew: val.lat,
  1648. lonNew: val.lon,
  1649. PointSum: '0',
  1650. marklat: val.lat,
  1651. marklon: val.lon,
  1652. linkType: that.$route.query.tabVal,
  1653. from: 'outPlan',
  1654. },
  1655. });
  1656. } else {
  1657. let loading1 = this.$toast.loading({
  1658. duration: 0,
  1659. message: '加载中...',
  1660. forbidClick: true,
  1661. });
  1662. let url = window.location.href;
  1663. let wx = this.wx;
  1664. let qiyeData;
  1665. const instance = axios.create();
  1666. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1667. instance
  1668. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1669. params: {
  1670. url: url,
  1671. },
  1672. })
  1673. .then((response) => {
  1674. if (response.status == 200) {
  1675. this.cont = 3;
  1676. var flat = true;
  1677. var times = setInterval(() => {
  1678. this.cont--;
  1679. if (this.cont == '0') {
  1680. if (flat) {
  1681. loading1.clear();
  1682. clearInterval(times);
  1683. that.$dialog
  1684. .alert({
  1685. message: '定位失败,请开启企微定位权限',
  1686. })
  1687. .then(() => {});
  1688. } else {
  1689. clearInterval(times);
  1690. }
  1691. }
  1692. }, 1000);
  1693. qiyeData = response.data.data;
  1694. wx.config({
  1695. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1696. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1697. appId: qiyeData.appId, // 必填,企业微信的corpID
  1698. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1699. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1700. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1701. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1702. });
  1703. wx.ready(() => {
  1704. wx.getLocation({
  1705. type: 'gcj02',
  1706. success: (res) => {
  1707. flat = false;
  1708. var location = that.CJ02BD(res.latitude, res.longitude);
  1709. checkStoreAddressByStoreCode({
  1710. storeCode: val.storeCode,
  1711. lon: location.lon,
  1712. lat: location.lat,
  1713. }).then((response) => {
  1714. loading1.clear();
  1715. if (val.lat == '' || val.lat == null) {
  1716. that.lat = location.lat;
  1717. that.lon = location.lon;
  1718. } else {
  1719. that.lat = val.lat;
  1720. that.lon = val.lon;
  1721. }
  1722. let PointSum = that
  1723. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1724. .toFixed(2);
  1725. let PointSumval = that
  1726. .twoPointSum(location.lat, location.lon, location.lat, location.lon)
  1727. .toFixed(2);
  1728. // GZ:工装店铺 直接进入拜访
  1729. if (localStorage.getItem('postType') == 'GZ') {
  1730. localStorage.setItem('startTime', new Date());
  1731. localStorage.setItem('ORGName', val.deptName);
  1732. localStorage.setItem('chainNameR', val.storeName);
  1733. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1734. return;
  1735. }
  1736. // 门店编码校验门店地址不通过
  1737. if (response.code != 200) {
  1738. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1739. if (response.data.updateAddress == 0) {
  1740. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1741. this.$dialog
  1742. .confirm({
  1743. confirmButtonText: '确定拜访',
  1744. cancelButtonText: '取消拜访',
  1745. title: '系统提示',
  1746. message:
  1747. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1748. closeOnClickOverlay: true,
  1749. })
  1750. .then(() => {
  1751. this.toSuishenbangOutstoreVisit(
  1752. res,
  1753. val,
  1754. location,
  1755. PointSumval
  1756. );
  1757. });
  1758. } else if (response.data.updateAddress == 1) {
  1759. // 同城AB+金牌,去修改地址
  1760. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1761. if (!response.data.addressUpdateTimesOver) {
  1762. this.$dialog
  1763. .confirm({
  1764. title: '系统提示',
  1765. message: response.msg + '请立即修改后再拜访',
  1766. messageAlign: 'left',
  1767. confirmButtonText: '立即修改',
  1768. cancelButtonText: '取消',
  1769. })
  1770. .then(() => {
  1771. this.$router.push({
  1772. path: '/storeDetail',
  1773. query: {
  1774. id: val.storeId,
  1775. type: 'address',
  1776. storeAddressId: val.storeAddressId,
  1777. },
  1778. });
  1779. });
  1780. } else {
  1781. this.$dialog.confirm({
  1782. title: '系统提示',
  1783. message: '已经达到最大修改次数',
  1784. messageAlign: 'left',
  1785. confirmButtonText: '确定',
  1786. });
  1787. }
  1788. } else if (response.data.updateAddress == 2) {
  1789. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1790. this.resetCoord(res, val, location, PointSumval);
  1791. return;
  1792. }
  1793. } else {
  1794. // 门店编码校验门店地址通过 进入拜访
  1795. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1796. }
  1797. });
  1798. },
  1799. fail: function () {
  1800. loading1.clear();
  1801. that.$dialog.alert({
  1802. message: 'GPS未开启',
  1803. });
  1804. },
  1805. });
  1806. });
  1807. wx.error(function (res) {
  1808. loading1.clear();
  1809. that.$dialog
  1810. .alert({
  1811. message: '定位失败,请开启企微定位权限',
  1812. })
  1813. .then(() => {});
  1814. });
  1815. }
  1816. });
  1817. }
  1818. }
  1819. }
  1820. }
  1821. });
  1822. },
  1823. // 重置经纬度
  1824. resetCoord(res, val, location, PointSumval) {
  1825. this.$dialog
  1826. .confirm({
  1827. confirmButtonText: '初始化定位',
  1828. cancelButtonText: '取消拜访',
  1829. title: '系统提示',
  1830. message: '偏差过大,不允许拜访。可修改本店定位.',
  1831. closeOnClickOverlay: true,
  1832. })
  1833. .then(() => {
  1834. mobileReposition({
  1835. storeId: val.storeId,
  1836. lat: location.lat,
  1837. lon: location.lon,
  1838. }).then((response) => {
  1839. if (response.code == 200) {
  1840. this.$dialog
  1841. .alert({
  1842. title: '系统提示',
  1843. message: '本信息定位已更新成功!',
  1844. })
  1845. .then(() => {
  1846. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1847. });
  1848. localStorage.setItem('startTime', new Date());
  1849. localStorage.setItem('ORGName', val.deptName);
  1850. localStorage.setItem('chainNameR', val.storeName);
  1851. } else {
  1852. this.$toast(response.msg);
  1853. }
  1854. });
  1855. });
  1856. },
  1857. // 进入拜访 router.push
  1858. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1859. addVisitsPosition({
  1860. storeId: val.storeId,
  1861. visitsId: '',
  1862. lon: res.longitude,
  1863. lat: res.latitude,
  1864. sourceLon: location.lon,
  1865. sourceLat: location.lat,
  1866. positionDesc: '',
  1867. accuracy: res.accuracy,
  1868. });
  1869. this.$router.push({
  1870. path: '/suishenbangOutstoreVisit',
  1871. query: {
  1872. storeId: val.storeId,
  1873. rdId: val.rdId,
  1874. lat: location.lat,
  1875. lon: location.lon,
  1876. visitId: val.visitId,
  1877. pageType: 'out',
  1878. addressLine: val.addressLine,
  1879. storeCategory: val.storeCategory,
  1880. storeName: val.storeName,
  1881. hisTime: val.hisTime,
  1882. contactName: val.contactName,
  1883. storeCode: val.storeCode,
  1884. tabVal: this.$route.query.tabVal,
  1885. visitModel: '1',
  1886. latNew: location.lat,
  1887. lonNew: location.lon,
  1888. PointSum: PointSumval,
  1889. marklat: res.latitude,
  1890. marklon: res.longitude,
  1891. linkType: this.$route.query.tabVal,
  1892. from: 'outPlan',
  1893. },
  1894. });
  1895. },
  1896. linkapp(val) {
  1897. var poind = this.gcj02BD(val.lat, val.lon);
  1898. let url = window.location.href;
  1899. let that = this;
  1900. let wx = this.wx;
  1901. let qiyeData;
  1902. const instance = axios.create();
  1903. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1904. instance
  1905. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1906. params: {
  1907. url: url,
  1908. agent: 1,
  1909. },
  1910. })
  1911. .then((response) => {
  1912. if (response.status == 200) {
  1913. qiyeData = response.data.data;
  1914. // wx.config({
  1915. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1916. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1917. // appId: qiyeData.appId, // 必填,企业微信的corpID
  1918. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1919. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1920. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1921. // jsApiList: ["ready", "invoke"]
  1922. // });
  1923. // wx.ready(function() {
  1924. // wx.checkJsApi({
  1925. // jsApiList: ["agentConfig", "launchMiniprogram"], // 需要检测的JS接口列表
  1926. // success: function(res) {}})})
  1927. wx.agentConfig({
  1928. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  1929. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  1930. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1931. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1932. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  1933. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  1934. success: function (res) {
  1935. wx.invoke(
  1936. 'launchMiniprogram',
  1937. {
  1938. appid: 'wx238bbb5f6d958414',
  1939. path:
  1940. 'pages/relayStation/relayStation?latitude=' +
  1941. poind.lat +
  1942. '&longitude=' +
  1943. poind.lon +
  1944. '&name=' +
  1945. val.addressLine,
  1946. },
  1947. function (res) {
  1948. if (res.err_msg == 'launchMiniprogram:ok') {
  1949. } else {
  1950. }
  1951. }
  1952. );
  1953. },
  1954. fail: function (res) {
  1955. if (res.errMsg.indexOf('function not exist') > -1) {
  1956. alert('版本过低请升级');
  1957. }
  1958. },
  1959. });
  1960. }
  1961. });
  1962. },
  1963. },
  1964. };
  1965. </script>
  1966. <style scoped>
  1967. .map {
  1968. width: 100%;
  1969. height: 79.3vh;
  1970. margin-top: 180px;
  1971. }
  1972. .text {
  1973. font-size: 14px;
  1974. color: #909090;
  1975. margin: 6px 0;
  1976. }
  1977. #container {
  1978. width: 20px;
  1979. height: 20px;
  1980. position: fixed;
  1981. left: -888px;
  1982. }
  1983. .mapimg {
  1984. position: fixed;
  1985. bottom: 235px;
  1986. right: 2px;
  1987. width: 38px;
  1988. }
  1989. .mapStoreList {
  1990. position: fixed;
  1991. width: 96%;
  1992. bottom: 10px;
  1993. background-color: white;
  1994. border-radius: 6px;
  1995. padding: 10px 0 14px;
  1996. overflow: hidden;
  1997. margin: 0 2%;
  1998. max-height: 330px;
  1999. }
  2000. .maplit {
  2001. width: 100%;
  2002. margin-top: -10px;
  2003. overflow-y: auto;
  2004. border-top: 1px solid #eeeeee;
  2005. padding: 0 14px;
  2006. }
  2007. .maplitactive {
  2008. height: 270px;
  2009. }
  2010. .maplistitem {
  2011. padding-bottom: 14px;
  2012. border-bottom: 1px solid #eeeeee;
  2013. }
  2014. .maplistitem:last-child {
  2015. border: 0;
  2016. }
  2017. .tipsTitle {
  2018. padding: 5px 0;
  2019. text-align: center;
  2020. font-size: 16px;
  2021. font-weight: 600;
  2022. }
  2023. </style>
  2024. <style>
  2025. .icoImgMAP {
  2026. background-color: #fff;
  2027. text-align: center;
  2028. padding: 0 2px;
  2029. }
  2030. .icoImgMAP .van-grid-item__icon {
  2031. font-size: 40px;
  2032. margin: 0 auto;
  2033. }
  2034. .icoImgMAP .van-grid-item__content {
  2035. font-size: 10px;
  2036. margin: 0;
  2037. padding: 0;
  2038. color: #666;
  2039. justify-content: normal;
  2040. }
  2041. .icoImgMAP .van-grid-item__content:after {
  2042. border: 0;
  2043. }
  2044. .icoImgMAP .van-grid-item__text {
  2045. font-size: 14px;
  2046. width: 48px;
  2047. }
  2048. .icoImgMAP .titleico {
  2049. margin-top: 8px;
  2050. }
  2051. .icoImgMAP .titleico p {
  2052. font-size: 14px;
  2053. margin: 0;
  2054. }
  2055. .icoImgMAP .titleico .p {
  2056. margin-top: -4px;
  2057. }
  2058. .textc .van-grid-item__content,
  2059. .textc .van-grid-item__text {
  2060. color: red;
  2061. }
  2062. .visitStoreIco {
  2063. float: left;
  2064. float: left;
  2065. width: 26px;
  2066. text-align: center;
  2067. background-color: #ffba13;
  2068. color: #fff;
  2069. border-radius: 100%;
  2070. margin-left: 14px;
  2071. line-height: 26px;
  2072. height: 26px;
  2073. }
  2074. </style>
  2075. <style>
  2076. .van-tabs__nav--card .van-tab.van-tab--active {
  2077. background-color: #0057ba !important;
  2078. }
  2079. .visitSearch {
  2080. width: 68px;
  2081. color: #0057ba;
  2082. font-size: 14px;
  2083. }
  2084. .visitSearch .van-dropdown-menu__bar {
  2085. box-shadow: 0 0 0 #fff;
  2086. height: 52px;
  2087. }
  2088. .visitSearch .van-dropdown-menu__item {
  2089. justify-content: normal;
  2090. }
  2091. .visitSearch .van-dropdown-menu__title {
  2092. border-left: 1px solid #ccc;
  2093. }
  2094. .visitSearch .van-cell {
  2095. border: 1px solid #ccc;
  2096. border-radius: 5px;
  2097. padding: 6px;
  2098. }
  2099. .positionContent {
  2100. position: fixed;
  2101. color: #666;
  2102. display: inline-block;
  2103. box-shadow: 0px 2px 7px -5px #000;
  2104. border-radius: 100px;
  2105. overflow: hidden;
  2106. right: 14px;
  2107. cursor: pointer;
  2108. bottom: 96px;
  2109. background-color: white;
  2110. }
  2111. .positionContent .img {
  2112. border-radius: 100px;
  2113. float: left;
  2114. }
  2115. .positionContent .img .van-icon__image {
  2116. border-radius: 100px;
  2117. }
  2118. .zDialog .van-dialog__header {
  2119. padding: 10px;
  2120. border-bottom: 1px solid #f5f5f5;
  2121. }
  2122. .zDialog .infoText {
  2123. margin: 10px;
  2124. font-size: 14px;
  2125. color: #909090;
  2126. width: 98%;
  2127. }
  2128. .visitStoreIco {
  2129. float: right;
  2130. width: 26px;
  2131. text-align: center;
  2132. background-color: #ffba13;
  2133. color: #fff;
  2134. border-radius: 100%;
  2135. margin-left: 10px;
  2136. line-height: 26px;
  2137. height: 26px;
  2138. }
  2139. .searchcheck {
  2140. padding: 0 10px 10px;
  2141. }
  2142. .searchcheck .van-checkbox {
  2143. /*width: 44%;*/
  2144. padding-bottom: 10px;
  2145. }
  2146. .searchcheck .checkbox {
  2147. font-size: 14px;
  2148. display: inline-block;
  2149. width: 50%;
  2150. line-height: 28px;
  2151. }
  2152. .searchcheck .checkbox .van-checkbox {
  2153. margin-bottom: 2px;
  2154. }
  2155. .searchcheck .checkbox1 {
  2156. font-size: 14px;
  2157. float: left;
  2158. line-height: 28px;
  2159. width: 50%;
  2160. }
  2161. .searchcheck .checkbox1 .child {
  2162. width: 100%;
  2163. }
  2164. .searchcheck {
  2165. height: 93vh;
  2166. overflow-y: auto;
  2167. }
  2168. .searchchecktitle {
  2169. width: 100%;
  2170. margin: 20px 0;
  2171. font-size: 16px;
  2172. border-left: 3px solid #0057ba;
  2173. line-height: 18px;
  2174. }
  2175. .searchchecktitle1 {
  2176. width: 100%;
  2177. margin: 20px 0;
  2178. font-size: 16px;
  2179. line-height: 18px;
  2180. }
  2181. .textsize {
  2182. font-size: 14px;
  2183. }
  2184. </style>