index.vue 69 KB

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