index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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="5" :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. watch:{
  109. 'modelTime':function () {
  110. this.startList()
  111. }
  112. },
  113. onLoad() {
  114. uni.hideTabBar()
  115. uni.$on('newReceiving', () => {
  116. })
  117. this.startList()
  118. },
  119. onPageScroll(res) {
  120. this.scrollTop = res.scrollTop / 120
  121. },
  122. onReachBottom() {
  123. this.getDayBacklogList()
  124. },
  125. methods: {
  126. getDateBacklogStatistics(){
  127. getDateBacklogStatistics({'dateNum':this.modelTime}).then(res=>{
  128. if(res.code===1){
  129. if(res.data.totalNum>0){
  130. this.chartList[0].value=(res.data.exceedNum/res.data.totalNum*100).toFixed(0)*1;
  131. this.chartList[1].value=(res.data.lagNum/res.data.totalNum*100).toFixed(0)*1;
  132. this.chartList[2].value=(res.data.normalNum/res.data.totalNum*100).toFixed(0)*1;
  133. this.$refs.circleObj.setServerData( (res.data.endNum/res.data.totalNum).toFixed(2)*1)
  134. }else {
  135. this.chartList[0].value=0;
  136. this.chartList[1].value=0;
  137. this.chartList[2].value=0;
  138. this.$refs.circleObj.setServerData( 0)
  139. }
  140. console.log(this.chartList)
  141. this.$refs.pieChart.setData( this.chartList)
  142. }
  143. })
  144. },
  145. startList(){
  146. this.backlogList=[];
  147. this.page=1;
  148. this.total=null;
  149. this.getDayBacklogList();
  150. this.getDateBacklogStatistics()
  151. },
  152. getDayBacklogList() {
  153. if(this.total!==null && this.total<=this.backlogList.length){
  154. return
  155. }
  156. getDayBacklogList({'dateNum': this.modelTime,'page':this.page}).then((res) => {
  157. if (res.code === 1) {
  158. this.backlogList.push(...res.data.items)
  159. this.total = res.data.total
  160. ++ this.page
  161. }
  162. })
  163. },
  164. setMemberData(memberData){
  165. this.memberData=memberData
  166. },
  167. onChangeTime(e) {
  168. this.indexTime = e
  169. },
  170. moveHandle() {
  171. return false
  172. },
  173. },
  174. }
  175. </script>
  176. <style lang="scss" scoped>
  177. .personal {
  178. height: 55rpx;
  179. line-height: 55rpx;
  180. }
  181. .pie_chart {
  182. width: 135px
  183. }
  184. .circle_chart {
  185. width: 135px;
  186. padding-top: 20rpx;
  187. }
  188. .chart_dot {
  189. width: 16rpx;
  190. height: 16rpx;
  191. border-radius: 50%;
  192. }
  193. </style>