AI销管
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 26 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065
  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. <view class="nodata-box" v-if="nodata">
  16. <image class="img" src="/static/images/nodata.png" mode="" />
  17. <view class="text">此项目今日还没有接待量哦~</view>
  18. </view>
  19. <view v-if="!nodata">
  20. <!-- 循环渲染的数据 -->
  21. <view class="dateList">
  22. <!-- -->
  23. <view class="arrs">
  24. <view class="arrs-items index1">
  25. <view class="left">
  26. 1
  27. </view>
  28. <view class="right">
  29. <view class="r-title">
  30. <text>接待量:</text>
  31. </view>
  32. <view class="r-box">
  33. <view class="r-box-item">
  34. <text>接待量</text><text class="value">{{ weekObj.receptionCount || 0 }}</text>
  35. </view>
  36. <view class="r-box-item">
  37. <text>有效接待</text><text class="value">{{ weekObj.activeCustomer || 0 }}</text>
  38. </view>
  39. <view class="r-box-item-lang">
  40. <view>有效接待率<text class="value">{{ weekObj.validReceptionRate || 0 }}%</text>
  41. </view>
  42. <view class="contrast">对比昨天<text class="value"
  43. :class="{down: weekObj.validReceptionRatePK < 0, up: weekObj.validReceptionRatePK > 0}">{{ weekObj.validReceptionRatePK > 0 ? '+' : '' }}{{ weekObj.validReceptionRatePK || 0 }}%</text>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="arrs-items index2">
  50. <view class="left">
  51. 2
  52. </view>
  53. <view class="right">
  54. <view class="r-title">
  55. <text v-if="!weekObj.orgCode">平均执行率:</text>
  56. <text v-else>销讲执行率:</text>
  57. </view>
  58. <view class="r-box">
  59. <view class="r-box-item-lang">
  60. <view>
  61. <text v-if="!weekObj.orgCode">平均执行率:</text>
  62. <text v-else>销讲执行率:</text>
  63. <text class="value">{{ weekObj.fraction || 0 }}%</text>
  64. </view>
  65. <view class="contrast">对比昨天<text class="value"
  66. :class="{down: weekObj.fractionPK < 0, up: weekObj.fractionPK > 0}">{{ weekObj.fractionPK > 0 ? '+' : '' }}{{ weekObj.fractionPK || 0 }}%</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="arrs-items index3">
  73. <view class="left">
  74. 3
  75. </view>
  76. <view class="right">
  77. <view class="r-title">
  78. <text>平均接待时长:</text>
  79. </view>
  80. <view class="r-box">
  81. <view class="r-box-item-lang">
  82. <view>平均接待时长<text class="value">{{ weekObj.avgDuration || 0 }}min</text></view>
  83. <view class="contrast">对比昨天<text class="value"
  84. :class="{down: weekObj.avgDurationPK < 0, up: weekObj.avgDurationPK > 0}">{{ weekObj.avgDurationPK > 0 ? '+' : '' }}{{ weekObj.avgDurationPK || 0 }}min</text>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="arrs-items index4">
  91. <view class="left">
  92. 4
  93. </view>
  94. <view class="right">
  95. <view class="r-title">
  96. <text v-if="!weekObj.orgCode">销讲维度执行前三:</text>
  97. <text v-else>项目平均执行率排名:</text>
  98. </view>
  99. <template v-if="!weekObj.orgCode">
  100. <view class="ranking">
  101. <block v-for="(rank, rankIndex) in carryOutTop" :key="rankIndex">
  102. <view class="ranking-item">
  103. <view class="serial">
  104. {{ rankIndex+1 }}
  105. </view>
  106. <view class="lside">
  107. {{ rank.title || '--' }}
  108. </view>
  109. <view class="rside">
  110. ({{ rank.value || 0 }}%)
  111. </view>
  112. </view>
  113. </block>
  114. <template v-if="carryOutTop.length == 0">
  115. <view class="empty">
  116. 暂无数据
  117. </view>
  118. </template>
  119. </view>
  120. </template>
  121. <template v-else>
  122. <!-- consultant -->
  123. <view class="ranking">
  124. <block v-for="(rank, rankIndex) in consultant" :key="rankIndex">
  125. <view class="ranking-item">
  126. <view class="serial">
  127. {{ rankIndex+1 }}
  128. </view>
  129. <view class="lside">
  130. {{ rank.title || '--' }}
  131. </view>
  132. <view class="rside">
  133. ({{ rank.value || 0 }}%)
  134. </view>
  135. </view>
  136. </block>
  137. <template v-if="consultant.length == 0">
  138. <view class="empty">
  139. 暂无数据
  140. </view>
  141. </template>
  142. </view>
  143. </template>
  144. </view>
  145. </view>
  146. <view class="arrs-items index5">
  147. <view class="left">
  148. 5
  149. </view>
  150. <view class="right">
  151. <view class="r-title">
  152. <text v-if="!weekObj.orgCode">销讲维度执行弱项前三:</text>
  153. <text v-else>项目平均接访时长排名:</text>
  154. </view>
  155. <template v-if="!weekObj.orgCode">
  156. <view class="ranking">
  157. <block v-for="(rank, rankIndex) in carryOutLast" :key="rankIndex">
  158. <view class="ranking-item">
  159. <view class="serial">
  160. {{ rankIndex+1 }}
  161. </view>
  162. <view class="lside">
  163. {{ rank.title || '--' }}
  164. </view>
  165. <view class="rside">
  166. ({{ rank.value || 0 }}%)
  167. </view>
  168. </view>
  169. </block>
  170. <template v-if="carryOutLast.length == 0">
  171. <view class="empty">
  172. 暂无数据
  173. </view>
  174. </template>
  175. </view>
  176. </template>
  177. <template v-else>
  178. <view class="ranking">
  179. <block v-for="(rank, rankIndex) in recording" :key="rankIndex">
  180. <view class="ranking-item">
  181. <view class="serial">
  182. {{ rankIndex+1 }}
  183. </view>
  184. <view class="lside">
  185. {{ rank.title || '--' }}
  186. </view>
  187. <view class="rside">
  188. ({{ tofixed2(rank.value/60) || 0 }}m)
  189. </view>
  190. </view>
  191. </block>
  192. <template v-if="recording.length == 0">
  193. <view class="empty">
  194. 暂无数据
  195. </view>
  196. </template>
  197. </view>
  198. </template>
  199. </view>
  200. </view>
  201. <view class="arrs-items index6" v-if="!weekObj.orgCode">
  202. <view class="left">
  203. 6
  204. </view>
  205. <view class="right">
  206. <view class="r-title">
  207. <text>置业顾问平均执行率排名:</text>
  208. </view>
  209. <view class="ranking">
  210. <block v-for="(rank, rankIndex) in consultant" :key="rankIndex">
  211. <view class="ranking-item">
  212. <view class="serial">
  213. {{ rankIndex+1 }}
  214. </view>
  215. <view class="lside">
  216. {{ rank.title || '--' }}
  217. </view>
  218. <view class="rside">
  219. ({{ rank.value || 0 }}%)
  220. </view>
  221. </view>
  222. </block>
  223. <template v-if="consultant.length == 0">
  224. <view class="empty">
  225. 暂无数据
  226. </view>
  227. </template>
  228. </view>
  229. </view>
  230. </view>
  231. <view class="arrs-items index7" v-if="!weekObj.orgCode">
  232. <view class="left">
  233. 7
  234. </view>
  235. <view class="right">
  236. <view class="r-title">
  237. <text>置业顾问平均接访时长排名:</text>
  238. </view>
  239. <view class="ranking">
  240. <block v-for="(rank, rankIndex) in recording" :key="rankIndex">
  241. <view class="ranking-item">
  242. <view class="serial">
  243. {{ rankIndex+1 }}
  244. </view>
  245. <view class="lside">
  246. {{ rank.title || '--' }}
  247. </view>
  248. <view class="rside">
  249. ({{ rank.value || 0 }}min)
  250. </view>
  251. </view>
  252. </block>
  253. <template v-if="recording.length == 0">
  254. <view class="empty">
  255. 暂无数据
  256. </view>
  257. </template>
  258. </view>
  259. </view>
  260. </view>
  261. <view class="arrs-items index8">
  262. <view class="left">
  263. <template v-if="!weekObj.orgCode">
  264. 8
  265. </template>
  266. <template v-else>
  267. 6
  268. </template>
  269. </view>
  270. <view class="right">
  271. <view class="r-title">
  272. <text v-if="!weekObj.orgCode">平均执行率最低的顾问:</text>
  273. <text v-else>执行率最低的项目:</text>
  274. </view>
  275. <template v-if="!weekObj.orgCode">
  276. <view class="ranking">
  277. <block v-for="(rank, rankIndex) in lowest" :key="rankIndex">
  278. <view class="ranking-item">
  279. <view class="lside">
  280. {{ rank.title || '--' }}
  281. </view>
  282. <view class="rside value">
  283. {{ rank.value || 0 }}%
  284. </view>
  285. </view>
  286. </block>
  287. <template v-if="lowest.length == 0">
  288. <view class="empty">
  289. 暂无数据
  290. </view>
  291. </template>
  292. </view>
  293. </template>
  294. <template v-else>
  295. <view class="ranking">
  296. <block v-for="(rank, rankIndex) in weekObj.minFraction" :key="rankIndex">
  297. <view class="ranking-item">
  298. <view class="lside">
  299. {{ rankIndex || '--' }}
  300. </view>
  301. <view class="rside value">
  302. {{ rank || 0 }}%
  303. </view>
  304. </view>
  305. </block>
  306. <template v-if="!weekObj.minFraction">
  307. <view class="empty">
  308. 暂无数据
  309. </view>
  310. </template>
  311. </view>
  312. </template>
  313. </view>
  314. </view>
  315. <view class="arrs-items index9">
  316. <view class="left">
  317. <template v-if="!weekObj.orgCode">
  318. 9
  319. </template>
  320. <template v-else>
  321. 7
  322. </template>
  323. </view>
  324. <view class="right">
  325. <view class="r-title">
  326. <text>客户画像触达:</text>
  327. <text class="num value">{{ weekObj.reachSum || 0 }}次</text>
  328. </view>
  329. </view>
  330. </view>
  331. <view class="arrs-items index8" v-if="weekObj.orgCode">
  332. <view class="left">
  333. 8
  334. </view>
  335. <view class="right">
  336. <view class="r-title">
  337. <text>画像一级触达接待前三:</text>
  338. </view>
  339. <view class="ranking">
  340. <block v-for="(rank, rankIndex) in weekObj.level1List" :key="rankIndex">
  341. <view class="ranking-item">
  342. <view class="lside">
  343. {{ rank.name || '--' }}
  344. </view>
  345. <view class="rside value">
  346. ({{ rank.total || 0 }})
  347. </view>
  348. </view>
  349. </block>
  350. <template v-if="!weekObj.level1List || weekObj.level1List.length == 0">
  351. <view class="empty">
  352. 暂无数据
  353. </view>
  354. </template>
  355. </view>
  356. </view>
  357. </view>
  358. <view class="arrs-items index8" v-if="weekObj.orgCode">
  359. <view class="left">
  360. 9
  361. </view>
  362. <view class="right">
  363. <view class="r-title">
  364. <text>画像关键词触达接待前三:</text>
  365. </view>
  366. <view class="ranking">
  367. <block v-for="(rank, rankIndex) in weekObj.level2List" :key="rankIndex">
  368. <view class="ranking-item">
  369. <view class="lside">
  370. {{ rank.name || '--' }}
  371. </view>
  372. <view class="rside value">
  373. ({{ rank.total || 0 }})
  374. </view>
  375. </view>
  376. </block>
  377. <template v-if="!weekObj.level2List || weekObj.level2List.length == 0">
  378. <view class="empty">
  379. 暂无数据
  380. </view>
  381. </template>
  382. </view>
  383. </view>
  384. </view>
  385. <view class="arrs-items index10">
  386. <view class="left">
  387. <template v-if="!weekObj.orgCode">
  388. 12
  389. </template>
  390. <template v-else>
  391. 10
  392. </template>
  393. </view>
  394. <view class="right">
  395. <view class="r-title">
  396. <text>未标记接待数:</text>
  397. <text class="num value down"
  398. style="font-weight: 500;font-size: 34rpx;">{{ weekObj.unlabelledReceptionNum || 0 }}</text>
  399. <text class="down value">条</text>
  400. </view>
  401. </view>
  402. </view>
  403. <view class="arrs-items index11">
  404. <view class="left">
  405. <template v-if="!weekObj.orgCode">
  406. 13
  407. </template>
  408. <template v-else>
  409. 11
  410. </template>
  411. </view>
  412. <view class="right">
  413. <view class="r-title">
  414. <text>设备情况:</text>
  415. </view>
  416. <view class="r-box">
  417. <view class="r-box-item-lang">
  418. <view>在线<text class="value">{{ weekObj.equipmentInfo.onlineNum || 0 }}</text>
  419. </view>
  420. <view style="margin-left: 24rpx;">
  421. 离线<text class="value">{{ weekObj.equipmentInfo.offlineNum || 0 }}</text>
  422. </view>
  423. </view>
  424. </view>
  425. </view>
  426. </view>
  427. </view>
  428. </view>
  429. </view>
  430. </view>
  431. <!-- 底部按钮 -->
  432. <view class="nav-footer" v-if="!nodata">
  433. <view class="footer-item" @click="toHome">
  434. 回到管理端
  435. </view>
  436. <view class="footer-item" @click="copy" style="margin-left: 24rpx;">
  437. 复制内容
  438. </view>
  439. <view class="footer-item full" style="margin-left: 24rpx;" @tap="forShare">
  440. <button open-type="share" class="fulls">
  441. 一键转发
  442. </button>
  443. </view>
  444. </view>
  445. </view>
  446. </template>
  447. <script>
  448. export default {
  449. data() {
  450. return {
  451. needList: ['XJTop', 'ZXLTop', 'avgJds'], // 需要转换数组的内容
  452. carryOutTop: [], //
  453. carryOutLast: [], //
  454. consultant: [], // 置业顾问排名
  455. recording: [], // 录音排名
  456. lowest: [], // 执行率最低的顾问
  457. building: uni.getStorageSync('buildingID'),
  458. id: '', // 消息id
  459. projectName: '', // 项目名称
  460. weekObj: {}, // 日报详情
  461. nodata: false //有无数据
  462. }
  463. },
  464. onLoad(option) {
  465. if (option.id) this.id = option.id
  466. this.getMessage()
  467. },
  468. onShareAppMessage() {
  469. return {
  470. title: `${this.projectName}销讲助手日报`,
  471. path: `/pages/reportExcel/dayReport?id=${this.id}`
  472. }
  473. },
  474. methods: {
  475. tofixed2(time) {
  476. if (time) {
  477. return time.toFixed(2)
  478. } else {
  479. return 0
  480. }
  481. },
  482. // 项目拷贝
  483. copys() {
  484. let str = `
  485. ${this.projectName}数智工牌日报
  486. 生成时间:${this.weekObj.createTime || '--'}
  487. 1、接待量:${this.weekObj.receptionCount || 0 }
  488. 有效接待:${this.weekObj.activeCustomer || 0}
  489. 有效接待率:${this.weekObj.validReceptionRate || 0}%
  490. 对比昨天:${ this.weekObj.validReceptionRatePK > 0 ? '+' : '' }${ this.weekObj.validReceptionRatePK || 0 }%
  491. 2、平均执行率:${ this.weekObj.fraction || 0 }%
  492. 销讲执行率:${ this.weekObj.fractionPK > 0 ? '+' : '' }${ this.weekObj.fractionPK || 0 }%
  493. 3、平均接待时长:${ this.weekObj.avgDuration || 0 }min
  494. 对比昨天:${this.weekObj.avgDurationPK > 0 ? '+' : '' }${ this.weekObj.avgDurationPK || 0 }min`
  495. if (this.consultant.length > 0) {
  496. str += `
  497. 4、项目平均执行率排名:`
  498. this.consultant.map((item, index) => {
  499. str += `
  500. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  501. })
  502. }
  503. if (this.recording.length > 0) {
  504. str += `
  505. 5、项目平均接访时长排名:`
  506. this.recording.map((item, index) => {
  507. str += `
  508. top${index+1}.${item.title || '--'}${this.tofixed2(item.value/60)||'0'}m`
  509. })
  510. }
  511. if (this.lowest.length > 0) {
  512. str += `
  513. 6、执行率最低的项目:`
  514. for (let i in this.weekObj.minFraction) {
  515. str += `
  516. ${i || '--'}${this.weekObj.minFraction[i]||'0'}%`
  517. }
  518. }
  519. str += `
  520. 7、客户画像触达:${this.weekObj.reachSum || 0}次`
  521. if (this.weekObj.level1List.length > 0) {
  522. str += `
  523. 8、画像一级触达接待前三
  524. `
  525. this.weekObj.level1List.map((item, index) => {
  526. str += `
  527. top${index+1}.${item.name || '--'}${item.total||'0'}%`
  528. })
  529. }
  530. if (this.weekObj.level1List.length > 0) {
  531. str += `
  532. 9、画像关键词触达接待前三
  533. `
  534. this.weekObj.level1List.map((item, index) => {
  535. str += `
  536. top${index+1}.${item.name || '--'}${item.total||'0'}%`
  537. })
  538. }
  539. str += `
  540. 10、未标记接待数:${ this.weekObj.unlabelledReceptionNum || 0 }条
  541. 11、设备情况:
  542. 在线:${this.weekObj.equipmentInfo.onlineNum || 0}
  543. 离线:${this.weekObj.equipmentInfo.offlineNum || 0}`
  544. uni.setClipboardData({
  545. data: str
  546. })
  547. },
  548. forShare() {
  549. this.$u.get("/zkMessage/shareMessage", {
  550. id: this.id,
  551. houseId: uni.getStorageSync('buildingID').id,
  552. username: uni.getStorageSync('weapp_session_userInfo_data').username
  553. })
  554. },
  555. // 跳转首页
  556. toHome() {
  557. uni.navigateTo({
  558. url: '/pages/index/guide'
  559. })
  560. },
  561. // 获取日报详情
  562. getMessage() {
  563. this.$u.get('/zkMessage/findByProjectId', {
  564. id: this.id,
  565. houseId: uni.getStorageSync('buildingID').id,
  566. username: uni.getStorageSync('weapp_session_userInfo_data').username
  567. }).then(res => {
  568. console.log(res)
  569. let data = JSON.parse(res.zkMessage.content)
  570. if (res.zkMessage.content) {
  571. data = JSON.parse(res.zkMessage.content)
  572. this.weekObj = {
  573. ...res.zkMessage,
  574. ...data
  575. }
  576. this.nodata = false
  577. } else {
  578. this.nodata = true
  579. this.weekObj = {
  580. ...res.zkMessage
  581. }
  582. }
  583. this.projectName = res.projectName
  584. this.init()
  585. }).catch(e => {
  586. console.log(e)
  587. })
  588. },
  589. copy() {
  590. if (this.weekObj.orgCode) return this.copys()
  591. let str = `
  592. ${this.projectName}销讲助手日报
  593. 生成时间:${this.weekObj.createTime || '--'}
  594. 1、接待量:${this.weekObj.receptionCount || 0 }
  595. 有效接待:${this.weekObj.activeCustomer || 0}
  596. 有效接待率:${this.weekObj.validReceptionRate || 0}%
  597. 对比昨天:${ this.weekObj.validReceptionRatePK > 0 ? '+' : '' }${ this.weekObj.validReceptionRatePK || 0 }%
  598. 2、平均执行率:${ this.weekObj.fraction || 0 }%
  599. 对比昨天:${ this.weekObj.fractionPK > 0 ? '+' : '' }${ this.weekObj.fractionPK || 0 }%
  600. 3、平均接待时长:${ this.weekObj.avgDuration || 0 }min
  601. 对比昨天:${this.weekObj.avgDurationPK > 0 ? '+' : '' }${ this.weekObj.avgDurationPK || 0 }min`
  602. if (this.carryOutTop.length > 0) {
  603. str += `
  604. 4、销讲维度执行前三:`
  605. this.carryOutTop.map((item, index) => {
  606. str += `
  607. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  608. })
  609. }
  610. if (this.carryOutLast.length > 0) {
  611. str += `
  612. 5、销讲维度执行弱项前三:`
  613. this.carryOutLast.map((item, index) => {
  614. str += `
  615. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  616. })
  617. }
  618. if (this.consultant.length > 0) {
  619. str += `
  620. 6、置业顾问平均执行率排名:`
  621. this.consultant.map((item, index) => {
  622. str += `
  623. top${index+1}.${item.title || '--'}${item.value||'0'}%`
  624. })
  625. }
  626. if (this.recording.length > 0) {
  627. str += `
  628. 7、置业顾问平均接访时长排名:`
  629. this.recording.map((item, index) => {
  630. str += `
  631. top${index+1}.${item.title || '--'}${item.value||'0'}min`
  632. })
  633. }
  634. if (this.lowest.length > 0) {
  635. str += `
  636. 8、平均执行率最低的顾问:`
  637. this.lowest.map((item, index) => {
  638. str += `
  639. ${item.title || '--'}${item.value||'0'}%`
  640. })
  641. }
  642. str += `
  643. 9、客户画像触达:${this.weekObj.reachSum || 0}次
  644. 10、未标记接待数:${ this.weekObj.unlabelledReceptionNum || 0 }条
  645. 11、设备情况:
  646. 在线:${this.weekObj.equipmentInfo.onlineNum || 0}
  647. 离线:${this.weekObj.equipmentInfo.offlineNum || 0}`
  648. uni.setClipboardData({
  649. data: str
  650. })
  651. },
  652. // 分割数组排名前三,倒三
  653. getTopThree() {
  654. if (this.weekObj.XJTopList && this.weekObj.XJTopList.length > 0) {
  655. let arr = this.weekObj.XJTopList.slice(0, 3)
  656. arr.forEach(item => {
  657. if (item.value != 100) {
  658. this.carryOutLast.push(item)
  659. }
  660. })
  661. this.carryOutTop = this.weekObj.XJTopList.reverse().slice(0, 3)
  662. console.log(this.weekObj.XJTopList)
  663. }
  664. if (this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0) {
  665. this.consultant = this.weekObj.ZXLTopList.reverse().slice(0, 3)
  666. if (this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1].value != 100) {
  667. this.lowest.push(this.weekObj.ZXLTopList[this.weekObj.ZXLTopList.length - 1])
  668. }
  669. }
  670. if (this.weekObj.avgJdsList && this.weekObj.avgJdsList.length > 0) {
  671. this.recording = this.weekObj.avgJdsList.reverse().slice(0, 3)
  672. }
  673. },
  674. init() {
  675. // 把对象转成数组并在后续的步骤方便处理
  676. this.needList.forEach(item => {
  677. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  678. this.weekObj[item + 'List'] = [] // 销讲执行
  679. for (let i in this.weekObj[item]) {
  680. this.weekObj[item + 'List'].push({
  681. title: i,
  682. value: this.weekObj[item][i]
  683. })
  684. }
  685. }
  686. })
  687. this.sortInitArr()
  688. },
  689. // 排序对象转换后的数组
  690. sortInitArr() {
  691. this.needList.forEach(item => {
  692. if (this.weekObj[item + 'List']) {
  693. this.bubbleSort(this.weekObj[item + 'List'])
  694. }
  695. })
  696. this.getTopThree()
  697. },
  698. // 冒泡排序
  699. bubbleSort(arr) {
  700. for (let i = 0; i < arr.length - 1; i += 1) {
  701. //通过 arr.length 次把第一位放到最后,完成排序
  702. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  703. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  704. if (arr[j].value > arr[j + 1].value) {
  705. const temp = arr[j];
  706. arr[j] = arr[j + 1];
  707. arr[j + 1] = temp;
  708. }
  709. }
  710. }
  711. },
  712. },
  713. filters: {
  714. fomatDate(date) {
  715. if (!date) return '--'
  716. let arr = date.split(' ')
  717. let str = arr[0]
  718. let result = str.split('-')
  719. return `${result[1]}-${result[2]}`
  720. }
  721. }
  722. }
  723. </script>
  724. <style lang="scss" scoped>
  725. .pages {
  726. width: 100vw;
  727. min-height: 100vh;
  728. display: flex;
  729. flex-direction: column;
  730. .nav-header {
  731. flex-shrink: 0;
  732. }
  733. .container {
  734. padding: 30rpx 30rpx 0;
  735. flex-grow: 1;
  736. display: flex;
  737. flex-direction: column;
  738. .c-head-card {
  739. padding: 30rpx;
  740. width: 100%;
  741. min-height: 252rpx;
  742. border: 2rpx solid #000000;
  743. border-radius: 12rpx;
  744. box-shadow: 10rpx 10rpx #2671E2;
  745. display: flex;
  746. flex-direction: column;
  747. .c-title-text {
  748. // position: relative;
  749. flex-grow: 1;
  750. font-size: 48rpx;
  751. font-weight: bold;
  752. color: #303030;
  753. }
  754. .date {
  755. // position: absolute;
  756. // right: 0;
  757. // bottom: 6rpx;
  758. font-size: 30rpx;
  759. color: #303030;
  760. }
  761. .creative-time {
  762. margin: 20rpx 0 0 0;
  763. flex-shrink: 0;
  764. }
  765. }
  766. .dateList {
  767. width: 100%;
  768. .arrs {
  769. width: 100%;
  770. .arrs-items {
  771. margin: 40rpx 0 0 0;
  772. display: flex;
  773. min-height: 100rpx;
  774. .left {
  775. flex-shrink: 0;
  776. margin-right: 12rpx;
  777. width: 48rpx;
  778. height: 44rpx;
  779. display: flex;
  780. justify-content: center;
  781. align-items: center;
  782. border-radius: 8rpx;
  783. border: 1rpx solid #999999;
  784. font-size: 32rpx;
  785. }
  786. .right {
  787. flex-grow: 1;
  788. .r-title {
  789. font-size: 32rpx;
  790. height: 44rpx;
  791. display: flex;
  792. align-items: center;
  793. .num {
  794. font-size: 34rpx;
  795. }
  796. }
  797. .r-box {
  798. padding: 21rpx 0 0 0;
  799. display: flex;
  800. flex-wrap: wrap;
  801. .r-box-item {
  802. margin-right: 24rpx;
  803. }
  804. .r-box-item-lang {
  805. margin-top: 19rpx;
  806. width: 100%;
  807. display: flex;
  808. align-items: center;
  809. .contrast {
  810. margin: 0 0 0 24rpx;
  811. display: flex;
  812. align-items: center;
  813. }
  814. .down {
  815. color: #43CD80;
  816. font-size: 34rpx;
  817. }
  818. .up {
  819. font-size: 34rpx;
  820. color: #E7483C;
  821. }
  822. }
  823. }
  824. .ranking {
  825. padding: 21rpx 0 0 0;
  826. display: flex;
  827. flex-direction: column;
  828. .ranking-item {
  829. margin-bottom: 22rpx;
  830. display: flex;
  831. align-items: center;
  832. font-size: 30rpx;
  833. .serial {
  834. flex-shrink: 0;
  835. width: 42rpx;
  836. height: 42rpx;
  837. background: #2671E2;
  838. border-radius: 50%;
  839. display: flex;
  840. justify-content: center;
  841. align-items: center;
  842. color: #fff;
  843. }
  844. .lside {
  845. margin: 0 20rpx;
  846. color: #505050;
  847. }
  848. .rside {
  849. flex-shrink: 0;
  850. font-size: 32rpx;
  851. }
  852. }
  853. }
  854. }
  855. }
  856. }
  857. }
  858. }
  859. .nav-footer {
  860. position: sticky;
  861. bottom: 0;
  862. padding: 32rpx;
  863. width: 100%;
  864. display: flex;
  865. justify-content: center;
  866. background: #fff;
  867. .footer-item {
  868. flex: 1;
  869. height: 88rpx;
  870. display: flex;
  871. justify-content: center;
  872. align-items: center;
  873. color: #2671E2;
  874. border: 2rpx solid #2671E2;
  875. border-radius: 8rpx;
  876. overflow: hidden;
  877. font-size: 32rpx;
  878. &.full {
  879. background: #2671E2;
  880. color: #fff;
  881. .fulls {
  882. box-sizing: border-box;
  883. width: 100%;
  884. height: 100%;
  885. background: transparent;
  886. color: #fff;
  887. font-size: 32rpx;
  888. font-weight: normal;
  889. line-height: 88rpx;
  890. }
  891. }
  892. }
  893. }
  894. .up {
  895. color: #43CD80 !important;
  896. }
  897. .down {
  898. color: #E6273A !important;
  899. }
  900. .empty {
  901. width: 100%;
  902. line-height: 48rpx;
  903. }
  904. .value {
  905. margin-left: 5rpx;
  906. font-size: 30rpx !important;
  907. font-weight: bold !important;
  908. }
  909. .nodata-box {
  910. width: 750rpx;
  911. margin: 20rpx auto 0;
  912. display: flex;
  913. justify-content: center;
  914. align-items: center;
  915. flex-direction: column;
  916. background-color: #fff;
  917. .img {
  918. width: 400rpx;
  919. height: 400rpx;
  920. }
  921. .text {
  922. text-align: center;
  923. font-size: 28rpx;
  924. font-family: PingFangSC-Regular, PingFang SC;
  925. font-weight: 400;
  926. color: #666666;
  927. line-height: 40rpx;
  928. // margin-top: -40rpx;
  929. }
  930. }
  931. }
  932. </style>