rangeStore.vue 85 KB

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