index.vue 35 KB

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