rangeStore.vue 79 KB

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