rangeStore.vue 84 KB

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