index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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 ref="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 ref="circleObj" :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 {getDateBacklogStatistics, getDayBacklogList} from "@/api/task";
  61. import {date} from "@/uni_modules/uv-ui-tools/libs/function/test";
  62. export default {
  63. components: {
  64. TaskItem,
  65. PieChart,
  66. CircleChart,
  67. IndexColumn,
  68. IndexPersonal
  69. },
  70. data() {
  71. return {
  72. modelTime: this.$tools.getDate('-'),
  73. indexTime: this.$tools.getDate(),
  74. is_admin: false,
  75. scrollTop: 0,
  76. topNavHeight: 0,
  77. chartList: [{
  78. name: "超期",
  79. color: '#DE5847',
  80. value: "100%"
  81. }, {
  82. name: "滞后",
  83. color: '#EF8F27',
  84. value: "100%"
  85. }, {
  86. name: "正常",
  87. color: '#3ABF7D',
  88. value: "100%"
  89. }, ],
  90. memberData:{},
  91. statisticsData:{
  92. endNum: 0,
  93. exceedDate: 0,
  94. lagDate: 0,
  95. totalNum: 0,
  96. },
  97. backlogList: [],
  98. weekData: [],
  99. weekNum: 1,
  100. dayNum: 0,
  101. day: '',
  102. month: '',
  103. page: 1,
  104. isAjax: false,
  105. total: null
  106. }
  107. },
  108. onLoad() {
  109. uni.hideTabBar()
  110. uni.$on('newReceiving', () => {
  111. })
  112. this.startList()
  113. },
  114. onPageScroll(res) {
  115. this.scrollTop = res.scrollTop / 120
  116. },
  117. onReachBottom() {
  118. this.getDayBacklogList()
  119. },
  120. methods: {
  121. getDateBacklogStatistics(){
  122. getDateBacklogStatistics({'dateNum':this.modelTime}).then(res=>{
  123. if(res.code===1){
  124. if(res.data.totalNum>0){
  125. this.chartList[0].value=(res.data.exceedNum/res.data.totalNum*100).toFixed(0)*1;
  126. this.chartList[1].value=(res.data.lagNum/res.data.totalNum*100).toFixed(0)*1;
  127. this.chartList[2].value=(res.data.normalNum/res.data.totalNum*100).toFixed(0)*1;
  128. this.$refs.circleObj.setServerData( (res.data.endNum/res.data.totalNum).toFixed(2)*1)
  129. }else {
  130. this.chartList[0].value=0;
  131. this.chartList[1].value=0;
  132. this.chartList[2].value=0;
  133. this.$refs.circleObj.setServerData( 0)
  134. }
  135. console.log(this.chartList)
  136. this.$refs.pieChart.setData( this.chartList)
  137. }
  138. })
  139. },
  140. startList(){
  141. this.backlogList=[];
  142. this.page=1;
  143. this.total=null;
  144. this.getDayBacklogList();
  145. this.getDateBacklogStatistics()
  146. },
  147. getDayBacklogList() {
  148. if(this.total!==null && this.total<=this.backlogList.length){
  149. return
  150. }
  151. getDayBacklogList({'dateNum': this.modelTime,'page':this.page}).then((res) => {
  152. if (res.code === 1) {
  153. this.backlogList.push(...res.data.items)
  154. this.total = res.data.total
  155. ++ this.page
  156. }
  157. })
  158. },
  159. setMemberData(memberData){
  160. this.memberData=memberData
  161. },
  162. onChangeTime(e) {
  163. this.indexTime = e
  164. },
  165. moveHandle() {
  166. return false
  167. },
  168. },
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. .personal {
  173. height: 55rpx;
  174. line-height: 55rpx;
  175. }
  176. .pie_chart {
  177. width: 135px
  178. }
  179. .circle_chart {
  180. width: 135px;
  181. padding-top: 20rpx;
  182. }
  183. .chart_dot {
  184. width: 16rpx;
  185. height: 16rpx;
  186. border-radius: 50%;
  187. }
  188. </style>