index.vue 89 KB

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