index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="total-page page-env-160 page-box">
  3. <Nav :title="'工作台导航'" :back="false" :is_fixed="true" :opacity="scrollTop" :justify="'left'" :color="'#fff'">
  4. <view class="p-20">
  5. <IndexPersonal @setMemberData="setMemberData"></IndexPersonal>
  6. <IndexColumn :memberData="memberData"></IndexColumn>
  7. </view>
  8. </Nav>
  9. <view class="p-lr20 m-tb30">
  10. <view class="personal m-lr10 row-justify-sb center">
  11. <text class="sys-weight-600">我的待办</text>
  12. <view class="row-justify-sb center">
  13. <view class="personal_text">
  14. <uni-datetime-picker type="date" v-model="modelTime" @change="onChangeTime"
  15. @touchmove.stop.prevent="moveHandle">
  16. <view class="personal sys-background-fff size-24 sys-weight-600 p-lr30 r-40">{{indexTime}}
  17. </view>
  18. </uni-datetime-picker>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="page-box-bg-fff m-t30 m-lr20 m-b20 r-30 row-justify-sb flex p-b30">
  24. <view class="">
  25. <view class="row-c">
  26. <view class="pie_chart column-c">
  27. <PieChart></PieChart>
  28. <text class="size-24 text-color-12">任务完成情况</text>
  29. </view>
  30. <view class="m-b30">
  31. <view class="row-c p-tb10" v-for="(item,index) in chartList" :key="index">
  32. <view class="row-c">
  33. <view class="row-c" style="line-height: 30rpx;">
  34. <view class="chart_dot" :style="{backgroundColor:item.color}"></view>
  35. <text class="m-l16 text-color-787">{{item.name}}</text>
  36. </view>
  37. </view>
  38. <text class="text-color-12 sys-weight-600 m-l40">{{item.value}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="circle_chart column-sb-c m-t10">
  44. <CircleChart :width="'180rpx'" :height="'180rpx'" :bgColor="'#0FB160'"></CircleChart>
  45. <text class="size-24 text-color-12">任务进度</text>
  46. </view>
  47. </view>
  48. <TaskItem :type="4" :taskList="backlogList"></TaskItem>
  49. <Tab class="tabs_height" :tab-index="0"></Tab>
  50. </view>
  51. </template>
  52. <script>
  53. import TaskItem from "@/common/task/task-item.vue"
  54. import PieChart from "@/common/chart/pie_chart.vue"
  55. import CircleChart from "@/common/chart/circle_chart.vue"
  56. // 个人信息
  57. import IndexColumn from "./module/index_column.vue"
  58. // 顶部栏目
  59. import IndexPersonal from "./module/index_personal.vue"
  60. import {getDayBacklogList} from "@/api/task";
  61. export default {
  62. components: {
  63. TaskItem,
  64. PieChart,
  65. CircleChart,
  66. IndexColumn,
  67. IndexPersonal
  68. },
  69. data() {
  70. return {
  71. modelTime: this.$tools.getDate('-'),
  72. indexTime: this.$tools.getDate(),
  73. is_admin: false,
  74. scrollTop: 0,
  75. topNavHeight: 0,
  76. chartList: [{
  77. name: "超期",
  78. color: '#DE5847',
  79. value: "100%"
  80. }, {
  81. name: "滞后",
  82. color: '#EF8F27',
  83. value: "100%"
  84. }, {
  85. name: "正常",
  86. color: '#3ABF7D',
  87. value: "100%"
  88. }, ],
  89. memberData:{},
  90. backlogList: [],
  91. weekData: [],
  92. weekNum: 1,
  93. dayNum: 0,
  94. day: '',
  95. month: '',
  96. page: 1,
  97. isAjax: false,
  98. total: null
  99. }
  100. },
  101. onLoad() {
  102. uni.hideTabBar()
  103. uni.$on('newReceiving', () => {
  104. })
  105. this.startList()
  106. },
  107. onPageScroll(res) {
  108. this.scrollTop = res.scrollTop / 120
  109. },
  110. onReachBottom() {
  111. console.log('到底部了');
  112. this.getDayBacklogList()
  113. },
  114. methods: {
  115. startList(){
  116. this.backlogList=[];
  117. this.page=1;
  118. this.total=null;
  119. this.getDayBacklogList();
  120. },
  121. getDayBacklogList() {
  122. if(this.total!==null && this.total<=this.backlogList.length){
  123. return
  124. }
  125. getDayBacklogList({'dateNum': this.indexTime,'page':this.page}).then((res) => {
  126. if (res.code === 1) {
  127. this.backlogList.push(...res.data.items)
  128. this.total = res.data.total
  129. ++ this.page
  130. }
  131. })
  132. },
  133. setMemberData(memberData){
  134. this.memberData=memberData
  135. },
  136. onChangeTime(e) {
  137. this.indexTime = e
  138. },
  139. moveHandle() {
  140. return false
  141. },
  142. },
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .personal {
  147. height: 55rpx;
  148. line-height: 55rpx;
  149. }
  150. .pie_chart {
  151. width: 135px
  152. }
  153. .circle_chart {
  154. width: 135px;
  155. padding-top: 20rpx;
  156. }
  157. .chart_dot {
  158. width: 16rpx;
  159. height: 16rpx;
  160. border-radius: 50%;
  161. }
  162. </style>