index.vue 36 KB

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