index.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228
  1. <template>
  2. <div class="bgcolor storeManagement">
  3. <div class="navBarTOP" style="background-color: #fff">
  4. <van-nav-bar class="navBar" title="客户信息" left-arrow @click-left="onClickLeft" />
  5. <!-- <van-row gutter="20" style="padding:0 16px;" v-if="addShow">
  6. <van-col span="12" v-if="addShow1">
  7. <van-button type="info" size="small" style="background: #0057ba;border-color: #0057ba;width: 100%;border-radius: 5px;
  8. margin-top: 10px;" @click="onSelect('A')"><van-icon name="guide-o" />&nbsp;新增专卖店/金牌店</van-button>
  9. </van-col>
  10. <van-col span="12" >
  11. <van-button type="info" size="small" style="margin-top: 10px;background: #0057ba;border-color: #0057ba;width: 100%;border-radius: 5px;" @click="onSelect('B')"><van-icon name="guide-o" />&nbsp;{{addBTN}}</van-button>
  12. </van-col>
  13. </van-row> -->
  14. <div class="searchDiv">
  15. <van-search
  16. v-model="fromValue.storeName"
  17. show-action
  18. left-icon="search"
  19. placeholder="搜索名称/编号/地址">
  20. <template #action>
  21. <div @click="onSearch">搜索</div>
  22. </template>
  23. </van-search>
  24. <div class="selectFilter" v-if="tabVal == 1">
  25. <van-dropdown-menu :close-on-click-overlay="false">
  26. <van-dropdown-item :title="dropdownTitle" ref="dropdownItem" @open="dropdownOpen">
  27. <van-cell
  28. center
  29. :title="item.text"
  30. v-for="item in statusOption"
  31. @click.stop="dropdownItemClick(item)">
  32. <template #right-icon v-if="item.selectFlag">
  33. <van-icon name="success" color="red" />
  34. </template>
  35. </van-cell>
  36. <div style="padding: 5px 16px">
  37. <van-button type="danger" block round @click="onConfirm"> 确认 </van-button>
  38. </div>
  39. </van-dropdown-item>
  40. </van-dropdown-menu>
  41. </div>
  42. </div>
  43. <van-tabs class="myTab" type="card" v-model="tabVal" color="#0057ba" @change="tabChange">
  44. <van-tab title="销售部" name="0" :disabled="disabled"></van-tab>
  45. <van-tab :title="title" name="1" :disabled="disabled"></van-tab>
  46. </van-tabs>
  47. <div class="lineGrey"></div>
  48. </div>
  49. <!-- <div v-if="!addShow" style="padding-top: 154px"></div> -->
  50. <!-- <div v-if="addShow" style="padding-top: 160px"></div> -->
  51. <div style="padding-top: 160px"></div>
  52. <!-- 主体内容-->
  53. <div class="container">
  54. <van-list
  55. class="myList"
  56. v-model="loading"
  57. :finished="finished"
  58. finished-text="--已经到底了--"
  59. :immediate-check="false"
  60. @load="onLoad">
  61. <div class="cellcontent srore" v-for="(item, index) in list" :key="index">
  62. <van-cell>
  63. <div class="card">
  64. <div></div>
  65. <div class="title" style="padding-right: 74px">
  66. <template v-if="item.storeLabels">
  67. <!-- 金牌店ABC -->
  68. <img
  69. class="JPABC"
  70. :src="require('@/assets/Icon/storeA.png')"
  71. v-if="item.storeLabels.storeA" />
  72. <img
  73. class="JPABC"
  74. :src="require('@/assets/Icon/storeB.png')"
  75. v-if="item.storeLabels.storeB" />
  76. <img
  77. class="JPABC"
  78. :src="require('@/assets/Icon/storeC.png')"
  79. v-if="item.storeLabels.storeC" />
  80. <img
  81. class="JPABC"
  82. :src="require('@/assets/Icon/storeD.png')"
  83. v-if="item.storeLabels.storeD" />
  84. <img
  85. class="JPABC"
  86. :src="require('@/assets/Icon/storeE.png')"
  87. v-if="item.storeLabels.storeE" />
  88. </template>
  89. <span class="btn" :data-clipboard-text="item.storeCode">
  90. <span>{{ item.storeName }}</span>
  91. (<span style="color: #0057ba">{{ item.storeCode }}</span
  92. >)
  93. <van-icon
  94. :name="paste"
  95. color="#ee0a24"
  96. size="20"
  97. style="top: 6px; margin-left: 4px" />
  98. </span>
  99. <!-- validFlag: 0正常门店,1无效门店,2临时门店 -->
  100. <span
  101. v-if="item.validFlag == 2"
  102. style="
  103. display: inline-block;
  104. border-radius: 100px;
  105. width: 20px;
  106. text-align: center;
  107. color: orange;
  108. font-weight: normal;
  109. "
  110. >临</span
  111. >
  112. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  113. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  114. <template v-if="item.approvalStatus == 0 && item.validFlag == 0">
  115. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
  116. >已提交</span
  117. >
  118. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  119. >未提交</span
  120. >
  121. </template>
  122. </div>
  123. <van-button
  124. type="info"
  125. size="small"
  126. plain
  127. class="centerBtn ctns"
  128. @click="storeDetailFn(item)"
  129. >客户信息<van-icon name="arrow"
  130. /></van-button>
  131. <div class="info" style="position: relative">
  132. 联系人:{{ item.contactName }}
  133. <div style="position: absolute; bottom: 0px; right: 0px" v-if="item.storeLabels">
  134. <el-popover
  135. popper-class="zpover"
  136. placement="bottom"
  137. width="120"
  138. trigger="click"
  139. content="该客户为凤凰客户">
  140. <div
  141. v-if="item.storeLabels.fhCustomer"
  142. class="visitStoreIco"
  143. style="background-color: #fff"
  144. slot="reference">
  145. <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
  146. </div>
  147. </el-popover>
  148. <el-popover popper-class="zpover zpover6" placement="bottom" trigger="click">
  149. <div>
  150. <p>
  151. 本店{{ timeData }}下单SKU数:<a
  152. @click="linkList(item)"
  153. style="text-decoration: underline"
  154. >点击查看详情</a
  155. >
  156. </p>
  157. </div>
  158. <div
  159. class="visitStoreIco"
  160. v-if="item.storeLabels.zysslNums !== false"
  161. style="background-color: #fff; position: relative"
  162. slot="reference">
  163. <p
  164. style="
  165. width: 100%;
  166. position: absolute;
  167. z-index: 1;
  168. top: 0.2px;
  169. width: 22px;
  170. margin: 0;
  171. margin-left: 3.6px;
  172. text-align: center;
  173. font-size: 12px;
  174. ">
  175. {{ item.storeLabels.zysslNums }}
  176. </p>
  177. <van-icon :name="ord" size="26" />
  178. </div>
  179. </el-popover>
  180. <el-popover
  181. popper-class="zpover zpover5"
  182. placement="bottom"
  183. width="200"
  184. trigger="click">
  185. <div v-if="item.storeLabels">
  186. <p>已参加:</p>
  187. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">{{ tt }}</p>
  188. </div>
  189. <div
  190. class="visitStoreIco"
  191. v-if="item.storeLabels.targetOne"
  192. style="background-color: #fff"
  193. slot="reference">
  194. <van-icon :name="targetOne" size="26" />
  195. </div>
  196. </el-popover>
  197. <el-popover
  198. popper-class="zpover"
  199. placement="bottom"
  200. width="200"
  201. trigger="click"
  202. content="同城店近60天未下单">
  203. <div
  204. v-if="item.storeLabels.fxNoOrder"
  205. class="visitStoreIco"
  206. style="background-color: #fff"
  207. slot="reference">
  208. <van-icon :name="order60" size="26" />
  209. </div>
  210. </el-popover>
  211. <el-popover
  212. popper-class="zpover"
  213. placement="bottom"
  214. width="200"
  215. trigger="click"
  216. content="金牌店近30天未下单">
  217. <div
  218. v-if="item.storeLabels.noOrder"
  219. class="visitStoreIco"
  220. style="background-color: #fff"
  221. slot="reference">
  222. <van-icon :name="order" size="26" />
  223. </div>
  224. </el-popover>
  225. <el-popover
  226. popper-class="zpover"
  227. placement="bottom"
  228. width="200"
  229. trigger="click"
  230. content="本店本月进过专业时时丽">
  231. <div
  232. v-if="item.storeLabels.zyssl"
  233. class="visitStoreIco"
  234. style="background-color: #ed5c68"
  235. slot="reference">
  236. </div>
  237. </el-popover>
  238. <el-popover
  239. popper-class="zpover zpover1"
  240. placement="bottom"
  241. width="200"
  242. trigger="click"
  243. content="本店本月进过超好贴">
  244. <div
  245. v-if="item.storeLabels.chtczj"
  246. class="visitStoreIco"
  247. style="background-color: #0057ba"
  248. slot="reference">
  249. </div>
  250. </el-popover>
  251. <!-- <el-popover-->
  252. <!-- placement="bottom"-->
  253. <!-- width="200"-->
  254. <!-- popper-class="zpover zpover2"-->
  255. <!-- trigger="click"-->
  256. <!-- content="本月未被拜访的门店">-->
  257. <!-- <div v-if="item.storeLabels.noVisit" class="visitStoreIco" style="background-color: #fff" slot="reference">-->
  258. <!-- <van-icon :name="visitTimess" size="26" /></div>-->
  259. <!-- </el-popover>-->
  260. <el-popover
  261. placement="bottom"
  262. popper-class="zpover zpover1 zpover1sb"
  263. trigger="click"
  264. :content="'本店本月已拜访过' + item.storeLabels.visitTimes + '次'">
  265. <div
  266. v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
  267. class="visitStoreIco"
  268. slot="reference"
  269. style="background-color: #fff; position: relative">
  270. <p
  271. style="
  272. width: 100%;
  273. position: absolute;
  274. z-index: 10;
  275. top: -2px;
  276. margin: 0;
  277. text-align: center;
  278. font-size: 12px;
  279. ">
  280. {{ item.storeLabels.visitTimes }}
  281. </p>
  282. <!-- A级金牌店拜访次数少于2 -->
  283. <van-icon
  284. :name="require('@/assets/ordernumRed.png')"
  285. size="26"
  286. v-if="
  287. item.storeLabels.storeA &&
  288. item.needVisitNum &&
  289. item.storeLabels.visitTimes < item.needVisitNum
  290. " />
  291. <van-icon :name="require('@/assets/ordernum.png')" size="26" v-else />
  292. </div>
  293. <p style="text-align: center; background: #fff; color: #000; padding: 5px 0">
  294. 本店本月已拜访过{{ item.storeLabels.visitTimes }}次
  295. </p>
  296. <p
  297. v-if="item.storeLabels.storeA && item.needVisitNum"
  298. style="text-align: center; background: #fff; color: red; padding: 5px 0">
  299. A级金牌店拜访标准:1月{{ item.needVisitNum }}次
  300. </p>
  301. <el-table :data="item.userVisitTimesMap" border max-height="180px">
  302. <el-table-column label="业务员" prop="userName" />
  303. <el-table-column label="拜访次数" prop="visitTimes" />
  304. </el-table>
  305. </el-popover>
  306. </div>
  307. </div>
  308. <div class="info">
  309. 类型:{{ item.storeCategoryName }}&nbsp;
  310. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  311. <div>
  312. <p>
  313. 本店经营品项指导:
  314. <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
  315. </p>
  316. </div>
  317. <van-icon name="question-o" size="18" slot="reference" />
  318. </el-popover>
  319. </div>
  320. <div class="info">联系电话:{{ item.telephone }}</div>
  321. <div class="info">地址:{{ item.addressLine }}</div>
  322. <!-- 分销店 -->
  323. <template
  324. v-if="
  325. item.sfaStoreType &&
  326. item.sfaStoreType.type == 'fxd' &&
  327. item.sfaStoreChainsContactList
  328. ">
  329. <div class="info" v-if="addShow1">
  330. 经销商:
  331. <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
  332. <el-popover
  333. popper-class="zpover zpoverStoreztype"
  334. placement="bottom-start"
  335. trigger="click">
  336. <div>
  337. <div>{{ item.chainCode }}</div>
  338. <div>{{ item.chainName }}</div>
  339. </div>
  340. <div slot="reference" :key="index">
  341. {{ item.categoryDescribe }}
  342. </div>
  343. </el-popover>
  344. </div>
  345. </div>
  346. </template>
  347. <template v-else>
  348. <div class="info" v-if="addShow1">经销商:{{ item.chainName }}</div>
  349. </template>
  350. </div>
  351. </van-cell>
  352. <div class="lineGrey"></div>
  353. </div>
  354. <van-empty v-if="list.length == 0" />
  355. </van-list>
  356. <br />
  357. <br />
  358. <br />
  359. <br />
  360. </div>
  361. <van-popup v-model="showProvincePicker" position="bottom">
  362. <van-picker
  363. show-toolbar
  364. title="省(州)"
  365. :columns="provinceList"
  366. @confirm="onProvinceConfirm"
  367. @cancel="showProvincePicker = false" />
  368. </van-popup>
  369. <van-popup v-model="showCityPicker" position="bottom">
  370. <van-picker
  371. show-toolbar
  372. title="城市"
  373. :columns="cityList"
  374. @confirm="onCityConfirm"
  375. @cancel="showCityPicker = false" />
  376. </van-popup>
  377. <van-popup v-model="showDistrictPicker" position="bottom">
  378. <van-picker
  379. show-toolbar
  380. title="县区"
  381. :columns="districtList"
  382. @confirm="onDistrictConfirm"
  383. @cancel="showDistrictPicker = false" />
  384. </van-popup>
  385. <div class="positionContent" @click="rangeStoreFn()" v-if="mapShows">
  386. <van-icon class="img" :name="mpimg" size="50" />
  387. </div>
  388. </div>
  389. </template>
  390. <script>
  391. import {
  392. storeList,
  393. getStoreTypeList,
  394. storeMyList,
  395. getStoreyslTypeList,
  396. getstoreCoverPosition,
  397. streetQuery,
  398. buryingPoint,
  399. ProductItemImge,
  400. } from '@/api/index';
  401. import ord from '@/assets/ord.png';
  402. import paste from '@/assets/paste.png';
  403. import mpimg from '@/assets/mpimg.png';
  404. import order from '@/assets/order.png';
  405. import axios from 'axios';
  406. import order60 from '@/assets/order60.png';
  407. import targetOne from '@/assets/targetOne.png';
  408. import visitTimes from '@/assets/visitTimes.png';
  409. export default {
  410. data() {
  411. return {
  412. disabled: false,
  413. list: [],
  414. ord: ord,
  415. addShow: false,
  416. mapShows: false,
  417. visitTimess: visitTimes,
  418. paste: paste,
  419. storeTypeList: [],
  420. loading: false,
  421. finished: false,
  422. mpimg: mpimg,
  423. order: order,
  424. order60: order60,
  425. targetOne: targetOne,
  426. pageSize: 12,
  427. pageNum: 1,
  428. cont: 0,
  429. tabVal: '1',
  430. showProvincePicker: false,
  431. showCityPicker: false,
  432. showDistrictPicker: false,
  433. provinceList: [],
  434. cityList: [],
  435. districtList: [],
  436. validFlag: '',
  437. addShow1: false,
  438. addBTN: '新建工地',
  439. title: '我的',
  440. fromValue: {
  441. storeName: '',
  442. provinceName: '全部省',
  443. districtName: '全部县区',
  444. cityName: '全部市',
  445. province: '',
  446. city: '',
  447. pageSize: 12,
  448. pageNum: 1,
  449. district: '',
  450. timeData: '',
  451. },
  452. timeData: '',
  453. approvalStatus: '',
  454. processApprovalStatus: '',
  455. typeOption: [
  456. { text: '全部门店', value: '' },
  457. { text: '已结案', value: 1 },
  458. { text: '未结案', value: 0 },
  459. ],
  460. statusOption: [
  461. { text: '已结案', value: 1, selectFlag: false },
  462. { text: '已提交', value: 2, selectFlag: false },
  463. { text: '未提交', value: 3, selectFlag: false },
  464. ],
  465. storeTypeTitle: '门店类型',
  466. storeStatusTitle: '门店状态',
  467. activatedTitles: [],
  468. activatedValues: [],
  469. dropdownTitle: '门店状态',
  470. };
  471. },
  472. activated() {
  473. // 是否从下单成功页面跳转过来,下单成功后点击上传陈列照直接跳转到编辑页面
  474. let id = localStorage.getItem('successStoreId');
  475. if (this.$route.query.source == 'successPage' && id) {
  476. // 跳转到详情页
  477. this.storeDetailFn({ storeId: id });
  478. } else {
  479. this.initSelect();
  480. this.tabVal = localStorage.getItem('tabVal') || '1';
  481. if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
  482. this.mapShows = false;
  483. } else {
  484. this.mapShows = true;
  485. }
  486. this.getStoreTypeList();
  487. this.getstoreCoverPosition();
  488. this.getStreetQuery();
  489. this.getMonth();
  490. let storeStatus = localStorage.getItem('storeStatus');
  491. // 1:未完工;2:未结案
  492. if (storeStatus) {
  493. if (storeStatus == 2) {
  494. this.statusOption = [
  495. { text: '已结案', value: 1, selectFlag: false },
  496. { text: '已提交', value: 2, selectFlag: true },
  497. { text: '未提交', value: 3, selectFlag: true },
  498. ];
  499. }
  500. this.setOption();
  501. }
  502. this.onSearch();
  503. if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
  504. this.mapShows = false;
  505. } else {
  506. this.mapShows = true;
  507. }
  508. }
  509. },
  510. watch: {
  511. $route: {
  512. handler(to, from) {
  513. // if (to.path == '/storemanagement/index' && from.path == '/My/index') {
  514. // this.tabVal = '1';
  515. // }
  516. if (from.path == '/storemanagement/index') {
  517. // 离开当前页面时
  518. localStorage.removeItem('storeStatus');
  519. }
  520. },
  521. // immediate: true,
  522. },
  523. },
  524. methods: {
  525. initSelect() {
  526. this.activatedTitles = [];
  527. this.activatedValues = [];
  528. this.dropdownTitle = '门店状态';
  529. this.dropdownOpen();
  530. },
  531. linkList(val) {
  532. localStorage.setItem('tabVal', this.tabVal);
  533. this.$router.push({
  534. path: '/pItem',
  535. query: {
  536. id: val.storeId,
  537. detilId: 'a',
  538. storeCode: val.storeCode,
  539. showOrderButton: val.showOrderButton,
  540. },
  541. });
  542. },
  543. linkimg(val) {
  544. ProductItemImge({ storeId: val.storeId }).then((response) => {
  545. if (response.code == 200) {
  546. if (response.data != undefined) {
  547. window.open(response.data);
  548. } else {
  549. this.$toast(response.msg);
  550. }
  551. }
  552. });
  553. },
  554. getMonth() {
  555. // 获取当前日期
  556. var currentDate = new Date();
  557. // 获取当前月份
  558. var currentMonth = currentDate.getMonth();
  559. // 获取当前年份
  560. // var currentYear = currentDate.getFullYear();
  561. var previousMonthDate1 = new Date();
  562. if (currentDate.getDate() == 1) {
  563. previousMonthDate1.setMonth(currentMonth - 1);
  564. } else {
  565. }
  566. var previousMonth1 = previousMonthDate1.getMonth();
  567. var previousYear1 = previousMonthDate1.getFullYear();
  568. // 计算前三个月的年份和月份
  569. var previousMonthDate = new Date();
  570. if (currentDate.getDate() == 1) {
  571. previousMonthDate.setMonth(currentMonth - 3);
  572. } else {
  573. previousMonthDate.setMonth(currentMonth - 2);
  574. }
  575. var previousMonth = previousMonthDate.getMonth();
  576. var previousYear = previousMonthDate.getFullYear();
  577. //前三个月
  578. if (previousYear1 == previousYear) {
  579. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  580. // 格式化年份和月份
  581. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  582. this.timeData =
  583. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  584. } else {
  585. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  586. // .toString().padStart(2, '0');
  587. // 格式化年份和月份
  588. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  589. this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  590. }
  591. },
  592. rangeStoreFn() {
  593. let loading1 = this.$toast.loading({
  594. duration: 0,
  595. message: '加载中...',
  596. forbidClick: true,
  597. });
  598. let url = window.location.href;
  599. let wx = this.wx;
  600. var that = this;
  601. let qiyeData;
  602. const instance = axios.create();
  603. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  604. instance
  605. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  606. params: {
  607. url: url,
  608. },
  609. })
  610. .then((response) => {
  611. if (response.status == 200) {
  612. this.cont = 3;
  613. var flat = true;
  614. var times = setInterval(() => {
  615. this.cont--;
  616. if (this.cont == '0') {
  617. if (flat) {
  618. loading1.clear();
  619. clearInterval(times);
  620. that.$dialog
  621. .alert({
  622. message: '定位失败,请开启企微定位权限',
  623. })
  624. .then(() => {});
  625. } else {
  626. clearInterval(times);
  627. }
  628. }
  629. }, 1000);
  630. qiyeData = response.data.data;
  631. wx.config({
  632. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  633. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  634. appId: qiyeData.appId, // 必填,企业微信的corpID
  635. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  636. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  637. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  638. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  639. });
  640. wx.ready(function () {
  641. wx.getLocation({
  642. type: 'gcj02',
  643. success: function (res) {
  644. flat = false;
  645. loading1.clear();
  646. var name = that.title;
  647. if (that.tabVal != 1) {
  648. name = '销售部';
  649. }
  650. buryingPoint({
  651. systemModel: '客户信息',
  652. buryingPointType: 3,
  653. buryingPointValue: name,
  654. buryingPointName: '地图',
  655. buryingPointPosition: '进入地图',
  656. });
  657. if (that.tabVal == 1) {
  658. localStorage.setItem('tabVal', this.tabVal);
  659. that.$router.push({
  660. path: '/rangeStore',
  661. query: {
  662. lat: '',
  663. lon: '',
  664. tabVal: 4,
  665. },
  666. });
  667. } else {
  668. localStorage.setItem('tabVal', this.tabVal);
  669. that.$router.push({
  670. path: '/rangeStore',
  671. query: {
  672. lat: '',
  673. lon: '',
  674. tabVal: 3,
  675. },
  676. });
  677. }
  678. },
  679. fail: function () {
  680. loading1.clear();
  681. that.$dialog.alert({
  682. message: 'GPS未开启',
  683. });
  684. },
  685. });
  686. });
  687. wx.error(function (res) {
  688. loading1.clear();
  689. that.$dialog
  690. .alert({
  691. message: '定位失败,请开启企微定位权限',
  692. })
  693. .then(() => {});
  694. });
  695. }
  696. });
  697. },
  698. onSelect(action) {
  699. if (action == 'B') {
  700. this.$router.push('/storeAdd');
  701. } else {
  702. window.location.href =
  703. 'https://weboa.nipponpaint.com.cn/4825836600585B0C/68488309EEFAC9044825805F0059C65B/_fi12rtp156lortal9ue32ww78_r_t4r5rr_09tu0qq19k09_npchina_sfs2g_?open&portalunid=AFECD3A3682ED7494825886F00242F0C&mainid=63C98CD1C79B608C4825886F0007F001';
  704. }
  705. },
  706. onProvinceConfirm(value) {
  707. this.fromValue.provinceName = value.text;
  708. this.fromValue.province = value.provinceCode;
  709. this.fromValue.cityName = '全部市';
  710. this.fromValue.city = '';
  711. this.fromValue.districtName = '全部县区';
  712. this.fromValue.district = '';
  713. this.fromValue.townName = '';
  714. this.fromValue.townCode = '';
  715. this.countyCode = '';
  716. this.cityCode = '';
  717. this.provinceCode = value.provinceCode;
  718. this.getStreetQuery('1');
  719. this.showProvincePicker = false;
  720. this.onSearch();
  721. },
  722. onCityConfirm(value) {
  723. this.fromValue.cityName = value.text;
  724. this.fromValue.city = value.cityCode;
  725. this.fromValue.districtName = '全部县区';
  726. this.fromValue.district = '';
  727. this.fromValue.townName = '';
  728. this.fromValue.townCode = '';
  729. this.countyCode = '';
  730. this.cityCode = value.cityCode;
  731. this.getStreetQuery('2');
  732. this.showCityPicker = false;
  733. this.onSearch();
  734. },
  735. onDistrictConfirm(value) {
  736. this.fromValue.districtName = value.text;
  737. this.fromValue.district = value.countyCode;
  738. this.fromValue.townName = '';
  739. this.fromValue.townCode = '';
  740. this.countyCode = value.countyCode;
  741. this.fromValue.cityLevel = value.countyLevel;
  742. this.getStreetQuery('3');
  743. this.showDistrictPicker = false;
  744. this.onSearch();
  745. },
  746. getStreetQuery(type) {
  747. var provinceCode = '';
  748. var cityCode = '';
  749. var countyCode = '';
  750. if (type == '1') {
  751. provinceCode = this.fromValue.province;
  752. cityCode = '';
  753. countyCode = '';
  754. } else if (type == '2') {
  755. provinceCode = this.fromValue.province;
  756. cityCode = this.fromValue.city;
  757. countyCode = '';
  758. } else if (type == '3') {
  759. provinceCode = this.fromValue.province;
  760. cityCode = this.fromValue.city;
  761. countyCode = this.fromValue.district;
  762. } else {
  763. provinceCode = '';
  764. cityCode = '';
  765. countyCode = '';
  766. }
  767. streetQuery({ provinceCode: provinceCode, cityCode: cityCode, countyCode: countyCode }).then(
  768. (res) => {
  769. var provinceList = [{ provinceCode: '', text: '全部省' }];
  770. var cityList = [{ cityCode: '', text: '全部市' }];
  771. var districtList = [{ countyCode: '', text: '全部县区' }];
  772. var townList = [];
  773. if (type == '1') {
  774. for (var z1 = 0; z1 < res.data.length; z1++) {
  775. cityList.push({ cityCode: res.data[z1].cityCode, text: res.data[z1].cityName });
  776. }
  777. this.cityList = cityList;
  778. } else if (type == '2') {
  779. for (var z2 = 0; z2 < res.data.length; z2++) {
  780. districtList.push({
  781. countyCode: res.data[z2].countyCode,
  782. text: res.data[z2].countyName,
  783. countyLevel: res.data[z2].countyLevel,
  784. });
  785. }
  786. this.districtList = districtList;
  787. } else if (type == '3') {
  788. for (var z3 = 0; z3 < res.data.length; z3++) {
  789. townList.push({ townCode: res.data[z3].townCode, text: res.data[z3].townName });
  790. }
  791. this.townList = townList;
  792. } else {
  793. for (var z = 0; z < res.data.length; z++) {
  794. provinceList.push({
  795. provinceCode: res.data[z].provinceCode,
  796. text: res.data[z].provinceName,
  797. });
  798. }
  799. this.provinceList = provinceList;
  800. }
  801. }
  802. );
  803. },
  804. getstoreCoverPosition() {
  805. getstoreCoverPosition({}).then((res) => {
  806. var postName = localStorage.getItem('postName');
  807. var postType = localStorage.getItem('postType');
  808. if (postType == 'DIY') {
  809. this.addBTN = '新建同城分销店';
  810. this.title = '我的';
  811. this.addShow1 = true;
  812. } else if (postType == 'JZ') {
  813. this.addBTN = '新建家装店';
  814. this.addShow1 = true;
  815. this.title = '我的';
  816. } else if (postType == 'GZ') {
  817. this.addBTN = '新建工地/潜在客户/公装客户仓库';
  818. this.addShow1 = false;
  819. this.title = '我的';
  820. }
  821. postName = postName.split(',');
  822. for (let i = 0; i < res.data.length; i++) {
  823. for (let j = 0; j < postName.length; j++) {
  824. if (res.data[i].dictLabel == postName[j]) {
  825. this.addShow = true;
  826. return false;
  827. }
  828. }
  829. }
  830. });
  831. },
  832. tabChange(name) {
  833. window.scrollTo(0, 0);
  834. this.finished = true;
  835. this.disabled = true;
  836. this.pageNum = 1;
  837. this.list = [];
  838. this.tabVal = name;
  839. this.onLoad();
  840. },
  841. getStoreTypeList() {
  842. if (localStorage.getItem('storeType') == '2') {
  843. getStoreyslTypeList({}).then((res) => {
  844. this.storeTypeList = res.data;
  845. });
  846. } else {
  847. getStoreTypeList({}).then((res) => {
  848. this.storeTypeList = res.data;
  849. });
  850. }
  851. },
  852. onLoad() {
  853. if (this.tabVal == 1) {
  854. this.getUserMyStoreList();
  855. } else {
  856. this.getUserStoreList();
  857. }
  858. },
  859. getUserMyStoreList() {
  860. if (this.refreshing) {
  861. this.refreshing = false;
  862. }
  863. if (this.pageNum == 1) {
  864. this.list = [];
  865. }
  866. let loading1 = this.$toast.loading({
  867. duration: 0,
  868. message: '加载中...',
  869. forbidClick: true,
  870. });
  871. var fromValue = this.fromValue;
  872. fromValue.pageNum = this.pageNum;
  873. fromValue.pageSize = this.pageSize;
  874. fromValue.storeName = this.fromValue.storeName.trim();
  875. storeMyList({
  876. ...fromValue,
  877. storeQueryStatus: this.activatedValues.join(','),
  878. }).then((res) => {
  879. loading1.clear();
  880. this.disabled = false;
  881. if (res.code == 200) {
  882. this.loading = false;
  883. this.list = this.list.concat(res.rows);
  884. if (this.list.length >= res.total) {
  885. this.finished = true;
  886. } else {
  887. this.finished = false;
  888. }
  889. this.pageNum = this.pageNum + 1;
  890. // this.list = res.rows
  891. } else {
  892. this.$toast.fail(res.msg);
  893. }
  894. });
  895. },
  896. getUserStoreList() {
  897. if (this.refreshing) {
  898. this.list = [];
  899. this.refreshing = false;
  900. }
  901. let loading1 = this.$toast.loading({
  902. duration: 0,
  903. message: '加载中...',
  904. forbidClick: true,
  905. });
  906. var fromValue = this.fromValue;
  907. fromValue.pageNum = this.pageNum;
  908. fromValue.pageSize = this.pageSize;
  909. fromValue.storeName = this.fromValue.storeName.trim();
  910. storeList(fromValue).then((res) => {
  911. loading1.clear();
  912. this.disabled = false;
  913. if (res.code == 200) {
  914. this.loading = false;
  915. this.list = this.list.concat(res.rows);
  916. if (this.list.length >= res.total) {
  917. this.finished = true;
  918. } else {
  919. this.finished = false;
  920. }
  921. this.pageNum = this.pageNum + 1;
  922. // this.list = res.rows
  923. } else {
  924. this.$toast.fail(res.msg);
  925. }
  926. });
  927. },
  928. storeDetailFn(item) {
  929. localStorage.setItem('tabVal', this.tabVal);
  930. // FSQ 仿石漆服务商
  931. if (item.storeCategory == 'FSQ01') {
  932. this.$router.push({
  933. path: '/FSQStoreDetail',
  934. query: { id: item.storeId },
  935. });
  936. } else if (item.designerStore) {
  937. // designerStore 是否为设计师招募门店,true-是,false-否
  938. this.$router.push({
  939. path: '/addDesignerDetail',
  940. query: { id: item.storeId },
  941. });
  942. } else {
  943. this.$router.push({
  944. path: '/storeDetail',
  945. query: { id: item.storeId },
  946. });
  947. }
  948. },
  949. onClickRight() {
  950. this.$router.push('/storeAdd');
  951. },
  952. onClickLeft() {
  953. localStorage.setItem('tabVal', '1');
  954. let storeStatus = localStorage.getItem('storeStatus');
  955. if (storeStatus) {
  956. localStorage.removeItem('storeStatus');
  957. this.$router.go(-1);
  958. } else {
  959. this.$router.push('/My/index');
  960. }
  961. },
  962. onSearch() {
  963. window.scrollTo(0, 0);
  964. this.pageNum = 1;
  965. this.list = [];
  966. this.finished = true;
  967. this.onLoad();
  968. },
  969. // 门店类型下拉选change
  970. storeTypeChange(value) {
  971. let storeTypeItem = this.typeOption.find((item) => item.value == value);
  972. this.storeTypeTitle = storeTypeItem ? storeTypeItem.title : '门店类型';
  973. // 门店每次切换 门店状态重置
  974. this.processApprovalStatus = '';
  975. this.storeStatusTitle = '门店状态';
  976. this.pageNum = 1;
  977. this.getUserMyStoreList();
  978. },
  979. // 门店状态下拉选change
  980. storeStatusChange(value) {
  981. let storeStatusItem = this.statusOption.find((item) => item.value == value);
  982. this.storeStatusTitle = storeStatusItem ? storeStatusItem.title : '门店状态';
  983. this.pageNum = 1;
  984. this.getUserMyStoreList();
  985. },
  986. // 打开筛选项
  987. dropdownOpen() {
  988. // 重置选中
  989. this.statusOption.forEach((val) => {
  990. this.$set(val, 'selectFlag', false);
  991. });
  992. if (this.activatedValues.length) {
  993. for (let i = 0; i < this.activatedValues.length; i++) {
  994. let item = this.statusOption[this.activatedValues[i] - 1];
  995. this.$set(item, 'selectFlag', true);
  996. }
  997. }
  998. },
  999. // 点击筛选项
  1000. dropdownItemClick(item) {
  1001. this.$set(item, 'selectFlag', !item.selectFlag);
  1002. },
  1003. // 筛选项确认
  1004. onConfirm() {
  1005. this.setOption();
  1006. this.$refs.dropdownItem.toggle();
  1007. this.pageNum = 1;
  1008. this.getUserMyStoreList();
  1009. },
  1010. setOption() {
  1011. let titles = [];
  1012. let values = [];
  1013. this.statusOption.forEach((val) => {
  1014. if (val.selectFlag) {
  1015. titles.push(val.text);
  1016. values.push(val.value);
  1017. }
  1018. });
  1019. this.activatedTitles = titles;
  1020. this.activatedValues = values;
  1021. this.dropdownTitle = this.activatedTitles.length
  1022. ? this.activatedTitles.join(',')
  1023. : '门店状态';
  1024. },
  1025. },
  1026. };
  1027. </script>
  1028. <style lang="scss">
  1029. .searchDiv {
  1030. .van-search {
  1031. background: #fff;
  1032. }
  1033. .van-search__action {
  1034. font-size: 14px;
  1035. color: #0057ba;
  1036. font-weight: bold;
  1037. background: #f1f1f1;
  1038. border-bottom-right-radius: 60px;
  1039. border-top-right-radius: 60px;
  1040. border: 1px solid #c1c1c1;
  1041. padding: 0 20px;
  1042. }
  1043. .van-search--show-action {
  1044. padding-right: 12px;
  1045. }
  1046. .van-search__content {
  1047. border: 1px solid #c1c1c1;
  1048. border-bottom-left-radius: 60px;
  1049. border-top-left-radius: 60px;
  1050. background: #f1f1f1;
  1051. border-right: 0;
  1052. }
  1053. }
  1054. .myList {
  1055. .van-cell {
  1056. padding: 0;
  1057. &:after {
  1058. border-bottom: none;
  1059. }
  1060. }
  1061. }
  1062. .myTab {
  1063. .van-tabs__nav--card {
  1064. margin: 0 !important;
  1065. border-left: 0;
  1066. border-right: 0;
  1067. }
  1068. .van-tabs__wrap,
  1069. .van-tabs__nav--card {
  1070. height: 39px;
  1071. }
  1072. .van-tab {
  1073. line-height: 40px;
  1074. }
  1075. }
  1076. .van-tabs__nav--card .van-tab.van-tab--active {
  1077. background-color: #0057ba !important;
  1078. }
  1079. .storeManagement {
  1080. .van-search {
  1081. flex: 1;
  1082. }
  1083. .searchDiv {
  1084. display: flex;
  1085. background: #fff;
  1086. align-items: center;
  1087. .selectFilter {
  1088. width: 30%;
  1089. .van-dropdown-menu__bar {
  1090. height: 40px !important;
  1091. box-shadow: none;
  1092. }
  1093. }
  1094. }
  1095. .JPVisitNum {
  1096. position: relative;
  1097. top: -26px;
  1098. font-size: 10px;
  1099. }
  1100. .TCFXListItem {
  1101. display: inline-block;
  1102. border: 1px solid #ccc;
  1103. padding: 3px 5px;
  1104. margin: 0 5px;
  1105. border-radius: 6px;
  1106. }
  1107. }
  1108. </style>
  1109. <style lang="scss" scoped>
  1110. .container {
  1111. padding-bottom: 50px;
  1112. }
  1113. .card {
  1114. padding: 10px 16px;
  1115. box-sizing: border-box;
  1116. .title {
  1117. font-size: 16px;
  1118. font-weight: bold;
  1119. color: #333;
  1120. line-height: 30px;
  1121. }
  1122. .info {
  1123. font-size: 14px;
  1124. color: #909090;
  1125. line-height: 26px;
  1126. }
  1127. }
  1128. .cellcontent .van-cell__right-icon {
  1129. height: 144px;
  1130. line-height: 144px;
  1131. margin-right: 10px;
  1132. }
  1133. .srore .van-cell {
  1134. padding: 0;
  1135. }
  1136. .contentpd16 .van-cell {
  1137. background-color: #ebf4ff;
  1138. margin: 8px 0;
  1139. border-radius: 5px;
  1140. padding: 4px 16px;
  1141. }
  1142. .visitStoreIco {
  1143. float: left;
  1144. float: left;
  1145. width: 26px;
  1146. text-align: center;
  1147. background-color: #ffba13;
  1148. color: #fff;
  1149. border-radius: 100%;
  1150. margin-left: 14px;
  1151. line-height: 26px;
  1152. height: 26px;
  1153. }
  1154. .centerBtn {
  1155. margin: 0 auto 10px;
  1156. display: block;
  1157. width: 92%;
  1158. color: #0057ba;
  1159. border-radius: 5px;
  1160. padding: 0 6px;
  1161. height: 28px;
  1162. }
  1163. .ctns {
  1164. position: absolute;
  1165. top: 12px;
  1166. right: 12px;
  1167. width: 74px;
  1168. }
  1169. .positionContent {
  1170. position: fixed;
  1171. color: #666;
  1172. display: inline-block;
  1173. box-shadow: 0px 2px 7px -5px #000;
  1174. border-radius: 100px;
  1175. overflow: hidden;
  1176. right: 14px;
  1177. cursor: pointer;
  1178. bottom: 60px;
  1179. background-color: white;
  1180. }
  1181. .positionContent .img {
  1182. border-radius: 100px;
  1183. float: left;
  1184. }
  1185. .positionContent .img .van-icon__image {
  1186. border-radius: 100px;
  1187. }
  1188. .JPABC {
  1189. width: 20px;
  1190. position: relative;
  1191. top: 4px;
  1192. margin-right: 3px;
  1193. }
  1194. .statusIcon {
  1195. padding: 3px;
  1196. font-size: 12px;
  1197. margin: 0 3px;
  1198. color: #fff;
  1199. display: inline-block;
  1200. height: 20px;
  1201. line-height: 16px;
  1202. vertical-align: -1px;
  1203. }
  1204. .submit {
  1205. background: #ffba13;
  1206. }
  1207. .noSubmit {
  1208. background: #f11818;
  1209. }
  1210. </style>