topStore.vue 108 KB

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