index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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 ref="memberObj" @setMemberData="setMemberData"></IndexPersonal>
  6. <IndexColumn ref="columnObj" :memberData="memberData" :model-time="modelTime"></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 r-30 row-justify-sb flex p-b30" v-show="backlogList.length>0">
  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" style="text-align: center;" v-for="(item,index) in chartList"
  32. :key="index">
  33. <view class="row-c">
  34. <view class="row-c" style="line-height: 30rpx;">
  35. <view class="chart_dot" :style="{backgroundColor:item.color}"></view>
  36. <text class="m-l16 size-28 text-color-787">{{item.name}}</text>
  37. </view>
  38. </view>
  39. <text class="text-color-12 sys-weight-600 m-l20 size-28">{{item.value}}%</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="circle_chart column-sb-c m-t10">
  45. <CircleChart ref="circleObj" :width="'185rpx'" :height="'185rpx'" bgColor="#0FB160"></CircleChart>
  46. <text class="size-24 text-color-12">任务进度</text>
  47. </view>
  48. </view>
  49. <TaskItem :type="5" :taskList="backlogList"></TaskItem>
  50. <Tab class="tabs_height" :tab-index="0"></Tab>
  51. </view>
  52. </template>
  53. <script>
  54. import TaskItem from "@/common/task/task-item.vue"
  55. import PieChart from "@/common/chart/pie_chart.vue"
  56. import CircleChart from "@/common/chart/circle_chart.vue"
  57. // 个人信息
  58. import IndexColumn from "./module/index_column.vue"
  59. // 顶部栏目
  60. import IndexPersonal from "./module/index_personal.vue"
  61. import {
  62. getDateBacklogStatistics,
  63. getDayBacklogList
  64. } from "@/api/task";
  65. import {
  66. date
  67. } from "@/uni_modules/uv-ui-tools/libs/function/test";
  68. export default {
  69. components: {
  70. TaskItem,
  71. PieChart,
  72. CircleChart,
  73. IndexColumn,
  74. IndexPersonal
  75. },
  76. data() {
  77. return {
  78. modelTime: this.$tools.getDate('-'),
  79. indexTime: this.$tools.getDate('-'),
  80. is_admin: false,
  81. scrollTop: 0,
  82. topNavHeight: 0,
  83. chartList: [{
  84. name: "超期",
  85. color: '#DE5847',
  86. value: "0"
  87. }, {
  88. name: "滞后",
  89. color: '#EF8F27',
  90. value: "0"
  91. }, {
  92. name: "正常",
  93. color: '#3ABF7D',
  94. value: "0"
  95. }, ],
  96. memberData: {
  97. draftNum: "0",
  98. creditNum: "0",
  99. noticeNum: "0",
  100. take_num: "0",
  101. unreadNum: "0",
  102. },
  103. statisticsData: {
  104. endNum: 0,
  105. exceedDate: 0,
  106. lagDate: 0,
  107. totalNum: 0,
  108. },
  109. backlogList: [],
  110. weekData: [],
  111. weekNum: 1,
  112. dayNum: 0,
  113. day: '',
  114. month: '',
  115. page: 1,
  116. isAjax: false,
  117. total: null
  118. }
  119. },
  120. watch: {
  121. 'modelTime': function() {
  122. this.startList()
  123. }
  124. },
  125. onLoad() {
  126. uni.hideTabBar()
  127. },
  128. onShow() {
  129. this.startList()
  130. this.$refs.memberObj.getMemberInfo()
  131. this.$refs.columnObj.getSysCashier()
  132. },
  133. onPageScroll(res) {
  134. this.scrollTop = res.scrollTop / 120
  135. },
  136. onReachBottom() {
  137. this.getDayBacklogList()
  138. },
  139. methods: {
  140. getDateBacklogStatistics() {
  141. getDateBacklogStatistics({
  142. 'dateNum': this.modelTime
  143. }).then(res => {
  144. if (res.code === 1) {
  145. if (res.data.totalNum > 0) {
  146. this.chartList[0].value = (res.data.exceedNum / res.data.totalNum * 100).toFixed(0) *
  147. 1;
  148. this.chartList[1].value = (res.data.lagNum / res.data.totalNum * 100).toFixed(0) * 1;
  149. this.chartList[2].value = (res.data.normalNum / res.data.totalNum * 100).toFixed(0) *
  150. 1;
  151. setTimeout(() => {
  152. this.$refs.circleObj.setServerData((res.data.endNum / res.data.totalNum)
  153. .toFixed(2) * 1)
  154. this.$refs.pieChart.setServerData(this.chartList)
  155. }, 50)
  156. } else {
  157. this.chartList[0].value = 0;
  158. this.chartList[1].value = 0;
  159. this.chartList[2].value = 0;
  160. setTimeout(() => {
  161. this.$refs.pieChart.setNoData()
  162. this.$refs.circleObj.notServerData()
  163. }, 50)
  164. }
  165. }
  166. })
  167. },
  168. startList() {
  169. this.backlogList = [];
  170. this.page = 1;
  171. this.total = null;
  172. this.getDayBacklogList();
  173. this.getDateBacklogStatistics()
  174. },
  175. getDayBacklogList() {
  176. if (this.total !== null && this.total <= this.backlogList.length) {
  177. return
  178. }
  179. getDayBacklogList({
  180. 'dateNum': this.modelTime,
  181. 'page': this.page
  182. }).then((res) => {
  183. if (res.code === 1) {
  184. this.backlogList.push(...res.data.items)
  185. this.total = res.data.total
  186. ++this.page
  187. }
  188. })
  189. },
  190. setMemberData(memberData) {
  191. this.memberData = memberData
  192. },
  193. onChangeTime(e) {
  194. this.indexTime = e
  195. },
  196. moveHandle() {
  197. return false
  198. },
  199. },
  200. }
  201. </script>
  202. <style lang="scss" scoped>
  203. .personal {
  204. height: 55rpx;
  205. line-height: 55rpx;
  206. }
  207. .pie_chart {
  208. width: 135px
  209. }
  210. .circle_chart {
  211. width: 135px;
  212. padding-top: 20rpx;
  213. }
  214. .chart_dot {
  215. width: 16rpx;
  216. height: 16rpx;
  217. border-radius: 50%;
  218. }
  219. </style>