index.vue 40 KB

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