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.
 
 
 

636 regels
15 KiB

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