rangeStore.vue 84 KB

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