topStore.vue 108 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951
  1. <template>
  2. <div class="bgcolor topStore">
  3. <div class="navBarTOP">
  4. <!-- 顶部条-->
  5. <van-nav-bar class="navBar" title="高销额门店推荐" left-arrow @click-left="onClickLeft">
  6. <template #right>
  7. <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
  8. </template>
  9. </van-nav-bar>
  10. <div class="searchDiv searchDivcs">
  11. <van-row v-if="showAll && showKM">
  12. <van-col span="16">
  13. <van-search
  14. v-model="storeName"
  15. left-icon="search"
  16. show-action
  17. placeholder="搜索名称/编号/地址"
  18. @clear="clearFn">
  19. <template #action>
  20. <div @click="onSearchm">搜索</div>
  21. </template>
  22. </van-search>
  23. </van-col>
  24. <van-col span="8">
  25. <div
  26. style="
  27. line-height: 36px;
  28. margin: 8px;
  29. margin-right: 0;
  30. text-align: center;
  31. border-radius: 6px;
  32. color: #0057ba;
  33. background-color: #fff;
  34. font-size: 14px;
  35. border: 1px solid #0057ba;
  36. "
  37. @click="jionAll">
  38. 加入计划内
  39. </div>
  40. </van-col>
  41. </van-row>
  42. <van-row v-if="!showAll || !showKM">
  43. <van-col span="24">
  44. <van-search
  45. v-model="storeName"
  46. left-icon="search"
  47. show-action
  48. placeholder="搜索名称/编号/地址"
  49. @clear="clearFn">
  50. <template #action>
  51. <div @click="onSearchm">搜索</div>
  52. </template>
  53. </van-search>
  54. </van-col>
  55. </van-row>
  56. </div>
  57. <van-dropdown-menu active-color="#0057ba">
  58. <van-dropdown-item v-model="value1" :options="option1" @change="v1Fn" />
  59. <van-dropdown-item v-model="value2" :options="option2" @change="v2Fn" />
  60. <van-dropdown-item v-model="value3" :options="option3" @change="v3Fn" />
  61. </van-dropdown-menu>
  62. </div>
  63. <!-- 主体内容-->
  64. <div style="height: 154px"></div>
  65. <van-notice-bar v-if="!showKM" color="#444" background="#f5f5f5" left-icon="info-o">
  66. 附近20KM内门店。
  67. </van-notice-bar>
  68. <div class="container">
  69. <van-list
  70. class="myList"
  71. v-model="loading"
  72. :finished="finished"
  73. @load="onLoad"
  74. finished-text="--已经到底了--">
  75. <van-checkbox-group v-model="radio">
  76. <div class="cellcontent" v-for="(item, index) in list" :key="index">
  77. <van-cell>
  78. <div class="card">
  79. <div class="title titlero">
  80. <template v-if="item.storeLabels">
  81. <!-- 金牌店ABC -->
  82. <img
  83. class="JPABC"
  84. :src="require('@/assets/Icon/storeA.png')"
  85. v-if="item.storeLabels.storeA" />
  86. <img
  87. class="JPABC"
  88. :src="require('@/assets/Icon/storeB.png')"
  89. v-if="item.storeLabels.storeB" />
  90. <img
  91. class="JPABC"
  92. :src="require('@/assets/Icon/storeC.png')"
  93. v-if="item.storeLabels.storeC" />
  94. <img
  95. class="JPABC"
  96. :src="require('@/assets/Icon/storeD.png')"
  97. v-if="item.storeLabels.storeD" />
  98. <img
  99. class="JPABC"
  100. :src="require('@/assets/Icon/storeE.png')"
  101. v-if="item.storeLabels.storeE" />
  102. </template>
  103. <span class="btn" :data-clipboard-text="item.storeCode">
  104. <span>{{ item.storeName }}</span>
  105. (<span style="color: #0057ba">{{ item.storeCode }}</span
  106. >)
  107. <van-icon
  108. :name="paste"
  109. color="#ee0a24"
  110. size="20"
  111. style="top: 6px; margin-left: 4px" />
  112. </span>
  113. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  114. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  115. <template v-if="item.approvalStatus == 0">
  116. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
  117. >已提交</span
  118. >
  119. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  120. >未提交</span
  121. >
  122. </template>
  123. </div>
  124. <div class="info" style="position: relative">
  125. 联系人:{{ item.contactName }}
  126. <div style="position: absolute; bottom: 0px; right: 0px">
  127. <el-popover
  128. popper-class="zpover"
  129. placement="bottom"
  130. width="120"
  131. trigger="click"
  132. content="该客户为凤凰客户">
  133. <div
  134. v-if="item.storeLabels.fhCustomer"
  135. class="visitStoreIco"
  136. style="background-color: #fff"
  137. slot="reference">
  138. <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
  139. </div>
  140. </el-popover>
  141. <el-popover
  142. popper-class="zpover zpover6"
  143. placement="bottom-start"
  144. trigger="click">
  145. <div>
  146. <p>
  147. 本店{{ timeData }}下单SKU数:<a
  148. @click="linkList(item)"
  149. style="text-decoration: underline"
  150. >点击查看</a
  151. >
  152. </p>
  153. </div>
  154. <div
  155. class="visitStoreIco"
  156. v-if="item.storeLabels.zysslNums !== false"
  157. style="background-color: #fff; position: relative"
  158. slot="reference">
  159. <p
  160. style="
  161. width: 100%;
  162. position: absolute;
  163. z-index: 1;
  164. top: 0.2px;
  165. width: 22px;
  166. margin: 0;
  167. margin-left: 3.6px;
  168. text-align: center;
  169. font-size: 12px;
  170. ">
  171. {{ item.storeLabels.zysslNums }}
  172. </p>
  173. <van-icon :name="ord" size="26" />
  174. </div>
  175. </el-popover>
  176. <el-popover
  177. popper-class="zpover"
  178. placement="bottom"
  179. width="200"
  180. trigger="click">
  181. <div v-if="item.storeLabels">
  182. <p>已参加:</p>
  183. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
  184. {{ tt }}
  185. </p>
  186. </div>
  187. <div
  188. class="visitStoreIco"
  189. v-if="item.storeLabels.targetOne"
  190. style="background-color: #fff"
  191. slot="reference">
  192. <van-icon :name="targetOne" size="26" />
  193. </div>
  194. </el-popover>
  195. <el-popover
  196. popper-class="zpover"
  197. placement="bottom"
  198. width="120"
  199. trigger="click"
  200. content="调色机7天未调色">
  201. <div
  202. v-if="item.storeLabels.stopColorMixerSeven"
  203. class="visitStoreIco"
  204. style="background-color: #fff"
  205. slot="reference">
  206. <van-icon :name="Network" size="26" />
  207. </div>
  208. </el-popover>
  209. <el-popover popper-class="zpover" placement="bottom" width="120" trigger="click"
  210. content="调色机当月未调色">
  211. <div v-if="item.storeLabels.stopColorMixerMonth" class="visitStoreIco"
  212. style="background-color: #fff" slot="reference">
  213. <van-icon :name="WiFi" size="26" />
  214. </div>
  215. </el-popover>
  216. <el-popover
  217. popper-class="zpover"
  218. placement="bottom"
  219. width="200"
  220. trigger="click"
  221. content="同城店近60天未下单">
  222. <div
  223. v-if="item.storeLabels.fxNoOrder"
  224. class="visitStoreIco"
  225. style="background-color: #fff"
  226. slot="reference">
  227. <van-icon :name="order60" size="26" />
  228. </div>
  229. </el-popover>
  230. <el-popover
  231. popper-class="zpover"
  232. placement="bottom"
  233. width="200"
  234. trigger="click"
  235. content="本店本月进过专业时时丽">
  236. <div
  237. class="visitStoreIco"
  238. v-if="item.storeLabels.zyssl"
  239. style="background-color: #ed5c68"
  240. slot="reference">
  241. </div>
  242. </el-popover>
  243. <el-popover
  244. popper-class="zpover zpover1"
  245. placement="bottom"
  246. width="200"
  247. trigger="click"
  248. content="本店本月进过超好贴">
  249. <div
  250. v-if="item.storeLabels.chtczj"
  251. class="visitStoreIco"
  252. style="background-color: #0057ba"
  253. slot="reference">
  254. </div>
  255. </el-popover>
  256. <el-popover
  257. placement="bottom"
  258. popper-class="zpover zpover1 zpover1sb"
  259. trigger="click"
  260. :disabled="!item.userVisitTimesMap"
  261. :content="'本店本月已拜访过' + item.storeLabels.visitTimes + '次'">
  262. <div
  263. v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
  264. class="visitStoreIco"
  265. slot="reference"
  266. style="background-color: #fff; position: relative">
  267. <p
  268. style="
  269. width: 100%;
  270. position: absolute;
  271. z-index: 10;
  272. top: -2px;
  273. margin: 0;
  274. text-align: center;
  275. font-size: 12px;
  276. ">
  277. {{ item.storeLabels.visitTimes }}
  278. </p>
  279. <!-- A级金牌店拜访次数少于2 -->
  280. <van-icon
  281. :name="require('@/assets/ordernumRed.png')"
  282. size="26"
  283. v-if="
  284. item.storeLabels.storeA &&
  285. item.needVisitNum &&
  286. item.storeLabels.visitTimes < item.needVisitNum
  287. " />
  288. <van-icon :name="require('@/assets/ordernum.png')" size="26" v-else />
  289. </div>
  290. <p style="text-align: center; background: #fff; color: #000; padding: 5px 0">
  291. 本店本月已拜访过{{ item.storeLabels.visitTimes }}次
  292. </p>
  293. <p
  294. v-if="item.storeLabels.storeA && item.needVisitNum"
  295. style="text-align: center; background: #fff; color: red; padding: 5px 0">
  296. A级金牌店拜访标准:1月{{ item.needVisitNum }}次
  297. </p>
  298. <el-table :data="item.userVisitTimesMap" border max-height="180px">
  299. <el-table-column label="业务员" prop="userName" />
  300. <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
  301. </el-table>
  302. </el-popover>
  303. </div>
  304. </div>
  305. <div class="info" style="position: relative">
  306. 类型:<span v-if="cstype != 1">{{ item.storeCategory }}</span
  307. ><span v-if="cstype == 1">金牌店</span>&nbsp;
  308. <el-popover
  309. popper-class="zpover zpover6"
  310. placement="bottom-start"
  311. trigger="click">
  312. <div>
  313. <p>
  314. 本店经营品项指导:
  315. <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
  316. </p>
  317. </div>
  318. <van-icon name="question-o" size="18" slot="reference" />
  319. </el-popover>
  320. </div>
  321. <div class="info" @click="buryingPointFn(item)">
  322. 联系电话:<a
  323. style="color: #0057ba; font-weight: bold; text-decoration: underline"
  324. :href="'tel:' + item.telephone"
  325. >{{ item.telephone }}<van-icon name="phone"
  326. /></a>
  327. </div>
  328. <div class="info">地址:{{ item.addressLine }}</div>
  329. <!-- 分销店 -->
  330. <template
  331. v-if="
  332. item.sfaStoreType &&
  333. item.sfaStoreType.type == 'fxd' &&
  334. item.sfaStoreChainsContactList
  335. ">
  336. <div class="info" v-if="typeShow">
  337. 经销商:
  338. <div
  339. class="TCFXListItem"
  340. v-for="(item, index) in item.sfaStoreChainsContactList">
  341. <el-popover
  342. popper-class="zpover zpoverStoreztype"
  343. placement="bottom-start"
  344. trigger="click">
  345. <div>
  346. <div>{{ item.chainCode }}</div>
  347. <div>{{ item.chainName }}</div>
  348. </div>
  349. <div slot="reference" :key="index">
  350. {{ item.categoryDescribe }}
  351. </div>
  352. </el-popover>
  353. </div>
  354. </div>
  355. </template>
  356. <template v-else>
  357. <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
  358. </template>
  359. <div class="info" style="color: #444">
  360. 门店销额(近三个月):¥{{ Micrometer(item.rolling3monthAMT) }}元
  361. <span
  362. v-if="cstype == 1 && index == 0 && value1 == 'b'"
  363. style="float: right; font-weight: bold; color: red">
  364. <img
  365. src="../../assets/Icon/top1.png"
  366. v-if="index == 0"
  367. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  368. >
  369. <span
  370. v-if="cstype == 1 && index == 1 && value1 == 'b'"
  371. style="float: right; font-weight: bold; color: #f4ea2a">
  372. <img
  373. src="../../assets/Icon/top2.png"
  374. v-if="index == 1"
  375. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  376. >
  377. <span
  378. v-if="cstype == 1 && index == 2 && value1 == 'b'"
  379. style="float: right; font-weight: bold; color: #1afa29">
  380. <img
  381. src="../../assets/Icon/top3.png"
  382. v-if="index == 2"
  383. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  384. >
  385. <span
  386. v-if="cstype == 1 && index > 2 && value1 == 'b'"
  387. style="float: right; font-weight: bold">
  388. <img
  389. src="../../assets/Icon/top4.png"
  390. v-if="index > 2"
  391. style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
  392. >
  393. </div>
  394. <div class="info" style="color: #444">
  395. 最近拜访时间:{{ parseTime(item.hisTime) }}
  396. </div>
  397. <div class="info" style="color: #444">
  398. 最新下单时间:{{ parseTime(item.deliveryDate) }}
  399. </div>
  400. </div>
  401. <div
  402. class="statstext"
  403. v-if="item.joinInPaln && showKM"
  404. style="background-color: #fff; bottom: 70px; right: 14px; top: auto">
  405. <van-checkbox
  406. :name="item.storeId"
  407. shape="square"
  408. style="float: right"></van-checkbox>
  409. </div>
  410. <div
  411. class="statstext"
  412. v-if="item.stateString == '未拜访'"
  413. style="background-color: #ed5c68">
  414. 未拜访
  415. </div>
  416. <div
  417. class="statstext"
  418. v-if="item.stateString == '拜访中'"
  419. style="background-color: white">
  420. <van-icon :name="times" color="#ee0a24" size="32" />
  421. </div>
  422. <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
  423. <div class="btnbox">
  424. <van-row>
  425. <van-col
  426. span="5"
  427. v-if="item.stateString != '已拜访' && customerVisits"
  428. @click="storeVisit(item)">
  429. <img :src="call" style="margin: 0 auto; height: 18px; display: block" />
  430. <p style="text-align: center; margin: 0; font-size: 12px">进入拜访</p>
  431. </van-col>
  432. <van-col
  433. span="5"
  434. v-if="item.storeCategory == '公装经销商'"
  435. @click="projectOutVisit(item)">
  436. <img :src="xmgj" style="margin: 0 auto; height: 18px; display: block" />
  437. <p style="text-align: center; margin: 0; font-size: 12px">项目跟进</p>
  438. <!-- <van-button type="info" size="small" plain class="centerBtn" @click="signAdd(item)">大客户签约</van-button>-->
  439. </van-col>
  440. <van-col
  441. span="5"
  442. v-if="
  443. item.stateString != '已拜访' &&
  444. item.storeCategory != '公装经销商' &&
  445. customerVisits
  446. "
  447. @click="abnormalVisit(item)">
  448. <img :src="yichang" style="margin: 0 auto; height: 18px; display: block" />
  449. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  450. 异常拜访
  451. </p>
  452. </van-col>
  453. <van-col span="4" v-if="item.showOrderButton" @click="orderFn(item)">
  454. <img :src="xiadan" style="margin: 0 auto; height: 18px; display: block" />
  455. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  456. 去下单
  457. </p>
  458. </van-col>
  459. <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
  460. <img :src="bfxx" style="margin: 0 auto; width: 18px; display: block" />
  461. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  462. 拜访信息
  463. </p>
  464. </van-col>
  465. <van-col span="5" @click="visitFn(item)">
  466. <img :src="kehuxinxi" style="margin: 0 auto; height: 18px; display: block" />
  467. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  468. 客户信息
  469. </p>
  470. </van-col>
  471. <van-col span="5" v-if="item.joinInPaln && showKM" @click="storeJoinVisitv(item)">
  472. <img :src="jiarujihua" style="margin: 0 auto; height: 18px; display: block" />
  473. <p style="text-align: center; margin: 0; font-size: 12px">加入计划内</p>
  474. </van-col>
  475. </van-row>
  476. </div>
  477. </van-cell>
  478. <div class="lineGrey"></div>
  479. </div>
  480. </van-checkbox-group>
  481. <van-empty v-if="list.length == 0" />
  482. </van-list>
  483. <br />
  484. <br />
  485. <br />
  486. <br />
  487. <br />
  488. </div>
  489. <van-action-sheet
  490. v-model="showOutPopover"
  491. :actions="actions"
  492. @select="onSelect"
  493. cancel-text="取消"
  494. @cancel="showOutPopover = false" />
  495. <van-popup v-model="showPicker" position="bottom" class="textsize">
  496. <van-row
  497. style="
  498. position: fixed;
  499. top: 0;
  500. width: 100%;
  501. z-index: 998;
  502. background-color: #fff;
  503. border-bottom: 1px solid #ccc;
  504. ">
  505. <van-col span="3" style="text-align: center; margin: 14px 0" @click="showPicker = false">
  506. <van-icon name="cross" size="20" color="#909399" />
  507. </van-col>
  508. <van-col span="13"> </van-col>
  509. <van-col span="4" style="text-align: center; line-height: 36px" @click="onConfirm">
  510. <div style="color: #0057ba">
  511. <van-button type="info" size="small" color="#0057ba">筛选</van-button>
  512. </div></van-col
  513. >
  514. <van-col span="4" style="text-align: center; line-height: 36px" @click="onsets">
  515. <van-button type="default" size="small" style="height: 28px">重置</van-button>
  516. </van-col>
  517. </van-row>
  518. <div style="height: 48px; width: 100%"></div>
  519. <!-- <van-picker show-toolbar :columns="storeTypeLists" value-key="dictLabel" @confirm="onConfirm" @cancel="showPicker = false"/> -->
  520. <div class="searchcheck">
  521. <p class="searchchecktitle">&nbsp;经销商</p>
  522. <van-row>
  523. <van-col span="24">
  524. <div @click="moreTypeShowFn">
  525. <van-field
  526. style="
  527. margin-top: -6px;
  528. border-radius: 6px;
  529. border: 1px solid #ccc;
  530. overflow: hidden;
  531. "
  532. readonly
  533. v-model="chainName"
  534. label=""
  535. placeholder="请选择经销商" />
  536. </div>
  537. </van-col>
  538. <!-- <van-col span="4"><van-button type="default" native-type="button" @click="moreTypeShowclearableFn">清空</van-button></van-col>-->
  539. </van-row>
  540. <p class="searchchecktitle" @click="otherbqShow = !otherbqShow">
  541. &nbsp;门店标签<van-icon name="arrow-down" style="float: right" />
  542. </p>
  543. <van-checkbox-group v-model="storeLabelTypes" direction="horizontal">
  544. <div v-if="otherbqShow" style="width: 100%">
  545. <div class="checkbox" v-for="(item, index) in StoreLabels" :key="index">
  546. <div>
  547. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  548. </div>
  549. </div>
  550. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  551. </div>
  552. </van-checkbox-group>
  553. <van-checkbox-group v-model="result" direction="horizontal">
  554. <p class="searchchecktitle" @click="otherkkdShow = !otherkkdShow">
  555. &nbsp;可控店<van-icon name="arrow-down" style="float: right" />
  556. </p>
  557. <div v-if="otherkkdShow">
  558. <div v-for="(item, index) in storeTypeLists" :key="index" class="checkbox1">
  559. <div v-if="item.groupType == 'kkd'" class="child">
  560. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  561. </div>
  562. </div>
  563. </div>
  564. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  565. <p class="searchchecktitle" @click="otherfxdShow = !otherfxdShow">
  566. &nbsp;分销店<van-icon name="arrow-down" style="float: right" />
  567. </p>
  568. <div v-if="otherfxdShow" style="margin: 0 14px; width: 100%">
  569. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  570. <p class="searchchecktitle1" @click="otherfxdShow1 = !otherfxdShow1">
  571. 金牌店<van-icon name="arrow-down" style="float: right" />
  572. </p>
  573. <div v-if="otherfxdShow1">
  574. <div v-for="(item1, index1) in storeTypeLists" :key="200 + index1" class="checkbox1">
  575. <div v-if="item1.groupType == 'fxd' && item1.remark == 'jp'" class="child">
  576. <van-checkbox :name="item1.dictValue">{{ item1.dictLabel }}</van-checkbox>
  577. </div>
  578. </div>
  579. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  580. </div>
  581. <p class="searchchecktitle1" @click="otherfxdShow2 = !otherfxdShow2">
  582. 同城分销店<van-icon name="arrow-down" style="float: right" />
  583. </p>
  584. <div v-if="otherfxdShow2">
  585. <div
  586. v-for="(itemlj, indexlj) in storeTypeLists"
  587. :key="400 + indexlj"
  588. class="checkbox1">
  589. <div v-if="itemlj.groupType == 'fxd' && itemlj.remark == 'tcfx'" class="child">
  590. <van-checkbox :name="itemlj.dictValue">{{ itemlj.dictLabel }}</van-checkbox>
  591. </div>
  592. </div>
  593. <div style="clear: both"></div>
  594. </div>
  595. </div>
  596. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  597. <p class="searchchecktitle" @click="otherShow = !otherShow">
  598. &nbsp;其他 <van-icon name="arrow-down" style="float: right" />
  599. </p>
  600. <div v-if="otherShow">
  601. <div v-for="(item2, index2) in storeTypeLists" :key="100 + index2" class="checkbox1">
  602. <div v-if="item2.groupType == 'other'" class="child">
  603. <van-checkbox :name="item2.dictValue">{{ item2.dictLabel }}</van-checkbox>
  604. </div>
  605. </div>
  606. </div>
  607. </van-checkbox-group>
  608. </div>
  609. </van-popup>
  610. <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%">
  611. <van-row style="background-color: #f5f5f5">
  612. <van-col span="20">
  613. <van-field
  614. left-icon="search"
  615. style="margin-top: 2px; border-radius: 6px; overflow: hidden"
  616. v-model="CustomerName"
  617. label=""
  618. placeholder="请输入关键词"
  619. clearable />
  620. </van-col>
  621. <van-col span="4" style="text-align: center; line-height: 48px" @click="getCustomer">
  622. <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
  623. >
  624. </van-row>
  625. <van-picker
  626. show-toolbar
  627. :columns="chainsData"
  628. value-key="chainName"
  629. @confirm="onConfirmChainsList"
  630. @cancel="moreTypeShow = false"
  631. visible-item-count="10" />
  632. </van-popup>
  633. <div class="positionContent" @click="rangeStoreFn()">
  634. <van-icon class="img" :name="mpimg" size="50" />
  635. </div>
  636. </div>
  637. </template>
  638. <script>
  639. import {
  640. stopVisit,
  641. checkVisit,
  642. addVisitsPosition,
  643. mobileReposition,
  644. getStoreyslTypeList,
  645. getStoreTypeListlp,
  646. joinInPlan,
  647. getStoreLabels,
  648. getCustomerList,
  649. buryingPoint,
  650. ProductItemImge,
  651. getStoreGroupCategory,
  652. } from '@/api/index';
  653. import times from '@/assets/Icon/times.png';
  654. import order60 from '@/assets/order60.png';
  655. import targetOne from '@/assets/targetOne.png';
  656. import Network from '@/assets/Network.png';
  657. import WiFi from '@/assets/WiFi.png';
  658. import ord from '@/assets/ord.png';
  659. import timeico from '@/assets/Icon/datatims.png';
  660. import location from '@/assets/location.png';
  661. import paste from '@/assets/paste.png';
  662. import visitTimes from '@/assets/visitTimes.png';
  663. import mpimg from '@/assets/mpimg.png';
  664. import axios from 'axios';
  665. import mapmarker from '@/components/mapMarkerDouble';
  666. import order from '@/assets/order.png';
  667. import nocj from '@/assets/nocj.png';
  668. import request from '@/utils/request';
  669. import call from '@/assets/call.png';
  670. import jiarujihua from '@/assets/jiarujihua.png';
  671. import kehuxinxi from '@/assets/kehuxinxi-2.png';
  672. import xiadan from '@/assets/xiadan.png';
  673. import yichang from '@/assets/yichang.png';
  674. import bfxx from '@/assets/bfxx.png';
  675. import xmgj from '@/assets/xmgj.png';
  676. import { getOrderUrlByStoreId, topjoinInPlan, topStore } from '@/api/inventory';
  677. import { parseTime } from '@/utils';
  678. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  679. import sbpmdh from '@/assets/sbpmdh.png';
  680. import { getPosition, getTicketFun } from '@/utils/TXApiFun';
  681. export default {
  682. name: 'outsidelist',
  683. components: { mapmarker },
  684. data() {
  685. return {
  686. xmgj: xmgj,
  687. bfxx: bfxx,
  688. times: times,
  689. searchShows: false,
  690. paste: paste,
  691. visitTimess: visitTimes,
  692. typeShow: false,
  693. mpimg: mpimg,
  694. order: order,
  695. mapShow: false,
  696. yichang: yichang,
  697. xiadan: xiadan,
  698. kehuxinxi: kehuxinxi,
  699. jiarujihua: jiarujihua,
  700. call: call,
  701. otherShow: false,
  702. Network: Network,
  703. WiFi: WiFi,
  704. order60: order60,
  705. targetOne: targetOne,
  706. chainName: '',
  707. chainCode: '',
  708. activeNames: '1',
  709. showPopover: false,
  710. moreTypeShow: false,
  711. showPopoverVNUM: [],
  712. showPopoverC: [],
  713. showPopoverZ: [],
  714. zyssl: [],
  715. chtczj: [],
  716. noVisit: [],
  717. noOrder: [],
  718. fxNoOrder: [],
  719. storeLabelTypes: [],
  720. // showPopover:false,
  721. location: location,
  722. timeico: timeico,
  723. nocj: nocj,
  724. disabled: false,
  725. timer: null,
  726. flag: true,
  727. show: false,
  728. tabVal: '0',
  729. list: [],
  730. cont: 0,
  731. loading: false,
  732. showPicker: false,
  733. finished: false,
  734. otherbqShow: true,
  735. otherkkdShow: true,
  736. otherfxdShow: true,
  737. typeName: '搜索',
  738. visitEndId: '',
  739. pageSize: 12,
  740. pageNum: 1,
  741. listActive: null,
  742. query: '',
  743. storeName: '',
  744. genDate: '',
  745. storeType: '',
  746. endShow: false,
  747. storeCategory: '',
  748. fromValue: {},
  749. storeTypeList: [],
  750. storeTypeLists: [],
  751. chainsData: [],
  752. serachstype: '',
  753. timeData: '',
  754. addShow1: false,
  755. storeCategoryList: '',
  756. result: [],
  757. StoreLabels: [],
  758. CustomerName: '',
  759. lat: '',
  760. lon: '',
  761. cstype: 0,
  762. title: '计划外',
  763. value1: 'b',
  764. value2: '',
  765. showKM: true,
  766. value3: '',
  767. showOutPopover: false,
  768. actions: [
  769. { name: '周一', id: 1 },
  770. { name: '周二', id: 2 },
  771. { name: '周三', id: 3 },
  772. { name: '周四', id: 4 },
  773. { name: '周五', id: 5 },
  774. { name: '周六', id: 6 },
  775. { name: '周日', id: 7 },
  776. ],
  777. option1: [
  778. { text: '门店销量', value: 'a' },
  779. { text: '门店销量倒序', value: 'b' },
  780. { text: '门店销量正序', value: 'c' },
  781. ],
  782. option2: [
  783. { text: '拜访时间', value: '' },
  784. { text: '拜访时间倒序', value: 'b' },
  785. { text: '拜访时间正序', value: 'c' },
  786. ],
  787. option3: [
  788. { text: '下单时间', value: '' },
  789. { text: '下单时间倒序', value: 'b' },
  790. { text: '下单时间正序', value: 'c' },
  791. ],
  792. radio: [],
  793. sortParam: 'sales',
  794. sortType: 'desc',
  795. storeIds: '',
  796. Jointype: 1,
  797. showAll: false,
  798. ord: ord,
  799. customerVisits: true,
  800. otherfxdShow1: true,
  801. otherfxdShow2: true,
  802. };
  803. },
  804. watch: {
  805. $route(to, from) {
  806. if (
  807. (from.path == '/storeDetail' && to.path == '/topStore') ||
  808. (from.path == '/storeGroup' && to.path == '/topStore') ||
  809. (from.path == '/suishenbangOutstoreVisit' && to.path == '/topStore') ||
  810. (from.path == '/outabnormalVisit' && to.path == '/topStore') ||
  811. (from.path == '/home' && to.path == '/topStore') ||
  812. (from.path == '/deviceWithin/index' && to.path == '/topStore') ||
  813. (from.path == '/AI/index' && to.path == '/topStore') ||
  814. (from.path == '/storemanagement/index' && to.path == '/topStore') ||
  815. (from.path == '/My/index' && to.path == '/topStore')
  816. ) {
  817. this.lat = '';
  818. this.onSearch();
  819. var week = new Date().getDay();
  820. if (week > 0 && week < 6) {
  821. this.actions[week - 1].name = '今天';
  822. }
  823. this.radio = [];
  824. // setTimeout(()=>{
  825. // this.onSearch()
  826. // },1000)
  827. }
  828. this.value1 = 'b';
  829. this.value2 = '';
  830. this.value3 = '';
  831. this.storeName = localStorage.getItem('outvstoreName');
  832. this.chainName = localStorage.getItem('outvchainName');
  833. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  834. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  835. } else {
  836. this.storeLabelTypes = [];
  837. }
  838. if (localStorage.getItem('outvstoreCategoryList') != null) {
  839. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  840. this.storeCategoryList = this.result.join(',');
  841. } else {
  842. this.result = [];
  843. this.storeCategoryList = this.result.join(',');
  844. }
  845. this.chainCode = localStorage.getItem('outvchainCode');
  846. this.storeName = localStorage.getItem('outvstoreName');
  847. this.sortType = localStorage.getItem('outvstoreName');
  848. this.sortParam = localStorage.getItem('outvstoreName');
  849. if (this.sortParam != '') {
  850. if (this.sortParam == 'sales') {
  851. if (this.sortType == 'desc') {
  852. this.value1 = 'b';
  853. }
  854. if (this.sortType == 'asc') {
  855. this.value1 = 'c';
  856. }
  857. }
  858. if (this.sortParam == 'visitTime') {
  859. this.value1 = '';
  860. if (this.sortType == 'desc') {
  861. this.value2 = 'b';
  862. }
  863. if (this.sortType == 'asc') {
  864. this.value2 = 'c';
  865. }
  866. }
  867. if (this.sortParam == 'orderTime') {
  868. this.value1 = '';
  869. if (this.sortType == 'desc') {
  870. this.value3 = 'b';
  871. }
  872. if (this.sortType == 'asc') {
  873. this.value3 = 'c';
  874. }
  875. }
  876. }
  877. var postType = localStorage.getItem('postType');
  878. if (postType == 'GZ') {
  879. this.addShow1 = false;
  880. this.otherShow = true;
  881. } else {
  882. this.addShow1 = true;
  883. this.otherShow = false;
  884. }
  885. },
  886. },
  887. created() {
  888. this.value1 = 'b';
  889. this.value2 = '';
  890. this.value3 = '';
  891. this.storeName = localStorage.getItem('outvstoreName');
  892. this.chainName = localStorage.getItem('outvchainName');
  893. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  894. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  895. } else {
  896. this.storeLabelTypes = [];
  897. }
  898. if (localStorage.getItem('outvstoreCategoryList') != null) {
  899. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  900. this.storeCategoryList = this.result.join(',');
  901. } else {
  902. this.result = [];
  903. this.storeCategoryList = this.result.join(',');
  904. }
  905. this.chainCode = localStorage.getItem('outvchainCode');
  906. this.storeName = localStorage.getItem('outvstoreName');
  907. this.sortType = localStorage.getItem('outvstoreName');
  908. this.sortParam = localStorage.getItem('outvstoreName');
  909. if (this.sortParam != '') {
  910. if (this.sortParam == 'sales') {
  911. if (this.sortType == 'desc') {
  912. this.value1 = 'b';
  913. }
  914. if (this.sortType == 'asc') {
  915. this.value1 = 'c';
  916. }
  917. }
  918. if (this.sortParam == 'visitTime') {
  919. this.value1 = '';
  920. if (this.sortType == 'desc') {
  921. this.value2 = 'b';
  922. }
  923. if (this.sortType == 'asc') {
  924. this.value2 = 'c';
  925. }
  926. }
  927. if (this.sortParam == 'orderTime') {
  928. this.value1 = '';
  929. if (this.sortType == 'desc') {
  930. this.value3 = 'b';
  931. }
  932. if (this.sortType == 'asc') {
  933. this.value3 = 'c';
  934. }
  935. }
  936. }
  937. if (localStorage.getItem('tabVal') == null || this.$route.query.info != 'y') {
  938. this.tabVal = '0';
  939. } else {
  940. this.tabVal = localStorage.getItem('tabVal');
  941. }
  942. this.cstype = this.$route.query.type;
  943. this.query = this.$route.query;
  944. localStorage.removeItem('visitId');
  945. this.getStoreTypeList();
  946. this.getStoreLabels();
  947. this.lat = '';
  948. var postType = localStorage.getItem('postType');
  949. if (postType == 'GZ') {
  950. this.addShow1 = false;
  951. this.otherShow = true;
  952. } else {
  953. this.addShow1 = true;
  954. this.otherShow = false;
  955. }
  956. var week = new Date().getDay();
  957. if (week > 0 && week < 6) {
  958. this.actions[week - 1].name = '今天';
  959. }
  960. this.radio = [];
  961. this.onSearch();
  962. this.getMonth();
  963. },
  964. methods: {
  965. linkapp(val) {
  966. var poind = this.gcj02BD(val.lat, val.lon);
  967. let url = window.location.href;
  968. let that = this;
  969. let wx = this.wx;
  970. let qiyeData;
  971. const instance = axios.create();
  972. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  973. instance
  974. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  975. params: {
  976. url: url,
  977. agent: 1,
  978. },
  979. })
  980. .then((response) => {
  981. if (response.status == 200) {
  982. qiyeData = response.data.data;
  983. wx.agentConfig({
  984. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  985. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  986. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  987. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  988. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  989. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  990. success: function (res) {
  991. wx.invoke(
  992. 'launchMiniprogram',
  993. {
  994. appid: 'wx238bbb5f6d958414',
  995. path:
  996. 'pages/relayStation/relayStation?latitude=' +
  997. poind.lat +
  998. '&longitude=' +
  999. poind.lon +
  1000. '&name=' +
  1001. val.addressLine,
  1002. },
  1003. function (res) {
  1004. if (res.err_msg == 'launchMiniprogram:ok') {
  1005. } else {
  1006. }
  1007. }
  1008. );
  1009. },
  1010. fail: function (res) {
  1011. if (res.errMsg.indexOf('function not exist') > -1) {
  1012. alert('版本过低请升级');
  1013. }
  1014. },
  1015. });
  1016. }
  1017. });
  1018. },
  1019. clearFn() {
  1020. this.storeName = '';
  1021. localStorage.setItem('outvstoreName', '');
  1022. },
  1023. orderFn(val) {
  1024. this.buryingPoint({
  1025. systemModel: '高销额门店推荐',
  1026. buryingPointType: 1,
  1027. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1028. buryingPointName: '去下单',
  1029. buryingPointPosition: '高销额门店推荐',
  1030. });
  1031. getOrderUrlByStoreId({
  1032. storeId: val.storeId,
  1033. from: 'topStore',
  1034. }).then((res) => {
  1035. if (res.code == 200 && res.data) {
  1036. window.location.href = res.data;
  1037. } else {
  1038. this.Toast({
  1039. message: res.msg,
  1040. duration: 5000,
  1041. });
  1042. }
  1043. });
  1044. },
  1045. linkList(val) {
  1046. this.$router.push({
  1047. path: '/pItem',
  1048. query: {
  1049. id: val.storeId,
  1050. detilId: 'a',
  1051. from: 'topStore',
  1052. storeCode: val.storeCode,
  1053. showOrderButton: val.showOrderButton,
  1054. },
  1055. });
  1056. },
  1057. linkimg(val) {
  1058. ProductItemImge({ storeId: val.storeId }).then((response) => {
  1059. if (response.code == 200) {
  1060. if (response.data != undefined) {
  1061. window.open(response.data);
  1062. } else {
  1063. this.$toast(response.msg);
  1064. }
  1065. }
  1066. });
  1067. },
  1068. getMonth() {
  1069. // 获取当前日期
  1070. var currentDate = new Date();
  1071. // 获取当前月份
  1072. var currentMonth = currentDate.getMonth();
  1073. // 获取当前年份
  1074. // var currentYear = currentDate.getFullYear();
  1075. var previousMonthDate1 = new Date();
  1076. if (currentDate.getDate() == 1) {
  1077. previousMonthDate1.setMonth(currentMonth - 1);
  1078. } else {
  1079. }
  1080. var previousMonth1 = previousMonthDate1.getMonth();
  1081. var previousYear1 = previousMonthDate1.getFullYear();
  1082. // 计算前三个月的年份和月份
  1083. var previousMonthDate = new Date();
  1084. if (currentDate.getDate() == 1) {
  1085. previousMonthDate.setMonth(currentMonth - 3);
  1086. } else {
  1087. previousMonthDate.setMonth(currentMonth - 2);
  1088. }
  1089. 1;
  1090. var previousMonth = previousMonthDate.getMonth();
  1091. var previousYear = previousMonthDate.getFullYear();
  1092. //前三个月
  1093. if (previousYear1 == previousYear) {
  1094. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  1095. // 格式化年份和月份
  1096. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  1097. this.timeData =
  1098. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  1099. } else {
  1100. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  1101. // .toString().padStart(2, '0');
  1102. // 格式化年份和月份
  1103. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  1104. this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  1105. }
  1106. },
  1107. jionAll() {
  1108. this.Jointype = 2;
  1109. this.showOutPopover = true;
  1110. },
  1111. storeJoinVisitv(val) {
  1112. this.storeIds = val.storeId;
  1113. this.Jointype = 1;
  1114. this.showOutPopover = true;
  1115. },
  1116. onClickLeft() {
  1117. this.$router.replace({ path: '/deviceWithin' });
  1118. },
  1119. onSelect(val) {
  1120. this.showOutPopover = false;
  1121. var storeIds = '';
  1122. if (this.Jointype == 1) {
  1123. storeIds = this.storeIds;
  1124. } else {
  1125. if (this.radio.length > 0) {
  1126. storeIds = this.radio.join(',');
  1127. } else {
  1128. var storeIdsss = [];
  1129. for (var i = 0; i < this.list.length; i++) {
  1130. if (this.list[i].joinInPaln) {
  1131. storeIdsss.push(this.list[i].storeId);
  1132. }
  1133. }
  1134. storeIds = storeIdsss.join(',');
  1135. }
  1136. }
  1137. topjoinInPlan({ storeIds: storeIds, date: val.id }).then((request) => {
  1138. if (request.code == 200) {
  1139. this.$toast.success('加入成功');
  1140. this.onSearch();
  1141. } else {
  1142. this.$toast(res.msg);
  1143. }
  1144. });
  1145. },
  1146. v1Fn(val) {
  1147. this.value3 = '';
  1148. this.value2 = '';
  1149. this.sortParam = 'sales';
  1150. if (val == 'b') {
  1151. this.sortType = 'desc';
  1152. } else {
  1153. this.sortType = 'asc';
  1154. }
  1155. this.onSearchm();
  1156. },
  1157. v2Fn(val) {
  1158. this.value1 = 'a';
  1159. this.value3 = '';
  1160. this.sortParam = 'visitTime';
  1161. if (val == 'b') {
  1162. this.sortType = 'desc';
  1163. } else {
  1164. this.sortType = 'asc';
  1165. }
  1166. this.onSearchm();
  1167. },
  1168. v3Fn(val) {
  1169. this.value1 = 'a';
  1170. this.value2 = '';
  1171. this.sortParam = 'orderTime';
  1172. if (val == 'b') {
  1173. this.sortType = 'desc';
  1174. } else {
  1175. this.sortType = 'asc';
  1176. }
  1177. this.onSearchm();
  1178. },
  1179. // value1
  1180. moreTypeShowFn() {
  1181. this.moreTypeShow = true;
  1182. // this.CustomerName=""
  1183. // this.chainsData=[]
  1184. this.getCustomer();
  1185. },
  1186. buryingPoint(val) {
  1187. buryingPoint(val);
  1188. },
  1189. getCustomer() {
  1190. var name = '';
  1191. if (this.tabVal != 1) {
  1192. name = 'org';
  1193. } else {
  1194. name = 'my';
  1195. }
  1196. getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
  1197. this.chainsData = request.data;
  1198. this.chainsData.push({});
  1199. this.chainsData.pop();
  1200. });
  1201. },
  1202. onConfirmChainsList(value) {
  1203. if (value.chainName != undefined) {
  1204. this.chainName = value.chainName;
  1205. this.chainCode = value.chainCode;
  1206. }
  1207. this.showPickerChainsList = false;
  1208. this.moreTypeShow = false;
  1209. },
  1210. getStoreLabels() {
  1211. getStoreLabels().then((res) => {
  1212. this.StoreLabels = res.data;
  1213. });
  1214. },
  1215. searchType(val) {
  1216. this.storeTypeLists = [];
  1217. if (val != '') {
  1218. let filterArr = this.storeTypeList.filter((item) => {
  1219. return item.dictLabel.toLowerCase().includes(val.toLowerCase());
  1220. });
  1221. this.storeTypeLists = filterArr;
  1222. } else {
  1223. this.storeTypeLists = this.storeTypeList;
  1224. }
  1225. },
  1226. onConfirm(value) {
  1227. this.storeCategoryList = this.result.join(',');
  1228. // this.typeName=value.dictLabel
  1229. this.showPicker = false;
  1230. this.onSearchm();
  1231. },
  1232. moreTypeShowclearableFn() {
  1233. this.chainName = '';
  1234. this.chainCode = '';
  1235. this.chainsData = [];
  1236. },
  1237. onsets() {
  1238. this.result = [];
  1239. this.zyssl = [];
  1240. this.chtczj = [];
  1241. this.noVisit = [];
  1242. this.noOrder = [];
  1243. this.fxNoOrder = [];
  1244. this.storeLabelTypes = [];
  1245. this.storeCategoryList = this.result.join(',');
  1246. this.chainName = '';
  1247. this.chainCode = '';
  1248. // this.typeName=value.dictLabel
  1249. this.onSearch();
  1250. },
  1251. getStoreTypeList() {
  1252. getStoreTypeListlp({}).then((res) => {
  1253. this.storeTypeLists = res.data;
  1254. this.storeTypeList = res.data;
  1255. });
  1256. },
  1257. // 范围
  1258. rangeStoreFn() {
  1259. getPosition()
  1260. .then((res) => {
  1261. let { TXisBD } = res;
  1262. this.lat = TXisBD.lat;
  1263. this.lon = TXisBD.lon;
  1264. this.buryingPoint({
  1265. systemModel: '高销额门店推荐',
  1266. buryingPointType: 3,
  1267. buryingPointValue: '进入地图',
  1268. buryingPointName: '高销额门店推荐',
  1269. buryingPointPosition: '进入地图',
  1270. });
  1271. this.$router.push({
  1272. path: '/rangeStore',
  1273. query: {
  1274. lat: '',
  1275. lon: '',
  1276. tabVal: 6,
  1277. },
  1278. });
  1279. })
  1280. .catch((error) => {
  1281. this.$dialog.alert({
  1282. message: error,
  1283. });
  1284. });
  1285. // let loading1 = this.$toast.loading({
  1286. // duration: 0,
  1287. // message: '加载中...',
  1288. // forbidClick: true,
  1289. // });
  1290. // let url = window.location.href;
  1291. // let wx = this.wx;
  1292. // var that = this;
  1293. // let qiyeData;
  1294. // const instance = axios.create();
  1295. // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1296. // instance
  1297. // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1298. // params: {
  1299. // url: url,
  1300. // },
  1301. // })
  1302. // .then((response) => {
  1303. // if (response.status == 200) {
  1304. // this.cont = 3;
  1305. // var flat = true;
  1306. // var times = setInterval(() => {
  1307. // this.cont--;
  1308. // if (this.cont == '0') {
  1309. // if (flat) {
  1310. // loading1.clear();
  1311. // clearInterval(times);
  1312. // that.$dialog
  1313. // .alert({
  1314. // message: '定位失败,请开启企微定位权限',
  1315. // })
  1316. // .then(() => {});
  1317. // } else {
  1318. // clearInterval(times);
  1319. // }
  1320. // }
  1321. // }, 1000);
  1322. // qiyeData = response.data.data;
  1323. // wx.config({
  1324. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1325. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1326. // appId: qiyeData.appId, // 必填,企业微信的corpID
  1327. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1328. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1329. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1330. // jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1331. // });
  1332. // wx.ready(function () {
  1333. // wx.getLocation({
  1334. // type: 'gcj02',
  1335. // success: function (res) {
  1336. // flat = false;
  1337. // loading1.clear();
  1338. // that.buryingPoint({
  1339. // systemModel: '高销额门店推荐',
  1340. // buryingPointType: 3,
  1341. // buryingPointValue: '进入地图',
  1342. // buryingPointName: '高销额门店推荐',
  1343. // buryingPointPosition: '进入地图',
  1344. // });
  1345. // that.$router.push({
  1346. // path: '/rangeStore',
  1347. // query: {
  1348. // lat: '',
  1349. // lon: '',
  1350. // tabVal: 6,
  1351. // },
  1352. // });
  1353. // },
  1354. // fail: function () {
  1355. // loading1.clear();
  1356. // that.$dialog.alert({
  1357. // message: 'GPS未开启',
  1358. // });
  1359. // },
  1360. // });
  1361. // });
  1362. // wx.error(function (res) {
  1363. // loading1.clear();
  1364. // that.$dialog
  1365. // .alert({
  1366. // message: '定位失败,请开启企微定位权限',
  1367. // })
  1368. // .then(() => {});
  1369. // });
  1370. // }
  1371. // });
  1372. },
  1373. //取消搜索
  1374. cancelSearch() {
  1375. this.$refs.item.toggle();
  1376. },
  1377. storeJoinVisit(val) {
  1378. joinInPlan({ storeId: val.storeId }).then((res) => {
  1379. if (res.code == 200) {
  1380. this.onSearch();
  1381. } else {
  1382. this.$dialog.alert({
  1383. title: '系统提示',
  1384. message: res.msg,
  1385. });
  1386. }
  1387. });
  1388. },
  1389. searchFn() {
  1390. this.showPicker = true;
  1391. this.CustomerName = '';
  1392. },
  1393. moreSearch() {
  1394. this.onSearch();
  1395. this.$refs.item.toggle();
  1396. },
  1397. getUserOutPlaList() {
  1398. this.storeType = localStorage.getItem('storeType');
  1399. this.customerVisits = localStorage.getItem('customerVisits');
  1400. var that = this;
  1401. let loading3 = this.$toast.loading({
  1402. duration: 0,
  1403. message: '加载中...',
  1404. forbidClick: true,
  1405. });
  1406. this.endShow = false;
  1407. if (this.refreshing) {
  1408. this.list = [];
  1409. this.refreshing = false;
  1410. }
  1411. topStore({
  1412. sortParam: this.sortParam,
  1413. sortType: this.sortType,
  1414. lat: that.lat || '',
  1415. lon: that.lon || '',
  1416. chainCode: this.chainCode,
  1417. storeLabelTypes: this.storeLabelTypes.join(','),
  1418. storeCategoryList: this.storeCategoryList,
  1419. storeName: this.storeName.trim(),
  1420. genDate: this.genDate,
  1421. }).then((res) => {
  1422. this.disabled = false;
  1423. if (res.code == 200) {
  1424. loading3.clear();
  1425. this.loading = false;
  1426. if (res.data.storeList != undefined) {
  1427. this.list = res.data.storeList;
  1428. this.showKM = res.data.coverUser;
  1429. this.list.forEach((item) => {
  1430. if (item.stateString.indexOf('拜访中') != -1) {
  1431. this.endShow = true;
  1432. this.visitEndId = item.visitId;
  1433. return;
  1434. }
  1435. });
  1436. res.data.storeList.forEach((item) => {
  1437. this.showPopoverVNUM.push({ showPopover: false });
  1438. this.showPopoverC.push({ showPopover: false });
  1439. this.showPopoverZ.push({ showPopover: false });
  1440. if (item.joinInPaln) {
  1441. this.showAll = true;
  1442. }
  1443. });
  1444. } else {
  1445. this.list = [];
  1446. }
  1447. } else {
  1448. loading3.clear();
  1449. this.$dialog.alert({
  1450. title: '系统提示',
  1451. message: res.msg,
  1452. });
  1453. }
  1454. });
  1455. },
  1456. storeVisit(val) {
  1457. if (val.visitSource && val.visitSource == 2) {
  1458. this.$toast('请先取消异常拜访后再进入正常拜访!');
  1459. return;
  1460. }
  1461. localStorage.setItem('tabVal', this.tabVal);
  1462. localStorage.removeItem('visitId');
  1463. checkVisit({ storeId: val.storeId }).then((res) => {
  1464. this.buryingPoint({
  1465. systemModel: '高销额门店推荐',
  1466. buryingPointType: 1,
  1467. buryingPointValue: '进店拜访',
  1468. buryingPointName: '进店拜访',
  1469. buryingPointPosition: '高销额门店推荐',
  1470. });
  1471. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1472. if (localStorage.getItem('loginType') == 'cs') {
  1473. var lat = '';
  1474. var lon = '';
  1475. if (val.lat == '' || val.lat == null) {
  1476. lat = '31.2517820000';
  1477. lon = '120.5593090000';
  1478. } else {
  1479. lat = val.lat;
  1480. lon = val.lon;
  1481. }
  1482. this.$router.push({
  1483. path: '/suishenbangOutstoreVisit',
  1484. query: {
  1485. storeId: val.storeId,
  1486. rdId: val.rdId,
  1487. lat: lat,
  1488. lon: lon,
  1489. visitId: val.visitId,
  1490. pageType: 'out',
  1491. addressLine: val.addressLine,
  1492. storeCategory: val.storeCategory,
  1493. storeName: val.storeName,
  1494. hisTime: val.hisTime,
  1495. contactName: val.contactName,
  1496. storeCode: val.storeCode,
  1497. tabVal: this.tabVal,
  1498. visitModel: '1',
  1499. latNew: '31.2517820000',
  1500. lonNew: '120.5593090000',
  1501. PointSum: 0,
  1502. marklat: lat,
  1503. marklon: lon,
  1504. linkType: 6,
  1505. from: 'topStore',
  1506. },
  1507. });
  1508. localStorage.setItem('startTime', new Date());
  1509. localStorage.setItem('ORGName', val.deptName);
  1510. localStorage.setItem('chainNameR', val.storeName);
  1511. } else {
  1512. if (this.flag) {
  1513. this.flag = false;
  1514. this.timer = null;
  1515. let that = this;
  1516. this.timer = setTimeout(() => {
  1517. this.flag = true;
  1518. }, 2000);
  1519. if (val.stateString.indexOf('拜访中') != -1) {
  1520. localStorage.setItem('startTime', new Date());
  1521. localStorage.setItem('ORGName', val.deptName);
  1522. localStorage.setItem('chainNameR', val.storeName);
  1523. that.$router.push({
  1524. path: '/suishenbangOutstoreVisit',
  1525. query: {
  1526. storeId: val.storeId,
  1527. rdId: val.rdId,
  1528. lat: val.lat,
  1529. lon: val.lon,
  1530. visitId: val.visitId,
  1531. pageType: 'out',
  1532. addressLine: val.addressLine,
  1533. storeCategory: val.storeCategory,
  1534. storeName: val.storeName,
  1535. hisTime: val.hisTime,
  1536. contactName: val.contactName,
  1537. storeCode: val.storeCode,
  1538. tabVal: that.tabVal,
  1539. visitModel: '1',
  1540. latNew: val.lat,
  1541. lonNew: val.lon,
  1542. PointSum: '0',
  1543. marklat: val.lat,
  1544. marklon: val.lon,
  1545. linkType: 6,
  1546. from: 'topStore',
  1547. },
  1548. });
  1549. } else {
  1550. getPosition()
  1551. .then((res) => {
  1552. let { TXisBD, resData } = res;
  1553. this.lat = TXisBD.lat;
  1554. this.lon = TXisBD.lon;
  1555. localStorage.setItem('lat', this.lat);
  1556. localStorage.setItem('lon', this.lon);
  1557. // var location = this.CJ02BD(res.latitude, res.longitude);
  1558. this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
  1559. })
  1560. .catch((error) => {
  1561. this.$dialog.alert({
  1562. message: error,
  1563. });
  1564. });
  1565. // let loading1 = this.$toast.loading({
  1566. // duration: 0,
  1567. // message: '加载中...',
  1568. // forbidClick: true,
  1569. // });
  1570. // let url = window.location.href;
  1571. // let wx = this.wx;
  1572. // let qiyeData;
  1573. // const instance = axios.create();
  1574. // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1575. // instance
  1576. // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1577. // params: {
  1578. // url: url,
  1579. // },
  1580. // })
  1581. // .then((response) => {
  1582. // if (response.status == 200) {
  1583. // this.cont = 5;
  1584. // var flat = true;
  1585. // var times = setInterval(() => {
  1586. // this.cont--;
  1587. // if (this.cont == '0') {
  1588. // if (flat) {
  1589. // loading1.clear();
  1590. // clearInterval(times);
  1591. // that.$dialog
  1592. // .alert({
  1593. // message: '定位失败,请开启企微定位权限',
  1594. // })
  1595. // .then(() => {});
  1596. // } else {
  1597. // clearInterval(times);
  1598. // }
  1599. // }
  1600. // }, 1000);
  1601. // qiyeData = response.data.data;
  1602. // wx.config({
  1603. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1604. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1605. // appId: qiyeData.appId, // 必填,企业微信的corpID
  1606. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1607. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1608. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1609. // jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1610. // });
  1611. // wx.ready(() => {
  1612. // wx.getLocation({
  1613. // type: 'gcj02',
  1614. // success: (res) => {
  1615. // flat = false;
  1616. // // loading1.clear();
  1617. // var location = that.CJ02BD(res.latitude, res.longitude);
  1618. // checkStoreAddressByStoreCode({
  1619. // storeCode: val.storeCode,
  1620. // lon: location.lon,
  1621. // lat: location.lat,
  1622. // }).then((response) => {
  1623. // loading1.clear();
  1624. // if (val.lat == '' || val.lat == null) {
  1625. // this.lat = location.lat;
  1626. // this.lon = location.lon;
  1627. // } else {
  1628. // this.lat = val.lat;
  1629. // this.lon = val.lon;
  1630. // }
  1631. // let PointSum = this.twoPointSum(
  1632. // this.lat,
  1633. // this.lon,
  1634. // location.lat,
  1635. // location.lon
  1636. // ).toFixed(2);
  1637. // let PointSumval = this.twoPointSum(
  1638. // location.lat,
  1639. // location.lon,
  1640. // location.lat,
  1641. // location.lon
  1642. // ).toFixed(2);
  1643. // // GZ:工装店铺 直接进入拜访
  1644. // if (localStorage.getItem('postType') == 'GZ') {
  1645. // localStorage.setItem('startTime', new Date());
  1646. // localStorage.setItem('ORGName', val.deptName);
  1647. // localStorage.setItem('chainNameR', val.storeName);
  1648. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1649. // return;
  1650. // }
  1651. // // 门店编码校验门店地址不通过
  1652. // if (response.code != 200) {
  1653. // // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1654. // if (response.data.updateAddress == 0) {
  1655. // // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1656. // this.$dialog
  1657. // .confirm({
  1658. // confirmButtonText: '确定拜访',
  1659. // cancelButtonText: '取消拜访',
  1660. // title: '系统提示',
  1661. // message:
  1662. // '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1663. // closeOnClickOverlay: true,
  1664. // })
  1665. // .then(() => {
  1666. // this.toSuishenbangOutstoreVisit(
  1667. // res,
  1668. // val,
  1669. // location,
  1670. // PointSumval
  1671. // );
  1672. // });
  1673. // } else if (response.data.updateAddress == 1) {
  1674. // // 同城AB+金牌,去修改地址
  1675. // // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1676. // if (!response.data.addressUpdateTimesOver) {
  1677. // this.$dialog
  1678. // .confirm({
  1679. // title: '系统提示',
  1680. // message: response.msg + '请立即修改后再拜访',
  1681. // messageAlign: 'left',
  1682. // confirmButtonText: '立即修改',
  1683. // cancelButtonText: '取消',
  1684. // })
  1685. // .then(() => {
  1686. // this.$router.push({
  1687. // path: '/storeDetail',
  1688. // query: {
  1689. // id: val.storeId,
  1690. // type: 'address',
  1691. // storeAddressId: val.storeAddressId,
  1692. // },
  1693. // });
  1694. // });
  1695. // } else {
  1696. // this.$dialog.confirm({
  1697. // title: '系统提示',
  1698. // message: '已经达到最大修改次数',
  1699. // messageAlign: 'left',
  1700. // confirmButtonText: '确定',
  1701. // });
  1702. // }
  1703. // } else if (response.data.updateAddress == 2) {
  1704. // // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1705. // this.resetCoord(res, val, location, PointSumval);
  1706. // return;
  1707. // }
  1708. // } else {
  1709. // // 门店编码校验门店地址通过 进入拜访
  1710. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1711. // }
  1712. // });
  1713. // },
  1714. // fail: function () {
  1715. // loading1.clear();
  1716. // that.$dialog.alert({
  1717. // message: 'GPS未开启',
  1718. // });
  1719. // },
  1720. // });
  1721. // });
  1722. // wx.error(function (error) {
  1723. // loading1.clear();
  1724. // that.$dialog
  1725. // .alert({
  1726. // message: '定位失败,请开启企微定位权限',
  1727. // })
  1728. // .then(() => {});
  1729. // });
  1730. // }
  1731. // });
  1732. }
  1733. }
  1734. }
  1735. } else {
  1736. this.$dialog.alert({
  1737. title: '系统提示',
  1738. message: res.msg,
  1739. });
  1740. }
  1741. });
  1742. },
  1743. checkStoreAddressByStoreCodeFun(val, location, res) {
  1744. checkStoreAddressByStoreCode({
  1745. storeCode: val.storeCode,
  1746. lon: location.lon,
  1747. lat: location.lat,
  1748. }).then((response) => {
  1749. // loading1.clear();
  1750. if (val.lat == '' || val.lat == null) {
  1751. this.lat = location.lat;
  1752. this.lon = location.lon;
  1753. } else {
  1754. this.lat = val.lat;
  1755. this.lon = val.lon;
  1756. }
  1757. // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
  1758. let PointSumval = this.twoPointSum(
  1759. location.lat,
  1760. location.lon,
  1761. location.lat,
  1762. location.lon
  1763. ).toFixed(2);
  1764. // GZ:工装店铺 直接进入拜访
  1765. if (localStorage.getItem('postType') == 'GZ') {
  1766. localStorage.setItem('startTime', new Date());
  1767. localStorage.setItem('ORGName', val.deptName);
  1768. localStorage.setItem('chainNameR', val.storeName);
  1769. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1770. return;
  1771. }
  1772. // 门店校验 地址不通过
  1773. if (response.code != 200) {
  1774. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1775. if (response.data.updateAddress == 0) {
  1776. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1777. this.$dialog
  1778. .confirm({
  1779. confirmButtonText: '确定拜访',
  1780. cancelButtonText: '取消拜访',
  1781. title: '系统提示',
  1782. message:
  1783. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1784. closeOnClickOverlay: true,
  1785. })
  1786. .then(() => {
  1787. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1788. });
  1789. } else if (response.data.updateAddress == 1) {
  1790. // 同城AB+金牌,去修改地址
  1791. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1792. if (!response.data.addressUpdateTimesOver) {
  1793. this.$dialog
  1794. .confirm({
  1795. title: '系统提示',
  1796. message: response.msg + '请立即修改后再拜访',
  1797. messageAlign: 'left',
  1798. confirmButtonText: '立即修改',
  1799. cancelButtonText: '取消',
  1800. })
  1801. .then(() => {
  1802. this.$router.push({
  1803. path: '/storeDetail',
  1804. query: {
  1805. id: val.storeId,
  1806. type: 'address',
  1807. storeAddressId: val.storeAddressId,
  1808. },
  1809. });
  1810. });
  1811. } else {
  1812. this.$dialog.confirm({
  1813. title: '系统提示',
  1814. message: '已经达到最大修改次数',
  1815. messageAlign: 'left',
  1816. confirmButtonText: '确定',
  1817. });
  1818. }
  1819. } else if (response.data.updateAddress == 2) {
  1820. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1821. this.resetCoord(res, val, location, PointSumval);
  1822. return;
  1823. }
  1824. } else {
  1825. // 门店编码校验门店地址通过 进入拜访
  1826. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1827. }
  1828. });
  1829. },
  1830. // 重置经纬度
  1831. resetCoord(res, val, location, PointSumval) {
  1832. this.$dialog
  1833. .confirm({
  1834. confirmButtonText: '初始化定位',
  1835. cancelButtonText: '取消拜访',
  1836. title: '系统提示',
  1837. message: '偏差过大,不允许拜访。可修改本店定位.',
  1838. closeOnClickOverlay: true,
  1839. })
  1840. .then(() => {
  1841. mobileReposition({
  1842. storeId: val.storeId,
  1843. lat: location.lat,
  1844. lon: location.lon,
  1845. }).then((response) => {
  1846. if (response.code == 200) {
  1847. this.$dialog
  1848. .alert({
  1849. title: '系统提示',
  1850. message: '本信息定位已更新成功!',
  1851. })
  1852. .then(() => {
  1853. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1854. });
  1855. localStorage.setItem('startTime', new Date());
  1856. localStorage.setItem('ORGName', val.deptName);
  1857. localStorage.setItem('chainNameR', val.storeName);
  1858. } else {
  1859. this.$toast(response.msg);
  1860. }
  1861. });
  1862. });
  1863. },
  1864. // 进入拜访 router.push
  1865. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1866. addVisitsPosition({
  1867. storeId: val.storeId,
  1868. visitsId: '',
  1869. lon: res.longitude,
  1870. lat: res.latitude,
  1871. sourceLon: location.lon,
  1872. sourceLat: location.lat,
  1873. positionDesc: '',
  1874. accuracy: res.accuracy,
  1875. });
  1876. this.$router.push({
  1877. path: '/suishenbangOutstoreVisit',
  1878. query: {
  1879. storeId: val.storeId,
  1880. rdId: val.rdId,
  1881. lat: location.lat,
  1882. lon: location.lon,
  1883. visitId: val.visitId,
  1884. pageType: 'out',
  1885. addressLine: val.addressLine,
  1886. storeCategory: val.storeCategory,
  1887. storeName: val.storeName,
  1888. hisTime: val.hisTime,
  1889. contactName: val.contactName,
  1890. storeCode: val.storeCode,
  1891. tabVal: this.tabVal,
  1892. visitModel: '1',
  1893. latNew: location.lat,
  1894. lonNew: location.lon,
  1895. PointSum: PointSumval,
  1896. marklat: res.latitude,
  1897. marklon: res.longitude,
  1898. from: 'topStore',
  1899. },
  1900. });
  1901. },
  1902. projectOutVisit(val) {
  1903. localStorage.setItem('tabVal', this.tabVal);
  1904. localStorage.removeItem('visitId');
  1905. // checkVisit({storeId:val.storeId}).then(res=>{
  1906. // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
  1907. if (localStorage.getItem('loginType') == 'cs') {
  1908. var lat = '';
  1909. var lon = '';
  1910. if (val.lat == '' || val.lat == null) {
  1911. lat = '31.2517820000';
  1912. lon = '120.5593090000';
  1913. } else {
  1914. lat = val.lat;
  1915. lon = val.lon;
  1916. }
  1917. this.$router.push({
  1918. path: '/storeGroup',
  1919. query: {
  1920. storeId: val.storeId,
  1921. rdId: val.rdId,
  1922. lat: lat,
  1923. lon: lon,
  1924. visitId: val.visitId,
  1925. pageType: 'out',
  1926. addressLine: val.addressLine,
  1927. storeCategory: val.storeCategory,
  1928. storeName: val.storeName,
  1929. hisTime: val.hisTime,
  1930. contactName: val.contactName,
  1931. storeCode: val.storeCode,
  1932. tabVal: this.tabVal,
  1933. visitModel: '1',
  1934. latNew: '31.2517820000',
  1935. lonNew: '120.5593090000',
  1936. PointSum: 0,
  1937. marklat: lat,
  1938. marklon: lon,
  1939. },
  1940. });
  1941. localStorage.setItem('startTime', new Date());
  1942. localStorage.setItem('ORGName', val.deptName);
  1943. localStorage.setItem('chainNameR', val.storeName);
  1944. } else {
  1945. if (this.flag) {
  1946. this.flag = false;
  1947. this.timer = null;
  1948. let that = this;
  1949. this.timer = setTimeout(() => {
  1950. this.flag = true;
  1951. }, 2000);
  1952. if (val.stateString.indexOf('拜访中') != -1) {
  1953. localStorage.setItem('startTime', new Date());
  1954. localStorage.setItem('ORGName', val.deptName);
  1955. localStorage.setItem('chainNameR', val.storeName);
  1956. that.$router.push({
  1957. path: '/storeGroup',
  1958. query: {
  1959. storeId: val.storeId,
  1960. rdId: val.rdId,
  1961. lat: val.lat,
  1962. lon: val.lon,
  1963. visitId: val.visitId,
  1964. pageType: 'out',
  1965. addressLine: val.addressLine,
  1966. storeCategory: val.storeCategory,
  1967. storeName: val.storeName,
  1968. hisTime: val.hisTime,
  1969. contactName: val.contactName,
  1970. storeCode: val.storeCode,
  1971. tabVal: that.tabVal,
  1972. visitModel: '1',
  1973. latNew: val.lat,
  1974. lonNew: val.lon,
  1975. PointSum: '0',
  1976. marklat: val.lat,
  1977. marklon: val.lon,
  1978. },
  1979. });
  1980. } else {
  1981. let loading1 = this.$toast.loading({
  1982. duration: 0,
  1983. message: '加载中...',
  1984. forbidClick: true,
  1985. });
  1986. let url = window.location.href;
  1987. let wx = this.wx;
  1988. let qiyeData;
  1989. const instance = axios.create();
  1990. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1991. instance
  1992. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1993. params: {
  1994. url: url,
  1995. },
  1996. })
  1997. .then((response) => {
  1998. if (response.status == 200) {
  1999. this.cont = 3;
  2000. var flat = true;
  2001. var times = setInterval(() => {
  2002. this.cont--;
  2003. if (this.cont == '0') {
  2004. if (flat) {
  2005. loading1.clear();
  2006. clearInterval(times);
  2007. that.$dialog
  2008. .alert({
  2009. message: '定位失败,请开启企微定位权限',
  2010. })
  2011. .then(() => {});
  2012. } else {
  2013. clearInterval(times);
  2014. }
  2015. }
  2016. }, 1000);
  2017. qiyeData = response.data.data;
  2018. wx.config({
  2019. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2020. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2021. appId: qiyeData.appId, // 必填,企业微信的corpID
  2022. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2023. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2024. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2025. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2026. });
  2027. wx.ready(function () {
  2028. wx.getLocation({
  2029. type: 'gcj02',
  2030. success: function (res) {
  2031. flat = false;
  2032. loading1.clear();
  2033. var location = that.CJ02BD(res.latitude, res.longitude);
  2034. if (val.lat == '' || val.lat == null) {
  2035. that.lat = location.lat;
  2036. that.lon = location.lon;
  2037. } else {
  2038. that.lat = val.lat;
  2039. that.lon = val.lon;
  2040. }
  2041. let PointSum = that
  2042. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  2043. .toFixed(2);
  2044. if (val.lat == '' || val.lat == null) {
  2045. if (localStorage.getItem('postType') != 'GZ') {
  2046. that.$dialog
  2047. .confirm({
  2048. confirmButtonText: '确定拜访',
  2049. cancelButtonText: '取消拜访',
  2050. title: '系统提示',
  2051. message:
  2052. '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
  2053. closeOnClickOverlay: true,
  2054. })
  2055. .then(() => {
  2056. that.$router.push({
  2057. path: '/storeGroup',
  2058. query: {
  2059. storeId: val.storeId,
  2060. rdId: val.rdId,
  2061. lat: that.lat,
  2062. lon: that.lon,
  2063. visitId: val.visitId,
  2064. pageType: 'out',
  2065. addressLine: val.addressLine,
  2066. storeCategory: val.storeCategory,
  2067. storeName: val.storeName,
  2068. contactName: val.contactName,
  2069. hisTime: val.hisTime,
  2070. storeCode: val.storeCode,
  2071. tabVal: that.tabVal,
  2072. visitModel: '1',
  2073. latNew: location.lat,
  2074. lonNew: location.lon,
  2075. PointSum: PointSum,
  2076. marklat: res.latitude,
  2077. marklon: res.longitude,
  2078. },
  2079. });
  2080. });
  2081. } else {
  2082. that.$router.push({
  2083. path: '/storeGroup',
  2084. query: {
  2085. storeId: val.storeId,
  2086. rdId: val.rdId,
  2087. lat: that.lat,
  2088. lon: that.lon,
  2089. visitId: val.visitId,
  2090. pageType: 'out',
  2091. addressLine: val.addressLine,
  2092. storeCategory: val.storeCategory,
  2093. storeName: val.storeName,
  2094. contactName: val.contactName,
  2095. hisTime: val.hisTime,
  2096. storeCode: val.storeCode,
  2097. tabVal: that.tabVal,
  2098. visitModel: '1',
  2099. latNew: location.lat,
  2100. lonNew: location.lon,
  2101. PointSum: PointSum,
  2102. marklat: res.latitude,
  2103. marklon: res.longitude,
  2104. },
  2105. });
  2106. }
  2107. } else {
  2108. that.$router.push({
  2109. path: '/storeGroup',
  2110. query: {
  2111. storeId: val.storeId,
  2112. rdId: val.rdId,
  2113. lat: that.lat,
  2114. lon: that.lon,
  2115. visitId: val.visitId,
  2116. pageType: 'out',
  2117. addressLine: val.addressLine,
  2118. storeCategory: val.storeCategory,
  2119. storeName: val.storeName,
  2120. contactName: val.contactName,
  2121. hisTime: val.hisTime,
  2122. storeCode: val.storeCode,
  2123. tabVal: that.tabVal,
  2124. visitModel: '1',
  2125. latNew: location.lat,
  2126. lonNew: location.lon,
  2127. PointSum: PointSum,
  2128. marklat: res.latitude,
  2129. marklon: res.longitude,
  2130. },
  2131. });
  2132. }
  2133. localStorage.setItem('startTime', new Date());
  2134. localStorage.setItem('ORGName', val.deptName);
  2135. localStorage.setItem('chainNameR', val.storeName);
  2136. addVisitsPosition({
  2137. storeId: val.storeId,
  2138. visitsId: '',
  2139. lon: res.longitude,
  2140. lat: res.latitude,
  2141. sourceLon: location.lon,
  2142. sourceLat: location.lat,
  2143. positionDesc: '',
  2144. accuracy: res.accuracy,
  2145. });
  2146. },
  2147. fail: function () {
  2148. loading1.clear();
  2149. that.$dialog.alert({
  2150. message: 'GPS未开启',
  2151. });
  2152. },
  2153. });
  2154. });
  2155. wx.error(function (res) {
  2156. loading1.clear();
  2157. that.$dialog
  2158. .alert({
  2159. message: '定位失败,请开启企微定位权限',
  2160. })
  2161. .then(() => {});
  2162. });
  2163. }
  2164. });
  2165. }
  2166. }
  2167. }
  2168. // }
  2169. // })
  2170. },
  2171. abnormalVisit(val) {
  2172. localStorage.removeItem('visitId');
  2173. localStorage.setItem('tabVal', this.tabVal);
  2174. checkVisit({ storeId: val.storeId }).then((res) => {
  2175. this.buryingPoint({
  2176. systemModel: '高销额门店推荐',
  2177. buryingPointType: 1,
  2178. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  2179. buryingPointName: '异常拜访',
  2180. buryingPointPosition: '高销额门店推荐',
  2181. });
  2182. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  2183. if (localStorage.getItem('loginType') == 'cs') {
  2184. var lat = '';
  2185. var lon = '';
  2186. if (val.lat == '' || val.lat == null) {
  2187. lat = '31.2517820000';
  2188. lon = '120.5593090000';
  2189. } else {
  2190. lat = val.lat;
  2191. lon = val.lon;
  2192. }
  2193. this.$router.push({
  2194. path: '/outabnormalVisit',
  2195. query: {
  2196. storeId: val.storeId,
  2197. rdId: val.rdId,
  2198. lat: lat,
  2199. lon: lon,
  2200. visitId: val.visitId,
  2201. pageType: 'out',
  2202. addressLine: val.addressLine,
  2203. storeCategory: val.storeCategory,
  2204. storeName: val.storeName,
  2205. hisTime: val.hisTime,
  2206. contactName: val.contactName,
  2207. storeCode: val.storeCode,
  2208. tabVal: this.tabVal,
  2209. visitModel: '3',
  2210. latNew: '31.2517820000',
  2211. lonNew: '120.5593090000',
  2212. PointSum: 0,
  2213. marklat: lat,
  2214. marklon: lon,
  2215. linkType: 6,
  2216. },
  2217. });
  2218. localStorage.setItem('startTime', new Date());
  2219. localStorage.setItem('ORGName', val.deptName);
  2220. localStorage.setItem('chainNameR', val.storeName);
  2221. } else {
  2222. if (this.flag) {
  2223. this.flag = false;
  2224. this.timer = null;
  2225. this.timer = setTimeout(() => {
  2226. this.flag = true;
  2227. }, 2000);
  2228. let loading1 = this.$toast.loading({
  2229. duration: 0,
  2230. message: '加载中...',
  2231. forbidClick: true,
  2232. });
  2233. let url = window.location.href;
  2234. let that = this;
  2235. let wx = this.wx;
  2236. let qiyeData;
  2237. const instance = axios.create();
  2238. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2239. instance
  2240. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2241. params: {
  2242. url: url,
  2243. },
  2244. })
  2245. .then((response) => {
  2246. if (response.status == 200) {
  2247. this.cont = 3;
  2248. var flat = true;
  2249. var times = setInterval(() => {
  2250. this.cont--;
  2251. if (this.cont == '0') {
  2252. if (flat) {
  2253. loading1.clear();
  2254. clearInterval(times);
  2255. that.$dialog
  2256. .alert({
  2257. message: '定位失败,请开启企微定位权限',
  2258. })
  2259. .then(() => {
  2260. this.$router.go(-1);
  2261. });
  2262. } else {
  2263. clearInterval(times);
  2264. }
  2265. }
  2266. }, 1000);
  2267. qiyeData = response.data.data;
  2268. wx.config({
  2269. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2270. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2271. appId: qiyeData.appId, // 必填,企业微信的corpID
  2272. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2273. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2274. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2275. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2276. });
  2277. wx.ready(function () {
  2278. wx.getLocation({
  2279. type: 'gcj02',
  2280. success: function (res) {
  2281. flat = false;
  2282. loading1.clear();
  2283. var location = that.CJ02BD(res.latitude, res.longitude);
  2284. if (val.lat == '' || val.lat == null) {
  2285. that.lat = location.lat;
  2286. that.lon = location.lon;
  2287. } else {
  2288. that.lat = val.lat;
  2289. that.lon = val.lon;
  2290. }
  2291. let PointSum = that
  2292. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  2293. .toFixed(2);
  2294. if (PointSum > 500 && localStorage.getItem('postType') != 'GZ') {
  2295. that.$dialog
  2296. .confirm({
  2297. confirmButtonText: '确定',
  2298. cancelButtonText: '取消',
  2299. title: '系统提示',
  2300. message: '定位距离偏差大',
  2301. closeOnClickOverlay: true,
  2302. })
  2303. .then(() => {
  2304. that.$router.push({
  2305. path: '/outabnormalVisit',
  2306. query: {
  2307. storeId: val.storeId,
  2308. rdId: val.rdId,
  2309. lat: that.lat,
  2310. lon: that.lon,
  2311. visitId: val.visitId,
  2312. pageType: 'out',
  2313. visitModel: '5',
  2314. storeCode: val.storeCode,
  2315. tabVal: that.tabVal,
  2316. latNew: location.lat,
  2317. lonNew: location.lon,
  2318. PointSum: PointSum,
  2319. marklat: res.latitude,
  2320. marklon: res.longitude,
  2321. linkType: 6,
  2322. },
  2323. });
  2324. localStorage.setItem('startTime', new Date());
  2325. localStorage.setItem('ORGName', val.deptName);
  2326. localStorage.setItem('chainNameR', val.storeName);
  2327. })
  2328. .catch(() => {
  2329. // that.abnormalVisit(val)
  2330. });
  2331. } else {
  2332. that.$router.push({
  2333. path: '/outabnormalVisit',
  2334. query: {
  2335. storeId: val.storeId,
  2336. rdId: val.rdId,
  2337. lat: that.lat,
  2338. lon: that.lon,
  2339. visitId: val.visitId,
  2340. pageType: 'out',
  2341. visitModel: '3',
  2342. storeCode: val.storeCode,
  2343. tabVal: that.tabVal,
  2344. latNew: location.lat,
  2345. lonNew: location.lon,
  2346. PointSum: PointSum,
  2347. marklat: res.latitude,
  2348. marklon: res.longitude,
  2349. linkType: 6,
  2350. },
  2351. });
  2352. localStorage.setItem('startTime', new Date());
  2353. localStorage.setItem('ORGName', val.deptName);
  2354. localStorage.setItem('chainNameR', val.storeName);
  2355. }
  2356. addVisitsPosition({
  2357. storeId: val.storeId,
  2358. visitsId: '',
  2359. lon: res.longitude,
  2360. lat: res.latitude,
  2361. sourceLon: location.lon,
  2362. sourceLat: location.lat,
  2363. positionDesc: '',
  2364. accuracy: res.accuracy,
  2365. });
  2366. },
  2367. fail: function () {
  2368. loading1.clear();
  2369. that.$dialog
  2370. .alert({
  2371. message: 'GPS未开启',
  2372. })
  2373. .then(() => {
  2374. // that.abnormalVisit(val)
  2375. });
  2376. },
  2377. });
  2378. });
  2379. wx.error(function (res) {
  2380. loading1.clear();
  2381. that.$dialog
  2382. .alert({
  2383. message: '定位失败,请开启企微定位权限',
  2384. })
  2385. .then(() => {});
  2386. });
  2387. } else {
  2388. loading1.clear();
  2389. this.$toast.fail(dataList.msg);
  2390. }
  2391. });
  2392. // this.$router.push({path: "/outabnormalVisit", query: {
  2393. // storeId:"179792",
  2394. // rdId:"null",
  2395. // lat:"31.1882020000",
  2396. // lon:"120.6801770000",
  2397. // visitId:"null",
  2398. // visitModel:"5",
  2399. // storeCode:"0190141901",
  2400. // tabVal:"0",
  2401. // latNew:34.621855582632264,
  2402. // lonNew:112.45382530736684,
  2403. // PointSum:857246.44
  2404. // }})
  2405. localStorage.setItem('startTime', new Date());
  2406. localStorage.setItem('ORGName', val.deptName);
  2407. localStorage.setItem('chainNameR', val.storeName);
  2408. }
  2409. }
  2410. } else {
  2411. this.$dialog.alert({
  2412. title: '系统提示',
  2413. message: res.msg,
  2414. });
  2415. }
  2416. });
  2417. },
  2418. visitFn(val) {
  2419. this.buryingPoint({
  2420. systemModel: '高销额门店推荐',
  2421. buryingPointType: 1,
  2422. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  2423. buryingPointName: '客户信息',
  2424. buryingPointPosition: '高销额门店推荐',
  2425. });
  2426. // designerStore 是否为设计师招募门店,true-是,false-否
  2427. if (val.designerStore) {
  2428. this.$router.push({
  2429. path: '/addDesignerDetail',
  2430. query: { id: val.storeId },
  2431. });
  2432. return;
  2433. } else {
  2434. this.$router.push({
  2435. path: '/storeDetail',
  2436. query: { id: val.storeId, detilId: 'a' },
  2437. });
  2438. }
  2439. },
  2440. // 大客户签约
  2441. signAdd(val) {
  2442. this.$router.push({
  2443. path: '/sign',
  2444. query: { id: val.storeId, detilId: 'a' },
  2445. });
  2446. },
  2447. Visit(val) {
  2448. this.$router.push({
  2449. path: '/historicalDetails',
  2450. query: {
  2451. visitId: val.visitId,
  2452. storeId: val.storeId,
  2453. storeCode: val.storeCode,
  2454. },
  2455. });
  2456. },
  2457. onSearch() {
  2458. window.scrollTo(0, 0);
  2459. this.list = [];
  2460. this.finished = true;
  2461. this.cstype = this.$route.query.type;
  2462. this.getPositionFn();
  2463. if (this.lat != '') {
  2464. this.onLoad();
  2465. } else {
  2466. let loading3 = this.$toast.loading({
  2467. duration: 0,
  2468. message: '加载中...',
  2469. forbidClick: true,
  2470. });
  2471. setTimeout(() => {
  2472. loading3.clear();
  2473. this.onLoad();
  2474. }, 1000);
  2475. }
  2476. },
  2477. getPositionFn() {
  2478. var that = this;
  2479. let url = window.location.href;
  2480. let wx = this.wx;
  2481. let qiyeData;
  2482. const instance = axios.create();
  2483. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2484. instance
  2485. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2486. params: {
  2487. url: url,
  2488. },
  2489. })
  2490. .then((response) => {
  2491. if (response.status == 200) {
  2492. this.cont = 3;
  2493. var flat = true;
  2494. var times = setInterval(() => {
  2495. this.cont--;
  2496. if (this.cont == '0') {
  2497. if (flat) {
  2498. clearInterval(times);
  2499. } else {
  2500. clearInterval(times);
  2501. }
  2502. }
  2503. }, 1000);
  2504. qiyeData = response.data.data;
  2505. wx.config({
  2506. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2507. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2508. appId: qiyeData.appId, // 必填,企业微信的corpID
  2509. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2510. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2511. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2512. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2513. });
  2514. wx.ready(function () {
  2515. wx.getLocation({
  2516. type: 'gcj02',
  2517. success: function (res) {
  2518. flat = false;
  2519. var location = that.CJ02BD(res.latitude, res.longitude);
  2520. that.lat = location.lat;
  2521. that.lon = location.lon;
  2522. },
  2523. });
  2524. });
  2525. }
  2526. });
  2527. },
  2528. buryingPointFn(val) {
  2529. this.buryingPoint({
  2530. systemModel: '高销额门店推荐',
  2531. buryingPointType: 1,
  2532. buryingPointValue: val.telephone,
  2533. buryingPointName: '点击电话',
  2534. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  2535. });
  2536. },
  2537. onSearchm() {
  2538. var postType = localStorage.getItem('postType');
  2539. if (postType == 'GZ') {
  2540. this.typeShow = false;
  2541. } else {
  2542. this.typeShow = true;
  2543. }
  2544. var StoreLabelsArr = [];
  2545. for (var k = 0; k < this.storeLabelTypes.length; k++) {
  2546. for (var k1 = 0; k1 < this.StoreLabels.length; k1++) {
  2547. if (this.StoreLabels[k1].dictValue == this.storeLabelTypes[k]) {
  2548. StoreLabelsArr.push(this.StoreLabels[k1].dictLabel);
  2549. }
  2550. }
  2551. }
  2552. var storeCategoryList = [];
  2553. for (var q = 0; q < this.result.length; q++) {
  2554. for (var q1 = 0; q1 < this.storeTypeLists.length; q1++) {
  2555. if (this.storeTypeLists[q1].dictValue == this.result[q]) {
  2556. storeCategoryList.push(this.storeTypeLists[q1].dictLabel);
  2557. }
  2558. }
  2559. }
  2560. if (this.storeLabelTypes.length > 0) {
  2561. this.buryingPoint({
  2562. systemModel: '高销额门店推荐',
  2563. buryingPointType: 1,
  2564. buryingPointValue: StoreLabelsArr.join(','),
  2565. buryingPointName: '标签',
  2566. buryingPointPosition: '客户信息筛选',
  2567. });
  2568. }
  2569. if (this.storeCategoryList != '') {
  2570. this.buryingPoint({
  2571. systemModel: '高销额门店推荐',
  2572. buryingPointType: 1,
  2573. buryingPointValue: storeCategoryList.join(','),
  2574. buryingPointName: '类型',
  2575. buryingPointPosition: '客户信息筛选',
  2576. });
  2577. }
  2578. if (this.chainName != '') {
  2579. this.buryingPoint({
  2580. systemModel: '高销额门店推荐',
  2581. buryingPointType: 1,
  2582. buryingPointValue: this.chainName,
  2583. buryingPointName: '经销商筛选',
  2584. buryingPointPosition: '客户信息筛选',
  2585. });
  2586. }
  2587. if (this.storeName != '') {
  2588. this.buryingPoint({
  2589. systemModel: '高销额门店推荐',
  2590. buryingPointType: 1,
  2591. buryingPointValue: this.storeName,
  2592. buryingPointName: '搜索名称/编号/地址',
  2593. buryingPointPosition: '客户信息筛选',
  2594. });
  2595. }
  2596. var sortParam = '';
  2597. if (this.sortParam == 'sales') {
  2598. sortParam = '销量';
  2599. } else if (this.sortParam == 'visitTime') {
  2600. sortParam = '拜访时间';
  2601. } else {
  2602. sortParam = '下单时间';
  2603. }
  2604. var sortType = '';
  2605. if (this.sortType == 'desc') {
  2606. sortType = '正序';
  2607. } else {
  2608. sortType = '倒叙';
  2609. }
  2610. this.buryingPoint({
  2611. systemModel: '高销额门店推荐',
  2612. buryingPointType: 1,
  2613. buryingPointValue: sortType,
  2614. buryingPointName: sortParam,
  2615. buryingPointPosition: '客户信息筛选',
  2616. });
  2617. localStorage.setItem('outvstoreName', this.storeName);
  2618. localStorage.setItem('outvchainName', this.chainName);
  2619. localStorage.setItem('outvstoreLabelTypes', this.storeLabelTypes);
  2620. localStorage.setItem('outvstoreCategoryList', this.result);
  2621. localStorage.setItem('outvchainCode', this.chainCode);
  2622. localStorage.setItem('outvchainCode', this.chainCode);
  2623. localStorage.setItem('outvsortType', this.sortType);
  2624. localStorage.setItem('outsortParam', this.sortParam);
  2625. this.onSearch();
  2626. },
  2627. tabChange(name) {
  2628. window.scrollTo(0, 0);
  2629. this.finished = true;
  2630. this.disabled = true;
  2631. this.list = [];
  2632. this.tabVal = name;
  2633. this.onLoad();
  2634. },
  2635. onLoad() {
  2636. // 授权
  2637. getTicketFun().then(() => {
  2638. var postType = localStorage.getItem('postType');
  2639. if (postType == 'GZ') {
  2640. this.typeShow = false;
  2641. } else {
  2642. this.typeShow = true;
  2643. }
  2644. this.getUserOutPlaList();
  2645. });
  2646. },
  2647. onLoadlong() {
  2648. this.list = [];
  2649. this.getUserOutPlaList();
  2650. },
  2651. },
  2652. };
  2653. </script>
  2654. <style lang="scss">
  2655. .van-dialog__confirm,
  2656. .van-dialog__confirm:active {
  2657. color: #0057ba;
  2658. }
  2659. .searchDiv {
  2660. .van-search {
  2661. background: #fff;
  2662. }
  2663. .van-search__action {
  2664. font-size: 14px;
  2665. color: #0057ba;
  2666. font-weight: bold;
  2667. background: #f1f1f1;
  2668. border-bottom-right-radius: 60px;
  2669. border-top-right-radius: 60px;
  2670. border: 1px solid #ccc;
  2671. padding: 0 20px;
  2672. }
  2673. .van-search--show-action {
  2674. padding-right: 12px;
  2675. }
  2676. .van-search__content {
  2677. border: 1px solid #ccc;
  2678. border-bottom-left-radius: 60px;
  2679. border-top-left-radius: 60px;
  2680. background: #f1f1f1;
  2681. border-right: 0;
  2682. }
  2683. }
  2684. .myTab {
  2685. .van-tabs__nav--card {
  2686. margin: 0 !important;
  2687. border-left: 0;
  2688. border-right: 0;
  2689. }
  2690. .van-tabs__wrap,
  2691. .van-tabs__nav--card {
  2692. height: 39px;
  2693. }
  2694. .van-tab {
  2695. line-height: 40px;
  2696. }
  2697. }
  2698. .myList {
  2699. .van-cell {
  2700. padding: 0;
  2701. &:after {
  2702. border-bottom: none;
  2703. }
  2704. }
  2705. }
  2706. .searchDivcs .van-search__content {
  2707. border-bottom-left-radius: 6px;
  2708. border-top-left-radius: 6px;
  2709. }
  2710. .searchDivcs .van-search__action {
  2711. border-bottom-right-radius: 6px;
  2712. border-top-right-radius: 6px;
  2713. }
  2714. </style>
  2715. <style lang="scss" scoped>
  2716. .bgcolor {
  2717. background-color: #f5f5f5;
  2718. }
  2719. .container {
  2720. padding-bottom: 50px;
  2721. }
  2722. .card {
  2723. padding: 10px 16px;
  2724. box-sizing: border-box;
  2725. }
  2726. .card .title {
  2727. font-size: 15px;
  2728. font-weight: bold;
  2729. color: #333;
  2730. line-height: 22px;
  2731. padding-right: 52px;
  2732. .JPABC {
  2733. width: 20px;
  2734. position: relative;
  2735. top: 4px;
  2736. margin-right: 3px;
  2737. }
  2738. .statusIcon {
  2739. padding: 3px;
  2740. font-size: 12px;
  2741. margin: 0 3px;
  2742. color: #fff;
  2743. display: inline-block;
  2744. height: 20px;
  2745. line-height: 16px;
  2746. vertical-align: -1px;
  2747. }
  2748. .submit {
  2749. background: #ffba13;
  2750. }
  2751. .noSubmit {
  2752. background: #f11818;
  2753. }
  2754. }
  2755. .card .info {
  2756. font-size: 14px;
  2757. color: #909090;
  2758. line-height: 26px;
  2759. }
  2760. .btnbox {
  2761. padding-top: 14px;
  2762. border-top: 1px solid #eee;
  2763. margin: 0 10px;
  2764. }
  2765. .navBarTOP {
  2766. position: fixed;
  2767. width: 100%;
  2768. z-index: 2;
  2769. top: 0;
  2770. }
  2771. .cellcontent .centerBtn {
  2772. margin: 0 auto 10px;
  2773. display: block;
  2774. width: 92%;
  2775. color: #0057ba;
  2776. border-radius: 5px;
  2777. padding: 0 2px;
  2778. }
  2779. .cellcontent .centerBtn1 {
  2780. background-color: #0057ba;
  2781. color: #fff;
  2782. border-color: #0057ba;
  2783. }
  2784. .cellcontent .centerBtn2 {
  2785. margin: 0 auto 10px;
  2786. display: block;
  2787. width: 92%;
  2788. color: #0057ba;
  2789. border-radius: 5px;
  2790. padding: 0;
  2791. }
  2792. .statstext {
  2793. background-color: #0057ba;
  2794. position: absolute;
  2795. right: 0;
  2796. top: 6px;
  2797. padding: 2px 6px 2px 12px;
  2798. border-bottom-left-radius: 60px;
  2799. border-top-left-radius: 60px;
  2800. color: #fff;
  2801. }
  2802. .cellcontent .van-cell {
  2803. padding: 10px 0;
  2804. }
  2805. .statstext .van-icon__image {
  2806. height: 0.7em;
  2807. }
  2808. .tipsTitle {
  2809. padding: 5px 0;
  2810. text-align: center;
  2811. font-size: 16px;
  2812. font-weight: 600;
  2813. }
  2814. </style>
  2815. <style lang="scss">
  2816. .zpover99 {
  2817. background-color: #00afff !important;
  2818. }
  2819. .van-tabs__nav--card .van-tab.van-tab--active {
  2820. background-color: #0057ba !important;
  2821. }
  2822. .visitSearch {
  2823. width: 68px;
  2824. color: #0057ba;
  2825. font-size: 14px;
  2826. }
  2827. .visitSearch .van-dropdown-menu__bar {
  2828. box-shadow: 0 0 0 #fff;
  2829. height: 52px;
  2830. }
  2831. .visitSearch .van-dropdown-menu__item {
  2832. justify-content: normal;
  2833. }
  2834. .visitSearch .van-dropdown-menu__title {
  2835. border-left: 1px solid #ccc;
  2836. }
  2837. .visitSearch .van-cell {
  2838. border: 1px solid #ccc;
  2839. border-radius: 5px;
  2840. padding: 6px;
  2841. }
  2842. .positionContent {
  2843. position: fixed;
  2844. color: #666;
  2845. display: inline-block;
  2846. box-shadow: 0px 2px 7px -5px #000;
  2847. border-radius: 100px;
  2848. overflow: hidden;
  2849. right: 14px;
  2850. cursor: pointer;
  2851. bottom: 96px;
  2852. background-color: white;
  2853. }
  2854. .positionContent .img {
  2855. border-radius: 100px;
  2856. float: left;
  2857. }
  2858. .positionContent .img .van-icon__image {
  2859. border-radius: 100px;
  2860. }
  2861. .zDialog .van-dialog__header {
  2862. padding: 10px;
  2863. border-bottom: 1px solid #f5f5f5;
  2864. }
  2865. .zDialog .infoText {
  2866. margin: 10px;
  2867. font-size: 14px;
  2868. color: #909090;
  2869. width: 98%;
  2870. }
  2871. .visitStoreIco {
  2872. float: left;
  2873. float: left;
  2874. width: 26px;
  2875. text-align: center;
  2876. background-color: #ffba13;
  2877. color: #fff;
  2878. border-radius: 100%;
  2879. margin-left: 14px;
  2880. line-height: 26px;
  2881. height: 26px;
  2882. }
  2883. .searchcheck {
  2884. padding: 0 10px 10px;
  2885. }
  2886. .searchcheck .van-checkbox {
  2887. /*width: 44%;*/
  2888. padding-bottom: 10px;
  2889. }
  2890. .searchcheck .checkbox {
  2891. font-size: 14px;
  2892. display: inline-block;
  2893. width: 50%;
  2894. line-height: 28px;
  2895. }
  2896. .searchcheck .checkbox .van-checkbox {
  2897. margin-bottom: 2px;
  2898. }
  2899. .searchcheck .checkbox1 {
  2900. font-size: 14px;
  2901. float: left;
  2902. line-height: 28px;
  2903. width: 50%;
  2904. }
  2905. .searchcheck .checkbox1 .child {
  2906. width: 100%;
  2907. }
  2908. .searchcheck {
  2909. height: 93vh;
  2910. overflow-y: auto;
  2911. }
  2912. .searchchecktitle {
  2913. width: 100%;
  2914. margin: 20px 0;
  2915. font-size: 16px;
  2916. border-left: 3px solid #0057ba;
  2917. line-height: 18px;
  2918. }
  2919. .textsize {
  2920. font-size: 14px;
  2921. }
  2922. .visitStoreIcos {
  2923. /*background: url("./../../assets/order1.png") center;*/
  2924. }
  2925. .topStore {
  2926. .JPVisitNum {
  2927. position: relative;
  2928. top: -26px;
  2929. font-size: 10px;
  2930. }
  2931. .TCFXListItem {
  2932. display: inline-block;
  2933. border: 1px solid #ccc;
  2934. padding: 3px 5px;
  2935. margin: 0 5px;
  2936. border-radius: 6px;
  2937. }
  2938. }
  2939. </style>