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.
 
 
 

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