index.vue 88 KB

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