topStore.vue 109 KB

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