Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

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