index.vue 40 KB

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