index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  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.label }}:{{ item.prop }}
  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. :contentData="createStore.contentData"
  50. :maskShow="createStore.collapseLosding"></visitPage> -->
  51. </van-collapse-item>
  52. <!-- 日报、周报、半月报 -->
  53. <van-collapse-item name="3" v-if="empLevel != '4'">
  54. <template #title>
  55. <div class="itemHeader" @click.stop>
  56. <span class="itemTitle">{{ report.title }}</span>
  57. <el-popover placement="right" trigger="click" popper-class="hintPopover">
  58. <div class="popoverConten">
  59. {{ report.reportData.tip }}
  60. </div>
  61. <div slot="reference" class="hintIconBox">
  62. <img class="hintIcon" :src="hintIcon" />
  63. </div>
  64. </el-popover>
  65. </div>
  66. </template>
  67. <div class="reportContent">
  68. <div class="reportItem">
  69. <div class="label">填写率:</div>
  70. <div class="value">本月{{ report.reportData.fillingRate }}</div>
  71. <div class="itemDetail" v-if="empLevel != '3'" @click="reportClick('fillingRate')">
  72. 下属详情
  73. </div>
  74. </div>
  75. <div class="reportItem" v-show="empLevel != '3'">
  76. <div class="label">审批率:</div>
  77. <div class="value">本月{{ report.reportData.approvalRate }}</div>
  78. </div>
  79. <div class="" v-show="empLevel == '1'">本周点评业务员</div>
  80. <div class="reportItem" v-show="empLevel == '1'">
  81. <div class="label">日报数(目标数):</div>
  82. <div class="value">{{ report.reportData.commentNum }}个(5个)</div>
  83. <div class="itemDetail" @click="reportClick('commentNum')">进入点评</div>
  84. </div>
  85. </div>
  86. </van-collapse-item>
  87. <!-- 色卡 -->
  88. <van-collapse-item name="4" v-if="empLevel == '2' || empLevel == '3'">
  89. <template #title>
  90. <div class="itemHeader" @click.stop>
  91. <span class="itemTitle">{{ pantone.title }}</span>
  92. <el-popover placement="right" trigger="click" popper-class="hintPopover">
  93. <div class="popoverConten">
  94. {{ pantone.tip }}
  95. </div>
  96. <div slot="reference" class="hintIconBox">
  97. <img class="hintIcon" :src="hintIcon" />
  98. </div>
  99. </el-popover>
  100. </div>
  101. </template>
  102. </van-collapse-item>
  103. </van-collapse>
  104. </div>
  105. </div>
  106. </template>
  107. <script>
  108. import { getReportTarget } from '@/api/index';
  109. import hintIcon from '@/assets/hintIcon.png';
  110. import visitPage from './visitPage.vue';
  111. import { mapState } from 'vuex';
  112. export default {
  113. components: { visitPage },
  114. computed: {
  115. ...mapState({
  116. userInfo: (state) => state.user.userInfo,
  117. }),
  118. },
  119. data() {
  120. return {
  121. empLevel: '3', //员工级别,1大区主管2销售部主管3业务员4其他 ***其他级别4,不显示日报、周报、半月报和色卡
  122. hintIcon: hintIcon,
  123. activeNames: ['1', '2', '3', '4', '5'],
  124. visitCollapse: {
  125. name: '1',
  126. title: '拜访(实时)',
  127. collapseLosding: true,
  128. tipsPopoverlabel: [],
  129. tipsPopoverValue: null,
  130. contentData: [
  131. {
  132. title: '可控店',
  133. titleProp: 'keKong',
  134. bagColor: '#eb6877',
  135. visitDetail: [
  136. {
  137. leftTable: '本月拜访率:',
  138. leftProp: 'visitRateThisMonth',
  139. leftUnit: '%',
  140. leftIsClick: false,
  141. rightTable: '未拜访:',
  142. rightProp: 'notVisited',
  143. rightUnit: '家',
  144. rightIsClick: true,
  145. },
  146. ],
  147. },
  148. {
  149. title: '金牌店',
  150. titleProp: 'jinPai',
  151. bagColor: '#f1b789',
  152. visitDetail: [
  153. {
  154. leftTable: '本月拜访率:',
  155. leftProp: 'visitRateThisMonth',
  156. leftUnit: '%',
  157. leftIsClick: false,
  158. rightTable: '未拜访:',
  159. rightProp: 'notVisited',
  160. rightUnit: '家',
  161. rightIsClick: true,
  162. },
  163. ],
  164. },
  165. {
  166. title: '同A店',
  167. titleProp: 'tongA',
  168. bagColor: '#88abda',
  169. visitDetail: [
  170. {
  171. leftTable: '进2个月拜访率:',
  172. leftProp: 'visitRateInThePastTwoMonths',
  173. leftUnit: '%',
  174. leftIsClick: false,
  175. rightTable: '未拜访:',
  176. rightProp: 'notVisited',
  177. rightUnit: '家',
  178. rightIsClick: true,
  179. },
  180. ],
  181. },
  182. {
  183. title: '同B店',
  184. titleProp: 'tongB',
  185. bagColor: '#8f82bc',
  186. visitDetail: [
  187. {
  188. leftTable: '进3个月拜访率:',
  189. leftProp: 'visitRateInThePastThreeMonths',
  190. leftUnit: '%',
  191. leftIsClick: false,
  192. rightTable: '未拜访:',
  193. rightProp: 'notVisited',
  194. rightUnit: '家',
  195. rightIsClick: true,
  196. },
  197. ],
  198. },
  199. ],
  200. },
  201. createStore: {
  202. name: '2',
  203. title: '建店',
  204. collapseLosding: true,
  205. tipsPopoverlabel: [
  206. {
  207. label: '未完工',
  208. prop: '',
  209. },
  210. {
  211. label: '为结案',
  212. prop: '',
  213. },
  214. ],
  215. tipsPopoverValue: null,
  216. contentData: [
  217. {
  218. title: '可控店',
  219. bagColor: '#eb6877',
  220. visitDetail: [
  221. {
  222. leftTable: '本月累计:',
  223. leftValue: '',
  224. leftUnit: '%',
  225. leftIsClick: false,
  226. },
  227. {
  228. leftTable: '今年累计:',
  229. leftValue: '',
  230. leftUnit: '%',
  231. leftIsClick: false,
  232. rightTable: '45天未结案:',
  233. rightValue: '',
  234. rightUnit: '家',
  235. rightIsClick: true,
  236. },
  237. ],
  238. },
  239. {
  240. title: '金牌店',
  241. bagColor: '#f1b789',
  242. visitDetail: [
  243. {
  244. leftTable: '本月累计:',
  245. leftValue: '',
  246. leftUnit: '%',
  247. leftIsClick: false,
  248. rightTable: '7天未完工:',
  249. rightValue: '',
  250. rightUnit: '家',
  251. rightIsClick: true,
  252. },
  253. {
  254. leftTable: '今年累计:',
  255. leftValue: '',
  256. leftUnit: '%',
  257. leftIsClick: false,
  258. rightTable: '30天未结案:',
  259. rightValue: '',
  260. rightUnit: '家',
  261. rightIsClick: true,
  262. },
  263. ],
  264. },
  265. {
  266. title: '同A店',
  267. bagColor: '#88abda',
  268. visitDetail: [
  269. {
  270. leftTable: '本月累计:',
  271. leftValue: '',
  272. leftUnit: '%',
  273. leftIsClick: false,
  274. },
  275. {
  276. leftTable: '今年累计:',
  277. leftValue: '',
  278. leftUnit: '%',
  279. leftIsClick: false,
  280. rightTable: '30天未结案:',
  281. rightValue: '',
  282. rightUnit: '家',
  283. rightIsClick: true,
  284. },
  285. ],
  286. },
  287. {
  288. title: '同B店',
  289. bagColor: '#8f82bc',
  290. visitDetail: [
  291. {
  292. leftTable: '本月累计:',
  293. leftValue: '',
  294. leftUnit: '%',
  295. leftIsClick: false,
  296. },
  297. {
  298. leftTable: '今年累计:',
  299. leftValue: '',
  300. leftUnit: '%',
  301. leftIsClick: false,
  302. rightTable: '30天未结案:',
  303. rightValue: '',
  304. rightUnit: '家',
  305. rightIsClick: true,
  306. },
  307. ],
  308. },
  309. ],
  310. resData: {},
  311. },
  312. report: {
  313. title: '',
  314. reportData: {},
  315. },
  316. pantone: {
  317. title: '色卡',
  318. pantoneData: {},
  319. },
  320. pantoneData: [
  321. // 业务员
  322. {
  323. firstRowLLabel: '已领用',
  324. firstRowLProp: 'firstRowLProp',
  325. firstRowRLabel: '已发放门店',
  326. firstRowRProp: 'firstRowRProp',
  327. secondRowLLabel: '门店未签收',
  328. secondRowLProp: 'secondRowLProp',
  329. secondRowRLabel: '门店未签收',
  330. secondRowRProp: 'secondRowRProp',
  331. },
  332. // 销售部主管
  333. {
  334. firstRowLLabel: '直发销售部数',
  335. firstRowLProp: 'firstRowLProp',
  336. firstRowRLabel: '业务员已领用',
  337. firstRowRProp: 'firstRowRProp',
  338. secondRowLLabel: '业务员已发放',
  339. secondRowLProp: 'secondRowLProp',
  340. secondRowRLabel: '门店未签收',
  341. secondRowRProp: 'secondRowRProp',
  342. },
  343. ],
  344. pantoneData: null,
  345. };
  346. },
  347. activated() {
  348. debugger;
  349. this.empLevel = this.userInfo.empLevel;
  350. // 获取拜访数据
  351. this.getVisitCollapseData();
  352. // 获取汇报数据 日报、周报、半月报
  353. this.getReportData();
  354. // 获取色卡数据
  355. this.getPantoneData();
  356. },
  357. methods: {
  358. getVisitCollapseData() {
  359. let resData = {
  360. reminderContent: [
  361. '1.本月拜访率:2024-10-01~2024-10-31',
  362. '2.近2月拜访率:2024-08-01~2024-10-31',
  363. '3.近3月拜访率:2024-07-01~2024-10-31',
  364. ],
  365. jinPai: {
  366. notVisited: 2007,
  367. visitRateThisMonth: '0.5%',
  368. },
  369. tongB: {
  370. notVisited: 838,
  371. visitRateInThePastThreeMonths: '6.2%',
  372. },
  373. tongA: {
  374. visitRateInThePastTwoMonths: '8.8%',
  375. notVisited: 384,
  376. },
  377. keKong: {
  378. notVisited: 73,
  379. visitRateThisMonth: '27.0%',
  380. },
  381. };
  382. this.visitCollapse.collapseLosding = false;
  383. this.visitCollapse.tipsPopoverlabel = resData.reminderContent;
  384. this.visitCollapse.resData = resData;
  385. },
  386. getReportData() {
  387. if (this.empLevel == '1') {
  388. this.report.title = '半月报';
  389. } else if (this.empLevel == '2') {
  390. this.report.title = '周报';
  391. } else if (this.empLevel == '3') {
  392. this.report.title = '日报';
  393. }
  394. // let resData = {
  395. // commentNum: '',
  396. // empLevel: '2',
  397. // tip: '下述指标:本人填写/审批情况',
  398. // approvalRate: '0.00%',
  399. // fillingRate: '0.00%',
  400. // };
  401. getReportTarget().then((res) => {
  402. this.report.reportData = res.data || {};
  403. });
  404. },
  405. getPantoneData() {},
  406. // 汇报下属详情-点击
  407. reportClick(type) {
  408. if (type == 'fillingRate') {
  409. // 下属汇报率审批率统计
  410. this.$router.push({ path: 'reportingRate' });
  411. } else if (type == 'commentNum') {
  412. // 下属业务员历史日报
  413. this.$router.push({ path: 'subordinateHistoricalDaily' });
  414. }
  415. },
  416. },
  417. };
  418. </script>
  419. <style lang="scss" scoped>
  420. .hintTabPage {
  421. padding: 10px;
  422. .itemTab {
  423. /* background: #fff; */
  424. padding: 10px;
  425. margin-bottom: 10px;
  426. border-radius: 5px;
  427. .itemHeader {
  428. width: 150px;
  429. color: #0057ba;
  430. font-weight: 500;
  431. font-size: 16px;
  432. padding: 10px 0;
  433. display: flex;
  434. align-items: center;
  435. .itemTitle {
  436. margin-right: 10px;
  437. }
  438. .hintIconBox {
  439. display: flex;
  440. .hintIcon {
  441. width: 16px;
  442. height: 16px;
  443. }
  444. }
  445. .van-popover__wrapper {
  446. display: flex;
  447. }
  448. }
  449. .van-collapse-item {
  450. margin-bottom: 15px;
  451. }
  452. /* 汇报 日报、周报、半月报 */
  453. .reportContent {
  454. color: #666666;
  455. padding: 8px 0;
  456. .reportItem {
  457. display: flex;
  458. position: relative;
  459. padding: 3px 0;
  460. .value {
  461. font-weight: 600;
  462. }
  463. .itemDetail {
  464. text-decoration: underline;
  465. color: #0057ba;
  466. position: absolute;
  467. right: 10px;
  468. }
  469. }
  470. }
  471. }
  472. }
  473. </style>
  474. <style lang="scss">
  475. .hintTabPage {
  476. .itemTab {
  477. .van-cell {
  478. padding: 0 16px;
  479. align-items: center;
  480. }
  481. .van-collapse-item__content {
  482. padding: 0 16px;
  483. }
  484. }
  485. }
  486. .hintPopover {
  487. background: #deedff;
  488. .popper__arrow {
  489. &::after {
  490. border-right-color: #deedff !important;
  491. }
  492. }
  493. }
  494. </style>