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.

dayReport.vue 14 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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>{{ weekObj.receptionCount || 0 }}</text>
  30. </view>
  31. <view class="r-box-item">
  32. <text>有效接待</text><text>{{ weekObj.activeCustomer || 0 }}</text>
  33. </view>
  34. <view class="r-box-item-lang">
  35. <view>有效接待率<text>{{ weekObj.validReceptionRate || 0 }}%</text></view>
  36. <view class="contrast">对比昨天<text
  37. :class="{down: weekObj.validReceptionRatePK < 0, up: 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>{{ weekObj.fraction || 0 }}%</text></view>
  54. <view class="contrast">对比昨天<text
  55. :class="{down: weekObj.fractionPK < 0, up: 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>{{ weekObj.avgDuration || 0 }}min</text></view>
  72. <view class="contrast">对比昨天<text
  73. :class="{down: weekObj.avgDurationPK < 0, up: weekObj.avgDurationPK > 0}">{{ weekObj.avgDurationPK }}</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 }}%)
  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">
  214. {{ rank.value || 0 }}%
  215. </view>
  216. </view>
  217. </block>
  218. </view>
  219. </view>
  220. </view>
  221. <view class="arrs-items index9">
  222. <view class="left">
  223. 9
  224. </view>
  225. <view class="right">
  226. <view class="r-title">
  227. <text>客户画像触达:</text>
  228. <text class="num">{{ weekObj.reachSum || 0 }}次</text>
  229. </view>
  230. </view>
  231. </view>
  232. <view class="arrs-items index10">
  233. <view class="left">
  234. 10
  235. </view>
  236. <view class="right">
  237. <view class="r-title">
  238. <text>未标记接待数:</text>
  239. <text class="num up"
  240. style="font-weight: 500;font-size: 34rpx;">{{ weekObj.unlabelledReceptionNum || 0 }}</text>条
  241. </view>
  242. </view>
  243. </view>
  244. <view class="arrs-items index11">
  245. <view class="left">
  246. 11
  247. </view>
  248. <view class="right">
  249. <view class="r-title">
  250. <text>设备情况:</text>
  251. </view>
  252. <view class="r-box">
  253. <view class="r-box-item-lang">
  254. <view>在线<text>{{ weekObj.equipmentInfo.onlineNum || 0 }}</text></view>
  255. <view style="margin-left: 24rpx;">
  256. 离线<text>{{ weekObj.equipmentInfo.offlineNum || 0 }}</text></view>
  257. </view>
  258. </view>
  259. </view>
  260. </view>
  261. </view>
  262. </view>
  263. </view>
  264. <!-- 底部按钮 -->
  265. <view class="nav-footer">
  266. <view class="footer-item full">
  267. <button open-type="share" class="fulls">
  268. 分享给好友
  269. </button>
  270. </view>
  271. </view>
  272. </view>
  273. </template>
  274. <script>
  275. export default {
  276. data() {
  277. return {
  278. needList: ['XJTop', 'ZXLTop', 'avgJds'], // 需要转换数组的内容
  279. carryOutTop: [], // 销讲维度执行前三:
  280. carryOutLast: [], // 销讲维度执行倒三:
  281. consultant: [], // 置业顾问排名
  282. recording: [], // 录音排名
  283. lowest: [], // 执行率最低的顾问
  284. building: uni.getStorageSync('buildingID'),
  285. id: '', // 消息id
  286. projectName: '', // 项目名称
  287. weekObj: {}, // 日报详情
  288. }
  289. },
  290. onLoad(option) {
  291. if (option.id) this.id = option.id
  292. this.getMessage()
  293. },
  294. onShareAppMessage() {
  295. return {
  296. title: `${this.projectName}数智工牌日报`,
  297. type: 2,
  298. path: `/pages/mine/reportExcel/dayReport?id=${this.id}`
  299. }
  300. },
  301. methods: {
  302. // 获取日报详情
  303. getMessage() {
  304. this.$u.get('/zkMessage/findByProjectId', {
  305. id: this.id
  306. }).then(res => {
  307. console.log(res)
  308. let data = JSON.parse(res.zkMessage.content)
  309. this.weekObj = {
  310. ...res.zkMessage,
  311. ...data
  312. }
  313. this.projectName = res.projectName
  314. this.init()
  315. }).catch(e => {
  316. console.log(e)
  317. })
  318. },
  319. copy() {
  320. let str = ``
  321. uni.setClipboardData({
  322. data: str
  323. })
  324. },
  325. // 分割数组排名前三,倒三
  326. getTopThree() {
  327. if (this.weekObj.XJTopList && this.weekObj.XJTopList.length > 0) {
  328. this.carryOutLast = this.weekObj.XJTopList.slice(0, 3)
  329. this.carryOutTop = this.weekObj.XJTopList.reverse().slice(0, 3)
  330. }
  331. if (this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0) {
  332. this.consultant = this.weekObj.ZXLTopList.reverse().slice(0, 3)
  333. this.lowest.push(this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1])
  334. }
  335. if (this.weekObj.avgJdsList && this.weekObj.avgJdsList.length > 0) {
  336. console.log(this.weekObj.avgJdsList.slice(0, 3))
  337. this.recording = this.weekObj.avgJdsList.reverse().slice(0, 3)
  338. }
  339. },
  340. init() {
  341. // 把对象转成数组并在后续的步骤方便处理
  342. this.needList.forEach(item => {
  343. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  344. this.weekObj[item + 'List'] = [] // 销讲执行
  345. for (let i in this.weekObj[item]) {
  346. this.weekObj[item + 'List'].push({
  347. title: i,
  348. value: this.weekObj[item][i]
  349. })
  350. }
  351. }
  352. })
  353. this.sortInitArr()
  354. },
  355. // 排序对象转换后的数组
  356. sortInitArr() {
  357. this.needList.forEach(item => {
  358. if (this.weekObj[item + 'List']) {
  359. this.bubbleSort(this.weekObj[item + 'List'])
  360. }
  361. })
  362. this.getTopThree()
  363. },
  364. // 冒泡排序
  365. bubbleSort(arr) {
  366. for (let i = 0; i < arr.length - 1; i += 1) {
  367. //通过 arr.length 次把第一位放到最后,完成排序
  368. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  369. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  370. if (arr[j].value > arr[j + 1].value) {
  371. const temp = arr[j];
  372. arr[j] = arr[j + 1];
  373. arr[j + 1] = temp;
  374. }
  375. }
  376. }
  377. },
  378. },
  379. filters: {
  380. fomatDate(date) {
  381. if (!date) return '--'
  382. let arr = date.split(' ')
  383. let str = arr[0]
  384. let result = str.split('-')
  385. return `${result[1]}-${result[2]}`
  386. }
  387. }
  388. }
  389. </script>
  390. <style lang="scss" scoped>
  391. .pages {
  392. width: 100vw;
  393. min-height: 100vh;
  394. display: flex;
  395. flex-direction: column;
  396. .nav-header {
  397. flex-shrink: 0;
  398. }
  399. .container {
  400. padding: 30rpx 30rpx 0;
  401. flex-grow: 1;
  402. display: flex;
  403. flex-direction: column;
  404. .c-head-card {
  405. padding: 30rpx;
  406. width: 100%;
  407. height: 252rpx;
  408. border: 2rpx solid #000000;
  409. border-radius: 12rpx;
  410. box-shadow: 10rpx 10rpx #2671E2;
  411. display: flex;
  412. flex-direction: column;
  413. .c-title-text {
  414. // position: relative;
  415. flex-grow: 1;
  416. font-size: 48rpx;
  417. font-weight: bold;
  418. color: #303030;
  419. }
  420. .date {
  421. // position: absolute;
  422. // right: 0;
  423. // bottom: 6rpx;
  424. font-size: 30rpx;
  425. color: #303030;
  426. }
  427. .creative-time {
  428. margin: 20rpx 0 0 0;
  429. flex-shrink: 0;
  430. }
  431. }
  432. .dateList {
  433. width: 100%;
  434. .arrs {
  435. width: 100%;
  436. .arrs-items {
  437. margin: 40rpx 0 0 0;
  438. display: flex;
  439. .left {
  440. flex-shrink: 0;
  441. margin-right: 12rpx;
  442. width: 48rpx;
  443. height: 44rpx;
  444. display: flex;
  445. justify-content: center;
  446. align-items: center;
  447. border-radius: 8rpx;
  448. border: 1rpx solid #999999;
  449. font-size: 32rpx;
  450. }
  451. .right {
  452. flex-grow: 1;
  453. .r-title {
  454. font-size: 32rpx;
  455. height: 44rpx;
  456. display: flex;
  457. align-items: center;
  458. .num {
  459. font-size: 34rpx;
  460. }
  461. }
  462. .r-box {
  463. padding: 21rpx 0 0 0;
  464. display: flex;
  465. flex-wrap: wrap;
  466. .r-box-item {
  467. margin-right: 24rpx;
  468. }
  469. .r-box-item-lang {
  470. margin-top: 19rpx;
  471. width: 100%;
  472. display: flex;
  473. align-items: center;
  474. .contrast {
  475. margin: 0 0 0 24rpx;
  476. display: flex;
  477. align-items: center;
  478. }
  479. .down {
  480. color: #43CD80;
  481. font-size: 34rpx;
  482. }
  483. .up {
  484. font-size: 34rpx;
  485. color: #E7483C;
  486. }
  487. }
  488. }
  489. .ranking {
  490. padding: 21rpx 0 0 0;
  491. display: flex;
  492. flex-direction: column;
  493. .ranking-item {
  494. margin-bottom: 22rpx;
  495. display: flex;
  496. align-items: center;
  497. font-size: 30rpx;
  498. .serial {
  499. flex-shrink: 0;
  500. width: 42rpx;
  501. height: 42rpx;
  502. background: #2671E2;
  503. border-radius: 50%;
  504. display: flex;
  505. justify-content: center;
  506. align-items: center;
  507. color: #fff;
  508. }
  509. .lside {
  510. margin: 0 20rpx;
  511. color: #505050;
  512. }
  513. .rside {
  514. flex-shrink: 0;
  515. font-size: 32rpx;
  516. }
  517. }
  518. }
  519. }
  520. }
  521. }
  522. }
  523. }
  524. .nav-footer {
  525. position: sticky;
  526. bottom: 32rpx;
  527. margin: 32rpx 0;
  528. width: 100%;
  529. display: flex;
  530. justify-content: center;
  531. .footer-item {
  532. width: 686rpx;
  533. height: 88rpx;
  534. display: flex;
  535. justify-content: center;
  536. align-items: center;
  537. color: #2671E2;
  538. border: 2rpx solid #2671E2;
  539. border-radius: 8rpx;
  540. overflow: hidden;
  541. font-size: 32rpx;
  542. &.full {
  543. background: #2671E2;
  544. color: #fff;
  545. .fulls {
  546. width: 100%;
  547. height: 100%;
  548. background: transparent;
  549. color: #fff;
  550. }
  551. }
  552. }
  553. }
  554. .empty {
  555. width: 100%;
  556. height: 240rpx;
  557. display: flex;
  558. justify-content: center;
  559. align-items: center;
  560. flex-direction: column;
  561. }
  562. }
  563. </style>