rangeStore.vue 83 KB

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