index.vue 89 KB

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