index.vue 44 KB

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