index.vue 40 KB

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