You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

748 lines
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. let arr = this.weekObj.XJTopList.slice(0, 3)
  402. arr.forEach(item => {
  403. if (item.value != 100) {
  404. this.carryOutLast.push(item)
  405. }
  406. })
  407. this.carryOutTop = this.weekObj.XJTopList.reverse().slice(0, 3)
  408. console.log(this.weekObj.XJTopList)
  409. }
  410. if (this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0) {
  411. this.consultant = this.weekObj.ZXLTopList.reverse().slice(0, 3)
  412. if (this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1].value != 100) {
  413. this.lowest.push(this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1])
  414. }
  415. }
  416. if (this.weekObj.avgJdsList && this.weekObj.avgJdsList.length > 0) {
  417. this.recording = this.weekObj.avgJdsList.reverse().slice(0, 3)
  418. }
  419. },
  420. init() {
  421. // 把对象转成数组并在后续的步骤方便处理
  422. this.needList.forEach(item => {
  423. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  424. this.weekObj[item + 'List'] = [] // 销讲执行
  425. for (let i in this.weekObj[item]) {
  426. this.weekObj[item + 'List'].push({
  427. title: i,
  428. value: this.weekObj[item][i]
  429. })
  430. }
  431. }
  432. })
  433. this.sortInitArr()
  434. },
  435. // 排序对象转换后的数组
  436. sortInitArr() {
  437. this.needList.forEach(item => {
  438. if (this.weekObj[item + 'List']) {
  439. this.bubbleSort(this.weekObj[item + 'List'])
  440. }
  441. })
  442. this.getTopThree()
  443. },
  444. // 冒泡排序
  445. bubbleSort(arr) {
  446. for (let i = 0; i < arr.length - 1; i += 1) {
  447. //通过 arr.length 次把第一位放到最后,完成排序
  448. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  449. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  450. if (arr[j].value > arr[j + 1].value) {
  451. const temp = arr[j];
  452. arr[j] = arr[j + 1];
  453. arr[j + 1] = temp;
  454. }
  455. }
  456. }
  457. },
  458. },
  459. filters: {
  460. fomatDate(date) {
  461. if (!date) return '--'
  462. let arr = date.split(' ')
  463. let str = arr[0]
  464. let result = str.split('-')
  465. return `${result[1]}-${result[2]}`
  466. }
  467. }
  468. }
  469. </script>
  470. <style lang="scss" scoped>
  471. .pages {
  472. width: 100vw;
  473. min-height: 100vh;
  474. display: flex;
  475. flex-direction: column;
  476. .nav-header {
  477. flex-shrink: 0;
  478. }
  479. .container {
  480. padding: 30rpx 30rpx 0;
  481. flex-grow: 1;
  482. display: flex;
  483. flex-direction: column;
  484. .c-head-card {
  485. padding: 30rpx;
  486. width: 100%;
  487. min-height: 252rpx;
  488. border: 2rpx solid #000000;
  489. border-radius: 12rpx;
  490. box-shadow: 10rpx 10rpx #2671E2;
  491. display: flex;
  492. flex-direction: column;
  493. .c-title-text {
  494. // position: relative;
  495. flex-grow: 1;
  496. font-size: 48rpx;
  497. font-weight: bold;
  498. color: #303030;
  499. }
  500. .date {
  501. // position: absolute;
  502. // right: 0;
  503. // bottom: 6rpx;
  504. font-size: 30rpx;
  505. color: #303030;
  506. }
  507. .creative-time {
  508. margin: 20rpx 0 0 0;
  509. flex-shrink: 0;
  510. }
  511. }
  512. .dateList {
  513. width: 100%;
  514. .arrs {
  515. width: 100%;
  516. .arrs-items {
  517. margin: 40rpx 0 0 0;
  518. display: flex;
  519. min-height: 100rpx;
  520. .left {
  521. flex-shrink: 0;
  522. margin-right: 12rpx;
  523. width: 48rpx;
  524. height: 44rpx;
  525. display: flex;
  526. justify-content: center;
  527. align-items: center;
  528. border-radius: 8rpx;
  529. border: 1rpx solid #999999;
  530. font-size: 32rpx;
  531. }
  532. .right {
  533. flex-grow: 1;
  534. .r-title {
  535. font-size: 32rpx;
  536. height: 44rpx;
  537. display: flex;
  538. align-items: center;
  539. .num {
  540. font-size: 34rpx;
  541. }
  542. }
  543. .r-box {
  544. padding: 21rpx 0 0 0;
  545. display: flex;
  546. flex-wrap: wrap;
  547. .r-box-item {
  548. margin-right: 24rpx;
  549. }
  550. .r-box-item-lang {
  551. margin-top: 19rpx;
  552. width: 100%;
  553. display: flex;
  554. align-items: center;
  555. .contrast {
  556. margin: 0 0 0 24rpx;
  557. display: flex;
  558. align-items: center;
  559. }
  560. .down {
  561. color: #43CD80;
  562. font-size: 34rpx;
  563. }
  564. .up {
  565. font-size: 34rpx;
  566. color: #E7483C;
  567. }
  568. }
  569. }
  570. .ranking {
  571. padding: 21rpx 0 0 0;
  572. display: flex;
  573. flex-direction: column;
  574. .ranking-item {
  575. margin-bottom: 22rpx;
  576. display: flex;
  577. align-items: center;
  578. font-size: 30rpx;
  579. .serial {
  580. flex-shrink: 0;
  581. width: 42rpx;
  582. height: 42rpx;
  583. background: #2671E2;
  584. border-radius: 50%;
  585. display: flex;
  586. justify-content: center;
  587. align-items: center;
  588. color: #fff;
  589. }
  590. .lside {
  591. margin: 0 20rpx;
  592. color: #505050;
  593. }
  594. .rside {
  595. flex-shrink: 0;
  596. font-size: 32rpx;
  597. }
  598. }
  599. }
  600. }
  601. }
  602. }
  603. }
  604. }
  605. .nav-footer {
  606. position: sticky;
  607. bottom: 0;
  608. padding: 32rpx;
  609. width: 100%;
  610. display: flex;
  611. justify-content: center;
  612. background: #fff;
  613. .footer-item {
  614. flex: 1;
  615. height: 88rpx;
  616. display: flex;
  617. justify-content: center;
  618. align-items: center;
  619. color: #2671E2;
  620. border: 2rpx solid #2671E2;
  621. border-radius: 8rpx;
  622. overflow: hidden;
  623. font-size: 32rpx;
  624. &.full {
  625. background: #2671E2;
  626. color: #fff;
  627. .fulls {
  628. box-sizing: border-box;
  629. width: 100%;
  630. height: 100%;
  631. background: transparent;
  632. color: #fff;
  633. font-size: 32rpx;
  634. font-weight: normal;
  635. line-height: 88rpx;
  636. }
  637. }
  638. }
  639. }
  640. .up {
  641. color: #43CD80 !important;
  642. }
  643. .down {
  644. color: #E6273A !important;
  645. }
  646. .empty {
  647. width: 100%;
  648. line-height: 48rpx;
  649. }
  650. .value {
  651. margin-left: 5rpx;
  652. font-size: 30rpx !important;
  653. font-weight: bold !important;
  654. }
  655. }
  656. </style>