AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

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