index.vue 33 KB

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