index.vue 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750
  1. <template>
  2. <div class="bgcolor deviceWithin">
  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. <template #action>
  17. <div @click="onSearch">搜索</div>
  18. </template>
  19. </van-search>
  20. </div>
  21. <!-- 隐藏高销额门店入口 -->
  22. <!-- <div style="background-color: #dfebf4; padding: 10px" v-if="mapShows">
  23. <div
  24. style="
  25. font-size: 16px;
  26. text-align: center;
  27. margin: 0 auto;
  28. width: 150px;
  29. text-decoration: underline;
  30. font-weight: bold;
  31. color: #222;
  32. "
  33. @click="goFn(1)">
  34. <img
  35. src="./../../assets/Icon/clcik.png"
  36. style="width: 22px; float: left; display: inline-block" />高销额门店推荐
  37. </div>
  38. <van-button
  39. round
  40. type="info"
  41. size="small"
  42. style="position: absolute; top: 108px; right: 10px; height: 28px"
  43. @click="goFn(1)"
  44. >去查看<van-icon name="arrow"
  45. /></van-button>
  46. </div> -->
  47. <div class="monthNow" v-show="calendarIsshow == false">
  48. <span class="month" @click="show = true">{{ timeData }}</span>
  49. <van-icon class="CalendarIcon" :name="timeico" @click="show = true" />
  50. </div>
  51. </div>
  52. <!-- 主体内容-->
  53. <div class="container content" style="margin-top: 145px" @touchmove="handleTouch">
  54. <div class="cellcontent" v-for="(item, index) in list" :key="index">
  55. <van-cell>
  56. <div class="card">
  57. <div class="title">
  58. <template v-if="item.storeLabels">
  59. <!-- 金牌店ABC -->
  60. <img
  61. class="JPABC"
  62. :src="require('@/assets/Icon/storeA.png')"
  63. v-if="item.storeLabels.storeA" />
  64. <img
  65. class="JPABC"
  66. :src="require('@/assets/Icon/storeB.png')"
  67. v-if="item.storeLabels.storeB" />
  68. <img
  69. class="JPABC"
  70. :src="require('@/assets/Icon/storeC.png')"
  71. v-if="item.storeLabels.storeC" />
  72. <img
  73. class="JPABC"
  74. :src="require('@/assets/Icon/storeD.png')"
  75. v-if="item.storeLabels.storeD" />
  76. <img
  77. class="JPABC"
  78. :src="require('@/assets/Icon/storeE.png')"
  79. v-if="item.storeLabels.storeE" />
  80. </template>
  81. <span @click="goOtherSystem(item)" :style="setStroeNameStyle(item)">
  82. <span>{{ item.storeName }}</span>
  83. (<span>{{ item.storeCode }}</span
  84. >)
  85. </span>
  86. <span class="btn" :data-clipboard-text="item.storeCode">
  87. <van-icon
  88. :name="paste"
  89. color="#ee0a24"
  90. size="20"
  91. style="top: 6px; margin-left: 4px" />
  92. </span>
  93. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  94. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  95. <template v-if="item.approvalStatus == 0">
  96. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1">已提交</span>
  97. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  98. >未提交</span
  99. >
  100. </template>
  101. </div>
  102. <div class="info" style="position: relative">
  103. <!-- designerStore 是否为设计师招募门店,true-是,false-否 -->
  104. <template v-if="!item.designerStore"> 联系人:{{ item.contactName }}</template>
  105. </div>
  106. <div class="info" style="position: relative">
  107. 类型:{{ item.storeCategory }} &nbsp;
  108. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  109. <div>
  110. <p>
  111. 本店经营品项指导:
  112. <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
  113. </p>
  114. </div>
  115. <van-icon name="question-o" size="18" slot="reference" />
  116. </el-popover>
  117. <div style="position: absolute; bottom: 0; right: 14px">
  118. <el-popover
  119. popper-class="zpover"
  120. placement="bottom"
  121. width="120"
  122. trigger="click"
  123. content="该客户为凤凰客户">
  124. <div
  125. v-if="item.storeLabels.fhCustomer"
  126. class="visitStoreIco"
  127. style="background-color: #fff"
  128. slot="reference">
  129. <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
  130. </div>
  131. </el-popover>
  132. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  133. <div>
  134. <p>
  135. 本店{{ timeData1 }}下单SKU数:<a
  136. @click="linkList(item)"
  137. style="text-decoration: underline"
  138. >点击查看详情</a
  139. >
  140. </p>
  141. </div>
  142. <div
  143. class="visitStoreIco"
  144. v-if="item.storeLabels.zysslNums !== false"
  145. style="background-color: #fff; position: relative"
  146. slot="reference">
  147. <p
  148. style="
  149. width: 100%;
  150. position: absolute;
  151. z-index: 1;
  152. top: 0.2px;
  153. width: 22px;
  154. margin: 0;
  155. margin-left: 3.6px;
  156. text-align: center;
  157. font-size: 12px;
  158. ">
  159. {{ item.storeLabels.zysslNums }}
  160. </p>
  161. <van-icon :name="ord" size="26" />
  162. </div>
  163. </el-popover>
  164. <el-popover popper-class="zpover" placement="bottom" width="200" trigger="click">
  165. <div v-if="item.storeLabels">
  166. <p>已参加:</p>
  167. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
  168. {{ tt }}
  169. </p>
  170. </div>
  171. <div
  172. class="visitStoreIco"
  173. v-if="item.storeLabels.targetOne"
  174. style="background-color: #fff"
  175. slot="reference">
  176. <van-icon :name="targetOne" size="26" />
  177. </div>
  178. </el-popover>
  179. <el-popover
  180. popper-class="zpover"
  181. placement="bottom"
  182. width="200"
  183. trigger="click"
  184. content="同城店近60天未下单">
  185. <div
  186. v-if="item.storeLabels.fxNoOrder"
  187. class="visitStoreIco"
  188. style="background-color: #fff"
  189. slot="reference">
  190. <van-icon :name="order60" size="26" />
  191. </div>
  192. </el-popover>
  193. <el-popover
  194. popper-class="zpover"
  195. placement="bottom"
  196. width="200"
  197. trigger="click"
  198. content="金牌店近30天未下单">
  199. <div
  200. v-if="item.storeLabels.noOrder"
  201. class="visitStoreIco"
  202. style="background-color: #fff"
  203. slot="reference">
  204. <van-icon :name="order" size="26" />
  205. </div>
  206. </el-popover>
  207. <el-popover
  208. popper-class="zpover"
  209. placement="bottom"
  210. width="200"
  211. trigger="click"
  212. content="本店本月进过专业时时丽">
  213. <div
  214. v-if="item.storeLabels.zyssl"
  215. class="visitStoreIco"
  216. style="background-color: #ed5c68"
  217. slot="reference">
  218. </div>
  219. </el-popover>
  220. <el-popover
  221. popper-class="zpover zpover1"
  222. placement="bottom"
  223. width="200"
  224. trigger="click"
  225. content="本店本月进过超好贴">
  226. <div
  227. v-if="item.storeLabels.chtczj"
  228. class="visitStoreIco"
  229. style="background-color: #0057ba"
  230. slot="reference">
  231. </div>
  232. </el-popover>
  233. <el-popover
  234. placement="bottom"
  235. popper-class="zpover zpover1 zpover1sb"
  236. trigger="click"
  237. :disabled="!item.userVisitTimesMap"
  238. :content="'本店本月已拜访过' + item.storeLabels.visitTimes + '次'">
  239. <div
  240. v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
  241. class="visitStoreIco"
  242. slot="reference"
  243. style="background-color: #fff; position: relative">
  244. <p
  245. style="
  246. width: 100%;
  247. position: absolute;
  248. z-index: 10;
  249. top: -2px;
  250. margin: 0;
  251. text-align: center;
  252. font-size: 12px;
  253. ">
  254. {{ item.storeLabels.visitTimes }}
  255. </p>
  256. <!-- A级金牌店拜访次数少于2 -->
  257. <van-icon
  258. :name="require('@/assets/ordernumRed.png')"
  259. size="26"
  260. v-if="
  261. item.storeLabels.storeA &&
  262. item.needVisitNum &&
  263. item.storeLabels.visitTimes < item.needVisitNum
  264. " />
  265. <van-icon :name="require('@/assets/ordernum.png')" size="26" v-else />
  266. </div>
  267. <p style="text-align: center; background: #fff; color: #000; padding: 5px 0">
  268. 本店本月已拜访过{{ item.storeLabels.visitTimes }}次
  269. </p>
  270. <p
  271. v-if="item.storeLabels.storeA && item.needVisitNum"
  272. style="text-align: center; background: #fff; color: red; padding: 5px 0">
  273. A级金牌店拜访标准:1月{{ item.needVisitNum }}次
  274. </p>
  275. <el-table :data="item.userVisitTimesMap" border max-height="180px">
  276. <el-table-column label="业务员" prop="userName" />
  277. <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
  278. </el-table>
  279. </el-popover>
  280. </div>
  281. </div>
  282. <div class="info" v-if="item.telephone" @click="buryingPointFn(item)">
  283. 联系电话:<a
  284. style="color: #0057ba; font-weight: bold; text-decoration: underline"
  285. :href="'tel:' + item.telephone"
  286. >{{ item.telephone }}<van-icon name="phone"
  287. /></a>
  288. </div>
  289. <div class="info" v-if="item.addressLine">
  290. 地址:{{ item.addressLine
  291. }}<img
  292. v-if="item.storeLonExist"
  293. style="width: 36px"
  294. :src="sbpmdh"
  295. @click="linkapp(item)" />
  296. </div>
  297. <!-- 潜在店不显示经销商 -->
  298. <template v-if="item.sfaStoreType.type != 'qzd'">
  299. <!-- 分销店 -->
  300. <template
  301. v-if="
  302. item.sfaStoreType &&
  303. item.sfaStoreType.type == 'fxd' &&
  304. item.sfaStoreChainsContactList
  305. ">
  306. <div class="info" v-if="typeShow">
  307. 经销商:
  308. <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
  309. <el-popover
  310. popper-class="zpover zpoverStoreztype"
  311. placement="bottom-start"
  312. trigger="click">
  313. <div>
  314. <div>{{ item.chainCode }}</div>
  315. <div>{{ item.chainName }}</div>
  316. </div>
  317. <div slot="reference" :key="index">
  318. {{ item.categoryDescribe }}
  319. </div>
  320. </el-popover>
  321. </div>
  322. </div>
  323. </template>
  324. <template v-else>
  325. <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
  326. </template>
  327. </template>
  328. <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
  329. <div class="info" v-if="item.storeLonExist">距离:{{ Micrometer(item.distance) }}m</div>
  330. <div class="info" v-if="item.cntOrderAmtYear">
  331. 门店销额(全年累计):{{ Micrometer(item.cntOrderAmtYear) }}元
  332. </div>
  333. </div>
  334. <div
  335. class="statstext"
  336. v-if="item.stateString == '未拜访'"
  337. style="background-color: #ed5c68">
  338. 未拜访
  339. </div>
  340. <div
  341. class="statstext"
  342. v-if="item.stateString == '拜访中'"
  343. style="background-color: white">
  344. <van-icon :name="times" color="#ee0a24" size="32" />
  345. </div>
  346. <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
  347. <div class="btnbox">
  348. <van-row>
  349. <van-col
  350. span="4"
  351. v-if="item.stateString != '已拜访' && item.visitAble && customerVisits"
  352. @click="storeVisit(item)">
  353. <img :src="call" style="margin: 0 auto; height: 15px; display: block" />
  354. <p style="text-align: center; margin: 0; font-size: 11px">进入拜访</p>
  355. </van-col>
  356. <van-col
  357. span="4"
  358. v-if="item.storeCategory == '公装经销商'"
  359. @click="projectOutVisit(item)">
  360. <img :src="xmgj" style="margin: 0 auto; height: 15px; display: block" />
  361. <p style="text-align: center; margin: 0; font-size: 11px">项目跟进</p>
  362. </van-col>
  363. <van-col
  364. span="4"
  365. v-if="
  366. item.stateString != '已拜访' &&
  367. item.visitAble &&
  368. item.storeCategory != '公装经销商' &&
  369. customerVisits
  370. "
  371. @click="abnormalVisit(item)">
  372. <img :src="yichang" style="margin: 0 auto; height: 15px; display: block" />
  373. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  374. 异常拜访
  375. </p>
  376. </van-col>
  377. <van-col span="4" v-if="item.storeLabels.zysslNums !== false" @click="linkList(item)">
  378. <img
  379. :src="require('@/assets/recommendicon.png')"
  380. style="margin: 0 auto; height: 15px; display: block" />
  381. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  382. 推荐下单
  383. </p>
  384. </van-col>
  385. <van-col span="4" v-else-if="item.showOrderButton" @click="orderFn(item)">
  386. <img :src="xiadan" style="margin: 0 auto; height: 15px; display: block" />
  387. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  388. 去下单
  389. </p>
  390. </van-col>
  391. <van-col span="4" v-if="item.stateString == '已拜访'" @click="Visit(item)">
  392. <img :src="bfxx" style="margin: 0 auto; height: 15px; display: block" />
  393. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  394. 拜访信息
  395. </p>
  396. </van-col>
  397. <van-col span="4" @click="visitFn(item)">
  398. <img :src="kehuxinxi" style="margin: 0 auto; height: 15px; display: block" />
  399. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 11px">
  400. 客户信息
  401. </p>
  402. </van-col>
  403. </van-row>
  404. </div>
  405. </van-cell>
  406. <div class="lineGrey"></div>
  407. </div>
  408. <p style="text-align: center; color: #888a8e" v-if="list.length > 0">--已经到底了--</p>
  409. <br />
  410. <van-empty description="暂无数据" v-if="list.length == 0" />
  411. </div>
  412. <van-popup v-model="show" position="bottom" :style="{ height: '50%' }">
  413. <van-datetime-picker
  414. v-model="currentDate"
  415. type="date"
  416. title="计划日期"
  417. :min-date="minDate"
  418. :max-date="maxDate"
  419. @confirm="dateeconfirm"
  420. @cancel="show = false" />
  421. </van-popup>
  422. <!-- 筛选模块 -->
  423. <filtrate
  424. v-show="showFilter"
  425. :showFilter="showFilter"
  426. @closePopup="closePopup"
  427. :entry="0"></filtrate>
  428. <tab-bar tabBarActive="deviceWithin"></tab-bar>
  429. </div>
  430. </template>
  431. <script>
  432. import tabBar from '@/components/tabBar';
  433. import times from '@/assets/Icon/times.png';
  434. import order60 from '@/assets/order60.png';
  435. import targetOne from '@/assets/targetOne.png';
  436. import visitTimes from '@/assets/visitTimes.png';
  437. import ord from '@/assets/ord.png';
  438. import timeico from '@/assets/Icon/datatims.png';
  439. import sbpmdh from '@/assets/sbpmdh.png';
  440. import {
  441. getUserInPlanList,
  442. checkVisit,
  443. addVisitsPosition,
  444. mobileReposition,
  445. buryingPoint,
  446. ProductItemImge,
  447. } from '@/api/index';
  448. import axios from 'axios';
  449. import paste from '@/assets/paste.png';
  450. import order from '@/assets/order.png';
  451. import call from '@/assets/call.png';
  452. import jiarujihua from '@/assets/jiarujihua.png';
  453. import kehuxinxi from '@/assets/kehuxinxi-2.png';
  454. import xiadan from '@/assets/xiadan.png';
  455. import yichang from '@/assets/yichang.png';
  456. import bfxx from '@/assets/bfxx.png';
  457. import xmgj from '@/assets/xmgj.png';
  458. import { getOrderUrlByStoreId } from '@/api/inventory';
  459. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  460. import { getPosition, getTicketFun } from '@/utils/TXApiFun';
  461. import filtrate from '@/components/filtrate';
  462. export default {
  463. name: 'deviceWithin',
  464. components: { tabBar, filtrate },
  465. data() {
  466. return {
  467. xmgj: xmgj,
  468. bfxx: bfxx,
  469. yichang: yichang,
  470. xiadan: xiadan,
  471. kehuxinxi: kehuxinxi,
  472. jiarujihua: jiarujihua,
  473. call: call,
  474. times: times,
  475. timeico: timeico,
  476. order60: order60,
  477. sbpmdh: sbpmdh,
  478. ord: ord,
  479. timeData1: '',
  480. targetOne: targetOne,
  481. paste: paste,
  482. visitTimess: visitTimes,
  483. show: false,
  484. cont: 0,
  485. timer: null,
  486. flag: true,
  487. order: order,
  488. defaultDate: new Date(),
  489. minDate: new Date(2020, 0, 1),
  490. maxDate: new Date(2025, 10, 1),
  491. showPopoverVNUM: [],
  492. showPopoverC: [],
  493. showPopoverZ: [],
  494. currentDate: new Date(),
  495. searchValue: '',
  496. calendarIsshow: false,
  497. tabVal: 'insidePlan',
  498. list: [],
  499. loading: false,
  500. finished: false,
  501. mapShows: false,
  502. typeShow: false,
  503. storeName: '',
  504. timeData: '',
  505. genDate: '',
  506. listActive: null,
  507. query: '',
  508. lat: '',
  509. lon: '',
  510. storeType: '',
  511. endShow: false,
  512. visitEndId: '',
  513. customerVisits: true,
  514. // 筛选模块
  515. showFilter: false,
  516. filterParams: {},
  517. };
  518. },
  519. watch: {
  520. $route(to, from) {
  521. if (from.path == '/deviceWithin/index' && to.path == '/storeVisitpage') {
  522. localStorage.setItem('startTime', new Date());
  523. }
  524. },
  525. },
  526. activated() {
  527. this.query = this.$route.query;
  528. this.timeData = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  529. this.storeName = localStorage.getItem('deviveStoreName');
  530. this.getMonth();
  531. // 授权
  532. getTicketFun().then(() => {
  533. this.getUserInPlanList();
  534. });
  535. },
  536. mounted() {
  537. // 解决iOS 上拉边界下拉出现白色空白
  538. let node = document.getElementsByClassName('deviceWithin')[0];
  539. node.addEventListener(
  540. 'touchmove',
  541. (e) => {
  542. if (e._isScroller) return;
  543. e.preventDefault();
  544. },
  545. {
  546. passive: false,
  547. }
  548. );
  549. },
  550. methods: {
  551. closePopup(flag, filterParams) {
  552. this.showFilter = false;
  553. if (flag) {
  554. this.filterParams = filterParams;
  555. this.onSearch();
  556. }
  557. },
  558. searchFn() {
  559. this.showFilter = true;
  560. },
  561. handleTouch(e) {
  562. e._isScroller = true;
  563. },
  564. linkapp(val) {
  565. var poind = this.gcj02BD(val.lat, val.lon);
  566. let url = window.location.href;
  567. let that = this;
  568. let wx = this.wx;
  569. let qiyeData;
  570. const instance = axios.create();
  571. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  572. instance
  573. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  574. params: {
  575. url: url,
  576. agent: 1,
  577. },
  578. })
  579. .then((response) => {
  580. if (response.status == 200) {
  581. qiyeData = response.data.data;
  582. wx.agentConfig({
  583. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  584. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  585. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  586. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  587. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  588. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  589. success: function (res) {
  590. wx.invoke(
  591. 'launchMiniprogram',
  592. {
  593. appid: 'wx238bbb5f6d958414',
  594. path:
  595. 'pages/relayStation/relayStation?latitude=' +
  596. poind.lat +
  597. '&longitude=' +
  598. poind.lon +
  599. '&name=' +
  600. val.addressLine,
  601. },
  602. function (res) {
  603. if (res.err_msg == 'launchMiniprogram:ok') {
  604. } else {
  605. }
  606. }
  607. );
  608. },
  609. fail: function (res) {
  610. if (res.errMsg.indexOf('function not exist') > -1) {
  611. alert('版本过低请升级');
  612. }
  613. },
  614. });
  615. }
  616. });
  617. },
  618. orderFn(val) {
  619. buryingPoint({
  620. systemModel: '计划内',
  621. buryingPointType: 1,
  622. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  623. buryingPointName: '去下单',
  624. buryingPointPosition: '计划内',
  625. });
  626. getOrderUrlByStoreId({
  627. storeId: val.storeId,
  628. from: 'inPlan',
  629. }).then((res) => {
  630. if (res.code == 200 && res.data) {
  631. window.location.href = res.data;
  632. } else {
  633. this.Toast({
  634. message: res.msg,
  635. duration: 5000,
  636. });
  637. }
  638. });
  639. },
  640. linkList(val) {
  641. this.$router.push({
  642. path: '/pItem',
  643. query: {
  644. id: val.storeId,
  645. detilId: 'a',
  646. from: 'inPlan',
  647. storeCode: val.storeCode,
  648. showOrderButton: val.showOrderButton,
  649. },
  650. });
  651. },
  652. linkimg(val) {
  653. ProductItemImge({ storeId: val.storeId }).then((response) => {
  654. if (response.code == 200) {
  655. if (response.data != undefined) {
  656. window.open(response.data);
  657. } else {
  658. this.$toast(response.msg);
  659. }
  660. } else {
  661. this.$dialog.alert({
  662. title: '系统提示',
  663. message: res.msg,
  664. });
  665. }
  666. });
  667. },
  668. getMonth() {
  669. // 获取当前日期
  670. var currentDate = new Date();
  671. // 获取当前月份
  672. var currentMonth = currentDate.getMonth();
  673. // 获取当前年份
  674. // var currentYear = currentDate.getFullYear();
  675. var previousMonthDate1 = new Date();
  676. if (currentDate.getDate() == 1) {
  677. previousMonthDate1.setMonth(currentMonth - 1);
  678. } else {
  679. }
  680. var previousMonth1 = previousMonthDate1.getMonth();
  681. var previousYear1 = previousMonthDate1.getFullYear();
  682. // 计算前三个月的年份和月份
  683. var previousMonthDate = new Date();
  684. if (currentDate.getDate() == 1) {
  685. previousMonthDate.setMonth(currentMonth - 3);
  686. } else {
  687. previousMonthDate.setMonth(currentMonth - 2);
  688. }
  689. 1;
  690. var previousMonth = previousMonthDate.getMonth();
  691. var previousYear = previousMonthDate.getFullYear();
  692. //前三个月
  693. if (previousYear1 == previousYear) {
  694. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  695. // 格式化年份和月份
  696. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  697. this.timeData1 =
  698. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  699. } else {
  700. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  701. // .toString().padStart(2, '0');
  702. // 格式化年份和月份
  703. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  704. this.timeData1 = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  705. }
  706. },
  707. Visit(val) {
  708. this.$router.push({
  709. path: '/historicalDetails',
  710. query: {
  711. visitId: val.visitId,
  712. storeId: val.storeId,
  713. storeCode: val.storeCode,
  714. },
  715. });
  716. },
  717. dateeconfirm() {
  718. this.show = false;
  719. this.genDate = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
  720. this.timeData = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
  721. this.getUserInPlanList();
  722. },
  723. dataFn() {
  724. this.genDate = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  725. this.timeData = this.parseTime(new Date(), '{yy}-{mm}-{dd}');
  726. this.getUserInPlanList();
  727. },
  728. buryingPointFn(val) {
  729. buryingPoint({
  730. systemModel: '计划内',
  731. buryingPointType: 1,
  732. buryingPointValue: val.telephone,
  733. buryingPointName: '点击电话',
  734. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  735. });
  736. },
  737. getUserInPlanList() {
  738. localStorage.setItem('outvstoreName', '');
  739. localStorage.setItem('outvchainName', '');
  740. localStorage.removeItem('outvstoreLabelTypes');
  741. localStorage.removeItem('outvstoreCategoryList');
  742. localStorage.setItem('outvchainCode', '');
  743. localStorage.setItem('outvstoreName', '');
  744. localStorage.setItem('outvsortType', '');
  745. localStorage.setItem('outsortParam', '');
  746. localStorage.setItem('lat', '');
  747. localStorage.setItem('lon', '');
  748. this.list = [];
  749. var postType = localStorage.getItem('postType');
  750. this.customerVisits = localStorage.getItem('customerVisits');
  751. if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
  752. this.mapShows = false;
  753. } else {
  754. this.mapShows = true;
  755. }
  756. if (postType == 'GZ') {
  757. this.typeShow = false;
  758. } else {
  759. this.typeShow = true;
  760. }
  761. this.storeType = localStorage.getItem('storeType');
  762. this.endShow = false;
  763. this.toastLoading(0, '加载中...', true);
  764. localStorage.removeItem('visitId');
  765. getPosition(true, true)
  766. .then((res) => {
  767. let { TXisBD } = res;
  768. this.getUserInPlanListFun(TXisBD);
  769. })
  770. .catch((error) => {
  771. this.getUserInPlanListFun();
  772. // this.$dialog.alert({
  773. // message: error,
  774. // });
  775. });
  776. },
  777. getUserInPlanListFun(TXisBD) {
  778. getUserInPlanList({
  779. storeName: this.storeName.trim(),
  780. genDate: this.genDate,
  781. lat: TXisBD ? TXisBD.lat : '',
  782. lon: TXisBD ? TXisBD.lon : '',
  783. ...this.filterParams,
  784. }).then((res) => {
  785. this.toastLoading().clear();
  786. if (res.code == 200) {
  787. this.list = res.data;
  788. this.list.forEach((item) => {
  789. if (item.stateString.indexOf('拜访中') != -1) {
  790. this.endShow = true;
  791. this.visitEndId = item.visitId;
  792. return;
  793. }
  794. });
  795. } else {
  796. this.$toast.fail(res.msg);
  797. }
  798. });
  799. },
  800. storeVisit(val) {
  801. if (val.visitSource && val.visitSource == 2) {
  802. this.$toast('请先取消异常拜访后再进入正常拜访!');
  803. return;
  804. }
  805. var that = this;
  806. localStorage.removeItem('visitId');
  807. checkVisit({ storeId: val.storeId }).then((res) => {
  808. // buryingPoint({
  809. // systemModel: '计划内',
  810. // buryingPointType: 1,
  811. // buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  812. // buryingPointName: '进店拜访',
  813. // buryingPointPosition: '计划内',
  814. // });
  815. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  816. if (localStorage.getItem('loginType') == 'cs') {
  817. var lat = '';
  818. var lon = '';
  819. if (val.lat == '' || val.lat == null) {
  820. lat = '31.2517820000';
  821. lon = '120.5593090000';
  822. } else {
  823. lat = val.lat;
  824. lon = val.lon;
  825. }
  826. this.$router.push({
  827. path: '/storeVisitpage',
  828. query: {
  829. storeId: val.storeId,
  830. rdId: val.rdId,
  831. lat: lat,
  832. lon: lon,
  833. visitId: val.visitId,
  834. pageType: 'out',
  835. addressLine: val.addressLine,
  836. storeCategory: val.storeCategory,
  837. storeName: val.storeName,
  838. hisTime: val.hisTime,
  839. contactName: val.contactName,
  840. storeCode: val.storeCode,
  841. tabVal: this.tabVal,
  842. visitModel: '1',
  843. latNew: '31.2517820000',
  844. lonNew: '120.5593090000',
  845. PointSum: 0,
  846. marklat: lat,
  847. marklon: lon,
  848. from: 'inPlan',
  849. },
  850. });
  851. localStorage.setItem('startTime', new Date());
  852. localStorage.setItem('ORGName', val.deptName);
  853. localStorage.setItem('chainNameR', val.storeName);
  854. } else {
  855. if (that.flag) {
  856. that.flag = false;
  857. that.timer = null;
  858. that.timer = setTimeout(() => {
  859. that.flag = true;
  860. }, 2000);
  861. if (val.stateString.indexOf('拜访中') != -1) {
  862. that.$router.push({
  863. path: '/storeVisitpage',
  864. query: {
  865. storeId: val.storeId,
  866. rdId: val.rdId,
  867. lat: val.lat,
  868. lon: val.lon,
  869. visitId: val.visitId,
  870. addressLine: val.addressLine,
  871. storeCategory: val.storeCategory,
  872. storeName: val.storeName,
  873. contactName: val.contactName,
  874. genDate: val.hisTime,
  875. storeCode: val.storeCode,
  876. visitModel: '1',
  877. latNew: val.lat,
  878. lonNew: val.lon,
  879. PointSum: '0',
  880. marklat: val.lat,
  881. marklon: val.lon,
  882. from: 'inPlan',
  883. },
  884. });
  885. localStorage.setItem('startTime', new Date());
  886. localStorage.setItem('ORGName', val.deptName);
  887. localStorage.setItem('chainNameR', val.storeName);
  888. } else {
  889. getPosition()
  890. .then((res) => {
  891. let { TXisBD, resData } = res;
  892. this.lat = TXisBD.lat;
  893. this.lon = TXisBD.lon;
  894. localStorage.setItem('lat', this.lat);
  895. localStorage.setItem('lon', this.lon);
  896. this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
  897. })
  898. .catch((error) => {
  899. this.$dialog.alert({
  900. message: error,
  901. });
  902. });
  903. }
  904. }
  905. }
  906. } else {
  907. this.$dialog.alert({
  908. title: '系统提示',
  909. message: res.msg,
  910. });
  911. }
  912. });
  913. },
  914. checkStoreAddressByStoreCodeFun(val, location, res) {
  915. checkStoreAddressByStoreCode({
  916. storeCode: val.storeCode,
  917. lon: location.lon,
  918. lat: location.lat,
  919. }).then((response) => {
  920. // loading1.clear();
  921. if (val.lat == '' || val.lat == null) {
  922. this.lat = location.lat;
  923. this.lon = location.lon;
  924. }
  925. // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
  926. let PointSumval = this.twoPointSum(
  927. location.lat,
  928. location.lon,
  929. location.lat,
  930. location.lon
  931. ).toFixed(2);
  932. // GZ:工装店铺 直接进入拜访
  933. // if (localStorage.getItem('postType') == 'GZ') {
  934. // localStorage.setItem('startTime', new Date());
  935. // localStorage.setItem('ORGName', val.deptName);
  936. // localStorage.setItem('chainNameR', val.storeName);
  937. // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  938. // return;
  939. // }
  940. // 门店校验 地址不通过
  941. if (response.code != 200) {
  942. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  943. if (response.data.updateAddress == 0) {
  944. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  945. this.$dialog
  946. .confirm({
  947. confirmButtonText: '确定拜访',
  948. cancelButtonText: '取消拜访',
  949. title: '系统提示',
  950. message:
  951. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  952. closeOnClickOverlay: true,
  953. })
  954. .then(() => {
  955. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  956. });
  957. } else if (response.data.updateAddress == 1) {
  958. // 同城AB+金牌,去修改地址
  959. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  960. if (!response.data.addressUpdateTimesOver) {
  961. this.$dialog
  962. .confirm({
  963. title: '系统提示',
  964. message: response.msg + '请立即修改后再拜访',
  965. messageAlign: 'left',
  966. confirmButtonText: '立即修改',
  967. cancelButtonText: '取消',
  968. })
  969. .then(() => {
  970. this.$router.push({
  971. path: '/storeDetail',
  972. query: {
  973. id: val.storeId,
  974. type: 'address',
  975. storeAddressId: val.storeAddressId,
  976. },
  977. });
  978. });
  979. } else {
  980. this.$dialog.confirm({
  981. title: '系统提示',
  982. message: '已经达到最大修改次数',
  983. messageAlign: 'left',
  984. confirmButtonText: '确定',
  985. });
  986. }
  987. } else if (response.data.updateAddress == 2) {
  988. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  989. this.resetCoord(res, val, location, PointSumval);
  990. return;
  991. }
  992. } else {
  993. // 门店编码校验门店地址通过 进入拜访
  994. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  995. }
  996. });
  997. },
  998. // 重置经纬度
  999. resetCoord(res, val, location, PointSumval) {
  1000. this.$dialog
  1001. .confirm({
  1002. confirmButtonText: '初始化定位',
  1003. cancelButtonText: '取消拜访',
  1004. title: '系统提示',
  1005. message: '偏差过大,不允许拜访。可修改本店定位.',
  1006. closeOnClickOverlay: true,
  1007. })
  1008. .then(() => {
  1009. mobileReposition({
  1010. storeId: val.storeId,
  1011. lat: location.lat,
  1012. lon: location.lon,
  1013. }).then((response) => {
  1014. if (response.code == 200) {
  1015. this.$dialog
  1016. .alert({
  1017. title: '系统提示',
  1018. message: '本信息定位已更新成功!',
  1019. })
  1020. .then(() => {
  1021. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1022. });
  1023. localStorage.setItem('startTime', new Date());
  1024. localStorage.setItem('ORGName', val.deptName);
  1025. localStorage.setItem('chainNameR', val.storeName);
  1026. } else {
  1027. this.$toast(response.msg);
  1028. }
  1029. });
  1030. })
  1031. .catch(() => {});
  1032. },
  1033. // 进入拜访 router.push
  1034. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1035. addVisitsPosition({
  1036. storeId: val.storeId,
  1037. visitsId: '',
  1038. lon: res.longitude,
  1039. lat: res.latitude,
  1040. sourceLon: location.lon,
  1041. sourceLat: location.lat,
  1042. positionDesc: '',
  1043. accuracy: res.accuracy,
  1044. }).then(() => {
  1045. this.$router.push({
  1046. path: '/storeVisitpage',
  1047. query: {
  1048. storeId: val.storeId,
  1049. rdId: val.rdId,
  1050. lat: location.lat,
  1051. lon: location.lon,
  1052. visitId: val.visitId,
  1053. addressLine: val.addressLine,
  1054. storeCategory: val.storeCategory,
  1055. storeName: val.storeName,
  1056. contactName: val.contactName,
  1057. genDate: val.hisTime,
  1058. storeCode: val.storeCode,
  1059. visitModel: '1',
  1060. latNew: location.lat,
  1061. lonNew: location.lon,
  1062. PointSum: PointSumval,
  1063. marklat: res.latitude,
  1064. marklon: res.longitude,
  1065. from: 'inPlan',
  1066. },
  1067. });
  1068. });
  1069. },
  1070. projectOutVisit(val) {
  1071. localStorage.setItem('tabVal', this.tabVal);
  1072. localStorage.removeItem('visitId');
  1073. // checkVisit({storeId:val.storeId}).then(res=>{
  1074. // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
  1075. if (localStorage.getItem('loginType') == 'cs') {
  1076. var lat = '';
  1077. var lon = '';
  1078. if (val.lat == '' || val.lat == null) {
  1079. lat = '31.2517820000';
  1080. lon = '120.5593090000';
  1081. } else {
  1082. lat = val.lat;
  1083. lon = val.lon;
  1084. }
  1085. this.$router.push({
  1086. path: '/storeGroup',
  1087. query: {
  1088. storeId: val.storeId,
  1089. rdId: val.rdId,
  1090. lat: lat,
  1091. lon: lon,
  1092. visitId: val.visitId,
  1093. pageType: 'out',
  1094. addressLine: val.addressLine,
  1095. storeCategory: val.storeCategory,
  1096. storeName: val.storeName,
  1097. hisTime: val.hisTime,
  1098. contactName: val.contactName,
  1099. storeCode: val.storeCode,
  1100. tabVal: this.tabVal,
  1101. visitModel: '1',
  1102. latNew: '31.2517820000',
  1103. lonNew: '120.5593090000',
  1104. PointSum: 0,
  1105. marklat: lat,
  1106. marklon: lon,
  1107. },
  1108. });
  1109. localStorage.setItem('startTime', new Date());
  1110. localStorage.setItem('ORGName', val.deptName);
  1111. localStorage.setItem('chainNameR', val.storeName);
  1112. } else {
  1113. if (this.flag) {
  1114. this.flag = false;
  1115. this.timer = null;
  1116. let that = this;
  1117. this.timer = setTimeout(() => {
  1118. this.flag = true;
  1119. }, 2000);
  1120. if (val.stateString.indexOf('拜访中') != -1) {
  1121. localStorage.setItem('startTime', new Date());
  1122. localStorage.setItem('ORGName', val.deptName);
  1123. localStorage.setItem('chainNameR', val.storeName);
  1124. that.$router.push({
  1125. path: '/storeGroup',
  1126. query: {
  1127. storeId: val.storeId,
  1128. rdId: val.rdId,
  1129. lat: val.lat,
  1130. lon: val.lon,
  1131. visitId: val.visitId,
  1132. pageType: 'out',
  1133. addressLine: val.addressLine,
  1134. storeCategory: val.storeCategory,
  1135. storeName: val.storeName,
  1136. hisTime: val.hisTime,
  1137. contactName: val.contactName,
  1138. storeCode: val.storeCode,
  1139. tabVal: that.tabVal,
  1140. visitModel: '1',
  1141. latNew: val.lat,
  1142. lonNew: val.lon,
  1143. PointSum: '0',
  1144. marklat: val.lat,
  1145. marklon: val.lon,
  1146. },
  1147. });
  1148. } else {
  1149. let loading1 = this.$toast.loading({
  1150. duration: 0,
  1151. message: '加载中...',
  1152. forbidClick: true,
  1153. });
  1154. let url = window.location.href;
  1155. let wx = this.wx;
  1156. let qiyeData;
  1157. const instance = axios.create();
  1158. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1159. instance
  1160. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1161. params: {
  1162. url: url,
  1163. },
  1164. })
  1165. .then((response) => {
  1166. if (response.status == 200) {
  1167. this.cont = 3;
  1168. var flat = true;
  1169. var times = setInterval(() => {
  1170. this.cont--;
  1171. if (this.cont == '0') {
  1172. if (flat) {
  1173. loading1.clear();
  1174. clearInterval(times);
  1175. that.$dialog
  1176. .alert({
  1177. message: '定位失败,请开启企微定位权限',
  1178. })
  1179. .then(() => {});
  1180. } else {
  1181. clearInterval(times);
  1182. }
  1183. }
  1184. }, 1000);
  1185. qiyeData = response.data.data;
  1186. wx.config({
  1187. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1188. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1189. appId: qiyeData.appId, // 必填,企业微信的corpID
  1190. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1191. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1192. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1193. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1194. });
  1195. wx.ready(function () {
  1196. wx.getLocation({
  1197. type: 'gcj02',
  1198. success: function (res) {
  1199. flat = false;
  1200. loading1.clear();
  1201. var location = that.CJ02BD(res.latitude, res.longitude);
  1202. if (val.lat == '' || val.lat == null) {
  1203. that.lat = location.lat;
  1204. that.lon = location.lon;
  1205. }
  1206. let PointSum = that
  1207. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1208. .toFixed(2);
  1209. if (val.lat == '' || val.lat == null) {
  1210. if (localStorage.getItem('postType') != 'GZ') {
  1211. that.$dialog
  1212. .confirm({
  1213. confirmButtonText: '确定拜访',
  1214. cancelButtonText: '取消拜访',
  1215. title: '系统提示',
  1216. message:
  1217. '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
  1218. closeOnClickOverlay: true,
  1219. })
  1220. .then(() => {
  1221. that.$router.push({
  1222. path: '/storeGroup',
  1223. query: {
  1224. storeId: val.storeId,
  1225. rdId: val.rdId,
  1226. lat: that.lat,
  1227. lon: that.lon,
  1228. visitId: val.visitId,
  1229. pageType: 'out',
  1230. addressLine: val.addressLine,
  1231. storeCategory: val.storeCategory,
  1232. storeName: val.storeName,
  1233. contactName: val.contactName,
  1234. hisTime: val.hisTime,
  1235. storeCode: val.storeCode,
  1236. tabVal: that.tabVal,
  1237. visitModel: '1',
  1238. latNew: location.lat,
  1239. lonNew: location.lon,
  1240. PointSum: PointSum,
  1241. marklat: res.latitude,
  1242. marklon: res.longitude,
  1243. },
  1244. });
  1245. });
  1246. } else {
  1247. that.$router.push({
  1248. path: '/storeGroup',
  1249. query: {
  1250. storeId: val.storeId,
  1251. rdId: val.rdId,
  1252. lat: that.lat,
  1253. lon: that.lon,
  1254. visitId: val.visitId,
  1255. pageType: 'out',
  1256. addressLine: val.addressLine,
  1257. storeCategory: val.storeCategory,
  1258. storeName: val.storeName,
  1259. contactName: val.contactName,
  1260. hisTime: val.hisTime,
  1261. storeCode: val.storeCode,
  1262. tabVal: that.tabVal,
  1263. visitModel: '1',
  1264. latNew: location.lat,
  1265. lonNew: location.lon,
  1266. PointSum: PointSum,
  1267. marklat: res.latitude,
  1268. marklon: res.longitude,
  1269. },
  1270. });
  1271. }
  1272. } else {
  1273. that.$router.push({
  1274. path: '/storeGroup',
  1275. query: {
  1276. storeId: val.storeId,
  1277. rdId: val.rdId,
  1278. lat: that.lat,
  1279. lon: that.lon,
  1280. visitId: val.visitId,
  1281. pageType: 'out',
  1282. addressLine: val.addressLine,
  1283. storeCategory: val.storeCategory,
  1284. storeName: val.storeName,
  1285. contactName: val.contactName,
  1286. hisTime: val.hisTime,
  1287. storeCode: val.storeCode,
  1288. tabVal: that.tabVal,
  1289. visitModel: '1',
  1290. latNew: location.lat,
  1291. lonNew: location.lon,
  1292. PointSum: PointSum,
  1293. marklat: res.latitude,
  1294. marklon: res.longitude,
  1295. },
  1296. });
  1297. }
  1298. localStorage.setItem('startTime', new Date());
  1299. localStorage.setItem('ORGName', val.deptName);
  1300. localStorage.setItem('chainNameR', val.storeName);
  1301. addVisitsPosition({
  1302. storeId: val.storeId,
  1303. visitsId: '',
  1304. lon: res.longitude,
  1305. lat: res.latitude,
  1306. sourceLon: location.lon,
  1307. sourceLat: location.lat,
  1308. positionDesc: '',
  1309. accuracy: res.accuracy,
  1310. });
  1311. },
  1312. fail: function () {
  1313. loading1.clear();
  1314. that.$dialog.alert({
  1315. message: 'GPS未开启',
  1316. });
  1317. },
  1318. });
  1319. });
  1320. wx.error(function (res) {
  1321. loading1.clear();
  1322. that.$dialog
  1323. .alert({
  1324. message: '定位失败,请开启企微定位权限',
  1325. })
  1326. .then(() => {});
  1327. });
  1328. }
  1329. });
  1330. }
  1331. }
  1332. }
  1333. // }
  1334. // })
  1335. },
  1336. abnormalVisit(val) {
  1337. localStorage.removeItem('visitId');
  1338. checkVisit({ storeId: val.storeId }).then((res) => {
  1339. buryingPoint({
  1340. systemModel: '计划内',
  1341. buryingPointType: 1,
  1342. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1343. buryingPointName: '异常拜访',
  1344. buryingPointPosition: '计划内',
  1345. });
  1346. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1347. if (localStorage.getItem('loginType') == 'cs') {
  1348. var lat = '';
  1349. var lon = '';
  1350. if (val.lat == '' || val.lat == null) {
  1351. lat = '31.2517820000';
  1352. lon = '120.5593090000';
  1353. } else {
  1354. lat = val.lat;
  1355. lon = val.lon;
  1356. }
  1357. this.$router.push({
  1358. path: '/abnormalVisit',
  1359. query: {
  1360. storeId: val.storeId,
  1361. rdId: val.rdId,
  1362. lat: lat,
  1363. lon: lon,
  1364. visitId: val.visitId,
  1365. pageType: 'out',
  1366. addressLine: val.addressLine,
  1367. storeCategory: val.storeCategory,
  1368. storeName: val.storeName,
  1369. hisTime: val.hisTime,
  1370. contactName: val.contactName,
  1371. storeCode: val.storeCode,
  1372. tabVal: this.tabVal,
  1373. visitModel: '3',
  1374. latNew: '31.2517820000',
  1375. lonNew: '120.5593090000',
  1376. PointSum: 0,
  1377. marklat: lat,
  1378. marklon: lon,
  1379. },
  1380. });
  1381. localStorage.setItem('startTime', new Date());
  1382. localStorage.setItem('ORGName', val.deptName);
  1383. localStorage.setItem('chainNameR', val.storeName);
  1384. } else {
  1385. getPosition()
  1386. .then((res) => {
  1387. let { TXisBD, resData } = res;
  1388. this.lat = TXisBD.lat;
  1389. this.lon = TXisBD.lon;
  1390. localStorage.setItem('lat', this.lat);
  1391. localStorage.setItem('lon', this.lon);
  1392. console.log('异常拜访=' + this.lat);
  1393. console.log('异常拜访=' + this.lon);
  1394. let PointSum = this.twoPointSum(
  1395. TXisBD.lat,
  1396. TXisBD.lon,
  1397. TXisBD.lat,
  1398. TXisBD.lon
  1399. ).toFixed(2);
  1400. this.$router.push({
  1401. path: '/abnormalVisit',
  1402. query: {
  1403. storeId: val.storeId,
  1404. rdId: val.rdId,
  1405. lat: this.lat,
  1406. lon: this.lon,
  1407. visitModel: localStorage.getItem('postType') != 'GZ' ? '5' : '3',
  1408. visitId: val.visitId,
  1409. genDate: val.genDate,
  1410. storeCode: val.storeCode,
  1411. latNew: location.lat,
  1412. lonNew: location.lon,
  1413. PointSum: PointSum,
  1414. marklat: resData.latitude,
  1415. marklon: resData.longitude,
  1416. },
  1417. });
  1418. localStorage.setItem('startTime', new Date());
  1419. localStorage.setItem('ORGName', val.deptName);
  1420. localStorage.setItem('chainNameR', val.storeName);
  1421. addVisitsPosition({
  1422. storeId: val.storeId,
  1423. visitsId: '',
  1424. lon: resData.longitude,
  1425. lat: resData.latitude,
  1426. sourceLon: location.lon,
  1427. sourceLat: location.lat,
  1428. positionDesc: '',
  1429. accuracy: resData.accuracy,
  1430. });
  1431. })
  1432. .catch((error) => {
  1433. this.$dialog.alert({
  1434. message: error,
  1435. });
  1436. });
  1437. }
  1438. } else {
  1439. this.$dialog.alert({
  1440. title: '系统提示',
  1441. message: res.msg,
  1442. });
  1443. }
  1444. });
  1445. },
  1446. compareDate(dateTime1) {
  1447. var formatDate1 = Date.parse(dateTime1);
  1448. var formatDate2 = Date.parse(this.parseTime(new Date(), '{yy}-{mm}-{dd}'));
  1449. if (formatDate1 == formatDate2) {
  1450. return true;
  1451. } else {
  1452. return false;
  1453. }
  1454. },
  1455. visitFn(val) {
  1456. buryingPoint({
  1457. systemModel: '计划内',
  1458. buryingPointType: 1,
  1459. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1460. buryingPointName: '客户信息',
  1461. buryingPointPosition: '计划内',
  1462. });
  1463. if (val.sfaStoreType.type == 'qzd') {
  1464. // 竞品店/潜在店
  1465. this.$router.push({
  1466. path: '/competingStoresDetail',
  1467. query: { id: val.storeId },
  1468. });
  1469. } else if (/^FSQ/.test(val.storeCode)) {
  1470. // FSQ 仿石漆服务商
  1471. this.$router.push({
  1472. path: '/FSQStoreDetail',
  1473. query: { id: val.storeId },
  1474. });
  1475. return;
  1476. } else if (val.designerStore) {
  1477. // designerStore 是否为设计师招募门店,true-是,false-否
  1478. this.$router.push({
  1479. path: '/addDesignerDetail',
  1480. query: { id: val.storeId },
  1481. });
  1482. return;
  1483. } else {
  1484. this.$router.push({
  1485. path: '/storeDetail',
  1486. query: { id: val.storeId, detilId: 'a' },
  1487. });
  1488. }
  1489. },
  1490. goFn() {
  1491. this.$router.push({
  1492. path: '/topStore',
  1493. });
  1494. },
  1495. formLink() {
  1496. this.$router.push('/storeVisit/questions');
  1497. },
  1498. onClickLeft() {
  1499. this.$router.go(-1);
  1500. },
  1501. onSearch() {
  1502. localStorage.setItem('deviveStoreName', this.storeName);
  1503. this.getUserInPlanList();
  1504. },
  1505. handelChange(date) {
  1506. var dateF = this.parseTime(date.$d, '{yy}-{mm}-{dd}');
  1507. this.timeData = dateF;
  1508. this.genDate = dateF;
  1509. this.getUserInPlanList();
  1510. },
  1511. onLoad() {
  1512. this.getUserInPlanList();
  1513. },
  1514. listClick(val) {
  1515. this.listActive = val;
  1516. },
  1517. setStroeNameStyle(item) {
  1518. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  1519. if (
  1520. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  1521. item.approvalStatus == null ||
  1522. item.approvalStatus == 0
  1523. ) {
  1524. return {};
  1525. } else {
  1526. return { color: '#0057ba', 'text-decoration': 'underline' };
  1527. }
  1528. },
  1529. // 跳转好帮手门店详情
  1530. goOtherSystem(item) {
  1531. // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
  1532. if (
  1533. (item.sfaStoreType && (item.sfaStoreType.jz || item.sfaStoreType.gz)) ||
  1534. item.approvalStatus == null ||
  1535. item.approvalStatus == 0
  1536. ) {
  1537. return false;
  1538. }
  1539. if (item.storeCode) {
  1540. window.location.href =
  1541. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
  1542. } else {
  1543. this.$dialog.alert({
  1544. message: '缺少门店code',
  1545. });
  1546. }
  1547. },
  1548. },
  1549. };
  1550. </script>
  1551. <style lang="scss">
  1552. .van-dialog__confirm,
  1553. .van-dialog__confirm:active {
  1554. color: #0057ba;
  1555. }
  1556. .searchDiv {
  1557. .van-search {
  1558. background: #fff;
  1559. }
  1560. .van-search__action {
  1561. font-size: 14px;
  1562. color: #0057ba;
  1563. font-weight: bold;
  1564. background: #f1f1f1;
  1565. border-bottom-right-radius: 60px;
  1566. border-top-right-radius: 60px;
  1567. border: 1px solid #c1c1c1;
  1568. padding: 0 20px;
  1569. }
  1570. .van-search--show-action {
  1571. padding-right: 12px;
  1572. }
  1573. .van-search__content {
  1574. border: 1px solid #c1c1c1;
  1575. border-bottom-left-radius: 60px;
  1576. border-top-left-radius: 60px;
  1577. background: #f1f1f1;
  1578. border-right: 0;
  1579. }
  1580. }
  1581. </style>
  1582. <style lang="scss" scoped>
  1583. .bgcolor {
  1584. background-color: #f5f5f5;
  1585. }
  1586. .container {
  1587. padding-bottom: 50px;
  1588. }
  1589. .monthNow {
  1590. height: 48px;
  1591. line-height: 48px;
  1592. text-align: center;
  1593. font-weight: bold;
  1594. padding: 0 15px;
  1595. box-sizing: border-box;
  1596. background-color: #f5f5f5;
  1597. font-size: 16px;
  1598. .CalendarIcon {
  1599. font-size: 24px;
  1600. color: #0057ba;
  1601. position: relative;
  1602. top: 6px;
  1603. margin-left: 10px;
  1604. }
  1605. }
  1606. .card {
  1607. padding: 10px 16px;
  1608. box-sizing: border-box;
  1609. .title {
  1610. font-size: 15px;
  1611. font-weight: bold;
  1612. color: #333;
  1613. line-height: 22px;
  1614. padding-right: 52px;
  1615. /*word-break: break-all;*/
  1616. .JPABC {
  1617. width: 20px;
  1618. position: relative;
  1619. top: 4px;
  1620. margin-right: 3px;
  1621. }
  1622. .statusIcon {
  1623. padding: 3px;
  1624. font-size: 12px;
  1625. margin: 0 3px;
  1626. color: #fff;
  1627. display: inline-block;
  1628. height: 20px;
  1629. line-height: 16px;
  1630. vertical-align: -1px;
  1631. }
  1632. .submit {
  1633. background: #ffba13;
  1634. }
  1635. .noSubmit {
  1636. background: #f11818;
  1637. }
  1638. }
  1639. .info {
  1640. font-size: 14px;
  1641. color: #909090;
  1642. line-height: 26px;
  1643. }
  1644. }
  1645. .navBarTOP {
  1646. position: fixed;
  1647. width: 100%;
  1648. z-index: 2;
  1649. top: 0;
  1650. }
  1651. .cellcontent .centerBtn {
  1652. margin: 0 auto 10px;
  1653. display: block;
  1654. width: 92%;
  1655. border-radius: 5px;
  1656. color: #0057ba;
  1657. border: 1px solid #0057ba;
  1658. }
  1659. .cellcontent .centerBtn1 {
  1660. background-color: #0057ba;
  1661. color: #fff;
  1662. }
  1663. .btnbox {
  1664. padding-top: 14px;
  1665. border-top: 1px solid #eee;
  1666. margin: 0 10px;
  1667. }
  1668. .cellcontent .centerBtn2 {
  1669. margin: 0 auto 10px;
  1670. display: block;
  1671. width: 92%;
  1672. color: #0057ba;
  1673. border-radius: 5px;
  1674. padding: 0;
  1675. }
  1676. .statstext {
  1677. background-color: #0057ba;
  1678. position: absolute;
  1679. right: 0;
  1680. top: 6px;
  1681. padding: 2px 6px 2px 12px;
  1682. border-bottom-left-radius: 60px;
  1683. border-top-left-radius: 60px;
  1684. color: #fff;
  1685. }
  1686. .lineGrey {
  1687. height: 10px;
  1688. width: 100%;
  1689. background: #f1f1f1;
  1690. }
  1691. .cellcontent .van-cell {
  1692. padding: 10px 0;
  1693. }
  1694. .statstext .van-icon__image {
  1695. height: 0.7em;
  1696. }
  1697. .visitStoreIco {
  1698. float: left;
  1699. float: left;
  1700. width: 26px;
  1701. text-align: center;
  1702. background-color: #ffba13;
  1703. color: #fff;
  1704. border-radius: 100%;
  1705. margin-left: 14px;
  1706. line-height: 26px;
  1707. height: 26px;
  1708. }
  1709. .tipsTitle {
  1710. padding: 5px 0;
  1711. text-align: center;
  1712. font-size: 16px;
  1713. font-weight: 600;
  1714. }
  1715. .deviceWithin {
  1716. height: 100%;
  1717. width: 100%;
  1718. display: flex;
  1719. flex-direction: column;
  1720. overflow: hidden;
  1721. .content {
  1722. flex: 1;
  1723. overflow-y: auto;
  1724. }
  1725. .tabBar {
  1726. height: 50px;
  1727. }
  1728. .JPVisitNum {
  1729. position: relative;
  1730. top: -26px;
  1731. font-size: 10px;
  1732. }
  1733. .TCFXListItem {
  1734. display: inline-block;
  1735. border: 1px solid #ccc;
  1736. padding: 3px 5px;
  1737. margin: 0 5px;
  1738. border-radius: 6px;
  1739. }
  1740. }
  1741. </style>