Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

740 righe
18 KiB

  1. <template>
  2. <view class="pages">
  3. <!-- 日报内容部分 -->
  4. <view class="container" ref="lists">
  5. <!-- 头部日报卡 -->
  6. <view class="c-head-card">
  7. <view class="c-title-text">
  8. {{ projectName }}数智工牌日报
  9. </view>
  10. <text class="date">{{ weekObj.createTime | fomatDate }}</text>
  11. <view class="creative-time">
  12. 生成时间:{{ weekObj.createTime || '--' }}
  13. </view>
  14. </view>
  15. <!-- 循环渲染的数据 -->
  16. <view class="dateList">
  17. <!-- -->
  18. <view class="arrs">
  19. <view class="arrs-items index1">
  20. <view class="left">
  21. 1
  22. </view>
  23. <view class="right">
  24. <view class="r-title">
  25. <text>接待量:</text>
  26. </view>
  27. <view class="r-box">
  28. <view class="r-box-item">
  29. <text>接待量</text><text class="value">{{ weekObj.receptionCount || 0 }}</text>
  30. </view>
  31. <view class="r-box-item">
  32. <text>有效接待</text><text class="value">{{ weekObj.activeCustomer || 0 }}</text>
  33. </view>
  34. <view class="r-box-item-lang">
  35. <view>有效接待率<text class="value">{{ weekObj.validReceptionRate || 0 }}%</text></view>
  36. <view class="contrast">对比昨天<text class="value"
  37. :class="{down: weekObj.validReceptionRatePK < 0, up: weekObj.validReceptionRatePK > 0}">{{ weekObj.validReceptionRatePK > 0 ? '+' : '' }}{{ weekObj.validReceptionRatePK || 0 }}%</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="arrs-items index2">
  44. <view class="left">
  45. 2
  46. </view>
  47. <view class="right">
  48. <view class="r-title">
  49. <text>平均执行率:</text>
  50. </view>
  51. <view class="r-box">
  52. <view class="r-box-item-lang">
  53. <view>平均执行率<text class="value">{{ weekObj.fraction || 0 }}%</text></view>
  54. <view class="contrast">对比昨天<text class="value"
  55. :class="{down: weekObj.fractionPK < 0, up: weekObj.fractionPK > 0}">{{ weekObj.fractionPK > 0 ? '+' : '' }}{{ weekObj.fractionPK || 0 }}%</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="arrs-items index3">
  62. <view class="left">
  63. 3
  64. </view>
  65. <view class="right">
  66. <view class="r-title">
  67. <text>平均接待时长:</text>
  68. </view>
  69. <view class="r-box">
  70. <view class="r-box-item-lang">
  71. <view>平均接待时长<text class="value">{{ weekObj.avgDuration || 0 }}min</text></view>
  72. <view class="contrast">对比昨天<text class="value"
  73. :class="{down: weekObj.avgDurationPK < 0, up: weekObj.avgDurationPK > 0}">{{ weekObj.avgDurationPK > 0 ? '+' : '' }}{{ weekObj.avgDurationPK || 0 }}min</text>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="arrs-items index4">
  80. <view class="left">
  81. 4
  82. </view>
  83. <view class="right">
  84. <view class="r-title">
  85. <text>销讲维度执行前三:</text>
  86. </view>
  87. <view class="ranking">
  88. <block v-for="(rank, rankIndex) in carryOutTop" :key="rankIndex">
  89. <view class="ranking-item">
  90. <view class="serial">
  91. {{ rankIndex+1 }}
  92. </view>
  93. <view class="lside">
  94. {{ rank.title || '--' }}
  95. </view>
  96. <view class="rside">
  97. ({{ rank.value || 0 }}%)
  98. </view>
  99. </view>
  100. </block>
  101. <template v-if="carryOutTop.length == 0">
  102. <view class="empty">
  103. 暂无数据
  104. </view>
  105. </template>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="arrs-items index5">
  110. <view class="left">
  111. 5
  112. </view>
  113. <view class="right">
  114. <view class="r-title">
  115. <text>销讲维度执行弱项前三:</text>
  116. </view>
  117. <view class="ranking">
  118. <block v-for="(rank, rankIndex) in carryOutLast" :key="rankIndex">
  119. <view class="ranking-item">
  120. <view class="serial">
  121. {{ rankIndex+1 }}
  122. </view>
  123. <view class="lside">
  124. {{ rank.title || '--' }}
  125. </view>
  126. <view class="rside">
  127. ({{ rank.value || 0 }}%)
  128. </view>
  129. </view>
  130. </block>
  131. <template v-if="carryOutLast.length == 0">
  132. <view class="empty">
  133. 暂无数据
  134. </view>
  135. </template>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="arrs-items index6">
  140. <view class="left">
  141. 6
  142. </view>
  143. <view class="right">
  144. <view class="r-title">
  145. <text>置业顾问平均执行率排名:</text>
  146. </view>
  147. <view class="ranking">
  148. <block v-for="(rank, rankIndex) in consultant" :key="rankIndex">
  149. <view class="ranking-item">
  150. <view class="serial">
  151. {{ rankIndex+1 }}
  152. </view>
  153. <view class="lside">
  154. {{ rank.title || '--' }}
  155. </view>
  156. <view class="rside">
  157. ({{ rank.value || 0 }}%)
  158. </view>
  159. </view>
  160. </block>
  161. <template v-if="consultant.length == 0">
  162. <view class="empty">
  163. 暂无数据
  164. </view>
  165. </template>
  166. </view>
  167. </view>
  168. </view>
  169. <view class="arrs-items index7">
  170. <view class="left">
  171. 7
  172. </view>
  173. <view class="right">
  174. <view class="r-title">
  175. <text>置业顾问平均接访时长排名:</text>
  176. </view>
  177. <view class="ranking">
  178. <block v-for="(rank, rankIndex) in recording" :key="rankIndex">
  179. <view class="ranking-item">
  180. <view class="serial">
  181. {{ rankIndex+1 }}
  182. </view>
  183. <view class="lside">
  184. {{ rank.title || '--' }}
  185. </view>
  186. <view class="rside">
  187. ({{ rank.value || 0 }}min)
  188. </view>
  189. </view>
  190. </block>
  191. <template v-if="recording.length == 0">
  192. <view class="empty">
  193. 暂无数据
  194. </view>
  195. </template>
  196. </view>
  197. </view>
  198. </view>
  199. <view class="arrs-items index8">
  200. <view class="left">
  201. 8
  202. </view>
  203. <view class="right">
  204. <view class="r-title">
  205. <text>平均执行率最低的顾问:</text>
  206. </view>
  207. <view class="ranking">
  208. <block v-for="(rank, rankIndex) in lowest" :key="rankIndex">
  209. <view class="ranking-item">
  210. <view class="lside">
  211. {{ rank.title || '--' }}
  212. </view>
  213. <view class="rside value">
  214. {{ rank.value || 0 }}%
  215. </view>
  216. </view>
  217. </block>
  218. <template v-if="lowest.length == 0">
  219. <view class="empty">
  220. 暂无数据
  221. </view>
  222. </template>
  223. </view>
  224. </view>
  225. </view>
  226. <view class="arrs-items index9">
  227. <view class="left">
  228. 9
  229. </view>
  230. <view class="right">
  231. <view class="r-title">
  232. <text>客户画像触达:</text>
  233. <text class="num value">{{ weekObj.reachSum || 0 }}次</text>
  234. </view>
  235. </view>
  236. </view>
  237. <view class="arrs-items index10">
  238. <view class="left">
  239. 10
  240. </view>
  241. <view class="right">
  242. <view class="r-title">
  243. <text>未标记接待数:</text>
  244. <text class="num value down"
  245. style="font-weight: 500;font-size: 34rpx;">{{ weekObj.unlabelledReceptionNum || 0 }}</text>
  246. <text class="down value">条</text>
  247. </view>
  248. </view>
  249. </view>
  250. <view class="arrs-items index11">
  251. <view class="left">
  252. 11
  253. </view>
  254. <view class="right">
  255. <view class="r-title">
  256. <text>设备情况:</text>
  257. </view>
  258. <view class="r-box">
  259. <view class="r-box-item-lang">
  260. <view>在线<text class="value">{{ weekObj.equipmentInfo.onlineNum || 0 }}</text></view>
  261. <view style="margin-left: 24rpx;">
  262. 离线<text class="value">{{ weekObj.equipmentInfo.offlineNum || 0 }}</text></view>
  263. </view>
  264. </view>
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </view>
  270. <!-- 底部按钮 -->
  271. <view class="nav-footer">
  272. <view class="footer-item" @click="toHome">
  273. 回到管理端
  274. </view>
  275. <view class="footer-item" @click="copy" style="margin-left: 24rpx;">
  276. 复制内容
  277. </view>
  278. <view class="footer-item full" style="margin-left: 24rpx;">
  279. <button open-type="share" class="fulls">
  280. 一键转发
  281. </button>
  282. </view>
  283. </view>
  284. </view>
  285. </template>
  286. <script>
  287. export default {
  288. data() {
  289. return {
  290. needList: ['XJTop', 'ZXLTop', 'avgJds'], // 需要转换数组的内容
  291. carryOutTop: [], //
  292. carryOutLast: [], //
  293. consultant: [], // 置业顾问排名
  294. recording: [], // 录音排名
  295. lowest: [], // 执行率最低的顾问
  296. building: uni.getStorageSync('buildingID'),
  297. id: '', // 消息id
  298. projectName: '', // 项目名称
  299. weekObj: {}, // 日报详情
  300. }
  301. },
  302. onLoad(option) {
  303. if (option.id) this.id = option.id
  304. this.getMessage()
  305. },
  306. onShareAppMessage() {
  307. return {
  308. title: `${this.projectName}数智工牌日报`,
  309. path: `/pages/reportExcel/dayReport?id=${this.id}`
  310. }
  311. },
  312. methods: {
  313. // 跳转首页
  314. toHome() {
  315. uni.navigateTo({
  316. url: '/pages/index/guide'
  317. })
  318. },
  319. // 获取日报详情
  320. getMessage() {
  321. this.$u.get('/zkMessage/findByProjectId', {
  322. id: this.id
  323. }).then(res => {
  324. console.log(res)
  325. let data = JSON.parse(res.zkMessage.content)
  326. this.weekObj = {
  327. ...res.zkMessage,
  328. ...data
  329. }
  330. this.projectName = res.projectName
  331. this.init()
  332. }).catch(e => {
  333. console.log(e)
  334. })
  335. },
  336. copy() {
  337. let str = `
  338. ${this.projectName}数智工牌日报
  339. 生成时间:${this.weekObj.createTime || '--'}
  340. 1、接待量:${this.weekObj.receptionCount || 0 }
  341. 有效接待:${this.weekObj.activeCustomer || 0}
  342. 有效接待率:${this.weekObj.validReceptionRate || 0}%
  343. 对比昨天:${ this.weekObj.validReceptionRatePK > 0 ? '+' : '' }${ this.weekObj.validReceptionRatePK || 0 }%
  344. 2、平均执行率:${ this.weekObj.fraction || 0 }%
  345. 对比昨天:${ this.weekObj.fractionPK > 0 ? '+' : '' }${ this.weekObj.fractionPK || 0 }%
  346. 3、平均接待时长:${ this.weekObj.avgDuration || 0 }min
  347. 对比昨天:${this.weekObj.avgDurationPK > 0 ? '+' : '' }${ this.weekObj.avgDurationPK || 0 }min`
  348. if (this.carryOutTop.length > 0) {
  349. str += `
  350. 4、销讲维度执行前三:`
  351. this.carryOutTop.map((item, index) => {
  352. str += `
  353. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  354. })
  355. }
  356. if (this.carryOutLast.length > 0) {
  357. str += `
  358. 5、销讲维度执行弱项前三:`
  359. this.carryOutLast.map((item, index) => {
  360. str += `
  361. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  362. })
  363. }
  364. if (this.consultant.length > 0) {
  365. str += `
  366. 6、置业顾问平均执行率排名:`
  367. this.consultant.map((item, index) => {
  368. str += `
  369. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  370. })
  371. }
  372. if (this.recording.length > 0) {
  373. str += `
  374. 7、置业顾问平均接访时长排名:`
  375. this.recording.map((item, index) => {
  376. str += `
  377. top${index+1}.${item.title || '--'}${item.value||'0'}min`
  378. })
  379. }
  380. if (this.lowest.length > 0) {
  381. str += `
  382. 8、平均执行率最低的顾问:`
  383. this.lowest.map((item, index) => {
  384. str += `
  385. ${item.title || '--'}${item.value||'0'}%`
  386. })
  387. }
  388. str += `
  389. 9、客户画像触达:${this.weekObj.reachSum || 0}次
  390. 10、未标记接待数:${ this.weekObj.unlabelledReceptionNum || 0 }条
  391. 11、设备情况:
  392. 在线:${this.weekObj.equipmentInfo.onlineNum || 0}
  393. 离线:${this.weekObj.equipmentInfo.offlineNum || 0}`
  394. uni.setClipboardData({
  395. data: str
  396. })
  397. },
  398. // 分割数组排名前三,倒三
  399. getTopThree() {
  400. if (this.weekObj.XJTopList && this.weekObj.XJTopList.length > 0) {
  401. this.carryOutLast = this.weekObj.XJTopList.slice(0, 3)
  402. this.carryOutTop = this.weekObj.XJTopList.reverse().slice(0, 3)
  403. }
  404. if (this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0) {
  405. this.consultant = this.weekObj.ZXLTopList.reverse().slice(0, 3)
  406. this.lowest.push(this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1])
  407. }
  408. if (this.weekObj.avgJdsList && this.weekObj.avgJdsList.length > 0) {
  409. this.recording = this.weekObj.avgJdsList.reverse().slice(0, 3)
  410. }
  411. },
  412. init() {
  413. // 把对象转成数组并在后续的步骤方便处理
  414. this.needList.forEach(item => {
  415. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  416. this.weekObj[item + 'List'] = [] // 销讲执行
  417. for (let i in this.weekObj[item]) {
  418. this.weekObj[item + 'List'].push({
  419. title: i,
  420. value: this.weekObj[item][i]
  421. })
  422. }
  423. }
  424. })
  425. this.sortInitArr()
  426. },
  427. // 排序对象转换后的数组
  428. sortInitArr() {
  429. this.needList.forEach(item => {
  430. if (this.weekObj[item + 'List']) {
  431. this.bubbleSort(this.weekObj[item + 'List'])
  432. }
  433. })
  434. this.getTopThree()
  435. },
  436. // 冒泡排序
  437. bubbleSort(arr) {
  438. for (let i = 0; i < arr.length - 1; i += 1) {
  439. //通过 arr.length 次把第一位放到最后,完成排序
  440. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  441. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  442. if (arr[j].value > arr[j + 1].value) {
  443. const temp = arr[j];
  444. arr[j] = arr[j + 1];
  445. arr[j + 1] = temp;
  446. }
  447. }
  448. }
  449. },
  450. },
  451. filters: {
  452. fomatDate(date) {
  453. if (!date) return '--'
  454. let arr = date.split(' ')
  455. let str = arr[0]
  456. let result = str.split('-')
  457. return `${result[1]}-${result[2]}`
  458. }
  459. }
  460. }
  461. </script>
  462. <style lang="scss" scoped>
  463. .pages {
  464. width: 100vw;
  465. min-height: 100vh;
  466. display: flex;
  467. flex-direction: column;
  468. .nav-header {
  469. flex-shrink: 0;
  470. }
  471. .container {
  472. padding: 30rpx 30rpx 0;
  473. flex-grow: 1;
  474. display: flex;
  475. flex-direction: column;
  476. .c-head-card {
  477. padding: 30rpx;
  478. width: 100%;
  479. min-height: 252rpx;
  480. border: 2rpx solid #000000;
  481. border-radius: 12rpx;
  482. box-shadow: 10rpx 10rpx #2671E2;
  483. display: flex;
  484. flex-direction: column;
  485. .c-title-text {
  486. // position: relative;
  487. flex-grow: 1;
  488. font-size: 48rpx;
  489. font-weight: bold;
  490. color: #303030;
  491. }
  492. .date {
  493. // position: absolute;
  494. // right: 0;
  495. // bottom: 6rpx;
  496. font-size: 30rpx;
  497. color: #303030;
  498. }
  499. .creative-time {
  500. margin: 20rpx 0 0 0;
  501. flex-shrink: 0;
  502. }
  503. }
  504. .dateList {
  505. width: 100%;
  506. .arrs {
  507. width: 100%;
  508. .arrs-items {
  509. margin: 40rpx 0 0 0;
  510. display: flex;
  511. min-height: 100rpx;
  512. .left {
  513. flex-shrink: 0;
  514. margin-right: 12rpx;
  515. width: 48rpx;
  516. height: 44rpx;
  517. display: flex;
  518. justify-content: center;
  519. align-items: center;
  520. border-radius: 8rpx;
  521. border: 1rpx solid #999999;
  522. font-size: 32rpx;
  523. }
  524. .right {
  525. flex-grow: 1;
  526. .r-title {
  527. font-size: 32rpx;
  528. height: 44rpx;
  529. display: flex;
  530. align-items: center;
  531. .num {
  532. font-size: 34rpx;
  533. }
  534. }
  535. .r-box {
  536. padding: 21rpx 0 0 0;
  537. display: flex;
  538. flex-wrap: wrap;
  539. .r-box-item {
  540. margin-right: 24rpx;
  541. }
  542. .r-box-item-lang {
  543. margin-top: 19rpx;
  544. width: 100%;
  545. display: flex;
  546. align-items: center;
  547. .contrast {
  548. margin: 0 0 0 24rpx;
  549. display: flex;
  550. align-items: center;
  551. }
  552. .down {
  553. color: #43CD80;
  554. font-size: 34rpx;
  555. }
  556. .up {
  557. font-size: 34rpx;
  558. color: #E7483C;
  559. }
  560. }
  561. }
  562. .ranking {
  563. padding: 21rpx 0 0 0;
  564. display: flex;
  565. flex-direction: column;
  566. .ranking-item {
  567. margin-bottom: 22rpx;
  568. display: flex;
  569. align-items: center;
  570. font-size: 30rpx;
  571. .serial {
  572. flex-shrink: 0;
  573. width: 42rpx;
  574. height: 42rpx;
  575. background: #2671E2;
  576. border-radius: 50%;
  577. display: flex;
  578. justify-content: center;
  579. align-items: center;
  580. color: #fff;
  581. }
  582. .lside {
  583. margin: 0 20rpx;
  584. color: #505050;
  585. }
  586. .rside {
  587. flex-shrink: 0;
  588. font-size: 32rpx;
  589. }
  590. }
  591. }
  592. }
  593. }
  594. }
  595. }
  596. }
  597. .nav-footer {
  598. position: sticky;
  599. bottom: 0;
  600. padding: 32rpx;
  601. width: 100%;
  602. display: flex;
  603. justify-content: center;
  604. background: #fff;
  605. .footer-item {
  606. flex: 1;
  607. height: 88rpx;
  608. display: flex;
  609. justify-content: center;
  610. align-items: center;
  611. color: #2671E2;
  612. border: 2rpx solid #2671E2;
  613. border-radius: 8rpx;
  614. overflow: hidden;
  615. font-size: 32rpx;
  616. &.full {
  617. background: #2671E2;
  618. color: #fff;
  619. .fulls {
  620. box-sizing: border-box;
  621. width: 100%;
  622. height: 100%;
  623. background: transparent;
  624. color: #fff;
  625. font-size: 32rpx;
  626. font-weight: normal;
  627. line-height: 88rpx;
  628. }
  629. }
  630. }
  631. }
  632. .up {
  633. color: #43CD80 !important;
  634. }
  635. .down {
  636. color: #E6273A !important;
  637. }
  638. .empty {
  639. width: 100%;
  640. line-height: 48rpx;
  641. }
  642. .value {
  643. margin-left: 5rpx;
  644. font-size: 30rpx !important;
  645. font-weight: bold !important;
  646. }
  647. }
  648. </style>