topStore.vue 108 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939
  1. <template>
  2. <div class="bgcolor topStore">
  3. <div class="navBarTOP">
  4. <!-- 顶部条-->
  5. <van-nav-bar class="navBar" title="高销额门店推荐" left-arrow @click-left="onClickLeft">
  6. <template #right>
  7. <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
  8. </template>
  9. </van-nav-bar>
  10. <div class="searchDiv searchDivcs">
  11. <van-row v-if="showAll && showKM">
  12. <van-col span="16">
  13. <van-search
  14. v-model="storeName"
  15. left-icon="search"
  16. show-action
  17. placeholder="搜索名称/编号/地址"
  18. @clear="clearFn">
  19. <template #action>
  20. <div @click="onSearchm">搜索</div>
  21. </template>
  22. </van-search>
  23. </van-col>
  24. <van-col span="8">
  25. <div
  26. style="
  27. line-height: 36px;
  28. margin: 8px;
  29. margin-right: 0;
  30. text-align: center;
  31. border-radius: 6px;
  32. color: #0057ba;
  33. background-color: #fff;
  34. font-size: 14px;
  35. border: 1px solid #0057ba;
  36. "
  37. @click="jionAll">
  38. 加入计划内
  39. </div>
  40. </van-col>
  41. </van-row>
  42. <van-row v-if="!showAll || !showKM">
  43. <van-col span="24">
  44. <van-search
  45. v-model="storeName"
  46. left-icon="search"
  47. show-action
  48. placeholder="搜索名称/编号/地址"
  49. @clear="clearFn">
  50. <template #action>
  51. <div @click="onSearchm">搜索</div>
  52. </template>
  53. </van-search>
  54. </van-col>
  55. </van-row>
  56. </div>
  57. <van-dropdown-menu active-color="#0057ba">
  58. <van-dropdown-item v-model="value1" :options="option1" @change="v1Fn" />
  59. <van-dropdown-item v-model="value2" :options="option2" @change="v2Fn" />
  60. <van-dropdown-item v-model="value3" :options="option3" @change="v3Fn" />
  61. </van-dropdown-menu>
  62. </div>
  63. <!-- 主体内容-->
  64. <div style="height: 154px"></div>
  65. <van-notice-bar v-if="!showKM" color="#444" background="#f5f5f5" left-icon="info-o">
  66. 附近20KM内门店。
  67. </van-notice-bar>
  68. <div class="container">
  69. <van-list
  70. class="myList"
  71. v-model="loading"
  72. :finished="finished"
  73. @load="onLoad"
  74. finished-text="--已经到底了--">
  75. <van-checkbox-group v-model="radio">
  76. <div class="cellcontent" v-for="(item, index) in list" :key="index">
  77. <van-cell>
  78. <div class="card">
  79. <div class="title titlero">
  80. <template v-if="item.storeLabels">
  81. <!-- 金牌店ABC -->
  82. <img
  83. class="JPABC"
  84. :src="require('@/assets/Icon/storeA.png')"
  85. v-if="item.storeLabels.storeA" />
  86. <img
  87. class="JPABC"
  88. :src="require('@/assets/Icon/storeB.png')"
  89. v-if="item.storeLabels.storeB" />
  90. <img
  91. class="JPABC"
  92. :src="require('@/assets/Icon/storeC.png')"
  93. v-if="item.storeLabels.storeC" />
  94. <img
  95. class="JPABC"
  96. :src="require('@/assets/Icon/storeD.png')"
  97. v-if="item.storeLabels.storeD" />
  98. <img
  99. class="JPABC"
  100. :src="require('@/assets/Icon/storeE.png')"
  101. v-if="item.storeLabels.storeE" />
  102. </template>
  103. <span class="btn" :data-clipboard-text="item.storeCode">
  104. <span>{{ item.storeName }}</span>
  105. (<span style="color: #0057ba">{{ item.storeCode }}</span
  106. >)
  107. <van-icon
  108. :name="paste"
  109. color="#ee0a24"
  110. size="20"
  111. style="top: 6px; margin-left: 4px" />
  112. </span>
  113. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  114. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  115. <template v-if="item.approvalStatus == 0">
  116. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
  117. >已提交</span
  118. >
  119. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  120. >未提交</span
  121. >
  122. </template>
  123. </div>
  124. <div class="info" style="position: relative">
  125. 联系人:{{ item.contactName }}
  126. <div style="position: absolute; bottom: 0px; right: 0px">
  127. <el-popover
  128. popper-class="zpover"
  129. placement="bottom"
  130. width="120"
  131. trigger="click"
  132. content="该客户为凤凰客户">
  133. <div
  134. v-if="item.storeLabels.fhCustomer"
  135. class="visitStoreIco"
  136. style="background-color: #fff"
  137. slot="reference">
  138. <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
  139. </div>
  140. </el-popover>
  141. <el-popover
  142. popper-class="zpover zpover6"
  143. placement="bottom-start"
  144. trigger="click">
  145. <div>
  146. <p>
  147. 本店{{ timeData }}下单SKU数:<a
  148. @click="linkList(item)"
  149. style="text-decoration: underline"
  150. >点击查看</a
  151. >
  152. </p>
  153. </div>
  154. <div
  155. class="visitStoreIco"
  156. v-if="item.storeLabels.zysslNums !== false"
  157. style="background-color: #fff; position: relative"
  158. slot="reference">
  159. <p
  160. style="
  161. width: 100%;
  162. position: absolute;
  163. z-index: 1;
  164. top: 0.2px;
  165. width: 22px;
  166. margin: 0;
  167. margin-left: 3.6px;
  168. text-align: center;
  169. font-size: 12px;
  170. ">
  171. {{ item.storeLabels.zysslNums }}
  172. </p>
  173. <van-icon :name="ord" size="26" />
  174. </div>
  175. </el-popover>
  176. <el-popover
  177. popper-class="zpover"
  178. placement="bottom"
  179. width="200"
  180. trigger="click">
  181. <div v-if="item.storeLabels">
  182. <p>已参加:</p>
  183. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
  184. {{ tt }}
  185. </p>
  186. </div>
  187. <div
  188. class="visitStoreIco"
  189. v-if="item.storeLabels.targetOne"
  190. style="background-color: #fff"
  191. slot="reference">
  192. <van-icon :name="targetOne" size="26" />
  193. </div>
  194. </el-popover>
  195. <el-popover
  196. popper-class="zpover"
  197. placement="bottom"
  198. width="120"
  199. trigger="click"
  200. content="调色机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', from: 'topStore' },
  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. localStorage.setItem('getRequestFlage', 'true');
  1468. this.$router.push({
  1469. path: '/suishenbangOutstoreVisit',
  1470. query: {
  1471. storeId: val.storeId,
  1472. rdId: val.rdId,
  1473. lat: lat,
  1474. lon: lon,
  1475. visitId: val.visitId,
  1476. pageType: 'out',
  1477. addressLine: val.addressLine,
  1478. storeCategory: val.storeCategory,
  1479. storeName: val.storeName,
  1480. hisTime: val.hisTime,
  1481. contactName: val.contactName,
  1482. storeCode: val.storeCode,
  1483. tabVal: this.tabVal,
  1484. visitModel: '1',
  1485. latNew: '31.2517820000',
  1486. lonNew: '120.5593090000',
  1487. PointSum: 0,
  1488. marklat: lat,
  1489. marklon: lon,
  1490. linkType: 6,
  1491. from: 'topStore',
  1492. },
  1493. });
  1494. localStorage.setItem('startTime', new Date());
  1495. localStorage.setItem('ORGName', val.deptName);
  1496. localStorage.setItem('chainNameR', val.storeName);
  1497. } else {
  1498. if (this.flag) {
  1499. this.flag = false;
  1500. this.timer = null;
  1501. let that = this;
  1502. this.timer = setTimeout(() => {
  1503. this.flag = true;
  1504. }, 2000);
  1505. if (val.stateString.indexOf('拜访中') != -1) {
  1506. localStorage.setItem('startTime', new Date());
  1507. localStorage.setItem('ORGName', val.deptName);
  1508. localStorage.setItem('chainNameR', val.storeName);
  1509. localStorage.setItem('getRequestFlage', 'true');
  1510. that.$router.push({
  1511. path: '/suishenbangOutstoreVisit',
  1512. query: {
  1513. storeId: val.storeId,
  1514. rdId: val.rdId,
  1515. lat: val.lat,
  1516. lon: val.lon,
  1517. visitId: val.visitId,
  1518. pageType: 'out',
  1519. addressLine: val.addressLine,
  1520. storeCategory: val.storeCategory,
  1521. storeName: val.storeName,
  1522. hisTime: val.hisTime,
  1523. contactName: val.contactName,
  1524. storeCode: val.storeCode,
  1525. tabVal: that.tabVal,
  1526. visitModel: '1',
  1527. latNew: val.lat,
  1528. lonNew: val.lon,
  1529. PointSum: '0',
  1530. marklat: val.lat,
  1531. marklon: val.lon,
  1532. linkType: 6,
  1533. from: 'topStore',
  1534. },
  1535. });
  1536. } else {
  1537. getPosition()
  1538. .then((res) => {
  1539. let { TXisBD, resData } = res;
  1540. this.lat = TXisBD.lat;
  1541. this.lon = TXisBD.lon;
  1542. localStorage.setItem('lat', this.lat);
  1543. localStorage.setItem('lon', this.lon);
  1544. // var location = this.CJ02BD(res.latitude, res.longitude);
  1545. this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
  1546. })
  1547. .catch((error) => {
  1548. this.$dialog.alert({
  1549. message: error,
  1550. });
  1551. });
  1552. // let loading1 = this.$toast.loading({
  1553. // duration: 0,
  1554. // message: '加载中...',
  1555. // forbidClick: true,
  1556. // });
  1557. // let url = window.location.href;
  1558. // let wx = this.wx;
  1559. // let qiyeData;
  1560. // const instance = axios.create();
  1561. // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1562. // instance
  1563. // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1564. // params: {
  1565. // url: url,
  1566. // },
  1567. // })
  1568. // .then((response) => {
  1569. // if (response.status == 200) {
  1570. // this.cont = 5;
  1571. // var flat = true;
  1572. // var times = setInterval(() => {
  1573. // this.cont--;
  1574. // if (this.cont == '0') {
  1575. // if (flat) {
  1576. // loading1.clear();
  1577. // clearInterval(times);
  1578. // that.$dialog
  1579. // .alert({
  1580. // message: '定位失败,请开启企微定位权限',
  1581. // })
  1582. // .then(() => {});
  1583. // } else {
  1584. // clearInterval(times);
  1585. // }
  1586. // }
  1587. // }, 1000);
  1588. // qiyeData = response.data.data;
  1589. // wx.config({
  1590. // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1591. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1592. // appId: qiyeData.appId, // 必填,企业微信的corpID
  1593. // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1594. // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1595. // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1596. // jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1597. // });
  1598. // wx.ready(() => {
  1599. // wx.getLocation({
  1600. // type: 'gcj02',
  1601. // success: (res) => {
  1602. // flat = false;
  1603. // // loading1.clear();
  1604. // var location = that.CJ02BD(res.latitude, res.longitude);
  1605. // checkStoreAddressByStoreCode({
  1606. // storeCode: val.storeCode,
  1607. // lon: location.lon,
  1608. // lat: location.lat,
  1609. // }).then((response) => {
  1610. // loading1.clear();
  1611. // if (val.lat == '' || val.lat == null) {
  1612. // this.lat = location.lat;
  1613. // this.lon = location.lon;
  1614. // } else {
  1615. // this.lat = val.lat;
  1616. // this.lon = val.lon;
  1617. // }
  1618. // let PointSum = this.twoPointSum(
  1619. // this.lat,
  1620. // this.lon,
  1621. // location.lat,
  1622. // location.lon
  1623. // ).toFixed(2);
  1624. // let PointSumval = this.twoPointSum(
  1625. // location.lat,
  1626. // location.lon,
  1627. // location.lat,
  1628. // location.lon
  1629. // ).toFixed(2);
  1630. // // GZ:工装店铺 直接进入拜访
  1631. // if (localStorage.getItem('postType') == 'GZ') {
  1632. // localStorage.setItem('startTime', new Date());
  1633. // localStorage.setItem('ORGName', val.deptName);
  1634. // localStorage.setItem('chainNameR', val.storeName);
  1635. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1636. // return;
  1637. // }
  1638. // // 门店编码校验门店地址不通过
  1639. // if (response.code != 200) {
  1640. // // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1641. // if (response.data.updateAddress == 0) {
  1642. // // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1643. // this.$dialog
  1644. // .confirm({
  1645. // confirmButtonText: '确定拜访',
  1646. // cancelButtonText: '取消拜访',
  1647. // title: '系统提示',
  1648. // message:
  1649. // '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1650. // closeOnClickOverlay: true,
  1651. // })
  1652. // .then(() => {
  1653. // this.toSuishenbangOutstoreVisit(
  1654. // res,
  1655. // val,
  1656. // location,
  1657. // PointSumval
  1658. // );
  1659. // });
  1660. // } else if (response.data.updateAddress == 1) {
  1661. // // 同城AB+金牌,去修改地址
  1662. // // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1663. // if (!response.data.addressUpdateTimesOver) {
  1664. // this.$dialog
  1665. // .confirm({
  1666. // title: '系统提示',
  1667. // message: response.msg + '请立即修改后再拜访',
  1668. // messageAlign: 'left',
  1669. // confirmButtonText: '立即修改',
  1670. // cancelButtonText: '取消',
  1671. // })
  1672. // .then(() => {
  1673. // this.$router.push({
  1674. // path: '/storeDetail',
  1675. // query: {
  1676. // id: val.storeId,
  1677. // type: 'address',
  1678. // storeAddressId: val.storeAddressId,
  1679. // },
  1680. // });
  1681. // });
  1682. // } else {
  1683. // this.$dialog.confirm({
  1684. // title: '系统提示',
  1685. // message: '已经达到最大修改次数',
  1686. // messageAlign: 'left',
  1687. // confirmButtonText: '确定',
  1688. // });
  1689. // }
  1690. // } else if (response.data.updateAddress == 2) {
  1691. // // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1692. // this.resetCoord(res, val, location, PointSumval);
  1693. // return;
  1694. // }
  1695. // } else {
  1696. // // 门店编码校验门店地址通过 进入拜访
  1697. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1698. // }
  1699. // });
  1700. // },
  1701. // fail: function () {
  1702. // loading1.clear();
  1703. // that.$dialog.alert({
  1704. // message: 'GPS未开启',
  1705. // });
  1706. // },
  1707. // });
  1708. // });
  1709. // wx.error(function (error) {
  1710. // loading1.clear();
  1711. // that.$dialog
  1712. // .alert({
  1713. // message: '定位失败,请开启企微定位权限',
  1714. // })
  1715. // .then(() => {});
  1716. // });
  1717. // }
  1718. // });
  1719. }
  1720. }
  1721. }
  1722. } else {
  1723. this.$dialog.alert({
  1724. title: '系统提示',
  1725. message: res.msg,
  1726. });
  1727. }
  1728. });
  1729. },
  1730. checkStoreAddressByStoreCodeFun(val, location, res) {
  1731. checkStoreAddressByStoreCode({
  1732. storeCode: val.storeCode,
  1733. lon: location.lon,
  1734. lat: location.lat,
  1735. }).then((response) => {
  1736. // loading1.clear();
  1737. if (val.lat == '' || val.lat == null) {
  1738. this.lat = location.lat;
  1739. this.lon = location.lon;
  1740. } else {
  1741. this.lat = val.lat;
  1742. this.lon = val.lon;
  1743. }
  1744. // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
  1745. let PointSumval = this.twoPointSum(
  1746. location.lat,
  1747. location.lon,
  1748. location.lat,
  1749. location.lon
  1750. ).toFixed(2);
  1751. // GZ:工装店铺 直接进入拜访
  1752. // if (localStorage.getItem('postType') == 'GZ') {
  1753. // localStorage.setItem('startTime', new Date());
  1754. // localStorage.setItem('ORGName', val.deptName);
  1755. // localStorage.setItem('chainNameR', val.storeName);
  1756. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1757. // return;
  1758. // }
  1759. // 门店校验 地址不通过
  1760. if (response.code != 200) {
  1761. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1762. if (response.data.updateAddress == 0) {
  1763. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1764. this.$dialog
  1765. .confirm({
  1766. confirmButtonText: '确定拜访',
  1767. cancelButtonText: '取消拜访',
  1768. title: '系统提示',
  1769. message:
  1770. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1771. closeOnClickOverlay: true,
  1772. })
  1773. .then(() => {
  1774. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1775. });
  1776. } else if (response.data.updateAddress == 1) {
  1777. // 同城AB+金牌,去修改地址
  1778. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1779. if (!response.data.addressUpdateTimesOver) {
  1780. this.$dialog
  1781. .confirm({
  1782. title: '系统提示',
  1783. message: response.msg + '请立即修改后再拜访',
  1784. messageAlign: 'left',
  1785. confirmButtonText: '立即修改',
  1786. cancelButtonText: '取消',
  1787. })
  1788. .then(() => {
  1789. this.$router.push({
  1790. path: '/storeDetail',
  1791. query: {
  1792. id: val.storeId,
  1793. type: 'address',
  1794. storeAddressId: val.storeAddressId,
  1795. },
  1796. });
  1797. });
  1798. } else {
  1799. this.$dialog.confirm({
  1800. title: '系统提示',
  1801. message: '已经达到最大修改次数',
  1802. messageAlign: 'left',
  1803. confirmButtonText: '确定',
  1804. });
  1805. }
  1806. } else if (response.data.updateAddress == 2) {
  1807. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1808. this.resetCoord(res, val, location, PointSumval);
  1809. return;
  1810. }
  1811. } else {
  1812. // 门店编码校验门店地址通过 进入拜访
  1813. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1814. }
  1815. });
  1816. },
  1817. // 重置经纬度
  1818. resetCoord(res, val, location, PointSumval) {
  1819. this.$dialog
  1820. .confirm({
  1821. confirmButtonText: '初始化定位',
  1822. cancelButtonText: '取消拜访',
  1823. title: '系统提示',
  1824. message: '偏差过大,不允许拜访。可修改本店定位.',
  1825. closeOnClickOverlay: true,
  1826. })
  1827. .then(() => {
  1828. mobileReposition({
  1829. storeId: val.storeId,
  1830. lat: location.lat,
  1831. lon: location.lon,
  1832. }).then((response) => {
  1833. if (response.code == 200) {
  1834. this.$dialog
  1835. .alert({
  1836. title: '系统提示',
  1837. message: '本信息定位已更新成功!',
  1838. })
  1839. .then(() => {
  1840. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1841. });
  1842. localStorage.setItem('startTime', new Date());
  1843. localStorage.setItem('ORGName', val.deptName);
  1844. localStorage.setItem('chainNameR', val.storeName);
  1845. } else {
  1846. this.$toast(response.msg);
  1847. }
  1848. });
  1849. });
  1850. },
  1851. // 进入拜访 router.push
  1852. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1853. addVisitsPosition({
  1854. storeId: val.storeId,
  1855. visitsId: '',
  1856. lon: res.longitude,
  1857. lat: res.latitude,
  1858. sourceLon: location.lon,
  1859. sourceLat: location.lat,
  1860. positionDesc: '',
  1861. accuracy: res.accuracy,
  1862. });
  1863. localStorage.setItem('getRequestFlage', 'true');
  1864. this.$router.push({
  1865. path: '/suishenbangOutstoreVisit',
  1866. query: {
  1867. storeId: val.storeId,
  1868. rdId: val.rdId,
  1869. lat: location.lat,
  1870. lon: location.lon,
  1871. visitId: val.visitId,
  1872. pageType: 'out',
  1873. addressLine: val.addressLine,
  1874. storeCategory: val.storeCategory,
  1875. storeName: val.storeName,
  1876. hisTime: val.hisTime,
  1877. contactName: val.contactName,
  1878. storeCode: val.storeCode,
  1879. tabVal: this.tabVal,
  1880. visitModel: '1',
  1881. latNew: location.lat,
  1882. lonNew: location.lon,
  1883. PointSum: PointSumval,
  1884. marklat: res.latitude,
  1885. marklon: res.longitude,
  1886. from: 'topStore',
  1887. },
  1888. });
  1889. },
  1890. projectOutVisit(val) {
  1891. localStorage.setItem('tabVal', this.tabVal);
  1892. localStorage.removeItem('visitId');
  1893. // checkVisit({storeId:val.storeId}).then(res=>{
  1894. // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
  1895. if (localStorage.getItem('loginType') == 'cs') {
  1896. var lat = '';
  1897. var lon = '';
  1898. if (val.lat == '' || val.lat == null) {
  1899. lat = '31.2517820000';
  1900. lon = '120.5593090000';
  1901. } else {
  1902. lat = val.lat;
  1903. lon = val.lon;
  1904. }
  1905. this.$router.push({
  1906. path: '/storeGroup',
  1907. query: {
  1908. storeId: val.storeId,
  1909. rdId: val.rdId,
  1910. lat: lat,
  1911. lon: lon,
  1912. visitId: val.visitId,
  1913. pageType: 'out',
  1914. addressLine: val.addressLine,
  1915. storeCategory: val.storeCategory,
  1916. storeName: val.storeName,
  1917. hisTime: val.hisTime,
  1918. contactName: val.contactName,
  1919. storeCode: val.storeCode,
  1920. tabVal: this.tabVal,
  1921. visitModel: '1',
  1922. latNew: '31.2517820000',
  1923. lonNew: '120.5593090000',
  1924. PointSum: 0,
  1925. marklat: lat,
  1926. marklon: lon,
  1927. },
  1928. });
  1929. localStorage.setItem('startTime', new Date());
  1930. localStorage.setItem('ORGName', val.deptName);
  1931. localStorage.setItem('chainNameR', val.storeName);
  1932. } else {
  1933. if (this.flag) {
  1934. this.flag = false;
  1935. this.timer = null;
  1936. let that = this;
  1937. this.timer = setTimeout(() => {
  1938. this.flag = true;
  1939. }, 2000);
  1940. if (val.stateString.indexOf('拜访中') != -1) {
  1941. localStorage.setItem('startTime', new Date());
  1942. localStorage.setItem('ORGName', val.deptName);
  1943. localStorage.setItem('chainNameR', val.storeName);
  1944. that.$router.push({
  1945. path: '/storeGroup',
  1946. query: {
  1947. storeId: val.storeId,
  1948. rdId: val.rdId,
  1949. lat: val.lat,
  1950. lon: val.lon,
  1951. visitId: val.visitId,
  1952. pageType: 'out',
  1953. addressLine: val.addressLine,
  1954. storeCategory: val.storeCategory,
  1955. storeName: val.storeName,
  1956. hisTime: val.hisTime,
  1957. contactName: val.contactName,
  1958. storeCode: val.storeCode,
  1959. tabVal: that.tabVal,
  1960. visitModel: '1',
  1961. latNew: val.lat,
  1962. lonNew: val.lon,
  1963. PointSum: '0',
  1964. marklat: val.lat,
  1965. marklon: val.lon,
  1966. },
  1967. });
  1968. } else {
  1969. let loading1 = this.$toast.loading({
  1970. duration: 0,
  1971. message: '加载中...',
  1972. forbidClick: true,
  1973. });
  1974. let url = window.location.href;
  1975. let wx = this.wx;
  1976. let qiyeData;
  1977. const instance = axios.create();
  1978. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1979. instance
  1980. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1981. params: {
  1982. url: url,
  1983. },
  1984. })
  1985. .then((response) => {
  1986. if (response.status == 200) {
  1987. this.cont = 3;
  1988. var flat = true;
  1989. var times = setInterval(() => {
  1990. this.cont--;
  1991. if (this.cont == '0') {
  1992. if (flat) {
  1993. loading1.clear();
  1994. clearInterval(times);
  1995. that.$dialog
  1996. .alert({
  1997. message: '定位失败,请开启企微定位权限',
  1998. })
  1999. .then(() => {});
  2000. } else {
  2001. clearInterval(times);
  2002. }
  2003. }
  2004. }, 1000);
  2005. qiyeData = response.data.data;
  2006. wx.config({
  2007. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2008. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2009. appId: qiyeData.appId, // 必填,企业微信的corpID
  2010. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2011. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2012. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2013. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2014. });
  2015. wx.ready(function () {
  2016. wx.getLocation({
  2017. type: 'gcj02',
  2018. success: function (res) {
  2019. flat = false;
  2020. loading1.clear();
  2021. var location = that.CJ02BD(res.latitude, res.longitude);
  2022. if (val.lat == '' || val.lat == null) {
  2023. that.lat = location.lat;
  2024. that.lon = location.lon;
  2025. } else {
  2026. that.lat = val.lat;
  2027. that.lon = val.lon;
  2028. }
  2029. let PointSum = that
  2030. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  2031. .toFixed(2);
  2032. if (val.lat == '' || val.lat == null) {
  2033. if (localStorage.getItem('postType') != 'GZ') {
  2034. that.$dialog
  2035. .confirm({
  2036. confirmButtonText: '确定拜访',
  2037. cancelButtonText: '取消拜访',
  2038. title: '系统提示',
  2039. message:
  2040. '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
  2041. closeOnClickOverlay: true,
  2042. })
  2043. .then(() => {
  2044. that.$router.push({
  2045. path: '/storeGroup',
  2046. query: {
  2047. storeId: val.storeId,
  2048. rdId: val.rdId,
  2049. lat: that.lat,
  2050. lon: that.lon,
  2051. visitId: val.visitId,
  2052. pageType: 'out',
  2053. addressLine: val.addressLine,
  2054. storeCategory: val.storeCategory,
  2055. storeName: val.storeName,
  2056. contactName: val.contactName,
  2057. hisTime: val.hisTime,
  2058. storeCode: val.storeCode,
  2059. tabVal: that.tabVal,
  2060. visitModel: '1',
  2061. latNew: location.lat,
  2062. lonNew: location.lon,
  2063. PointSum: PointSum,
  2064. marklat: res.latitude,
  2065. marklon: res.longitude,
  2066. },
  2067. });
  2068. });
  2069. } else {
  2070. that.$router.push({
  2071. path: '/storeGroup',
  2072. query: {
  2073. storeId: val.storeId,
  2074. rdId: val.rdId,
  2075. lat: that.lat,
  2076. lon: that.lon,
  2077. visitId: val.visitId,
  2078. pageType: 'out',
  2079. addressLine: val.addressLine,
  2080. storeCategory: val.storeCategory,
  2081. storeName: val.storeName,
  2082. contactName: val.contactName,
  2083. hisTime: val.hisTime,
  2084. storeCode: val.storeCode,
  2085. tabVal: that.tabVal,
  2086. visitModel: '1',
  2087. latNew: location.lat,
  2088. lonNew: location.lon,
  2089. PointSum: PointSum,
  2090. marklat: res.latitude,
  2091. marklon: res.longitude,
  2092. },
  2093. });
  2094. }
  2095. } else {
  2096. that.$router.push({
  2097. path: '/storeGroup',
  2098. query: {
  2099. storeId: val.storeId,
  2100. rdId: val.rdId,
  2101. lat: that.lat,
  2102. lon: that.lon,
  2103. visitId: val.visitId,
  2104. pageType: 'out',
  2105. addressLine: val.addressLine,
  2106. storeCategory: val.storeCategory,
  2107. storeName: val.storeName,
  2108. contactName: val.contactName,
  2109. hisTime: val.hisTime,
  2110. storeCode: val.storeCode,
  2111. tabVal: that.tabVal,
  2112. visitModel: '1',
  2113. latNew: location.lat,
  2114. lonNew: location.lon,
  2115. PointSum: PointSum,
  2116. marklat: res.latitude,
  2117. marklon: res.longitude,
  2118. },
  2119. });
  2120. }
  2121. localStorage.setItem('startTime', new Date());
  2122. localStorage.setItem('ORGName', val.deptName);
  2123. localStorage.setItem('chainNameR', val.storeName);
  2124. addVisitsPosition({
  2125. storeId: val.storeId,
  2126. visitsId: '',
  2127. lon: res.longitude,
  2128. lat: res.latitude,
  2129. sourceLon: location.lon,
  2130. sourceLat: location.lat,
  2131. positionDesc: '',
  2132. accuracy: res.accuracy,
  2133. });
  2134. },
  2135. fail: function () {
  2136. loading1.clear();
  2137. that.$dialog.alert({
  2138. message: 'GPS未开启',
  2139. });
  2140. },
  2141. });
  2142. });
  2143. wx.error(function (res) {
  2144. loading1.clear();
  2145. that.$dialog
  2146. .alert({
  2147. message: '定位失败,请开启企微定位权限',
  2148. })
  2149. .then(() => {});
  2150. });
  2151. }
  2152. });
  2153. }
  2154. }
  2155. }
  2156. // }
  2157. // })
  2158. },
  2159. abnormalVisit(val) {
  2160. localStorage.removeItem('visitId');
  2161. localStorage.setItem('tabVal', this.tabVal);
  2162. checkVisit({ storeId: val.storeId }).then((res) => {
  2163. this.buryingPoint({
  2164. systemModel: '高销额门店推荐',
  2165. buryingPointType: 1,
  2166. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  2167. buryingPointName: '异常拜访',
  2168. buryingPointPosition: '高销额门店推荐',
  2169. });
  2170. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  2171. if (localStorage.getItem('loginType') == 'cs') {
  2172. var lat = '';
  2173. var lon = '';
  2174. if (val.lat == '' || val.lat == null) {
  2175. lat = '31.2517820000';
  2176. lon = '120.5593090000';
  2177. } else {
  2178. lat = val.lat;
  2179. lon = val.lon;
  2180. }
  2181. this.$router.push({
  2182. path: '/outabnormalVisit',
  2183. query: {
  2184. storeId: val.storeId,
  2185. rdId: val.rdId,
  2186. lat: lat,
  2187. lon: lon,
  2188. visitId: val.visitId,
  2189. pageType: 'out',
  2190. addressLine: val.addressLine,
  2191. storeCategory: val.storeCategory,
  2192. storeName: val.storeName,
  2193. hisTime: val.hisTime,
  2194. contactName: val.contactName,
  2195. storeCode: val.storeCode,
  2196. tabVal: this.tabVal,
  2197. visitModel: '3',
  2198. latNew: '31.2517820000',
  2199. lonNew: '120.5593090000',
  2200. PointSum: 0,
  2201. marklat: lat,
  2202. marklon: lon,
  2203. linkType: 6,
  2204. },
  2205. });
  2206. localStorage.setItem('startTime', new Date());
  2207. localStorage.setItem('ORGName', val.deptName);
  2208. localStorage.setItem('chainNameR', val.storeName);
  2209. } else {
  2210. if (this.flag) {
  2211. this.flag = false;
  2212. this.timer = null;
  2213. this.timer = setTimeout(() => {
  2214. this.flag = true;
  2215. }, 2000);
  2216. let loading1 = this.$toast.loading({
  2217. duration: 0,
  2218. message: '加载中...',
  2219. forbidClick: true,
  2220. });
  2221. let url = window.location.href;
  2222. let that = this;
  2223. let wx = this.wx;
  2224. let qiyeData;
  2225. const instance = axios.create();
  2226. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2227. instance
  2228. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2229. params: {
  2230. url: url,
  2231. },
  2232. })
  2233. .then((response) => {
  2234. if (response.status == 200) {
  2235. this.cont = 3;
  2236. var flat = true;
  2237. var times = setInterval(() => {
  2238. this.cont--;
  2239. if (this.cont == '0') {
  2240. if (flat) {
  2241. loading1.clear();
  2242. clearInterval(times);
  2243. that.$dialog
  2244. .alert({
  2245. message: '定位失败,请开启企微定位权限',
  2246. })
  2247. .then(() => {
  2248. this.$router.go(-1);
  2249. });
  2250. } else {
  2251. clearInterval(times);
  2252. }
  2253. }
  2254. }, 1000);
  2255. qiyeData = response.data.data;
  2256. wx.config({
  2257. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2258. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2259. appId: qiyeData.appId, // 必填,企业微信的corpID
  2260. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2261. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2262. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2263. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2264. });
  2265. wx.ready(function () {
  2266. wx.getLocation({
  2267. type: 'gcj02',
  2268. success: function (res) {
  2269. flat = false;
  2270. loading1.clear();
  2271. var location = that.CJ02BD(res.latitude, res.longitude);
  2272. if (val.lat == '' || val.lat == null) {
  2273. that.lat = location.lat;
  2274. that.lon = location.lon;
  2275. } else {
  2276. that.lat = val.lat;
  2277. that.lon = val.lon;
  2278. }
  2279. let PointSum = that
  2280. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  2281. .toFixed(2);
  2282. if (PointSum > 500 && localStorage.getItem('postType') != 'GZ') {
  2283. that.$dialog
  2284. .confirm({
  2285. confirmButtonText: '确定',
  2286. cancelButtonText: '取消',
  2287. title: '系统提示',
  2288. message: '定位距离偏差大',
  2289. closeOnClickOverlay: true,
  2290. })
  2291. .then(() => {
  2292. that.$router.push({
  2293. path: '/outabnormalVisit',
  2294. query: {
  2295. storeId: val.storeId,
  2296. rdId: val.rdId,
  2297. lat: that.lat,
  2298. lon: that.lon,
  2299. visitId: val.visitId,
  2300. pageType: 'out',
  2301. visitModel: '5',
  2302. storeCode: val.storeCode,
  2303. tabVal: that.tabVal,
  2304. latNew: location.lat,
  2305. lonNew: location.lon,
  2306. PointSum: PointSum,
  2307. marklat: res.latitude,
  2308. marklon: res.longitude,
  2309. linkType: 6,
  2310. },
  2311. });
  2312. localStorage.setItem('startTime', new Date());
  2313. localStorage.setItem('ORGName', val.deptName);
  2314. localStorage.setItem('chainNameR', val.storeName);
  2315. })
  2316. .catch(() => {
  2317. // that.abnormalVisit(val)
  2318. });
  2319. } else {
  2320. that.$router.push({
  2321. path: '/outabnormalVisit',
  2322. query: {
  2323. storeId: val.storeId,
  2324. rdId: val.rdId,
  2325. lat: that.lat,
  2326. lon: that.lon,
  2327. visitId: val.visitId,
  2328. pageType: 'out',
  2329. visitModel: '3',
  2330. storeCode: val.storeCode,
  2331. tabVal: that.tabVal,
  2332. latNew: location.lat,
  2333. lonNew: location.lon,
  2334. PointSum: PointSum,
  2335. marklat: res.latitude,
  2336. marklon: res.longitude,
  2337. linkType: 6,
  2338. },
  2339. });
  2340. localStorage.setItem('startTime', new Date());
  2341. localStorage.setItem('ORGName', val.deptName);
  2342. localStorage.setItem('chainNameR', val.storeName);
  2343. }
  2344. addVisitsPosition({
  2345. storeId: val.storeId,
  2346. visitsId: '',
  2347. lon: res.longitude,
  2348. lat: res.latitude,
  2349. sourceLon: location.lon,
  2350. sourceLat: location.lat,
  2351. positionDesc: '',
  2352. accuracy: res.accuracy,
  2353. });
  2354. },
  2355. fail: function () {
  2356. loading1.clear();
  2357. that.$dialog
  2358. .alert({
  2359. message: 'GPS未开启',
  2360. })
  2361. .then(() => {
  2362. // that.abnormalVisit(val)
  2363. });
  2364. },
  2365. });
  2366. });
  2367. wx.error(function (res) {
  2368. loading1.clear();
  2369. that.$dialog
  2370. .alert({
  2371. message: '定位失败,请开启企微定位权限',
  2372. })
  2373. .then(() => {});
  2374. });
  2375. } else {
  2376. loading1.clear();
  2377. this.$toast.fail(dataList.msg);
  2378. }
  2379. });
  2380. // this.$router.push({path: "/outabnormalVisit", query: {
  2381. // storeId:"179792",
  2382. // rdId:"null",
  2383. // lat:"31.1882020000",
  2384. // lon:"120.6801770000",
  2385. // visitId:"null",
  2386. // visitModel:"5",
  2387. // storeCode:"0190141901",
  2388. // tabVal:"0",
  2389. // latNew:34.621855582632264,
  2390. // lonNew:112.45382530736684,
  2391. // PointSum:857246.44
  2392. // }})
  2393. localStorage.setItem('startTime', new Date());
  2394. localStorage.setItem('ORGName', val.deptName);
  2395. localStorage.setItem('chainNameR', val.storeName);
  2396. }
  2397. }
  2398. } else {
  2399. this.$dialog.alert({
  2400. title: '系统提示',
  2401. message: res.msg,
  2402. });
  2403. }
  2404. });
  2405. },
  2406. visitFn(val) {
  2407. this.buryingPoint({
  2408. systemModel: '高销额门店推荐',
  2409. buryingPointType: 1,
  2410. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  2411. buryingPointName: '客户信息',
  2412. buryingPointPosition: '高销额门店推荐',
  2413. });
  2414. // designerStore 是否为设计师招募门店,true-是,false-否
  2415. if (val.designerStore) {
  2416. this.$router.push({
  2417. path: '/addDesignerDetail',
  2418. query: { id: val.storeId },
  2419. });
  2420. return;
  2421. } else {
  2422. this.$router.push({
  2423. path: '/storeDetail',
  2424. query: { id: val.storeId, detilId: 'a' },
  2425. });
  2426. }
  2427. },
  2428. // 大客户签约
  2429. signAdd(val) {
  2430. this.$router.push({
  2431. path: '/sign',
  2432. query: { id: val.storeId, detilId: 'a' },
  2433. });
  2434. },
  2435. Visit(val) {
  2436. this.$router.push({
  2437. path: '/historicalDetails',
  2438. query: {
  2439. visitId: val.visitId,
  2440. storeId: val.storeId,
  2441. storeCode: val.storeCode,
  2442. },
  2443. });
  2444. },
  2445. onSearch() {
  2446. window.scrollTo(0, 0);
  2447. this.list = [];
  2448. this.finished = true;
  2449. this.cstype = this.$route.query.type;
  2450. this.getPositionFn();
  2451. if (this.lat != '') {
  2452. this.onLoad();
  2453. } else {
  2454. let loading3 = this.$toast.loading({
  2455. duration: 0,
  2456. message: '加载中...',
  2457. forbidClick: true,
  2458. });
  2459. setTimeout(() => {
  2460. loading3.clear();
  2461. this.onLoad();
  2462. }, 1000);
  2463. }
  2464. },
  2465. getPositionFn() {
  2466. var that = this;
  2467. let url = window.location.href;
  2468. let wx = this.wx;
  2469. let qiyeData;
  2470. const instance = axios.create();
  2471. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  2472. instance
  2473. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  2474. params: {
  2475. url: url,
  2476. },
  2477. })
  2478. .then((response) => {
  2479. if (response.status == 200) {
  2480. this.cont = 3;
  2481. var flat = true;
  2482. var times = setInterval(() => {
  2483. this.cont--;
  2484. if (this.cont == '0') {
  2485. if (flat) {
  2486. clearInterval(times);
  2487. } else {
  2488. clearInterval(times);
  2489. }
  2490. }
  2491. }, 1000);
  2492. qiyeData = response.data.data;
  2493. wx.config({
  2494. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  2495. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  2496. appId: qiyeData.appId, // 必填,企业微信的corpID
  2497. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  2498. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  2499. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  2500. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  2501. });
  2502. wx.ready(function () {
  2503. wx.getLocation({
  2504. type: 'gcj02',
  2505. success: function (res) {
  2506. flat = false;
  2507. var location = that.CJ02BD(res.latitude, res.longitude);
  2508. that.lat = location.lat;
  2509. that.lon = location.lon;
  2510. },
  2511. });
  2512. });
  2513. }
  2514. });
  2515. },
  2516. buryingPointFn(val) {
  2517. this.buryingPoint({
  2518. systemModel: '高销额门店推荐',
  2519. buryingPointType: 1,
  2520. buryingPointValue: val.telephone,
  2521. buryingPointName: '点击电话',
  2522. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  2523. });
  2524. },
  2525. onSearchm() {
  2526. var postType = localStorage.getItem('postType');
  2527. if (postType == 'GZ') {
  2528. this.typeShow = false;
  2529. } else {
  2530. this.typeShow = true;
  2531. }
  2532. var StoreLabelsArr = [];
  2533. for (var k = 0; k < this.storeLabelTypes.length; k++) {
  2534. for (var k1 = 0; k1 < this.StoreLabels.length; k1++) {
  2535. if (this.StoreLabels[k1].dictValue == this.storeLabelTypes[k]) {
  2536. StoreLabelsArr.push(this.StoreLabels[k1].dictLabel);
  2537. }
  2538. }
  2539. }
  2540. var storeCategoryList = [];
  2541. for (var q = 0; q < this.result.length; q++) {
  2542. for (var q1 = 0; q1 < this.storeTypeLists.length; q1++) {
  2543. if (this.storeTypeLists[q1].dictValue == this.result[q]) {
  2544. storeCategoryList.push(this.storeTypeLists[q1].dictLabel);
  2545. }
  2546. }
  2547. }
  2548. if (this.storeLabelTypes.length > 0) {
  2549. this.buryingPoint({
  2550. systemModel: '高销额门店推荐',
  2551. buryingPointType: 1,
  2552. buryingPointValue: StoreLabelsArr.join(','),
  2553. buryingPointName: '标签',
  2554. buryingPointPosition: '客户信息筛选',
  2555. });
  2556. }
  2557. if (this.storeCategoryList != '') {
  2558. this.buryingPoint({
  2559. systemModel: '高销额门店推荐',
  2560. buryingPointType: 1,
  2561. buryingPointValue: storeCategoryList.join(','),
  2562. buryingPointName: '类型',
  2563. buryingPointPosition: '客户信息筛选',
  2564. });
  2565. }
  2566. if (this.chainName != '') {
  2567. this.buryingPoint({
  2568. systemModel: '高销额门店推荐',
  2569. buryingPointType: 1,
  2570. buryingPointValue: this.chainName,
  2571. buryingPointName: '经销商筛选',
  2572. buryingPointPosition: '客户信息筛选',
  2573. });
  2574. }
  2575. if (this.storeName != '') {
  2576. this.buryingPoint({
  2577. systemModel: '高销额门店推荐',
  2578. buryingPointType: 1,
  2579. buryingPointValue: this.storeName,
  2580. buryingPointName: '搜索名称/编号/地址',
  2581. buryingPointPosition: '客户信息筛选',
  2582. });
  2583. }
  2584. var sortParam = '';
  2585. if (this.sortParam == 'sales') {
  2586. sortParam = '销量';
  2587. } else if (this.sortParam == 'visitTime') {
  2588. sortParam = '拜访时间';
  2589. } else {
  2590. sortParam = '下单时间';
  2591. }
  2592. var sortType = '';
  2593. if (this.sortType == 'desc') {
  2594. sortType = '正序';
  2595. } else {
  2596. sortType = '倒叙';
  2597. }
  2598. this.buryingPoint({
  2599. systemModel: '高销额门店推荐',
  2600. buryingPointType: 1,
  2601. buryingPointValue: sortType,
  2602. buryingPointName: sortParam,
  2603. buryingPointPosition: '客户信息筛选',
  2604. });
  2605. localStorage.setItem('outvstoreName', this.storeName);
  2606. localStorage.setItem('outvchainName', this.chainName);
  2607. localStorage.setItem('outvstoreLabelTypes', this.storeLabelTypes);
  2608. localStorage.setItem('outvstoreCategoryList', this.result);
  2609. localStorage.setItem('outvchainCode', this.chainCode);
  2610. localStorage.setItem('outvchainCode', this.chainCode);
  2611. localStorage.setItem('outvsortType', this.sortType);
  2612. localStorage.setItem('outsortParam', this.sortParam);
  2613. this.onSearch();
  2614. },
  2615. tabChange(name) {
  2616. window.scrollTo(0, 0);
  2617. this.finished = true;
  2618. this.disabled = true;
  2619. this.list = [];
  2620. this.tabVal = name;
  2621. this.onLoad();
  2622. },
  2623. onLoad() {
  2624. // 授权
  2625. getTicketFun().then(() => {
  2626. var postType = localStorage.getItem('postType');
  2627. if (postType == 'GZ') {
  2628. this.typeShow = false;
  2629. } else {
  2630. this.typeShow = true;
  2631. }
  2632. this.getUserOutPlaList();
  2633. });
  2634. },
  2635. onLoadlong() {
  2636. this.list = [];
  2637. this.getUserOutPlaList();
  2638. },
  2639. },
  2640. };
  2641. </script>
  2642. <style lang="scss">
  2643. .van-dialog__confirm,
  2644. .van-dialog__confirm:active {
  2645. color: #0057ba;
  2646. }
  2647. .searchDiv {
  2648. .van-search {
  2649. background: #fff;
  2650. }
  2651. .van-search__action {
  2652. font-size: 14px;
  2653. color: #0057ba;
  2654. font-weight: bold;
  2655. background: #f1f1f1;
  2656. border-bottom-right-radius: 60px;
  2657. border-top-right-radius: 60px;
  2658. border: 1px solid #ccc;
  2659. padding: 0 20px;
  2660. }
  2661. .van-search--show-action {
  2662. padding-right: 12px;
  2663. }
  2664. .van-search__content {
  2665. border: 1px solid #ccc;
  2666. border-bottom-left-radius: 60px;
  2667. border-top-left-radius: 60px;
  2668. background: #f1f1f1;
  2669. border-right: 0;
  2670. }
  2671. }
  2672. .myTab {
  2673. .van-tabs__nav--card {
  2674. margin: 0 !important;
  2675. border-left: 0;
  2676. border-right: 0;
  2677. }
  2678. .van-tabs__wrap,
  2679. .van-tabs__nav--card {
  2680. height: 39px;
  2681. }
  2682. .van-tab {
  2683. line-height: 40px;
  2684. }
  2685. }
  2686. .myList {
  2687. .van-cell {
  2688. padding: 0;
  2689. &:after {
  2690. border-bottom: none;
  2691. }
  2692. }
  2693. }
  2694. .searchDivcs .van-search__content {
  2695. border-bottom-left-radius: 6px;
  2696. border-top-left-radius: 6px;
  2697. }
  2698. .searchDivcs .van-search__action {
  2699. border-bottom-right-radius: 6px;
  2700. border-top-right-radius: 6px;
  2701. }
  2702. </style>
  2703. <style lang="scss" scoped>
  2704. .bgcolor {
  2705. background-color: #f5f5f5;
  2706. }
  2707. .container {
  2708. padding-bottom: 50px;
  2709. }
  2710. .card {
  2711. padding: 10px 16px;
  2712. box-sizing: border-box;
  2713. }
  2714. .card .title {
  2715. font-size: 15px;
  2716. font-weight: bold;
  2717. color: #333;
  2718. line-height: 22px;
  2719. padding-right: 52px;
  2720. .JPABC {
  2721. width: 20px;
  2722. position: relative;
  2723. top: 4px;
  2724. margin-right: 3px;
  2725. }
  2726. .statusIcon {
  2727. padding: 3px;
  2728. font-size: 12px;
  2729. margin: 0 3px;
  2730. color: #fff;
  2731. display: inline-block;
  2732. height: 20px;
  2733. line-height: 16px;
  2734. vertical-align: -1px;
  2735. }
  2736. .submit {
  2737. background: #ffba13;
  2738. }
  2739. .noSubmit {
  2740. background: #f11818;
  2741. }
  2742. }
  2743. .card .info {
  2744. font-size: 14px;
  2745. color: #909090;
  2746. line-height: 26px;
  2747. }
  2748. .btnbox {
  2749. padding-top: 14px;
  2750. border-top: 1px solid #eee;
  2751. margin: 0 10px;
  2752. }
  2753. .navBarTOP {
  2754. position: fixed;
  2755. width: 100%;
  2756. z-index: 2;
  2757. top: 0;
  2758. }
  2759. .cellcontent .centerBtn {
  2760. margin: 0 auto 10px;
  2761. display: block;
  2762. width: 92%;
  2763. color: #0057ba;
  2764. border-radius: 5px;
  2765. padding: 0 2px;
  2766. }
  2767. .cellcontent .centerBtn1 {
  2768. background-color: #0057ba;
  2769. color: #fff;
  2770. border-color: #0057ba;
  2771. }
  2772. .cellcontent .centerBtn2 {
  2773. margin: 0 auto 10px;
  2774. display: block;
  2775. width: 92%;
  2776. color: #0057ba;
  2777. border-radius: 5px;
  2778. padding: 0;
  2779. }
  2780. .statstext {
  2781. background-color: #0057ba;
  2782. position: absolute;
  2783. right: 0;
  2784. top: 6px;
  2785. padding: 2px 6px 2px 12px;
  2786. border-bottom-left-radius: 60px;
  2787. border-top-left-radius: 60px;
  2788. color: #fff;
  2789. }
  2790. .cellcontent .van-cell {
  2791. padding: 10px 0;
  2792. }
  2793. .statstext .van-icon__image {
  2794. height: 0.7em;
  2795. }
  2796. .tipsTitle {
  2797. padding: 5px 0;
  2798. text-align: center;
  2799. font-size: 16px;
  2800. font-weight: 600;
  2801. }
  2802. </style>
  2803. <style lang="scss">
  2804. .zpover99 {
  2805. background-color: #00afff !important;
  2806. }
  2807. .van-tabs__nav--card .van-tab.van-tab--active {
  2808. background-color: #0057ba !important;
  2809. }
  2810. .visitSearch {
  2811. width: 68px;
  2812. color: #0057ba;
  2813. font-size: 14px;
  2814. }
  2815. .visitSearch .van-dropdown-menu__bar {
  2816. box-shadow: 0 0 0 #fff;
  2817. height: 52px;
  2818. }
  2819. .visitSearch .van-dropdown-menu__item {
  2820. justify-content: normal;
  2821. }
  2822. .visitSearch .van-dropdown-menu__title {
  2823. border-left: 1px solid #ccc;
  2824. }
  2825. .visitSearch .van-cell {
  2826. border: 1px solid #ccc;
  2827. border-radius: 5px;
  2828. padding: 6px;
  2829. }
  2830. .positionContent {
  2831. position: fixed;
  2832. color: #666;
  2833. display: inline-block;
  2834. box-shadow: 0px 2px 7px -5px #000;
  2835. border-radius: 100px;
  2836. overflow: hidden;
  2837. right: 14px;
  2838. cursor: pointer;
  2839. bottom: 96px;
  2840. background-color: white;
  2841. }
  2842. .positionContent .img {
  2843. border-radius: 100px;
  2844. float: left;
  2845. }
  2846. .positionContent .img .van-icon__image {
  2847. border-radius: 100px;
  2848. }
  2849. .zDialog .van-dialog__header {
  2850. padding: 10px;
  2851. border-bottom: 1px solid #f5f5f5;
  2852. }
  2853. .zDialog .infoText {
  2854. margin: 10px;
  2855. font-size: 14px;
  2856. color: #909090;
  2857. width: 98%;
  2858. }
  2859. .visitStoreIco {
  2860. float: left;
  2861. float: left;
  2862. width: 26px;
  2863. text-align: center;
  2864. background-color: #ffba13;
  2865. color: #fff;
  2866. border-radius: 100%;
  2867. margin-left: 14px;
  2868. line-height: 26px;
  2869. height: 26px;
  2870. }
  2871. .searchcheck {
  2872. padding: 0 10px 10px;
  2873. }
  2874. .searchcheck .van-checkbox {
  2875. /*width: 44%;*/
  2876. padding-bottom: 10px;
  2877. }
  2878. .searchcheck .checkbox {
  2879. font-size: 14px;
  2880. display: inline-block;
  2881. width: 50%;
  2882. line-height: 28px;
  2883. }
  2884. .searchcheck .checkbox .van-checkbox {
  2885. margin-bottom: 2px;
  2886. }
  2887. .searchcheck .checkbox1 {
  2888. font-size: 14px;
  2889. float: left;
  2890. line-height: 28px;
  2891. width: 50%;
  2892. }
  2893. .searchcheck .checkbox1 .child {
  2894. width: 100%;
  2895. }
  2896. .searchcheck {
  2897. height: 93vh;
  2898. overflow-y: auto;
  2899. }
  2900. .searchchecktitle {
  2901. width: 100%;
  2902. margin: 20px 0;
  2903. font-size: 16px;
  2904. border-left: 3px solid #0057ba;
  2905. line-height: 18px;
  2906. }
  2907. .textsize {
  2908. font-size: 14px;
  2909. }
  2910. .visitStoreIcos {
  2911. /*background: url("./../../assets/order1.png") center;*/
  2912. }
  2913. .topStore {
  2914. .JPVisitNum {
  2915. position: relative;
  2916. top: -26px;
  2917. font-size: 10px;
  2918. }
  2919. .TCFXListItem {
  2920. display: inline-block;
  2921. border: 1px solid #ccc;
  2922. padding: 3px 5px;
  2923. margin: 0 5px;
  2924. border-radius: 6px;
  2925. }
  2926. }
  2927. </style>