index.vue 85 KB

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