index.vue 36 KB

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