index.vue 41 KB

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