topStore.vue 108 KB

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