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 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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 full" style="margin-left: 22rpx;">
  271. <button open-type="share" class="fulls">
  272. 分享给好友
  273. </button>
  274. </view>
  275. </view>
  276. </view>
  277. </template>
  278. <script>
  279. export default {
  280. data() {
  281. return {
  282. needList: ['XJTop', 'ZXLTop', 'avgJds'], // 需要转换数组的内容
  283. carryOutTop: [], // 销讲维度执行前三:
  284. carryOutLast: [], // 销讲维度执行倒三:
  285. consultant: [], // 置业顾问排名
  286. recording: [], // 录音排名
  287. lowest: [], // 执行率最低的顾问
  288. building: uni.getStorageSync('buildingID'),
  289. id: '', // 消息id
  290. projectName: '', // 项目名称
  291. weekObj: {}, // 日报详情
  292. }
  293. },
  294. onLoad(option) {
  295. if (option.id) this.id = option.id
  296. this.getMessage()
  297. },
  298. onShareAppMessage() {
  299. return {
  300. title: `${this.projectName}数智工牌日报`,
  301. path: `/pages/mine/reportExcel/dayReport?id=${this.id}`
  302. }
  303. },
  304. methods: {
  305. // 获取日报详情
  306. getMessage() {
  307. this.$u.get('/zkMessage/findByProjectId', {
  308. id: this.id
  309. }).then(res => {
  310. console.log(res)
  311. let data = JSON.parse(res.zkMessage.content)
  312. this.weekObj = {
  313. ...res.zkMessage,
  314. ...data
  315. }
  316. this.projectName = res.projectName
  317. this.init()
  318. }).catch(e => {
  319. console.log(e)
  320. })
  321. },
  322. copy() {
  323. let str = ``
  324. uni.setClipboardData({
  325. data: str
  326. })
  327. },
  328. // 分割数组排名前三,倒三
  329. getTopThree() {
  330. if (this.weekObj.XJTopList && this.weekObj.XJTopList.length > 0) {
  331. this.carryOutTop = this.weekObj.XJTopList.reverse().slice(0, 3)
  332. this.carryOutLast = this.weekObj.XJTopList.slice(0, 3)
  333. }
  334. if (this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0) {
  335. this.consultant = this.weekObj.ZXLTopList.reverse().slice(0, 3)
  336. this.lowest.push(this.weekObj.ZXLTopList[0])
  337. }
  338. if (this.weekObj.avgJdsList && this.weekObj.avgJdsList.length > 0) {
  339. console.log(this.weekObj.avgJdsList.slice(0, 3))
  340. this.recording = this.weekObj.avgJdsList.reverse().slice(0, 3)
  341. }
  342. },
  343. init() {
  344. // 把对象转成数组并在后续的步骤方便处理
  345. this.needList.forEach(item => {
  346. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  347. this.weekObj[item + 'List'] = [] // 销讲执行
  348. for (let i in this.weekObj[item]) {
  349. this.weekObj[item + 'List'].push({
  350. title: i,
  351. value: this.weekObj[item][i]
  352. })
  353. }
  354. }
  355. })
  356. this.sortInitArr()
  357. },
  358. // 排序对象转换后的数组
  359. sortInitArr() {
  360. this.needList.forEach(item => {
  361. if (this.weekObj[item + 'List']) {
  362. this.bubbleSort(this.weekObj[item + 'List'])
  363. }
  364. })
  365. this.getTopThree()
  366. },
  367. // 冒泡排序
  368. bubbleSort(arr) {
  369. for (let i = 0; i < arr.length - 1; i += 1) {
  370. //通过 arr.length 次把第一位放到最后,完成排序
  371. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  372. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  373. if (arr[j].value > arr[j + 1].value) {
  374. const temp = arr[j];
  375. arr[j] = arr[j + 1];
  376. arr[j + 1] = temp;
  377. }
  378. }
  379. }
  380. },
  381. },
  382. filters: {
  383. fomatDate(date) {
  384. if (!date) return '--'
  385. let arr = date.split(' ')
  386. let str = arr[0]
  387. let result = str.split('-')
  388. return `${result[1]}-${result[2]}`
  389. }
  390. }
  391. }
  392. </script>
  393. <style lang="scss" scoped>
  394. .pages {
  395. width: 100vw;
  396. min-height: 100vh;
  397. display: flex;
  398. flex-direction: column;
  399. .nav-header {
  400. flex-shrink: 0;
  401. }
  402. .container {
  403. padding: 30rpx 30rpx 0;
  404. flex-grow: 1;
  405. display: flex;
  406. flex-direction: column;
  407. .c-head-card {
  408. padding: 30rpx;
  409. width: 100%;
  410. height: 252rpx;
  411. border: 2rpx solid #000000;
  412. border-radius: 12rpx;
  413. box-shadow: 10rpx 10rpx #2671E2;
  414. display: flex;
  415. flex-direction: column;
  416. .c-title-text {
  417. position: relative;
  418. flex-grow: 1;
  419. font-size: 48rpx;
  420. color: #303030;
  421. .date {
  422. position: absolute;
  423. right: 0;
  424. bottom: 6rpx;
  425. font-size: 30rpx;
  426. color: #303030;
  427. }
  428. }
  429. .creative-time {
  430. margin: 20rpx 0 0 0;
  431. flex-shrink: 0;
  432. }
  433. }
  434. .dateList {
  435. width: 100%;
  436. .arrs {
  437. width: 100%;
  438. .arrs-items {
  439. margin: 40rpx 0 0 0;
  440. display: flex;
  441. .left {
  442. flex-shrink: 0;
  443. margin-right: 12rpx;
  444. width: 48rpx;
  445. height: 44rpx;
  446. display: flex;
  447. justify-content: center;
  448. align-items: center;
  449. border-radius: 8rpx;
  450. border: 1rpx solid #999999;
  451. font-size: 32rpx;
  452. }
  453. .right {
  454. flex-grow: 1;
  455. .r-title {
  456. font-size: 32rpx;
  457. height: 44rpx;
  458. display: flex;
  459. align-items: center;
  460. .num {
  461. font-size: 34rpx;
  462. }
  463. }
  464. .r-box {
  465. padding: 21rpx 0 0 0;
  466. display: flex;
  467. flex-wrap: wrap;
  468. .r-box-item {
  469. margin-right: 24rpx;
  470. }
  471. .r-box-item-lang {
  472. margin-top: 19rpx;
  473. width: 100%;
  474. display: flex;
  475. align-items: center;
  476. .contrast {
  477. margin: 0 0 0 24rpx;
  478. display: flex;
  479. align-items: center;
  480. }
  481. .down {
  482. color: #43CD80;
  483. font-size: 34rpx;
  484. }
  485. .up {
  486. font-size: 34rpx;
  487. color: #E7483C;
  488. }
  489. }
  490. }
  491. .ranking {
  492. padding: 21rpx 0 0 0;
  493. display: flex;
  494. flex-direction: column;
  495. .ranking-item {
  496. margin-bottom: 22rpx;
  497. display: flex;
  498. align-items: center;
  499. font-size: 30rpx;
  500. .serial {
  501. flex-shrink: 0;
  502. width: 42rpx;
  503. height: 42rpx;
  504. background: #2671E2;
  505. border-radius: 50%;
  506. display: flex;
  507. justify-content: center;
  508. align-items: center;
  509. color: #fff;
  510. }
  511. .lside {
  512. margin: 0 20rpx;
  513. color: #505050;
  514. }
  515. .rside {
  516. flex-shrink: 0;
  517. font-size: 32rpx;
  518. }
  519. }
  520. }
  521. }
  522. }
  523. }
  524. }
  525. }
  526. .nav-footer {
  527. margin: 32rpx 0;
  528. width: 100%;
  529. display: flex;
  530. justify-content: center;
  531. .footer-item {
  532. width: 334rpx;
  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>