rangeStore.vue 81 KB

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