zkTaskList.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!-- 首页-组长 -->
  2. <template>
  3. <view>
  4. <yui-tabs :tabs="pageInfo.tabs" :offsetTop="25" v-model="pageInfo.activeIndex" @change="tabChange" color="rgba(190, 163, 117, 1)"
  5. titleActiveColor="rgba(190, 163, 117, 1)" sticky swipeable line-width="60rpx" line-height="2px" animated>
  6. <template #pane0>
  7. <view class="view_container leaderIndex">
  8. <!-- 列表 -->
  9. <view class="leaderIndex_list">
  10. <uni-card v-for="(item,index) in pageData.taskList" padding="10rpx 0">
  11. <view class="list_title">
  12. <image :src="item.taskStatusIcon" class="statusIcon"></image>
  13. <view>{{item.name}}</view>
  14. <image :src="showIcon.nowIcon" class="showIcon" @click="changeState('list')"></image>
  15. </view>
  16. <view class="list_content">
  17. <text class="list_item">任务编号<text class="list_item_text">{{item.taskNumber}}</text></text>
  18. <text class="list_item">组长<text class="list_item_text">{{item.zzName}}</text></text>
  19. <text class="list_item">待质控代煎企业<text
  20. class="list_item_text">{{item.bzkOrgName}}</text></text>
  21. <text class="list_item">地址<text class="list_item_text">{{item.address}}</text></text>
  22. <text class="list_item">完成日期<text class="list_item_text">{{item.finishTime}}</text></text>
  23. </view>
  24. <view class="list_button">
  25. <view class="button_group">
  26. <view class="button_item" @click="signTask">签收</view>
  27. <view class="button_item" @click="starTask">开始质控</view>
  28. </view>
  29. </view>
  30. </uni-card>
  31. </view>
  32. </view>
  33. </template>
  34. </yui-tabs>
  35. </view>
  36. </template>
  37. <script setup>
  38. import http from '@/utils/request';
  39. import {
  40. reactive
  41. } from "vue";
  42. import {
  43. onLoad,
  44. onShow,
  45. onUnload,
  46. onPullDownRefresh
  47. } from "@dcloudio/uni-app";
  48. const pageInfo = reactive({
  49. // 判断列表是否为空
  50. isEmpty: true,
  51. total: 0,
  52. value: 0,
  53. orderList: [],
  54. tabs: ["所有", "待质控", "质控中", "完成"],
  55. activeIndex: 0,
  56. orderId: '',
  57. detailStatus: ''
  58. });
  59. const pageData = reactive({
  60. headImg: '/static/logo.png',
  61. userName: '王军',
  62. taskNum: 2,
  63. taskList: []
  64. })
  65. const eyeIcon = reactive({
  66. nowIcon: '',
  67. showIcon: '/static/whiteDisplay.png',
  68. hideIcon: '/static/whiteHide.png'
  69. })
  70. const showIcon = reactive({
  71. nowIcon: '',
  72. showIcon: '/static/blackDisplay.png',
  73. hideIcon: '/static/blackHide.png'
  74. })
  75. const statusIcon = reactive({
  76. daiIcon: '/static/dai_icon.png',
  77. wanIcon: '/static/wan_icon.png',
  78. zhiIcon: '/static/zhi_icon.png'
  79. })
  80. // 切换显示与隐藏
  81. const changeState = (type) => {
  82. if (type == 'header') {
  83. console.log("头部切换")
  84. if (eyeIcon.nowIcon == eyeIcon.hideIcon) {
  85. eyeIcon.nowIcon = eyeIcon.showIcon
  86. } else {
  87. eyeIcon.nowIcon = eyeIcon.hideIcon
  88. }
  89. } else if (type == 'list') {
  90. console.log("列表切换")
  91. if (showIcon.nowIcon == showIcon.hideIcon) {
  92. showIcon.nowIcon = showIcon.showIcon
  93. } else {
  94. showIcon.nowIcon = showIcon.hideIcon
  95. }
  96. }
  97. }
  98. // 跳转到任务详情
  99. const toDetail = () => {
  100. console.log("跳转到任务详情")
  101. }
  102. // 签收
  103. const starTask = () => {
  104. console.log("签收")
  105. }
  106. // 开始质控
  107. const signTask = () => {
  108. console.log("开始质控")
  109. }
  110. onPullDownRefresh(() => {
  111. console.log("下拉刷新")
  112. setTimeout(uni.stopPullDownRefresh(), 2000)
  113. })
  114. const getTaskData = () => {
  115. http.get("app-api/findList").then(res => {
  116. console.log(res)
  117. pageData.taskList = res
  118. pageData.taskList.forEach(item => {
  119. item.finishTime = item.wcrq1.slice(2) + ' ~ ' + item.wcrq2.slice(0, -2)
  120. if (item.status == '7003') {
  121. item.taskStatusIcon = statusIcon.daiIcon
  122. } else if (item.status == '7004') {
  123. item.taskStatusIcon = statusIcon.wanIcon
  124. } else {
  125. item.taskStatusIcon = statusIcon.zhiIcon
  126. }
  127. })
  128. console.log(pageData.taskList)
  129. })
  130. }
  131. onShow(() => {
  132. eyeIcon.nowIcon = eyeIcon.hideIcon
  133. showIcon.nowIcon = showIcon.hideIcon
  134. getTaskData()
  135. })
  136. </script>
  137. <style lang="scss" scoped>
  138. @import 'indexList.scss';
  139. .yui-tabs {
  140. position: relative;
  141. }
  142. ::v-deep.uni-view.yui-tabs__wrap {
  143. margin-top: 25px!important;
  144. }
  145. .yui-tabs__wrap{
  146. top: 50px !important;
  147. }
  148. </style>