AI销管
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

weekReport.vue 27 KiB

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