rangeStore.vue 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328
  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. };
  800. },
  801. created() {
  802. this.heifhgts = window.innerHeight - 190 + 'px';
  803. // 好邦手接入拜访系统地图功能
  804. // 获取url参数 userId
  805. let userId = this.$route.query.userId || '';
  806. console.log(this.$route);
  807. console.log(window.location.href);
  808. if (userId) {
  809. localStorage.setItem('loginName', userId);
  810. }
  811. },
  812. activated() {
  813. this.closeFn();
  814. // 获取地图范围 字典
  815. this.getMapRange();
  816. this.resultmap = [];
  817. this.tabVal = this.$route.query.tabVal;
  818. this.customerVisits = localStorage.getItem('customerVisits');
  819. this.initialize();
  820. this.range = 10000;
  821. this.zoom = 20;
  822. this.first = 1;
  823. this.msg = '';
  824. this.msgshow = false;
  825. this.storeName = localStorage.getItem('outvstoreName');
  826. this.chainName = localStorage.getItem('outvchainName');
  827. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  828. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  829. } else {
  830. this.storeLabelTypes = [];
  831. }
  832. if (localStorage.getItem('outvstoreCategoryList') != null) {
  833. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  834. this.storeCategoryList = localStorage.getItem('outvstoreCategoryList');
  835. } else {
  836. this.result = [];
  837. }
  838. this.chainCode = localStorage.getItem('outvchainCode');
  839. this.storeName = localStorage.getItem('outvstoreName');
  840. this.getMonth();
  841. this.getStoreTypeList();
  842. this.getStoreLabels();
  843. this.$nextTick(() => {
  844. // this.onClickLeft1();
  845. this.getposition();
  846. });
  847. },
  848. methods: {
  849. setStroeNameStyle(item) {
  850. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  851. if (
  852. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  853. item.approvalStatus == null ||
  854. item.approvalStatus == 0
  855. ) {
  856. return {};
  857. } else {
  858. return { color: '#0057ba', 'text-decoration': 'underline' };
  859. }
  860. },
  861. async getMapRange() {
  862. let mapRangeOption = await getDictOption({}, 'out_plan_map_range');
  863. this.mapRange = mapRangeOption.data || [];
  864. // dictValue
  865. },
  866. // 设置地图获取范围提示文字
  867. setMapRangeTitle(total) {
  868. let leftRange = this.mapRange[0] ? (this.mapRange[0].dictValue / 1000).toFixed(1) : '10';
  869. let rightRange = this.mapRange[1] ? (this.mapRange[1].dictValue / 1000).toFixed(1) : '5';
  870. let msg =
  871. '当前区域' +
  872. leftRange +
  873. '公里内共' +
  874. total +
  875. '家门店,展示附近' +
  876. rightRange +
  877. '公里的门店';
  878. console.log(msg);
  879. return msg;
  880. },
  881. closeFn() {
  882. this.show = false;
  883. // this.info.lon=0
  884. // this.info.lat=0
  885. },
  886. closeFns() {
  887. this.show = false;
  888. this.info.lon = 0;
  889. this.info.lat = 0;
  890. },
  891. linkList(val) {
  892. this.$router.push({
  893. path: '/pItem',
  894. query: { id: val.storeCode, detilId: 'a' },
  895. });
  896. },
  897. linkimg(val) {
  898. ProductItemImge({ storeId: val.storeId }).then((response) => {
  899. if (response.code == 200) {
  900. if (response.data != undefined) {
  901. window.open(response.data);
  902. } else {
  903. this.$toast(response.msg);
  904. }
  905. }
  906. });
  907. },
  908. onMaps() {
  909. this.closeFns();
  910. // this.mapk.clearOverlays()
  911. this.getposition();
  912. },
  913. getStoreTypeList() {
  914. getStoreTypeListlp({}).then((res) => {
  915. this.storeTypeLists = res.data;
  916. this.storeTypeList = res.data;
  917. });
  918. },
  919. onsets() {
  920. this.result = [];
  921. this.resultmap = [];
  922. this.zyssl = [];
  923. this.chtczj = [];
  924. this.noVisit = [];
  925. this.noOrder = [];
  926. this.fxNoOrder = [];
  927. this.storeLabelTypes = [];
  928. this.storeCategoryList = this.result.join(',');
  929. this.chainName = '';
  930. this.chainCode = '';
  931. // this.typeName=value.dictLabel
  932. this.onSearch();
  933. },
  934. searchFn() {
  935. this.showPicker = true;
  936. this.CustomerName = '';
  937. },
  938. moreSearch() {
  939. this.onSearch();
  940. this.$refs.item.toggle();
  941. },
  942. onConfirmChainsList(value) {
  943. if (value.chainName != undefined) {
  944. this.chainName = value.chainName;
  945. this.chainCode = value.chainCode;
  946. }
  947. this.showPickerChainsList = false;
  948. this.moreTypeShow = false;
  949. },
  950. getStoreLabels() {
  951. getStoreLabels().then((res) => {
  952. this.StoreLabels = res.data;
  953. });
  954. },
  955. onConfirm(value) {
  956. this.storeCategoryList = this.result.join(',');
  957. // this.typeName=value.dictLabel
  958. this.showPicker = false;
  959. this.onSearch();
  960. },
  961. moreTypeShowFn() {
  962. this.moreTypeShow = true;
  963. // this.CustomerName=""
  964. // this.chainsData=[]
  965. this.getCustomer();
  966. },
  967. getCustomer() {
  968. var name = '';
  969. if (this.tabVal != 1) {
  970. name = 'org';
  971. } else {
  972. name = 'my';
  973. }
  974. getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
  975. this.chainsData = request.data;
  976. this.chainsData.push({});
  977. this.chainsData.pop();
  978. });
  979. },
  980. getMonth() {
  981. var currentDate = new Date();
  982. var currentMonth = currentDate.getMonth();
  983. var previousMonthDate1 = new Date();
  984. if (currentDate.getDate() == 1) {
  985. previousMonthDate1.setMonth(currentMonth - 1);
  986. } else {
  987. }
  988. var previousMonth1 = previousMonthDate1.getMonth();
  989. var previousYear1 = previousMonthDate1.getFullYear();
  990. var previousMonthDate = new Date();
  991. if (currentDate.getDate() == 1) {
  992. previousMonthDate.setMonth(currentMonth - 3);
  993. } else {
  994. previousMonthDate.setMonth(currentMonth - 2);
  995. }
  996. var previousMonth = previousMonthDate.getMonth();
  997. var previousYear = previousMonthDate.getFullYear();
  998. if (previousYear1 == previousYear) {
  999. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  1000. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  1001. this.timeData =
  1002. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  1003. } else {
  1004. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  1005. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  1006. this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  1007. }
  1008. },
  1009. selectMapIco() {
  1010. if (this.resultmap.length > 0) {
  1011. this.closeFn();
  1012. this.listData = [];
  1013. var listData = [];
  1014. this.list.forEach((item) => {
  1015. if (this.resultmap.indexOf(item.iconName) != -1) {
  1016. listData.push(item);
  1017. }
  1018. });
  1019. this.listData = listData;
  1020. if (listData.length < 1) {
  1021. this.$toast('暂无客户信息');
  1022. }
  1023. } else {
  1024. this.listData = [];
  1025. this.listData = this.list;
  1026. }
  1027. },
  1028. handler({ BMap, map }) {
  1029. this.mapk = map;
  1030. this.mapks = BMap;
  1031. },
  1032. zoomFn(val, index) {
  1033. this.lat1 = val.lat;
  1034. this.lon1 = val.lon;
  1035. if (val.level == 1) {
  1036. this.zoom = 8;
  1037. } else if (val.level == 2) {
  1038. this.zoom = 10;
  1039. } else if (val.level == 3) {
  1040. this.zoom = 20;
  1041. }
  1042. },
  1043. initialize() {
  1044. this.isZoom = true;
  1045. var map = new TMap.Map('container', {
  1046. zoom: this.zoom,
  1047. center: new TMap.LatLng(39.986785, 116.301012),
  1048. });
  1049. this.geocoder = new TMap.service.Geocoder();
  1050. },
  1051. dragend(e) {
  1052. this.getMapposition(e, '2', this.$route.query.tabVal);
  1053. },
  1054. zoomend(e) {
  1055. this.getMapposition(e, '1', this.$route.query.tabVal);
  1056. },
  1057. getMapposition(e, type, listType) {
  1058. var that = this;
  1059. var typeList = -1;
  1060. var input = [e.target.re.lat, e.target.re.lng];
  1061. var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
  1062. var Zoom = e.target.getZoom();
  1063. if (listType == 1) {
  1064. typeList = 1;
  1065. } else if (listType == 3) {
  1066. typeList = 4;
  1067. } else if (listType == 4) {
  1068. typeList = 3;
  1069. } else {
  1070. typeList = 2;
  1071. }
  1072. // that.latsave=input[0]
  1073. // that.lonsave=input[1]
  1074. if (Zoom > 5 && this.isZoom && type != 2) {
  1075. this.isZoom = false;
  1076. this.range = 10000;
  1077. this.getUserOutPlaList();
  1078. }
  1079. if (type == 2) {
  1080. var lon = this.mapk.getCenter().lng;
  1081. var lat = this.mapk.getCenter().lat;
  1082. var PointSum = that.twoPointSum(lat, lon, that.latsave, that.lonsave).toFixed(2);
  1083. this.lon = this.mapk.getCenter().lng;
  1084. this.lat = this.mapk.getCenter().lat;
  1085. if (PointSum > 3000) {
  1086. setTimeout(() => {
  1087. this.getUserOutPlaList();
  1088. }, 1000);
  1089. }
  1090. }
  1091. },
  1092. getStoreMapInfo(val) {
  1093. this.poINData = [];
  1094. this.list = [];
  1095. this.listData = [];
  1096. getStoreMapInfo(val).then((res) => {
  1097. if (res.code == 200) {
  1098. this.poINData = res.data;
  1099. } else {
  1100. this.$toast(res.msg);
  1101. }
  1102. });
  1103. },
  1104. touchmove() {
  1105. this.dragging = true;
  1106. },
  1107. end(e) {
  1108. this.dragging = false;
  1109. },
  1110. mpFn(row, tyle) {
  1111. if (row.iconName == 'qita') {
  1112. // 非金牌-其他
  1113. if (tyle == 1) {
  1114. this.checkIco = otheractive;
  1115. } else {
  1116. return this.other;
  1117. }
  1118. } else if (row.iconName == 'tcfx_tl') {
  1119. // 非金牌-涂料店
  1120. if (tyle == 1) {
  1121. this.checkIco = storeAactive;
  1122. } else {
  1123. return this.storeA;
  1124. }
  1125. } else if (row.iconName == 'tcfx_cw') {
  1126. // 非金牌-厨卫
  1127. if (tyle == 1) {
  1128. this.checkIco = storeBCZactive;
  1129. } else {
  1130. return this.storeBCZ;
  1131. }
  1132. } else if (row.iconName == 'tcfx_B_fs') {
  1133. // 同城分销-瓷砖店
  1134. if (tyle == 1) {
  1135. this.checkIco = storeBFSactive;
  1136. } else {
  1137. return this.storeBFS;
  1138. }
  1139. } else if (row.iconName == 'tcfx_B_qt') {
  1140. // 同城分销-黄沙-水泥
  1141. if (tyle == 1) {
  1142. this.checkIco = storeBOtheractive;
  1143. } else {
  1144. return this.storeBOther;
  1145. }
  1146. } else if (row.iconName == 'jinpai') {
  1147. // 无布机-金牌店
  1148. if (tyle == 1) {
  1149. this.checkIco = storeGoldactive;
  1150. } else {
  1151. return this.storeGold;
  1152. }
  1153. } else if (row.iconName == 'jinpai_ccm') {
  1154. if (tyle == 1) {
  1155. this.checkIco = storeCCMactive;
  1156. } else {
  1157. return this.storeCCM;
  1158. }
  1159. } else {
  1160. if (tyle == 1) {
  1161. this.checkIco = mpactive;
  1162. } else {
  1163. return this.mp;
  1164. }
  1165. }
  1166. },
  1167. storeDetails(val) {
  1168. this.$router.push({
  1169. path: '/storeDetail',
  1170. query: { id: val.storeId },
  1171. });
  1172. },
  1173. locationSuccess(point) {
  1174. this.lon1 = point.point.lng;
  1175. this.lat1 = point.point.lat;
  1176. this.lon = point.point.lng;
  1177. this.lat = point.point.lat;
  1178. this.zoom = 19;
  1179. this.onSearch();
  1180. },
  1181. onSearch() {
  1182. // this.getposition()
  1183. this.resultmap = [];
  1184. this.closeFns();
  1185. this.lon = this.mapk.getCenter().lng;
  1186. this.lat = this.mapk.getCenter().lat;
  1187. this.getUserOutPlaList('1');
  1188. },
  1189. getposition() {
  1190. this.resultmap = [];
  1191. let loading1 = this.$toast.loading({
  1192. duration: 0,
  1193. message: '加载中...',
  1194. forbidClick: true,
  1195. });
  1196. let url = window.location.href;
  1197. let wx = this.wx;
  1198. var that = this;
  1199. let qiyeData;
  1200. const instance = axios.create();
  1201. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1202. instance
  1203. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1204. params: {
  1205. url: url,
  1206. },
  1207. })
  1208. .then((response) => {
  1209. if (response.status == 200) {
  1210. this.cont = 3;
  1211. var flat = true;
  1212. var times = setInterval(() => {
  1213. this.cont--;
  1214. if (this.cont == '0') {
  1215. if (flat) {
  1216. loading1.clear();
  1217. clearInterval(times);
  1218. that.$dialog
  1219. .alert({
  1220. message: '定位失败,请开启企微定位权限',
  1221. })
  1222. .then(() => {});
  1223. } else {
  1224. clearInterval(times);
  1225. }
  1226. }
  1227. }, 1000);
  1228. qiyeData = response.data.data;
  1229. wx.config({
  1230. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1231. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1232. appId: qiyeData.appId, // 必填,企业微信的corpID
  1233. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1234. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1235. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1236. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1237. });
  1238. wx.ready(function () {
  1239. wx.getLocation({
  1240. type: 'gcj02',
  1241. success: function (res) {
  1242. flat = false;
  1243. loading1.clear();
  1244. var location = that.CJ02BD(res.latitude, res.longitude);
  1245. that.lat = location.lat;
  1246. that.lon = location.lon;
  1247. that.latsave = location.lat;
  1248. that.lonsave = location.lon;
  1249. that.lat1 = location.lat;
  1250. that.lon1 = location.lon;
  1251. that.latmy = location.lat;
  1252. that.lonmy = location.lon;
  1253. that.mapk.centerAndZoom(new BMap.Point(location.lon, location.lat), 18);
  1254. that.getUserOutPlaList('2');
  1255. // setTimeout(()=>{
  1256. // that.getUserOutPlaList()
  1257. // },2000)
  1258. },
  1259. });
  1260. });
  1261. }
  1262. });
  1263. },
  1264. onClickLeft1() {
  1265. this.lon1 = '0';
  1266. this.lat1 = '0';
  1267. },
  1268. checkfn(row) {
  1269. this.info = row;
  1270. this.mpFn(row, 1);
  1271. },
  1272. infoShow(row, index) {
  1273. // for(var i=0;i<this.listData.length;i++){
  1274. // this.listData[i].select=false
  1275. // }
  1276. // this.listData[index].select=true
  1277. this.mpFn(row, 1);
  1278. this.info = row;
  1279. this.listpoint = [];
  1280. this.show = false;
  1281. var name = '我的';
  1282. var title = '客户信息';
  1283. var storeCategory = row.storeCategoryName;
  1284. if (this.tabVal != 1 && this.tabVal != 4) {
  1285. name = '销售部';
  1286. }
  1287. if (this.tabVal != 3 && this.tabVal != 4) {
  1288. storeCategory = row.storeCategory;
  1289. title = '计划外';
  1290. }
  1291. buryingPoint({
  1292. systemModel: title + name,
  1293. buryingPointType: 4,
  1294. buryingPointValue: storeCategory,
  1295. buryingPointName: row.storeCode,
  1296. buryingPointPosition: '地图',
  1297. });
  1298. this.getpointList(row);
  1299. },
  1300. getpointList(val) {
  1301. var that = this;
  1302. let loading3 = this.$toast.loading({
  1303. duration: 0,
  1304. message: '加载中...',
  1305. forbidClick: true,
  1306. });
  1307. if (this.$route.query.tabVal == 1) {
  1308. getUserOutPlaList({
  1309. storeCode: val.storeCode,
  1310. type: 1,
  1311. lon: val.lon,
  1312. lat: val.lat,
  1313. range: 20,
  1314. storeName: this.storeName.trim(),
  1315. chainCode: this.chainCode,
  1316. storeLabelTypes: this.storeLabelTypes.join(','),
  1317. pageNum: this.pageNum,
  1318. storeCategoryList: this.storeCategoryList,
  1319. }).then((res) => {
  1320. if (res.code == 200) {
  1321. loading3.clear();
  1322. this.listpoint = res.rows;
  1323. this.show = true;
  1324. } else {
  1325. this.$toast(res.msg);
  1326. }
  1327. });
  1328. } else if (this.$route.query.tabVal == 3) {
  1329. storeList({
  1330. storeCode: val.storeCode,
  1331. type: 4,
  1332. lon: val.lon,
  1333. lat: val.lat,
  1334. range: 20,
  1335. storeName: this.storeName.trim(),
  1336. }).then((res) => {
  1337. if (res.code == 200) {
  1338. loading3.clear();
  1339. this.listpoint = res.rows;
  1340. this.show = true;
  1341. } else {
  1342. this.$toast(res.msg);
  1343. }
  1344. });
  1345. } else if (this.$route.query.tabVal == 4) {
  1346. storeMyList({
  1347. storeCode: val.storeCode,
  1348. type: 3,
  1349. lon: val.lon,
  1350. lat: val.lat,
  1351. range: 20,
  1352. storeName: this.storeName.trim(),
  1353. }).then((res) => {
  1354. if (res.code == 200) {
  1355. loading3.clear();
  1356. this.listpoint = res.rows;
  1357. this.show = true;
  1358. } else {
  1359. this.$toast(res.msg);
  1360. }
  1361. });
  1362. } else if (this.$route.query.tabVal == 6) {
  1363. topStore({
  1364. storeCode: val.storeCode,
  1365. lon: val.lon,
  1366. lat: val.lat,
  1367. range: 20,
  1368. storeName: this.storeName.trim(),
  1369. chainCode: this.chainCode,
  1370. storeLabelTypes: this.storeLabelTypes.join(','),
  1371. pageNum: this.pageNum,
  1372. storeCategoryList: this.storeCategoryList,
  1373. }).then((res) => {
  1374. if (res.code == 200) {
  1375. loading3.clear();
  1376. this.listpoint = res.data.storeList;
  1377. this.show = true;
  1378. } else {
  1379. this.$toast(res.msg);
  1380. }
  1381. });
  1382. } else {
  1383. getUserOrgStoreList({
  1384. storeCode: val.storeCode,
  1385. type: 2,
  1386. lon: val.lon,
  1387. lat: val.lat,
  1388. range: 20,
  1389. storeName: this.storeName.trim(),
  1390. chainCode: this.chainCode,
  1391. storeLabelTypes: this.storeLabelTypes.join(','),
  1392. pageNum: this.pageNum,
  1393. storeCategoryList: this.storeCategoryList,
  1394. }).then((res) => {
  1395. if (res.code == 200) {
  1396. loading3.clear();
  1397. this.listpoint = res.rows;
  1398. this.show = true;
  1399. } else {
  1400. this.$toast(res.msg);
  1401. }
  1402. });
  1403. }
  1404. },
  1405. onClickLeft() {
  1406. this.$router.go(-1);
  1407. },
  1408. buryingPointFn(val) {
  1409. buryingPoint({
  1410. systemModel: '地图',
  1411. buryingPointType: 4,
  1412. buryingPointValue: val.telephone,
  1413. buryingPointName: '点击电话',
  1414. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  1415. });
  1416. },
  1417. onTownConfirm(val, zoom) {
  1418. this.range = val;
  1419. this.zoom = zoom;
  1420. this.getUserOutPlaList('1');
  1421. },
  1422. getUserOutPlaList(val) {
  1423. this.poINData = [];
  1424. var that = this;
  1425. this.list = [];
  1426. this.listData = [];
  1427. var types = '';
  1428. if (val == 1) {
  1429. types = '1';
  1430. } else {
  1431. types = '';
  1432. }
  1433. let loading3 = this.$toast.loading({
  1434. duration: 0,
  1435. message: '加载中...',
  1436. forbidClick: true,
  1437. });
  1438. if (this.$route.query.tabVal == 1) {
  1439. getUserOutPlaList({
  1440. type: 1,
  1441. lon: this.lon,
  1442. lat: this.lat,
  1443. range: this.range,
  1444. storeName: this.storeName.trim(),
  1445. chainCode: this.chainCode,
  1446. storeLabelTypes: this.storeLabelTypes.join(','),
  1447. pageNum: this.pageNum,
  1448. storeCategoryList: this.storeCategoryList,
  1449. }).then((res) => {
  1450. if (res.code == 200) {
  1451. loading3.clear();
  1452. this.listData = res.rows;
  1453. setTimeout(() => {
  1454. this.list = res.rows;
  1455. }, 2000);
  1456. // if(res.rows.length>0&&types==1){
  1457. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1458. // this.lon1="";
  1459. // this.lat1="";
  1460. // setTimeout(()=>{
  1461. // this.lon1=res.rows[0].lon;
  1462. // this.lat1=res.rows[0].lat;
  1463. // })
  1464. // }
  1465. // }
  1466. if (res.rows.length < 1) {
  1467. this.$toast('附近无客户信息');
  1468. this.show = false;
  1469. }
  1470. if (res.total > 50) {
  1471. this.msg = this.setMapRangeTitle(res.total);
  1472. this.msgshow = true;
  1473. this.show = false;
  1474. }
  1475. if (this.first < 2) {
  1476. this.zoom = 18;
  1477. this.first = 2;
  1478. }
  1479. } else {
  1480. this.$toast(res.msg);
  1481. }
  1482. });
  1483. } else if (this.$route.query.tabVal == 3) {
  1484. storeList({
  1485. type: 4,
  1486. lon: this.lon,
  1487. lat: this.lat,
  1488. range: this.range,
  1489. storeName: this.storeName.trim(),
  1490. }).then((res) => {
  1491. if (res.code == 200) {
  1492. loading3.clear();
  1493. // this.list = res.rows
  1494. this.listData = res.rows;
  1495. setTimeout(() => {
  1496. this.list = res.rows;
  1497. }, 2000);
  1498. // if(res.rows.length>0&&types==1){
  1499. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1500. // this.lon1="";
  1501. // this.lat1="";
  1502. // setTimeout(()=>{
  1503. // this.lon1=res.rows[0].lon;
  1504. // this.lat1=res.rows[0].lat;
  1505. // })
  1506. // }
  1507. // }
  1508. if (res.rows.length < 1) {
  1509. this.$toast('附近无客户信息');
  1510. this.show = false;
  1511. }
  1512. if (res.total > 50) {
  1513. this.msg = this.setMapRangeTitle(res.total);
  1514. this.msgshow = true;
  1515. this.show = false;
  1516. }
  1517. if (this.first < 2) {
  1518. this.zoom = 18;
  1519. this.first = 2;
  1520. }
  1521. } else {
  1522. this.$toast(res.msg);
  1523. }
  1524. });
  1525. } else if (this.$route.query.tabVal == 4) {
  1526. storeMyList({
  1527. type: 3,
  1528. lon: this.lon,
  1529. lat: this.lat,
  1530. range: this.range,
  1531. storeName: this.storeName.trim(),
  1532. }).then((res) => {
  1533. if (res.code == 200) {
  1534. loading3.clear();
  1535. // this.list = res.rows
  1536. this.listData = res.rows;
  1537. setTimeout(() => {
  1538. this.list = res.rows;
  1539. }, 2000);
  1540. // if(res.rows.length>0&&types==1){
  1541. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1542. // this.lon1="";
  1543. // this.lat1="";
  1544. // setTimeout(()=>{
  1545. // this.lon1=res.rows[0].lon;
  1546. // this.lat1=res.rows[0].lat;
  1547. // })
  1548. // }
  1549. // }
  1550. if (res.rows.length < 1) {
  1551. this.$toast('附近无客户信息');
  1552. this.show = false;
  1553. }
  1554. if (res.total > 50) {
  1555. this.msg = this.setMapRangeTitle(res.total);
  1556. this.msgshow = true;
  1557. this.show = false;
  1558. }
  1559. if (this.first < 2) {
  1560. this.zoom = 18;
  1561. this.first = 2;
  1562. }
  1563. } else {
  1564. this.$toast(res.msg);
  1565. }
  1566. });
  1567. } else if (this.$route.query.tabVal == 6) {
  1568. topStore({
  1569. lat: this.lat,
  1570. lon: this.lon,
  1571. range: this.range,
  1572. storeName: this.storeName.trim(),
  1573. chainCode: this.chainCode,
  1574. storeLabelTypes: this.storeLabelTypes.join(','),
  1575. pageNum: this.pageNum,
  1576. storeCategoryList: this.storeCategoryList,
  1577. }).then((res) => {
  1578. if (res.code == 200) {
  1579. loading3.clear();
  1580. this.listData = res.data.storeList;
  1581. setTimeout(() => {
  1582. this.list = res.data.storeList;
  1583. }, 2000);
  1584. // if(res.data.storeList.length>0&&types==1){
  1585. // if(res.data.storeList[0].lon!=null&&res.data.storeList[0].lon!=""&&res.data.storeList[0].lon!=undefined){
  1586. // this.lon1=res.data.storeList[0].lon
  1587. // this.lat1=res.data.storeList[0].lat
  1588. // }
  1589. // }
  1590. if (res.data.storeList.length < 1) {
  1591. this.$toast('附近无客户信息');
  1592. this.show = false;
  1593. }
  1594. if (this.first < 2) {
  1595. this.zoom = 18;
  1596. this.first = 2;
  1597. }
  1598. } else {
  1599. this.$toast(res.msg);
  1600. }
  1601. });
  1602. } else {
  1603. getUserOrgStoreList({
  1604. type: 2,
  1605. lon: this.lon,
  1606. lat: this.lat,
  1607. range: this.range,
  1608. storeName: this.storeName.trim(),
  1609. chainCode: this.chainCode,
  1610. storeLabelTypes: this.storeLabelTypes.join(','),
  1611. pageNum: this.pageNum,
  1612. storeCategoryList: this.storeCategoryList,
  1613. }).then((res) => {
  1614. if (res.code == 200) {
  1615. loading3.clear();
  1616. // this.list = res.rows
  1617. this.listData = res.rows;
  1618. setTimeout(() => {
  1619. this.list = res.rows;
  1620. }, 2000);
  1621. // if(res.rows.length>0&&types==1){
  1622. // if(res.rows[0].lon!=null&&res.rows[0].lon!=""&&res.rows[0].lon!=undefined){
  1623. // this.lon1="";
  1624. // this.lat1="";
  1625. // setTimeout(()=>{
  1626. // this.lon1=res.rows[0].lon;
  1627. // this.lat1=res.rows[0].lat;
  1628. // })
  1629. // }
  1630. // }
  1631. if (res.rows.length < 1) {
  1632. this.$toast('附近无客户信息');
  1633. this.show = false;
  1634. }
  1635. if (res.total > 50) {
  1636. this.msg = this.setMapRangeTitle(res.total);
  1637. this.msgshow = true;
  1638. this.show = false;
  1639. }
  1640. if (this.first < 2) {
  1641. this.zoom = 18;
  1642. this.first = 2;
  1643. }
  1644. } else {
  1645. this.$toast(res.msg);
  1646. }
  1647. });
  1648. }
  1649. },
  1650. storeVisit(val) {
  1651. // localStorage.setItem("tabVal",this.tabVal)
  1652. if (val.visitSource && val.visitSource == 2) {
  1653. this.$toast('请先取消异常拜访后再进入正常拜访!');
  1654. return;
  1655. }
  1656. localStorage.removeItem('visitId');
  1657. var rdId = val.rdId;
  1658. var that = this;
  1659. if (this.$route.query.tabVal != 3 || this.$route.query.tabVal != 4) {
  1660. rdId = null;
  1661. }
  1662. checkVisit({ storeId: val.storeId }).then((res) => {
  1663. buryingPoint({
  1664. systemModel: val.storeCategory,
  1665. buryingPointType: 5,
  1666. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1667. buryingPointName: '进店拜访',
  1668. buryingPointPosition: '地图客户信息',
  1669. });
  1670. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1671. if (localStorage.getItem('loginType') == 'cs') {
  1672. var lat = '';
  1673. var lon = '';
  1674. if (val.lat == '' || val.lat == null) {
  1675. lat = '31.2517820000';
  1676. lon = '120.5593090000';
  1677. } else {
  1678. lat = val.lat;
  1679. lon = val.lon;
  1680. }
  1681. this.$router.push({
  1682. path: '/suishenbangOutstoreVisit',
  1683. query: {
  1684. storeId: val.storeId,
  1685. rdId: val.rdId,
  1686. lat: lat,
  1687. lon: lon,
  1688. visitId: val.visitId,
  1689. pageType: 'out',
  1690. addressLine: val.addressLine,
  1691. storeCategory: val.storeCategory,
  1692. storeName: val.storeName,
  1693. hisTime: val.hisTime,
  1694. contactName: val.contactName,
  1695. storeCode: val.storeCode,
  1696. tabVal: that.$route.query.tabVal,
  1697. visitModel: '1',
  1698. latNew: '31.2517820000',
  1699. lonNew: '120.5593090000',
  1700. PointSum: 0,
  1701. marklat: lat,
  1702. marklon: lon,
  1703. linkType: that.$route.query.tabVal,
  1704. from: 'outPlan',
  1705. },
  1706. });
  1707. localStorage.setItem('startTime', new Date());
  1708. localStorage.setItem('ORGName', val.deptName);
  1709. localStorage.setItem('chainNameR', val.storeName);
  1710. } else {
  1711. if (this.flag) {
  1712. this.flag = false;
  1713. this.timer = null;
  1714. let that = this;
  1715. this.timer = setTimeout(() => {
  1716. this.flag = true;
  1717. }, 2000);
  1718. if (val.stateString.indexOf('拜访中') != -1) {
  1719. localStorage.setItem('startTime', new Date());
  1720. localStorage.setItem('ORGName', val.deptName);
  1721. localStorage.setItem('chainNameR', val.storeName);
  1722. that.$router.push({
  1723. path: '/suishenbangOutstoreVisit',
  1724. query: {
  1725. storeId: val.storeId,
  1726. rdId: rdId,
  1727. lat: val.lat,
  1728. lon: val.lon,
  1729. visitId: val.visitId,
  1730. pageType: 'out',
  1731. addressLine: val.addressLine,
  1732. storeCategory: val.storeCategory,
  1733. storeName: val.storeName,
  1734. hisTime: val.hisTime,
  1735. contactName: val.contactName,
  1736. storeCode: val.storeCode,
  1737. tabVal: that.$route.query.tabVal,
  1738. visitModel: '1',
  1739. latNew: val.lat,
  1740. lonNew: val.lon,
  1741. PointSum: '0',
  1742. marklat: val.lat,
  1743. marklon: val.lon,
  1744. linkType: that.$route.query.tabVal,
  1745. from: 'outPlan',
  1746. },
  1747. });
  1748. } else {
  1749. let loading1 = this.$toast.loading({
  1750. duration: 0,
  1751. message: '加载中...',
  1752. forbidClick: true,
  1753. });
  1754. let url = window.location.href;
  1755. let wx = this.wx;
  1756. let qiyeData;
  1757. const instance = axios.create();
  1758. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1759. instance
  1760. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1761. params: {
  1762. url: url,
  1763. },
  1764. })
  1765. .then((response) => {
  1766. if (response.status == 200) {
  1767. this.cont = 3;
  1768. var flat = true;
  1769. var times = setInterval(() => {
  1770. this.cont--;
  1771. if (this.cont == '0') {
  1772. if (flat) {
  1773. loading1.clear();
  1774. clearInterval(times);
  1775. that.$dialog
  1776. .alert({
  1777. message: '定位失败,请开启企微定位权限',
  1778. })
  1779. .then(() => {});
  1780. } else {
  1781. clearInterval(times);
  1782. }
  1783. }
  1784. }, 1000);
  1785. qiyeData = response.data.data;
  1786. wx.config({
  1787. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1788. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1789. appId: qiyeData.appId, // 必填,企业微信的corpID
  1790. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1791. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1792. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1793. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1794. });
  1795. wx.ready(() => {
  1796. wx.getLocation({
  1797. type: 'gcj02',
  1798. success: (res) => {
  1799. flat = false;
  1800. var location = that.CJ02BD(res.latitude, res.longitude);
  1801. checkStoreAddressByStoreCode({
  1802. storeCode: val.storeCode,
  1803. lon: location.lon,
  1804. lat: location.lat,
  1805. }).then((response) => {
  1806. loading1.clear();
  1807. if (val.lat == '' || val.lat == null) {
  1808. that.lat = location.lat;
  1809. that.lon = location.lon;
  1810. } else {
  1811. that.lat = val.lat;
  1812. that.lon = val.lon;
  1813. }
  1814. let PointSum = that
  1815. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1816. .toFixed(2);
  1817. let PointSumval = that
  1818. .twoPointSum(location.lat, location.lon, location.lat, location.lon)
  1819. .toFixed(2);
  1820. // GZ:工装店铺 直接进入拜访
  1821. if (localStorage.getItem('postType') == 'GZ') {
  1822. localStorage.setItem('startTime', new Date());
  1823. localStorage.setItem('ORGName', val.deptName);
  1824. localStorage.setItem('chainNameR', val.storeName);
  1825. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1826. return;
  1827. }
  1828. // 门店编码校验门店地址不通过
  1829. if (response.code != 200) {
  1830. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1831. if (response.data.updateAddress == 0) {
  1832. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1833. this.$dialog
  1834. .confirm({
  1835. confirmButtonText: '确定拜访',
  1836. cancelButtonText: '取消拜访',
  1837. title: '系统提示',
  1838. message:
  1839. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1840. closeOnClickOverlay: true,
  1841. })
  1842. .then(() => {
  1843. this.toSuishenbangOutstoreVisit(
  1844. res,
  1845. val,
  1846. location,
  1847. PointSumval
  1848. );
  1849. });
  1850. } else if (response.data.updateAddress == 1) {
  1851. // 同城AB+金牌,去修改地址
  1852. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1853. if (!response.data.addressUpdateTimesOver) {
  1854. this.$dialog
  1855. .confirm({
  1856. title: '系统提示',
  1857. message: response.msg + '请立即修改后再拜访',
  1858. messageAlign: 'left',
  1859. confirmButtonText: '立即修改',
  1860. cancelButtonText: '取消',
  1861. })
  1862. .then(() => {
  1863. this.$router.push({
  1864. path: '/storeDetail',
  1865. query: {
  1866. id: val.storeId,
  1867. type: 'address',
  1868. storeAddressId: val.storeAddressId,
  1869. },
  1870. });
  1871. });
  1872. } else {
  1873. this.$dialog.confirm({
  1874. title: '系统提示',
  1875. message: '已经达到最大修改次数',
  1876. messageAlign: 'left',
  1877. confirmButtonText: '确定',
  1878. });
  1879. }
  1880. } else if (response.data.updateAddress == 2) {
  1881. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1882. this.resetCoord(res, val, location, PointSumval);
  1883. return;
  1884. }
  1885. } else {
  1886. // 门店编码校验门店地址通过 进入拜访
  1887. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1888. }
  1889. });
  1890. },
  1891. fail: function () {
  1892. loading1.clear();
  1893. that.$dialog.alert({
  1894. message: 'GPS未开启',
  1895. });
  1896. },
  1897. });
  1898. });
  1899. wx.error(function (res) {
  1900. loading1.clear();
  1901. that.$dialog
  1902. .alert({
  1903. message: '定位失败,请开启企微定位权限',
  1904. })
  1905. .then(() => {});
  1906. });
  1907. }
  1908. });
  1909. }
  1910. }
  1911. }
  1912. } else if (res.code == 500) {
  1913. this.$dialog
  1914. .alert({
  1915. message: res.msg,
  1916. })
  1917. .then(() => {});
  1918. }
  1919. });
  1920. },
  1921. // 重置经纬度
  1922. resetCoord(res, val, location, PointSumval) {
  1923. this.$dialog
  1924. .confirm({
  1925. confirmButtonText: '初始化定位',
  1926. cancelButtonText: '取消拜访',
  1927. title: '系统提示',
  1928. message: '偏差过大,不允许拜访。可修改本店定位.',
  1929. closeOnClickOverlay: true,
  1930. })
  1931. .then(() => {
  1932. mobileReposition({
  1933. storeId: val.storeId,
  1934. lat: location.lat,
  1935. lon: location.lon,
  1936. }).then((response) => {
  1937. if (response.code == 200) {
  1938. this.$dialog
  1939. .alert({
  1940. title: '系统提示',
  1941. message: '本信息定位已更新成功!',
  1942. })
  1943. .then(() => {
  1944. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1945. });
  1946. localStorage.setItem('startTime', new Date());
  1947. localStorage.setItem('ORGName', val.deptName);
  1948. localStorage.setItem('chainNameR', val.storeName);
  1949. } else {
  1950. this.$toast(response.msg);
  1951. }
  1952. });
  1953. });
  1954. },
  1955. // 进入拜访 router.push
  1956. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1957. addVisitsPosition({
  1958. storeId: val.storeId,
  1959. visitsId: '',
  1960. lon: res.longitude,
  1961. lat: res.latitude,
  1962. sourceLon: location.lon,
  1963. sourceLat: location.lat,
  1964. positionDesc: '',
  1965. accuracy: res.accuracy,
  1966. });
  1967. this.$router.push({
  1968. path: '/suishenbangOutstoreVisit',
  1969. query: {
  1970. storeId: val.storeId,
  1971. rdId: val.rdId,
  1972. lat: location.lat,
  1973. lon: location.lon,
  1974. visitId: val.visitId,
  1975. pageType: 'out',
  1976. addressLine: val.addressLine,
  1977. storeCategory: val.storeCategory,
  1978. storeName: val.storeName,
  1979. hisTime: val.hisTime,
  1980. contactName: val.contactName,
  1981. storeCode: val.storeCode,
  1982. tabVal: this.$route.query.tabVal,
  1983. visitModel: '1',
  1984. latNew: location.lat,
  1985. lonNew: location.lon,
  1986. PointSum: PointSumval,
  1987. marklat: res.latitude,
  1988. marklon: res.longitude,
  1989. linkType: this.$route.query.tabVal,
  1990. from: 'outPlan',
  1991. },
  1992. });
  1993. },
  1994. linkapp(val) {
  1995. var poind = this.gcj02BD(val.lat, val.lon);
  1996. let url = window.location.href;
  1997. let that = this;
  1998. let wx = this.wx;
  1999. let qiyeData;
  2000. const instance = axios.create();
  2001. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2002. instance
  2003. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2004. params: {
  2005. url: url,
  2006. agent: 1,
  2007. },
  2008. })
  2009. .then((response) => {
  2010. if (response.status == 200) {
  2011. qiyeData = response.data.data;
  2012. // wx.config({
  2013. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2014. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2015. // appId: qiyeData.appId, // 必填,企业微信的corpID
  2016. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2017. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2018. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2019. // jsApiList: ["ready", "invoke"]
  2020. // });
  2021. // wx.ready(function() {
  2022. // wx.checkJsApi({
  2023. // jsApiList: ["agentConfig", "launchMiniprogram"], // 需要检测的JS接口列表
  2024. // success: function(res) {}})})
  2025. wx.agentConfig({
  2026. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  2027. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  2028. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2029. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2030. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  2031. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  2032. success: function (res) {
  2033. wx.invoke(
  2034. 'launchMiniprogram',
  2035. {
  2036. appid: 'wx238bbb5f6d958414',
  2037. path:
  2038. 'pages/relayStation/relayStation?latitude=' +
  2039. poind.lat +
  2040. '&longitude=' +
  2041. poind.lon +
  2042. '&name=' +
  2043. val.addressLine,
  2044. },
  2045. function (res) {
  2046. if (res.err_msg == 'launchMiniprogram:ok') {
  2047. } else {
  2048. }
  2049. }
  2050. );
  2051. },
  2052. fail: function (res) {
  2053. if (res.errMsg.indexOf('function not exist') > -1) {
  2054. alert('版本过低请升级');
  2055. }
  2056. },
  2057. });
  2058. }
  2059. });
  2060. },
  2061. // 跳转好帮手门店详情
  2062. goOtherSystem(item) {
  2063. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  2064. if (
  2065. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  2066. item.approvalStatus == null ||
  2067. item.approvalStatus == 0
  2068. ) {
  2069. return false;
  2070. }
  2071. if (item.storeCode) {
  2072. window.location.href =
  2073. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
  2074. } else {
  2075. this.$dialog.alert({
  2076. message: '缺少门店code',
  2077. });
  2078. }
  2079. },
  2080. filterTCFX(item) {
  2081. if (!item.remark) return false;
  2082. let remark = JSON.parse(item.remark);
  2083. return remark.tcfx ? true : false;
  2084. },
  2085. },
  2086. };
  2087. </script>
  2088. <style scoped>
  2089. .map {
  2090. width: 100%;
  2091. height: 79.3vh;
  2092. margin-top: 180px;
  2093. }
  2094. .text {
  2095. font-size: 14px;
  2096. color: #909090;
  2097. margin: 6px 0;
  2098. }
  2099. #container {
  2100. width: 20px;
  2101. height: 20px;
  2102. position: fixed;
  2103. left: -888px;
  2104. }
  2105. .mapimg {
  2106. position: fixed;
  2107. bottom: 235px;
  2108. right: 2px;
  2109. width: 38px;
  2110. }
  2111. .mapStoreList {
  2112. position: fixed;
  2113. width: 96%;
  2114. bottom: 10px;
  2115. background-color: white;
  2116. border-radius: 6px;
  2117. padding: 10px 0 14px;
  2118. overflow: hidden;
  2119. margin: 0 2%;
  2120. max-height: 330px;
  2121. }
  2122. .maplit {
  2123. width: 100%;
  2124. margin-top: -10px;
  2125. overflow-y: auto;
  2126. border-top: 1px solid #eeeeee;
  2127. padding: 0 14px;
  2128. }
  2129. .maplitactive {
  2130. height: 270px;
  2131. }
  2132. .maplistitem {
  2133. padding-bottom: 14px;
  2134. border-bottom: 1px solid #eeeeee;
  2135. }
  2136. .maplistitem:last-child {
  2137. border: 0;
  2138. }
  2139. .tipsTitle {
  2140. padding: 5px 0;
  2141. text-align: center;
  2142. font-size: 16px;
  2143. font-weight: 600;
  2144. }
  2145. </style>
  2146. <style>
  2147. .icoImgMAP {
  2148. background-color: #fff;
  2149. text-align: center;
  2150. padding: 0 2px;
  2151. }
  2152. .icoImgMAP .van-grid-item__icon {
  2153. font-size: 40px;
  2154. margin: 0 auto;
  2155. }
  2156. .icoImgMAP .van-grid-item__content {
  2157. font-size: 10px;
  2158. margin: 0;
  2159. padding: 0;
  2160. color: #666;
  2161. justify-content: normal;
  2162. }
  2163. .icoImgMAP .van-grid-item__content:after {
  2164. border: 0;
  2165. }
  2166. .icoImgMAP .van-grid-item__text {
  2167. font-size: 14px;
  2168. width: 48px;
  2169. }
  2170. .icoImgMAP .titleico {
  2171. margin-top: 8px;
  2172. }
  2173. .icoImgMAP .titleico p {
  2174. font-size: 14px;
  2175. margin: 0;
  2176. }
  2177. .icoImgMAP .titleico .p {
  2178. margin-top: -4px;
  2179. }
  2180. .textc .van-grid-item__content,
  2181. .textc .van-grid-item__text {
  2182. color: red;
  2183. }
  2184. .visitStoreIco {
  2185. float: left;
  2186. float: left;
  2187. width: 26px;
  2188. text-align: center;
  2189. background-color: #ffba13;
  2190. color: #fff;
  2191. border-radius: 100%;
  2192. margin-left: 14px;
  2193. line-height: 26px;
  2194. height: 26px;
  2195. }
  2196. </style>
  2197. <style lang="scss">
  2198. .van-tabs__nav--card .van-tab.van-tab--active {
  2199. background-color: #0057ba !important;
  2200. }
  2201. .visitSearch {
  2202. width: 68px;
  2203. color: #0057ba;
  2204. font-size: 14px;
  2205. }
  2206. .visitSearch .van-dropdown-menu__bar {
  2207. box-shadow: 0 0 0 #fff;
  2208. height: 52px;
  2209. }
  2210. .visitSearch .van-dropdown-menu__item {
  2211. justify-content: normal;
  2212. }
  2213. .visitSearch .van-dropdown-menu__title {
  2214. border-left: 1px solid #ccc;
  2215. }
  2216. .visitSearch .van-cell {
  2217. border: 1px solid #ccc;
  2218. border-radius: 5px;
  2219. padding: 6px;
  2220. }
  2221. .positionContent {
  2222. position: fixed;
  2223. color: #666;
  2224. display: inline-block;
  2225. box-shadow: 0px 2px 7px -5px #000;
  2226. border-radius: 100px;
  2227. overflow: hidden;
  2228. right: 14px;
  2229. cursor: pointer;
  2230. bottom: 96px;
  2231. background-color: white;
  2232. }
  2233. .positionContent .img {
  2234. border-radius: 100px;
  2235. float: left;
  2236. }
  2237. .positionContent .img .van-icon__image {
  2238. border-radius: 100px;
  2239. }
  2240. .zDialog .van-dialog__header {
  2241. padding: 10px;
  2242. border-bottom: 1px solid #f5f5f5;
  2243. }
  2244. .zDialog .infoText {
  2245. margin: 10px;
  2246. font-size: 14px;
  2247. color: #909090;
  2248. width: 98%;
  2249. }
  2250. .visitStoreIco {
  2251. float: right;
  2252. width: 26px;
  2253. text-align: center;
  2254. background-color: #ffba13;
  2255. color: #fff;
  2256. border-radius: 100%;
  2257. margin-left: 10px;
  2258. line-height: 26px;
  2259. height: 26px;
  2260. }
  2261. .searchcheck {
  2262. padding: 0 10px 10px;
  2263. }
  2264. .searchcheck .van-checkbox {
  2265. /*width: 44%;*/
  2266. padding-bottom: 10px;
  2267. }
  2268. .searchcheck .checkbox {
  2269. font-size: 14px;
  2270. display: inline-block;
  2271. width: 50%;
  2272. line-height: 28px;
  2273. }
  2274. .searchcheck .checkbox .van-checkbox {
  2275. margin-bottom: 2px;
  2276. }
  2277. .searchcheck .checkbox1 {
  2278. font-size: 14px;
  2279. float: left;
  2280. line-height: 28px;
  2281. width: 50%;
  2282. }
  2283. .searchcheck .checkbox1 .child {
  2284. width: 100%;
  2285. }
  2286. .searchcheck {
  2287. height: 93vh;
  2288. overflow-y: auto;
  2289. }
  2290. .searchchecktitle {
  2291. width: 100%;
  2292. margin: 20px 0;
  2293. font-size: 16px;
  2294. border-left: 3px solid #0057ba;
  2295. line-height: 18px;
  2296. }
  2297. .searchchecktitle1 {
  2298. width: 100%;
  2299. margin: 20px 0;
  2300. font-size: 16px;
  2301. line-height: 18px;
  2302. }
  2303. .textsize {
  2304. font-size: 14px;
  2305. }
  2306. .rangeStore {
  2307. .TCFXListItem {
  2308. display: inline-block;
  2309. border: 1px solid #ccc;
  2310. padding: 3px 5px;
  2311. margin: 0 5px;
  2312. border-radius: 6px;
  2313. }
  2314. }
  2315. </style>