25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

1313 satır
32 KiB

  1. <template>
  2. <view class="pages">
  3. <!-- 日报内容部分 -->
  4. <view class="container">
  5. <!-- 头部日报卡 -->
  6. <view class="c-head-card">
  7. <view class="c-title-text">
  8. {{ projectName || '' }}数智工牌周报
  9. </view>
  10. <text class="date">{{ weekObj.createTimeName }}</text>
  11. <view class="creative-time">
  12. 生成时间:{{ weekObj.createTime || '--' }}
  13. </view>
  14. </view>
  15. </view>
  16. <view class="nodata-box" v-if="nodata">
  17. <image class="img" src="/static/images/nodata.png" mode="" />
  18. <view class="text">此项目本周还没有接待量哦~</view>
  19. </view>
  20. <view v-if="!nodata">
  21. <!-- 简报 -->
  22. <view class="briefing">
  23. <view class="briefing-title">
  24. 简报
  25. </view>
  26. <!-- 简报表格部分 -->
  27. <view class="briefing-box">
  28. <block v-for="(data, index) in numlist" :key="index">
  29. <view class="briefing-box-item" @click="toAuthPage(data)">
  30. <view class="tops" :class="[data.class || '']">
  31. {{ data.name }}
  32. </view>
  33. <view class="middle" :class="[data.class || '']">
  34. {{ data.num || 0 }}
  35. </view>
  36. <view class="bottom">
  37. 对比上周: {{ data.preNum || 0 }}
  38. <text class="b-text"
  39. :class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent || '0' }}</text>
  40. <template v-if="data.percent != 0">
  41. <text style="margin-left: 8rpx;font-size: 34rpx;font-weight: bold;"
  42. :class="{up: data.percent > 0, down: data.percent < 0}">{{ data.percent > 0 ? '↑' : '↓' }}</text>
  43. </template>
  44. </view>
  45. </view>
  46. </block>
  47. </view>
  48. </view>
  49. <!-- 销讲场景执行排名 -->
  50. <view class="execution-ranking">
  51. <view class="execution-ranking-title">
  52. 销讲场景执行排名
  53. </view>
  54. <template v-if="isShowXJTop1List">
  55. <view class="execution-ranking-desc" v-if="false">
  56. <text>销讲场景平均执行对比上周</text>
  57. <text>{{ rankTop('fractionPKName') }}</text>
  58. <text>{{ rankTop('fractionPK') }}</text>
  59. <text>%</text>
  60. <template v-if="rankTop('fractionBastValue') > 0">
  61. <text>,其中【{{ rankTop('fractionBastName') }}】最强为</text>
  62. <text class="up">{{ rankTop('fractionBastValue') }}</text>
  63. <text>%</text>
  64. </template>
  65. <template v-if="rankTop('fractionLastValue') < 0">
  66. <text>,【{{ rankTop('fractionLastName') }}】执行最弱为</text>
  67. <text class="down">{{ rankTop('fractionLastValue') }}</text>
  68. <text>%;</text>
  69. </template>
  70. </view>
  71. <!-- 排名百分比列表 -->
  72. <view class="ranking-box" @click="toTrendAnalysis('销讲数据')">
  73. <block v-for="(percent, index) in weekObj.XJTop1List" :key="index">
  74. <view class="ranking-item">
  75. <view class="left">{{ percent.title }}</view>
  76. <view class="middle">
  77. <u-line-progress :active-color="$options.filters.setColor(index)"
  78. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
  79. </u-line-progress>
  80. </view>
  81. <view class="right"> {{ percent.value || '0' }} %</view>
  82. </view>
  83. </block>
  84. </view>
  85. </template>
  86. <template v-else>
  87. <view class="empity">
  88. 暂无数据
  89. </view>
  90. </template>
  91. </view>
  92. <!-- 接待统计 -->
  93. <view class="statistics">
  94. <view class="statistics-title">
  95. 接待统计
  96. </view>
  97. <template v-if="isShowStatistics">
  98. <view class="statistics-desc" v-if="false">
  99. <text>
  100. 顾问平均执行率对比上周
  101. </text>
  102. <text>
  103. {{ rankTop('ranktype') || '' }}
  104. </text>
  105. <text :class="[rankTop('class')]">{{ rankTop('people') || '' }}</text>
  106. <text class="">
  107. 人,其中{{ rankTop('topName') || '' }}上升
  108. </text>
  109. <text class="up">{{ rankTop('topPk') || '0' }}</text>
  110. <text class="">
  111. %为最高,{{ rankTop('lastName') || '' }}下降
  112. </text>
  113. <text class="down">{{ rankTop('lastPk') || '0' }}</text>
  114. <text class="">
  115. %降幅最大。
  116. </text>
  117. </view>
  118. <view class="table">
  119. <view class="thead">
  120. <block v-for="(head, headIndex) in tableHead" :key="headIndex">
  121. <view class="thead-item" :style="[(weekObj.orgCode && head.title2) ? head.style1 : head.style]">
  122. <template v-if="weekObj.orgCode && head.title2">
  123. {{ head.title2 }}
  124. </template>
  125. <template v-else>
  126. {{ head.title }}
  127. </template>
  128. </view>
  129. </block>
  130. </view>
  131. <view class="tbody" @click="toEmployeesstatistics('顾问排名')">
  132. <block v-for="(data, index) in weekObj.customerInfo1" :key="index">
  133. <view class="tbody-item">
  134. <template v-if="!weekObj.orgCode">
  135. <view class="tbody-items name">{{ data.name }}</view>
  136. </template>
  137. <template v-else>
  138. <view class="tbody-items time">{{ data.houseName }}</view>
  139. </template>
  140. <view class="tbody-items nums">{{ data.activeCustomer }}</view>
  141. <view class="tbody-items time">{{ data.avgDuration }}m</view>
  142. <view class="tbody-items percent">{{ data.fraction }}%</view>
  143. <template v-if="!weekObj.orgCode">
  144. <view class="tbody-items week" :class="{up: data.pk > 0, down: data.pk < 0}">
  145. <template v-if="data.pk">
  146. {{ data.pk > 0 ? `+${data.pk}` : data.pk }}%
  147. </template>
  148. </view>
  149. </template>
  150. <template v-else>
  151. <view class="tbody-items week"
  152. :class="{up: data.fractionContrast > 0, down: data.fractionContrast < 0}">
  153. <template v-if="data.fractionContrast">
  154. {{ data.fractionContrast > 0 ? `+${data.fractionContrast}` : data.fractionContrast }}%
  155. </template>
  156. </view>
  157. </template>
  158. </view>
  159. </block>
  160. </view>
  161. </view>
  162. </template>
  163. <template v-else>
  164. <view class="empity">
  165. 暂无数据
  166. </view>
  167. </template>
  168. </view>
  169. <!-- 顾问销讲执行率排名 -->
  170. <view class="guwen-ranking">
  171. <view class="guwen-ranking-title">
  172. 顾问销讲执行率排名(TOP10)
  173. </view>
  174. <template v-if="isShowZXLTopList">
  175. <!-- 排名百分比列表 -->
  176. <view class="ranking-box">
  177. <block v-for="(percent, index) in weekObj.ZXLTopList" :key="index">
  178. <view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
  179. <view class="left">{{ percent.title }}</view>
  180. <view class="middle">
  181. <u-line-progress :active-color="$options.filters.setColor(index)"
  182. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.value">
  183. </u-line-progress>
  184. </view>
  185. <view class="right"> {{ percent.value || '0' }} %</view>
  186. </view>
  187. </block>
  188. </view>
  189. </template>
  190. <template v-else>
  191. <view class="empity">
  192. 暂无数据
  193. </view>
  194. </template>
  195. </view>
  196. <!-- 顾问接待量排名 -->
  197. <view class="guwen-ranking">
  198. <view class="guwen-ranking-title">
  199. 顾问接待量排名(TOP10)
  200. </view>
  201. <template v-if="isShowJDLTopList">
  202. <!-- 排名百分比列表 -->
  203. <view class="ranking-box">
  204. <block v-for="(percent, index) in weekObj.JDLTopList" :key="index">
  205. <view class="ranking-item" @click="toStaffAnalysis('销讲数据', percent)">
  206. <view class="left">{{ percent.title }}</view>
  207. <view class="middle">
  208. <u-line-progress :active-color="$options.filters.setColor(index)"
  209. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.values">
  210. </u-line-progress>
  211. </view>
  212. <view class="right"> {{ percent.value || '0' }} </view>
  213. </view>
  214. </block>
  215. </view>
  216. </template>
  217. <template v-else>
  218. <view class="empity">
  219. 暂无数据
  220. </view>
  221. </template>
  222. </view>
  223. <!-- 顾问接待量排名 -->
  224. <view class="guwen-ranking" v-if="weekObj.level1List">
  225. <view class="guwen-ranking-title">
  226. 画像一级触达排名(TOP10)
  227. </view>
  228. <template v-if="weekObj.level1List">
  229. <!-- 排名百分比列表 -->
  230. <view class="ranking-box">
  231. <block v-for="(percent, index) in weekObj.level1List" :key="index">
  232. <view class="ranking-item">
  233. <view class="left">{{ percent.name }}</view>
  234. <view class="middle">
  235. <u-line-progress :active-color="$options.filters.setColor(index)"
  236. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.percent">
  237. </u-line-progress>
  238. </view>
  239. <view class="right"> {{ percent.total || '0' }} </view>
  240. </view>
  241. </block>
  242. </view>
  243. </template>
  244. <template v-else>
  245. <view class="empity">
  246. 暂无数据
  247. </view>
  248. </template>
  249. </view>
  250. <view class="guwen-ranking" v-if="weekObj.level2List">
  251. <view class="guwen-ranking-title">
  252. 画像关键词触达排名(TOP10)
  253. </view>
  254. <template v-if="weekObj.level2List">
  255. <!-- 排名百分比列表 -->
  256. <view class="ranking-box">
  257. <block v-for="(percent, index) in weekObj.level2List" :key="index">
  258. <view class="ranking-item">
  259. <view class="left">{{ percent.name }}</view>
  260. <view class="middle">
  261. <u-line-progress :active-color="$options.filters.setColor(index)"
  262. inactive-color="#F2F2F2" :show-percent="false" :percent="percent.percent">
  263. </u-line-progress>
  264. </view>
  265. <view class="right"> {{ percent.total || '0' }} </view>
  266. </view>
  267. </block>
  268. </view>
  269. </template>
  270. <template v-else>
  271. <view class="empity">
  272. 暂无数据
  273. </view>
  274. </template>
  275. </view>
  276. <!-- 使用建议 -->
  277. <view class="proposal" v-if="weekObj.suggest">
  278. <view class="proposal-title">
  279. 使用建议
  280. </view>
  281. <!-- 建议的文字 -->
  282. <view class="proposal-box">
  283. <u-parse class="ql-editor" :content="weekObj.suggest" />
  284. </view>
  285. </view>
  286. <!-- 底部按钮 -->
  287. <view class="nav-footer">
  288. <view class="footer-item" @click="toHome">
  289. 回到管理端
  290. </view>
  291. <view class="footer-item full" style="margin-left: 24rpx;" @tap="forShare">
  292. <button open-type="share" class="fulls">
  293. 一键转发
  294. </button>
  295. </view>
  296. </view>
  297. </view>
  298. </view>
  299. </template>
  300. <script>
  301. import uParse from '@/components/gaoyia-parse/parse.vue'
  302. export default {
  303. components: {
  304. uParse
  305. },
  306. data() {
  307. return {
  308. nodata: false,
  309. tableHead: [{
  310. title: '顾问',
  311. title2: '项目名称',
  312. style: {
  313. flex: 1
  314. },
  315. style1: {
  316. flex: 2
  317. },
  318. },
  319. {
  320. title: '接待量',
  321. style: {
  322. flex: 1
  323. }
  324. },
  325. {
  326. title: '平均接待时长',
  327. style: {
  328. flex: 2
  329. }
  330. },
  331. {
  332. title: '平均执行率',
  333. style: {
  334. flex: 2
  335. }
  336. },
  337. {
  338. title: '对比上周',
  339. style: {
  340. flex: 1.5
  341. }
  342. },
  343. ],
  344. id: '', // id
  345. needList: ['JDLTop', 'ZXLTop', 'XJTop1'], // 需要转换数组的内容
  346. // 简报
  347. numlist: [{
  348. name: '接待量 (次)',
  349. num: '',
  350. setName: 'receptionCount1',
  351. percent: '',
  352. percentName: 'receptionCountPK',
  353. preNum: '', // 上周数量
  354. preNumName: 'receptionCount2', //
  355. path: '/pages/center/records/index',
  356. pathParms: '?activeTotal=4&refresh=refresh', // 参数
  357. auth: '接待记录', //
  358. }, {
  359. name: '有效接待 (次)',
  360. num: '',
  361. setName: 'activeCustomer1',
  362. percent: '',
  363. percentName: 'activeCustomerPK',
  364. preNum: '', // 上周数量
  365. preNumName: 'activeCustomer2', //
  366. path: '/pages/center/records/index',
  367. pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数
  368. auth: '接待记录', //
  369. },
  370. {
  371. name: '平均执行率(%)',
  372. num: '',
  373. setName: 'fraction1',
  374. percent: '',
  375. percentName: 'fractionPK',
  376. preNum: '', // 上周数量
  377. preNumName: 'fraction2', //
  378. path: '/pages/center/records/index',
  379. pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数
  380. auth: '接待记录', //
  381. },
  382. {
  383. name: '平均接待时长(分)',
  384. num: '',
  385. setName: 'avgDuration1',
  386. percent: '',
  387. percentName: 'avgDurationPK',
  388. preNum: '', // 上周数量
  389. preNumName: 'avgDuration2', //
  390. path: '/pages/center/records/index',
  391. pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数
  392. auth: '接待记录', //
  393. },
  394. {
  395. name: '违禁接待 (次)',
  396. num: '',
  397. setName: 'prohibitedNum1',
  398. percent: '',
  399. percentName: 'prohibitedNumPK',
  400. preNum: '', // 上周数量
  401. preNumName: 'prohibitedNum2', //
  402. class: 'down',
  403. path: '/pages/center/prohibited/index',
  404. pathParms: '?activeTotal=4&violatedStatus=1&refresh=refresh', // 参数
  405. auth: '违禁记录',
  406. },
  407. {
  408. name: '客户画像触达 (次)',
  409. num: '',
  410. setName: 'reachSum1',
  411. percent: '',
  412. percentName: 'reachSumPK',
  413. preNum: '', // 上周数量
  414. preNumName: 'reachSum2', //
  415. path: '/pages/center/Piabodata/Userinsightinto',
  416. pathParms: '?activeTotal=3', // 参数
  417. auth: '销讲数据',
  418. },
  419. {
  420. name: '已标记',
  421. num: '',
  422. setName: 'labelledReceptionNum1',
  423. percent: '',
  424. percentName: 'labelledReceptionNumPK',
  425. preNum: '', // 上周数量
  426. preNumName: 'labelledReceptionNum2', //
  427. path: '/pages/center/records/index',
  428. pathParms: '?activeTotal=4&refresh=refresh&markAdvisor=1', // 参数
  429. auth: '接待记录', //
  430. },
  431. {
  432. name: '未标记',
  433. num: '',
  434. setName: 'unlabelledReceptionNum1',
  435. percent: '',
  436. percentName: 'unlabelledReceptionNumPK',
  437. preNum: '', // 上周数量
  438. preNumName: 'unlabelledReceptionNum2', //
  439. class: 'down',
  440. path: '/pages/center/records/index',
  441. pathParms: '?activeTotal=4&refresh=refresh&markAdvisor=0', // 参数
  442. auth: '接待记录', //
  443. },
  444. ],
  445. // 周报详情
  446. weekObj: {},
  447. projectName: '', // 项目名称
  448. }
  449. },
  450. computed: {
  451. // 获取本地存储的权限列表
  452. menuList() {
  453. return uni.getStorageSync('weapp_session_Menu_data')
  454. },
  455. // 排名最高与最低
  456. rankTop() {
  457. return name => {
  458. let obj = {}
  459. try {
  460. if (this.weekObj.customerInfo1.length && this.weekObj.customerInfo2.length) {
  461. obj.ranktype = (this.weekObj.customerInfo1.length - this.weekObj.customerInfo2.length) >
  462. 0 ? '上升' : '下降'
  463. obj.people = Math.abs(this.weekObj.customerInfo1.length - this.weekObj.customerInfo2
  464. .length)
  465. }
  466. if (this.weekObj.customerInfo1 && this.weekObj.customerInfo1.length > 0) {
  467. obj.topName = this.weekObj.customerInfo1[0].name
  468. obj.topPk = Math.abs(this.weekObj.customerInfo1[0].pk)
  469. obj.lastName = this.weekObj.customerInfo1[this.weekObj.customerInfo1.length - 1].name,
  470. obj.lastPk = Math.abs(this.weekObj.customerInfo1[this.weekObj.customerInfo1.length - 1]
  471. .pk)
  472. }
  473. if (this.weekObj.customerInfo1.length && this.weekObj.customerInfo2.length) {
  474. obj.class = (this.weekObj.customerInfo1.length - this.weekObj.customerInfo2.length) > 0 ?
  475. 'up' : 'down'
  476. }
  477. if (this.weekObj.fractionPK) {
  478. obj.fractionPKName = this.weekObj.fractionPK > 0 ? '上涨' : '下跌'
  479. obj.fractionPK = Math.abs(this.weekObj.fractionPK)
  480. }
  481. if (this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0) {
  482. obj.fractionBastName = this.weekObj.XJTop1List[0].title
  483. obj.fractionBastValue = this.weekObj.XJTop1List[0].value
  484. }
  485. if (this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0) {
  486. obj.fractionLastName = this.weekObj.XJTop1List[this.weekObj.XJTop1List.length - 1].title
  487. obj.fractionLastValue = this.weekObj.XJTop1List[this.weekObj.XJTop1List.length - 1].value
  488. }
  489. return obj[name] || ''
  490. } catch (e) {
  491. console.log(e)
  492. return ''
  493. }
  494. }
  495. },
  496. // 接待统计
  497. isShowStatistics() {
  498. // return this.rankTop('ranktype') && this.rankTop('class') && this.rankTop('people') && this.rankTop('topName') && this.rankTop('topPk') && this.rankTop('lastName') && this.rankTop('lastPk') && this.weekObj.customerInfo1 && this.weekObj.customerInfo1.length > 0
  499. return this.weekObj.customerInfo1 && this.weekObj.customerInfo1.length > 0
  500. },
  501. isShowXJTop1List() {
  502. // return this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0 && this.rankTop('fractionPKName') && this.rankTop('fractionPK') && this.rankTop('fractionBastName') && this.rankTop('fractionBastValue') && this.rankTop('fractionLastName') && this.rankTop('fractionLastName') && this.rankTop('fractionLastValue')
  503. return this.weekObj.XJTop1List && this.weekObj.XJTop1List.length > 0
  504. },
  505. isShowZXLTopList() {
  506. return this.weekObj.ZXLTopList && this.weekObj.ZXLTopList.length > 0
  507. },
  508. isShowJDLTopList() {
  509. return this.weekObj.JDLTopList && this.weekObj.JDLTopList.length > 0
  510. },
  511. },
  512. onLoad(option) {
  513. if (option.id) this.id = option.id
  514. this.getMessage()
  515. },
  516. onShareAppMessage() {
  517. return {
  518. title: `${this.projectName}数智工牌周报`,
  519. path: `/pages/reportExcel/weekReport?id=${this.id}`
  520. }
  521. },
  522. methods: {
  523. forShare() {
  524. this.$u.get("/zkMessage/shareMessage", {id: this.id})
  525. },
  526. // 趋势分析
  527. toTrendAnalysis(name) {
  528. return
  529. let date = this.weekObj.weekDate.split('~')
  530. let [t1, t2] = [date[0], date[1]]
  531. let time1 = new Date(t1.replace(/-/g, '/'))
  532. let time2 = new Date(t2.replace(/-/g, '/'))
  533. time1.setDate(time1.getDate() - 7)
  534. time2.setDate(time2.getDate() - 7)
  535. let res1 = `${time1.getFullYear()}-${time1.getMonth() + 1}-${time1.getDate()}`
  536. let res2 = `${time2.getFullYear()}-${time2.getMonth() + 1}-${time2.getDate()}`
  537. if (this.isPassWatch(name)) {
  538. uni.navigateTo({
  539. url: `/pages/center/Piabodata/TrendAnalysis?type=1&staTime=${date[0]}&endtime=${date[1]}&staTime1=${res1}&endtime1=${res2}`
  540. })
  541. } else {
  542. uni.showToast({
  543. title: '暂无权限',
  544. icon: "none"
  545. })
  546. }
  547. },
  548. // 顾问排名
  549. toEmployeesstatistics(name) {
  550. let date = this.weekObj.weekDate.split('~')
  551. let [t1, t2] = [date[0], date[1]]
  552. if (this.isPassWatch(name)) {
  553. uni.navigateTo({
  554. url: `/pages/center/Piabodata/Employeesstatistics?type=1&staTime=${date[0]}&endtime=${date[1]}`
  555. })
  556. } else {
  557. uni.showToast({
  558. title: '暂无权限',
  559. icon: "none"
  560. })
  561. }
  562. },
  563. // 员工分析
  564. toStaffAnalysis(name, data) {
  565. let obj = this.weekObj.customerInfo1.find(item => {
  566. return item.name == data.title
  567. })
  568. console.log(obj)
  569. let time = this.weekObj.weekDate.split('~')
  570. if (this.isPassWatch(name)) {
  571. uni.navigateTo({
  572. url: `/pages/center/Piabodata/StaffAnalysis?type=1&id=${obj.id}&startDate=${time[0]}&endDate=${time[1]}`
  573. });
  574. } else {
  575. uni.showToast({
  576. title: '暂无权限',
  577. icon: "none"
  578. })
  579. }
  580. },
  581. // 跳转对应页面
  582. toAuthPage(data) {
  583. if (!uni.getStorageSync('weapp_session_login_data').token) {
  584. this.toHome()
  585. return
  586. }
  587. if (this.isPassWatch(data.auth)) {
  588. let time = this.weekObj.weekDate.split('~')
  589. data.pathParms = `${data.pathParms}&staTime=${time[0]}&endtime=${time[1]}`
  590. uni.navigateTo({
  591. url: `${data.path}${data.pathParms}`
  592. })
  593. } else {
  594. uni.showToast({
  595. title: '暂无权限',
  596. icon: "none"
  597. })
  598. }
  599. },
  600. // 是否有权限观看
  601. isPassWatch(name) {
  602. return this.menuList.findIndex(item => {
  603. return item.name == name
  604. }) == -1 ? false : true
  605. },
  606. // 跳转首页
  607. toHome() {
  608. uni.navigateTo({
  609. url: '/pages/index/guide'
  610. })
  611. },
  612. // 获取周报详情
  613. getMessage() {
  614. this.$u.get('/zkMessage/findByProjectId', {
  615. id: this.id
  616. }).then(res => {
  617. // console.log(res)
  618. let data = {}
  619. if (res.zkMessage.content) {
  620. data = JSON.parse(res.zkMessage.content)
  621. this.bubbleSort(data.customerInfo1 || [], 'pk')
  622. this.bubbleSort(data.customerInfo2 || [], 'pk')
  623. data.customerInfo1 && data.customerInfo1.reverse()
  624. data.customerInfo2 && data.customerInfo2.reverse()
  625. this.weekObj = {
  626. ...res.zkMessage,
  627. ...data
  628. }
  629. } else {
  630. this.nodata = true
  631. this.weekObj = {
  632. ...res.zkMessage,
  633. }
  634. }
  635. let [max1, max2] = [this.weekObj.level1List[0].total||1, this.weekObj.level2List[0].total||1]
  636. this.weekObj.level1List.forEach(item => {
  637. item.percent = Math.floor((item.total/max1)*100)
  638. })
  639. this.weekObj.level2List.forEach(item => {
  640. item.percent = Math.floor((item.total/max2)*100)
  641. })
  642. this.weekObj.createTimeName = this.getTimeLines(this.weekObj.weekDate, 1)
  643. console.log(this.weekObj, 'this.weekObj')
  644. this.projectName = res.projectName
  645. this.numlist.forEach(item => {
  646. if (data[item.setName]) {
  647. item.num = data[item.setName]
  648. }
  649. if (data[item.percentName]) {
  650. item.percent = data[item.percentName]
  651. }
  652. if (data[item.preNumName]) {
  653. item.preNum = data[item.preNumName]
  654. }
  655. })
  656. this.init()
  657. }).catch(e => {
  658. console.log(e)
  659. })
  660. },
  661. // 把对象转成数组并在后续的步骤方便处理
  662. init() {
  663. console.log(this.weekObj, 'this.weekObj')
  664. this.needList.forEach(item => {
  665. console.log(item)
  666. if (this.weekObj[item] && Object.keys(this.weekObj[item]).length > 0) {
  667. this.weekObj[item + 'List'] = [] // 销讲执行
  668. for (let i in this.weekObj[item]) {
  669. this.weekObj[item + 'List'].push({
  670. title: i,
  671. value: this.weekObj[item][i]
  672. })
  673. }
  674. } else {
  675. this.weekObj[item + 'List'] = []
  676. }
  677. })
  678. this.sortInitArr()
  679. },
  680. // 排序对象转换后的数组
  681. sortInitArr() {
  682. this.needList.forEach(item => {
  683. if (this.weekObj[item + 'List']) {
  684. console.log(item)
  685. this.bubbleSort(this.weekObj[item + 'List'])
  686. this.weekObj[item + 'List'] = this.dealData(this.weekObj[item + 'List'])
  687. }
  688. })
  689. this.reverseList()
  690. },
  691. // 反转数组
  692. reverseList() {
  693. this.needList.forEach(item => {
  694. if (this.weekObj[item + 'List']) {
  695. this.weekObj[item + 'List'].reverse()
  696. }
  697. })
  698. console.log(this.weekObj, '12312312312')
  699. },
  700. // 冒泡排序
  701. bubbleSort(arr, keys = 'value') {
  702. console.log(arr, 'keys', keys)
  703. for (let i = 0; i < arr.length - 1; i += 1) {
  704. //通过 arr.length 次把第一位放到最后,完成排序
  705. //-i是因为最后的位置是会动态改变的,当完成一次后,最后一位会变成倒数第二位
  706. for (let j = 0; j < arr.length - 1 - i; j += 1) {
  707. if (arr[j][keys] > arr[j + 1][keys]) {
  708. const temp = arr[j];
  709. arr[j] = arr[j + 1];
  710. arr[j + 1] = temp;
  711. }
  712. }
  713. }
  714. },
  715. // 定义一个公共方法对数据进行处理
  716. dealData(arr) {
  717. // 获取最大值
  718. let num = Math.max.apply(Math, arr.map((o) => {
  719. return o.value
  720. }))
  721. arr.map(item => {
  722. item.values = Math.floor(item.value / num * 100)
  723. })
  724. return arr
  725. },
  726. // 转换时间
  727. getTimeLine(date, type = 1) {
  728. let resu = '--'
  729. if (!date) return resu
  730. let time = new Date(date.replace(/-/g, '/'))
  731. time.setDate(time.getDate() - 7)
  732. let arr = date.split(' ')
  733. let str = arr[0]
  734. let result = str.split('-')
  735. let m = (time.getMonth() + 1) < 10 ? `0${time.getMonth() + 1}` : (time.getMonth() + 1)
  736. let d = time.getDate() < 10 ? `0${time.getDate()}` : time.getDate()
  737. if (type == 1) {
  738. resu = `${m}.${d}-${result[1]}.${result[2]}`
  739. } else {
  740. resu = `${m}月${d}日~${result[1]}月${result[2]}日`
  741. }
  742. return resu
  743. },
  744. // 转换时间
  745. getTimeLines(date) {
  746. if (!date) return ''
  747. let arr = date.split('~')
  748. let str0 = arr[0].split('-')
  749. let str1 = arr[1].split('-')
  750. return `${str0[1]}月${str0[2]}日~${str1[1]}月${str1[2]}日`
  751. },
  752. },
  753. filters: {
  754. // 时间格式转换
  755. fomatDate(date) {
  756. if (!date) return '--'
  757. let arr = date.split(' ')
  758. let str = arr[0]
  759. let result = str.split('-')
  760. return `${result[1]}-${result[2]}`
  761. },
  762. // 转换时间
  763. getTimeLine(date, type = 1) {
  764. if (!date) return '--'
  765. console.log(date.replace(/-/g, '/'))
  766. let time = new Date(date.replace(/-/g, '/'))
  767. time.setDate(time.getDate() - 7)
  768. let arr = date.split(' ')
  769. let str = arr[0]
  770. let result = str.split('-')
  771. let m = (time.getMonth() + 1) < 10 ? `0${time.getMonth() + 1}` : (time.getMonth() + 1)
  772. let d = time.getDate() < 10 ? `0${time.getDate()}` : time.getDate()
  773. if (type == 1) {
  774. return `${m}.${d}-${result[1]}.${result[2]}`
  775. } else {
  776. return `${m}月${d}日~${result[1]}月${result[2]}日`
  777. }
  778. },
  779. // 设置颜色
  780. setColor(index) {
  781. let color = ''
  782. switch (index) {
  783. case 0:
  784. color = '#E7483C';
  785. break;
  786. case 1:
  787. color = '#FF8C13';
  788. break;
  789. case 2:
  790. color = '#FFCC00';
  791. break;
  792. default:
  793. color = '#4FC78F';
  794. break;
  795. }
  796. return color
  797. },
  798. }
  799. }
  800. </script>
  801. <style lang="scss" scoped>
  802. @import '@/static/css/quill/quill.core.css';
  803. @import '@/static/css/quill/quill.snow.css';
  804. @import '@/static/css/quill/quill.bubble.css';
  805. .pages {
  806. width: 100vw;
  807. min-height: 100vh;
  808. display: flex;
  809. flex-direction: column;
  810. background: #F8F8F8;
  811. .nav-header {
  812. flex-shrink: 0;
  813. }
  814. .container {
  815. padding: 30rpx 30rpx 40rpx;
  816. display: flex;
  817. flex-direction: column;
  818. background: #fff;
  819. .c-head-card {
  820. padding: 30rpx;
  821. width: 100%;
  822. min-height: 252rpx;
  823. border: 2rpx solid #000000;
  824. border-radius: 12rpx;
  825. box-shadow: 10rpx 10rpx #2671E2;
  826. display: flex;
  827. flex-direction: column;
  828. .c-title-text {
  829. // position: relative;
  830. flex-grow: 1;
  831. font-size: 48rpx;
  832. font-weight: bold;
  833. color: #303030;
  834. }
  835. .date {
  836. // position: absolute;
  837. // right: 0;
  838. // bottom: 6rpx;
  839. font-size: 30rpx;
  840. color: #303030;
  841. }
  842. .creative-time {
  843. margin: 20rpx 0 0 0;
  844. flex-shrink: 0;
  845. }
  846. }
  847. }
  848. .nodata-box {
  849. width: 750rpx;
  850. flex: 1;
  851. margin: 0 auto;
  852. display: flex;
  853. justify-content: center;
  854. align-items: center;
  855. flex-direction: column;
  856. background-color: #fff;
  857. .img {
  858. width: 400rpx;
  859. height: 400rpx;
  860. }
  861. .text {
  862. text-align: center;
  863. font-size: 28rpx;
  864. font-family: PingFangSC-Regular, PingFang SC;
  865. font-weight: 400;
  866. color: #666666;
  867. line-height: 40rpx;
  868. }
  869. }
  870. .briefing {
  871. background: #fff;
  872. .briefing-title {
  873. padding: 0 30rpx;
  874. height: 90rpx;
  875. display: flex;
  876. align-items: center;
  877. border: 1rpx solid #E0E0E0;
  878. font-size: 32rpx;
  879. font-weight: bold;
  880. }
  881. .briefing-box {
  882. width: 100%;
  883. display: flex;
  884. flex-wrap: wrap;
  885. .briefing-box-item {
  886. padding: 20rpx 30rpx;
  887. width: 50%;
  888. height: 186rpx;
  889. border: 1px solid #E0E0E0;
  890. border-left: none;
  891. border-top: none;
  892. &:nth-of-type(2n) {
  893. border-right: none;
  894. }
  895. .top {
  896. font-size: 28rpx;
  897. }
  898. .middle {
  899. margin: 14rpx 0 12rpx;
  900. font-size: 32rpx;
  901. font-weight: 600;
  902. color: #333333;
  903. }
  904. .bottom {
  905. font-size: 26rpx;
  906. color: #666666;
  907. .b-text {
  908. margin-left: 20rpx;
  909. &.down {
  910. color: #43CD80;
  911. font-size: 34rpx;
  912. }
  913. &.up {
  914. font-size: 34rpx;
  915. color: #E7483C;
  916. }
  917. }
  918. }
  919. }
  920. }
  921. }
  922. .execution-ranking {
  923. margin: 20rpx 0 0 0;
  924. padding: 30rpx;
  925. background: #fff;
  926. .execution-ranking-title {
  927. font-size: 32rpx;
  928. font-weight: bold;
  929. }
  930. .execution-ranking-desc {
  931. margin-top: 20rpx;
  932. font-size: 30rpx;
  933. }
  934. .ranking-box {
  935. margin: 30rpx 0 0 0;
  936. .ranking-item {
  937. margin-bottom: 18rpx;
  938. display: flex;
  939. &:nth-last-of-type(1) {
  940. margin-bottom: 0;
  941. }
  942. .left {
  943. flex-shrink: 0;
  944. width: 140rpx;
  945. font-size: 30rpx;
  946. overflow: hidden;
  947. text-overflow: ellipsis;
  948. white-space: nowrap;
  949. }
  950. .middle {
  951. flex-grow: 1;
  952. }
  953. .right {
  954. flex-shrink: 0;
  955. width: 118rpx;
  956. font-size: 30rpx;
  957. text-align: center;
  958. }
  959. }
  960. }
  961. }
  962. .statistics {
  963. margin: 20rpx 0 0 0;
  964. background: #fff;
  965. .statistics-title {
  966. padding: 30rpx 30rpx 0;
  967. width: 100%;
  968. font-size: 32rpx;
  969. font-weight: bold;
  970. }
  971. .statistics-desc {
  972. padding: 0 30rpx;
  973. margin-top: 20rpx;
  974. }
  975. .table {
  976. margin: 30rpx 0 0 0;
  977. .thead {
  978. padding: 0 30rpx;
  979. width: 100%;
  980. height: 72rpx;
  981. display: flex;
  982. align-items: center;
  983. border: 1rpx solid #E0E0E0;
  984. border-left: none;
  985. border-right: none;
  986. font-size: 26rpx;
  987. .thead-item {
  988. text-align: center;
  989. }
  990. }
  991. .tbody {
  992. .tbody-item {
  993. padding: 0 30rpx;
  994. display: flex;
  995. align-items: center;
  996. height: 72rpx;
  997. background: #FAFCFF;
  998. &:nth-of-type(2n) {
  999. background: #FFFFFF;
  1000. }
  1001. .tbody-items {
  1002. flex: 1;
  1003. display: flex;
  1004. justify-content: center;
  1005. }
  1006. .name {
  1007. justify-content: flex-start;
  1008. overflow: hidden;
  1009. text-overflow: ellipsis;
  1010. white-space: nowrap;
  1011. }
  1012. .time {
  1013. flex: 2;
  1014. }
  1015. .percent {
  1016. flex: 2;
  1017. }
  1018. .week {
  1019. flex: 1.5;
  1020. }
  1021. }
  1022. }
  1023. .tbottom {
  1024. width: 100%;
  1025. height: 72rpx;
  1026. display: flex;
  1027. justify-content: center;
  1028. align-items: center;
  1029. font-size: 30rpx;
  1030. color: #2671E2;
  1031. background: #FAFCFF;
  1032. }
  1033. }
  1034. }
  1035. .guwen-ranking {
  1036. margin: 20rpx 0 0 0;
  1037. width: 100%;
  1038. padding: 30rpx;
  1039. background: #fff;
  1040. .guwen-ranking-title {
  1041. font-size: 32rpx;
  1042. font-weight: 500;
  1043. }
  1044. .guwen-ranking-desc {
  1045. margin-top: 20rpx;
  1046. font-size: 30rpx;
  1047. }
  1048. .ranking-box {
  1049. margin: 30rpx 0 0 0;
  1050. .ranking-item {
  1051. margin-bottom: 18rpx;
  1052. display: flex;
  1053. &:nth-last-of-type(1) {
  1054. margin-bottom: 0;
  1055. }
  1056. .left {
  1057. flex-shrink: 0;
  1058. width: 140rpx;
  1059. font-size: 30rpx;
  1060. overflow: hidden;
  1061. text-overflow: ellipsis;
  1062. white-space: nowrap;
  1063. }
  1064. .middle {
  1065. flex-grow: 1;
  1066. }
  1067. .right {
  1068. flex-shrink: 0;
  1069. width: 118rpx;
  1070. font-size: 30rpx;
  1071. text-align: center;
  1072. }
  1073. }
  1074. }
  1075. }
  1076. .proposal {
  1077. margin: 20rpx 0 0 0;
  1078. padding: 30rpx;
  1079. background: #fff;
  1080. .proposal-title {
  1081. font-size: 32rpx;
  1082. font-weight: 500;
  1083. }
  1084. .proposal-box {
  1085. margin: 30rpx 0 0 0;
  1086. .proposal-item {
  1087. margin: 20rpx 0 0 0;
  1088. display: flex;
  1089. .lside {
  1090. flex-shrink: 0;
  1091. margin: 0 12rpx 0 0;
  1092. width: 44rpx;
  1093. height: 44rpx;
  1094. border-radius: 50%;
  1095. background: #2671E2;
  1096. text-align: center;
  1097. line-height: 44rpx;
  1098. color: #fff;
  1099. }
  1100. .rside {
  1101. .rside-title {
  1102. font-size: 32rpx;
  1103. }
  1104. .rside-box {
  1105. margin: 16rpx 0 0 0;
  1106. }
  1107. }
  1108. }
  1109. }
  1110. }
  1111. .nav-footer {
  1112. position: sticky;
  1113. bottom: 0;
  1114. padding: 32rpx;
  1115. width: 100%;
  1116. display: flex;
  1117. justify-content: center;
  1118. background: #fff;
  1119. .footer-item {
  1120. flex: 1;
  1121. height: 88rpx;
  1122. display: flex;
  1123. justify-content: center;
  1124. align-items: center;
  1125. color: #2671E2;
  1126. border: 2rpx solid #2671E2;
  1127. border-radius: 8rpx;
  1128. overflow: hidden;
  1129. font-size: 32rpx;
  1130. &.full {
  1131. background: #2671E2;
  1132. color: #fff;
  1133. .fulls {
  1134. box-sizing: border-box;
  1135. width: 100%;
  1136. height: 100%;
  1137. background: transparent;
  1138. color: #fff;
  1139. font-size: 32rpx;
  1140. font-weight: normal;
  1141. line-height: 88rpx;
  1142. }
  1143. }
  1144. }
  1145. }
  1146. .up {
  1147. color: #43CD80 !important;
  1148. }
  1149. .down {
  1150. color: #E6273A !important;
  1151. }
  1152. .empity {
  1153. width: 100%;
  1154. height: 300rpx;
  1155. display: flex;
  1156. justify-content: center;
  1157. align-items: center;
  1158. font-size: 28rpx;
  1159. color: #666666;
  1160. }
  1161. }
  1162. </style>