rangeStore.vue 77 KB

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