index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. <template>
  2. <div class="hintTabPage">
  3. <div class="itemTab">
  4. <van-collapse v-model="activeNames">
  5. <!-- 拜访(实时) -->
  6. <van-collapse-item :name="visitCollapse.name">
  7. <template #title>
  8. <div class="itemHeader" @click.stop>
  9. <span class="itemTitle">{{ visitCollapse.title }}</span>
  10. <el-popover placement="right" trigger="click" popper-class="hintPopover">
  11. <div
  12. class="popoverConten"
  13. v-for="(item, index) in visitCollapse.tipsPopoverlabel"
  14. :key="index">
  15. {{ item }}
  16. </div>
  17. <div slot="reference" class="hintIconBox">
  18. <img class="hintIcon" :src="hintIcon" />
  19. </div>
  20. </el-popover>
  21. </div>
  22. </template>
  23. <visitPage
  24. fromType="noVisit"
  25. :empLevel="empLevel"
  26. :contentData="visitCollapse.contentData"
  27. :maskShow="visitCollapse.collapseLosding"
  28. :resData="visitCollapse.resData"></visitPage>
  29. </van-collapse-item>
  30. <!-- 建店 -->
  31. <van-collapse-item :name="createStore.name">
  32. <template #title>
  33. <div class="itemHeader" @click.stop>
  34. <span class="itemTitle">{{ createStore.title }}</span>
  35. <el-popover placement="right" trigger="click" popper-class="hintPopover">
  36. <div
  37. class="popoverConten"
  38. v-for="(item, index) in createStore.tipsPopoverlabel"
  39. :key="index">
  40. {{ item }}
  41. </div>
  42. <div slot="reference" class="hintIconBox">
  43. <img class="hintIcon" :src="hintIcon" />
  44. </div>
  45. </el-popover>
  46. </div>
  47. </template>
  48. <visitPage
  49. fromType="createStore"
  50. :empLevel="empLevel"
  51. :contentData="createStore.contentData"
  52. :maskShow="createStore.collapseLosding"
  53. :resData="createStore.resData"></visitPage>
  54. </van-collapse-item>
  55. <!-- 日报、周报、半月报 -->
  56. <van-collapse-item name="3" v-if="empLevel != '4'">
  57. <template #title>
  58. <div class="itemHeader" @click.stop>
  59. <span class="itemTitle">{{ report.title }}</span>
  60. <el-popover placement="right" trigger="click" popper-class="hintPopover">
  61. <div class="popoverConten">
  62. {{ report.reportData.tip }}
  63. </div>
  64. <div slot="reference" class="hintIconBox">
  65. <img class="hintIcon" :src="hintIcon" />
  66. </div>
  67. </el-popover>
  68. </div>
  69. </template>
  70. <div class="reportContent">
  71. <div class="reportItem">
  72. <div class="label">填写率:</div>
  73. <div class="value">本月{{ report.reportData.fillingRate }}</div>
  74. <div class="itemDetail" v-if="empLevel != '3'" @click="reportClick('fillingRate')">
  75. 下属详情
  76. </div>
  77. </div>
  78. <div class="reportItem" v-show="empLevel != '3'">
  79. <div class="label">审批率:</div>
  80. <div class="value">本月{{ report.reportData.approvalRate }}</div>
  81. </div>
  82. <div class="" v-show="empLevel == '1'">本周点评业务员</div>
  83. <div class="reportItem" v-show="empLevel == '1'">
  84. <div class="label">日报数(目标数):</div>
  85. <div class="value">{{ report.reportData.commentNum }}个(5个)</div>
  86. <div class="itemDetail" @click="reportClick('commentNum')">进入点评</div>
  87. </div>
  88. <div class="mask" v-if="report.reportLosding">
  89. <van-loading type="spinner" color="#1989fa" />
  90. </div>
  91. </div>
  92. </van-collapse-item>
  93. <!-- 色卡 销售员和销售部主管显示-->
  94. <van-collapse-item name="4" v-if="empLevel == '2' || empLevel == '3'">
  95. <template #title>
  96. <div class="itemHeader" @click.stop>
  97. <span class="itemTitle">{{ pantone.title }}</span>
  98. <el-popover placement="right" trigger="click" popper-class="hintPopover">
  99. <div class="popoverConten">
  100. {{ pantone.tip }}
  101. </div>
  102. <div slot="reference" class="hintIconBox">
  103. <img class="hintIcon" :src="hintIcon" />
  104. </div>
  105. </el-popover>
  106. </div>
  107. </template>
  108. <div class="pantoneContent">
  109. <template v-if="empLevel == '3'">
  110. <div v-for="(val, key, index) in pantone.pantoneData" :key="index">
  111. <div class="title">{{ key }}</div>
  112. <div class="pantoneItem">
  113. <div class="firstItem item">
  114. <div class="left">
  115. <div class="lebel">已领用:</div>
  116. <div class="value">{{ val.ywyylyNum }}</div>
  117. </div>
  118. <div class="right">
  119. <div class="lebel">已发放门店:</div>
  120. <div class="value">{{ val.ywyyffNum }}</div>
  121. </div>
  122. </div>
  123. <div class="secondItem item">
  124. <div class="left">
  125. <div class="lebel">门店未签收:</div>
  126. <div class="value">{{ val.mdwqsNum }}</div>
  127. </div>
  128. <div class="right">
  129. <div class="lebel">门店未签收:</div>
  130. <div class="value valueIsClick" @click="pantoneClick(val, key)">
  131. {{ val.wqsmdNum }}
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </template>
  138. <template v-if="empLevel == '2'">
  139. <div v-for="(val, key, index) in pantone.pantoneData" :key="index">
  140. <div class="title">{{ key }}</div>
  141. <div class="pantoneItem">
  142. <div class="firstItem item">
  143. <div class="left">
  144. <div class="lebel">直发销售部数:</div>
  145. <div class="value">{{ val.zfxsbNum }}</div>
  146. </div>
  147. <div class="right">
  148. <div class="lebel">业务员已领用:</div>
  149. <div class="value">{{ val.ywyylyNum }}</div>
  150. </div>
  151. </div>
  152. <div class="secondItem item">
  153. <div class="left">
  154. <div class="lebel">业务员已发放:</div>
  155. <div class="value">{{ val.ywyyffNum }}</div>
  156. </div>
  157. <div class="right">
  158. <div class="lebel">门店未签收:</div>
  159. <div class="value valueIsClick" @click="pantoneClick(val, key)">
  160. {{ val.wqsmdNum }}
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </template>
  167. <div class="mask" v-if="pantone.pantoneLosding">
  168. <van-loading type="spinner" color="#1989fa" />
  169. </div>
  170. </div>
  171. </van-collapse-item>
  172. </van-collapse>
  173. </div>
  174. </div>
  175. </template>
  176. <script>
  177. import {
  178. selectVisitsRealTime,
  179. selectBuildingStore,
  180. getReportTarget,
  181. getReportMaterial,
  182. } from '@/api/index';
  183. import hintIcon from '@/assets/hintIcon.png';
  184. import visitPage from './visitPage.vue';
  185. import { mapState } from 'vuex';
  186. export default {
  187. name: 'hintTabPage',
  188. components: { visitPage },
  189. computed: {
  190. ...mapState({
  191. userInfo: (state) => state.user.userInfo,
  192. }),
  193. },
  194. props: {
  195. tabVal: {
  196. type: [String, Number],
  197. default: '-1',
  198. },
  199. },
  200. data() {
  201. return {
  202. empLevel: '', //员工级别,1大区主管2销售部主管3业务员4其他 ***其他级别4,不显示日报、周报、半月报和色卡
  203. hintIcon: hintIcon,
  204. activeNames: ['1', '2', '3', '4', '5'],
  205. visitCollapse: {
  206. name: '1',
  207. title: '拜访(实时)',
  208. collapseLosding: true,
  209. tipsPopoverlabel: [],
  210. tipsPopoverValue: null,
  211. contentData: [
  212. {
  213. title: '可控店',
  214. titleProp: 'keKong',
  215. bagColor: '#eb6877',
  216. visitDetail: [
  217. {
  218. leftTable: '本月拜访率:',
  219. leftProp: 'visitRateThisMonth',
  220. leftUnit: '%',
  221. leftIsClick: false,
  222. rightTable: '未拜访:',
  223. rightProp: 'notVisited',
  224. rightUnit: '家',
  225. rightIsClick: true,
  226. },
  227. ],
  228. },
  229. {
  230. title: '金牌店',
  231. titleProp: 'jinPai',
  232. bagColor: '#f1b789',
  233. visitDetail: [
  234. {
  235. leftTable: '本月拜访率:',
  236. leftProp: 'visitRateThisMonth',
  237. leftUnit: '%',
  238. leftIsClick: false,
  239. rightTable: '未拜访:',
  240. rightProp: 'notVisited',
  241. rightUnit: '家',
  242. rightIsClick: true,
  243. },
  244. ],
  245. },
  246. {
  247. title: '同A店',
  248. titleProp: 'tongA',
  249. bagColor: '#88abda',
  250. visitDetail: [
  251. {
  252. leftTable: '近2个月拜访率:',
  253. leftProp: 'visitRateInThePastTwoMonths',
  254. leftUnit: '%',
  255. leftIsClick: false,
  256. rightTable: '未拜访:',
  257. rightProp: 'notVisited',
  258. rightUnit: '家',
  259. rightIsClick: true,
  260. },
  261. ],
  262. },
  263. {
  264. title: '同B店',
  265. titleProp: 'tongB',
  266. bagColor: '#8f82bc',
  267. visitDetail: [
  268. {
  269. leftTable: '近3个月拜访率:',
  270. leftProp: 'visitRateInThePastThreeMonths',
  271. leftUnit: '%',
  272. leftIsClick: false,
  273. rightTable: '未拜访:',
  274. rightProp: 'notVisited',
  275. rightUnit: '家',
  276. rightIsClick: true,
  277. },
  278. ],
  279. },
  280. ],
  281. resData: null,
  282. },
  283. createStore: {
  284. name: '2',
  285. title: '建店',
  286. collapseLosding: true,
  287. tipsPopoverlabel: [
  288. {
  289. label: '未完工',
  290. prop: '',
  291. },
  292. {
  293. label: '为结案',
  294. prop: '',
  295. },
  296. ],
  297. tipsPopoverValue: null,
  298. contentData: [
  299. {
  300. title: '可控店',
  301. titleProp: 'keKong',
  302. bagColor: '#eb6877',
  303. visitDetail: [
  304. {
  305. leftTable: '本月累计:',
  306. leftProp: 'month',
  307. leftUnit: '%',
  308. leftIsClick: false,
  309. },
  310. {
  311. leftTable: '今年累计:',
  312. leftProp: 'year',
  313. leftUnit: '%',
  314. leftIsClick: false,
  315. rightTable: '45天未结案:',
  316. rightProp: 'keKongAbnormalNum',
  317. rightUnit: '家',
  318. rightIsClick: true,
  319. },
  320. ],
  321. },
  322. {
  323. title: '金牌店',
  324. titleProp: 'jinPai',
  325. bagColor: '#f1b789',
  326. visitDetail: [
  327. {
  328. leftTable: '本月累计:',
  329. leftProp: 'month',
  330. leftUnit: '%',
  331. leftIsClick: false,
  332. rightTable: '7天未完工:',
  333. rightProp: 'jinPaiAbnormalNum',
  334. rightUnit: '家',
  335. rightIsClick: true,
  336. },
  337. {
  338. leftTable: '今年累计:',
  339. leftProp: 'year',
  340. leftUnit: '%',
  341. leftIsClick: false,
  342. rightTable: '30天未结案:',
  343. rightProp: 'jinPaiUnfinishedNum',
  344. rightUnit: '家',
  345. rightIsClick: true,
  346. },
  347. ],
  348. },
  349. {
  350. title: '同A店',
  351. titleProp: 'tongA',
  352. bagColor: '#88abda',
  353. visitDetail: [
  354. {
  355. leftTable: '本月累计:',
  356. leftProp: 'month',
  357. leftUnit: '%',
  358. leftIsClick: false,
  359. },
  360. {
  361. leftTable: '今年累计:',
  362. leftProp: 'year',
  363. leftUnit: '%',
  364. leftIsClick: false,
  365. rightTable: '30天未结案:',
  366. rightProp: 'tongAAbnormalNum',
  367. rightUnit: '家',
  368. rightIsClick: true,
  369. },
  370. ],
  371. },
  372. {
  373. title: '同B店',
  374. titleProp: 'tongB',
  375. bagColor: '#8f82bc',
  376. visitDetail: [
  377. {
  378. leftTable: '本月累计:',
  379. leftProp: 'month',
  380. leftUnit: '%',
  381. leftIsClick: false,
  382. },
  383. {
  384. leftTable: '今年累计:',
  385. leftProp: 'year',
  386. leftUnit: '%',
  387. leftIsClick: false,
  388. rightTable: '30天未结案:',
  389. rightProp: 'tongBAbnormalNum',
  390. rightUnit: '家',
  391. rightIsClick: true,
  392. },
  393. ],
  394. },
  395. ],
  396. resData: null,
  397. },
  398. report: {
  399. title: '',
  400. reportLosding: true,
  401. reportData: {},
  402. },
  403. pantone: {
  404. title: '色卡',
  405. tip: '',
  406. pantoneLosding: true,
  407. pantoneData: {},
  408. },
  409. };
  410. },
  411. watch: {
  412. tabVal: {
  413. handler(val) {
  414. if (val == -1) {
  415. this.initData();
  416. }
  417. },
  418. immediate: true,
  419. },
  420. },
  421. activated() {},
  422. methods: {
  423. initData() {
  424. if (!this.userInfo) return;
  425. this.empLevel = this.userInfo.empLevel;
  426. // 获取拜访数据
  427. this.getVisitCollapseData();
  428. // 获取建店数据
  429. this.getSelectBuildingStore();
  430. // 获取汇报数据 日报、周报、半月报
  431. this.getReportData();
  432. // 获取色卡数据
  433. this.getPantoneData();
  434. },
  435. getVisitCollapseData() {
  436. selectVisitsRealTime().then((res) => {
  437. this.visitCollapse.resData = res.data;
  438. this.visitCollapse.tipsPopoverlabel = res.data.reminderContent;
  439. this.visitCollapse.collapseLosding = false;
  440. });
  441. },
  442. getSelectBuildingStore() {
  443. selectBuildingStore().then((res) => {
  444. this.createStore.resData = res.data;
  445. this.createStore.tipsPopoverlabel = res.data.reminderContent;
  446. this.createStore.collapseLosding = false;
  447. });
  448. },
  449. getReportData() {
  450. if (this.empLevel == '1') {
  451. this.report.title = '半月报';
  452. } else if (this.empLevel == '2') {
  453. this.report.title = '周报';
  454. } else if (this.empLevel == '3') {
  455. this.report.title = '日报';
  456. }
  457. getReportTarget().then((res) => {
  458. this.report.reportLosding = false;
  459. this.report.reportData = res.data || {};
  460. });
  461. },
  462. getPantoneData() {
  463. if (this.empLevel == 2 || this.empLevel == 3) {
  464. getReportMaterial().then((res) => {
  465. this.pantone.pantoneLosding = false;
  466. this.pantone.tip = res.data.tip;
  467. this.pantone.pantoneData = res.data;
  468. delete this.pantone.pantoneData.tip;
  469. });
  470. }
  471. },
  472. // 汇报下属详情-点击
  473. reportClick(type) {
  474. if (type == 'fillingRate') {
  475. // 下属汇报率审批率统计
  476. this.$router.push({ path: 'reportingRate' });
  477. } else if (type == 'commentNum') {
  478. // 下属业务员历史日报
  479. this.$router.push({ path: 'subordinateHistoricalDaily' });
  480. }
  481. },
  482. // 色卡查看详情
  483. pantoneClick(val, key) {
  484. // 业务员进入未拜访列表
  485. if (this.empLevel == '3') {
  486. this.$router.push({ path: '/pantoneNoGet', query: { storeId: val.storeId } });
  487. } else if (this.empLevel == '2') {
  488. // 销售部主管
  489. this.$router.push({
  490. path: '/hintDetail',
  491. query: { fromType: 'pantone', materialCode: val.materialCode, pantoneName: key }, // materialCode物料来源
  492. });
  493. }
  494. },
  495. },
  496. };
  497. </script>
  498. <style lang="scss" scoped>
  499. .hintTabPage {
  500. padding: 10px;
  501. .itemTab {
  502. /* background: #fff; */
  503. padding: 10px;
  504. margin-bottom: 10px;
  505. border-radius: 5px;
  506. .itemHeader {
  507. /* width: 150px; */
  508. color: #0057ba;
  509. font-weight: 500;
  510. font-size: 16px;
  511. padding: 10px 0;
  512. display: inline-flex;
  513. align-items: center;
  514. .itemTitle {
  515. margin-right: 10px;
  516. }
  517. .hintIconBox {
  518. display: flex;
  519. .hintIcon {
  520. width: 16px;
  521. height: 16px;
  522. }
  523. }
  524. .van-popover__wrapper {
  525. display: flex;
  526. }
  527. }
  528. .van-collapse-item {
  529. margin-bottom: 15px;
  530. }
  531. /* 汇报 日报、周报、半月报 */
  532. .reportContent {
  533. color: #666666;
  534. padding: 8px 0;
  535. .reportItem {
  536. display: flex;
  537. position: relative;
  538. padding: 3px 0;
  539. .value {
  540. font-weight: 600;
  541. }
  542. .itemDetail {
  543. text-decoration: underline;
  544. color: #0057ba;
  545. position: absolute;
  546. right: 10px;
  547. }
  548. }
  549. }
  550. /* 色卡 */
  551. .pantoneContent {
  552. padding-bottom: 10px;
  553. .title {
  554. padding: 2px 5px;
  555. border-radius: 2px;
  556. background-color: #13b5b1;
  557. margin: 4px 0;
  558. display: inline-block;
  559. color: #fff;
  560. }
  561. .pantoneItem {
  562. .item {
  563. display: flex;
  564. justify-content: space-between;
  565. .left {
  566. display: flex;
  567. }
  568. .right {
  569. display: flex;
  570. width: 40%;
  571. justify-content: left;
  572. .valueIsClick {
  573. text-decoration: underline;
  574. color: #0057ba;
  575. }
  576. }
  577. }
  578. .firstItem {
  579. }
  580. .secondItem {
  581. }
  582. }
  583. }
  584. }
  585. .mask {
  586. position: absolute;
  587. width: 100%;
  588. height: 100%;
  589. top: 0;
  590. background: rgba(255, 255, 255, 0.8);
  591. display: flex;
  592. justify-content: center;
  593. align-items: center;
  594. }
  595. }
  596. </style>
  597. <style lang="scss">
  598. .hintTabPage {
  599. .itemTab {
  600. .van-cell {
  601. padding: 0 16px;
  602. align-items: center;
  603. }
  604. .van-collapse-item__content {
  605. padding: 0 16px;
  606. }
  607. }
  608. }
  609. .hintPopover {
  610. background: #deedff;
  611. .popper__arrow {
  612. &::after {
  613. border-right-color: #deedff !important;
  614. }
  615. }
  616. }
  617. </style>