leaderIndex.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <!-- 首页-组长 -->
  2. <template>
  3. <view class="view_container leaderIndex">
  4. <!-- 头部 -->
  5. <view class="leaderIndex_header">
  6. <view class="info">
  7. <view class="info_img">
  8. <image :src="pageData.headImg" class="headImg"></image>
  9. </view>
  10. <text class="userName">{{pageData.userName}}</text>
  11. <image :src="eyeIcon.nowIcon" class="eyeIcon" @click="changeState('header')"></image>
  12. </view>
  13. <view class="slogan">
  14. <image src="/static/slogan_header_img.png" class="slogan_img"></image>
  15. </view>
  16. </view>
  17. <!-- 标题 -->
  18. <view class="leaderIndex_title">
  19. <view class="title_left">
  20. <text>任务列表</text>
  21. <!-- <uni-badge class="uni-badge-left-margin" :text="pageData.taskNum" /> -->
  22. </view>
  23. <view class="title_right" @click="toDetail">
  24. <text class="right_text">查看全部</text>
  25. <uni-icons type="right"></uni-icons>
  26. </view>
  27. </view>
  28. <!-- 列表 -->
  29. <view class="leaderIndex_list">
  30. <uni-card v-for="(item,index) in pageData.taskList" padding="10rpx 0">
  31. <view class="list_title">
  32. <image :src="item.taskStatusIcon" class="statusIcon"></image>
  33. <view>{{item.name}}</view>
  34. <image :src="showIcon.nowIcon" class="showIcon" @click="changeState('list')"></image>
  35. </view>
  36. <view class="list_content">
  37. <text class="list_item">任务编号<text class="list_item_text">{{item.taskNumber}}</text></text>
  38. <text class="list_item">组长<text class="list_item_text">{{item.zzName}}</text></text>
  39. <text class="list_item">待质控代煎企业<text class="list_item_text">{{item.bzkOrgName}}</text></text>
  40. <text class="list_item">地址<text class="list_item_text">{{item.address}}</text></text>
  41. <text class="list_item">完成日期<text class="list_item_text">{{item.finishTime}}</text></text>
  42. </view>
  43. <view class="list_button">
  44. <view class="button_group">
  45. <view class="button_item" @click="signTask">签收</view>
  46. <view class="button_item" @click="starTask">开始质控</view>
  47. </view>
  48. </view>
  49. </uni-card>
  50. </view>
  51. <!-- 签收任务/开始质控对话框 -->
  52. <uni-popup ref="operatorDialog" type="dialog">
  53. <uni-popup-dialog type="info" confirmText="确定" cancelText="取消" :title="pageData.popupMessage.title" :content="pageData.popupMessage.showMessage" @confirm="operatorDialogConfirm" @close="operatorDialogClose"></uni-popup-dialog>
  54. </uni-popup>
  55. </view>
  56. </template>
  57. <script setup>
  58. import http from '@/utils/request';
  59. import { ref,reactive } from "vue";
  60. import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
  61. const pageData=reactive({
  62. headImg:'/static/logo.png',
  63. userName:'王军',
  64. taskNum:2,
  65. taskList:[],
  66. // 对话框
  67. popupMessage:{
  68. // 标题
  69. title:'',
  70. // 提示内容
  71. showMessage:''
  72. }
  73. })
  74. const eyeIcon=reactive({
  75. nowIcon:'',
  76. showIcon:'/static/whiteDisplay.png',
  77. hideIcon:'/static/whiteHide.png'
  78. })
  79. const showIcon=reactive({
  80. nowIcon:'',
  81. showIcon:'/static/blackDisplay.png',
  82. hideIcon:'/static/blackHide.png'
  83. })
  84. const statusIcon=reactive({
  85. daiIcon:'/static/dai_icon.png',
  86. wanIcon:'/static/wan_icon.png',
  87. zhiIcon:'/static/zhi_icon.png'
  88. })
  89. // 定义签收任务/开始质控对话框
  90. const operatorDialog=ref()
  91. // 定义质控提醒对话框
  92. const remindDialog=ref()
  93. // 签收任务/开始质控对话框确定事件
  94. const operatorDialogConfirm=()=>{
  95. operatorDialog._value.close()
  96. }
  97. // 签收任务/开始质控对话框取消事件
  98. const operatorDialogClose=()=>{
  99. operatorDialog._value.close()
  100. }
  101. // 切换显示与隐藏
  102. const changeState=(type)=>{
  103. if(type=='header'){
  104. console.log("头部切换")
  105. if(eyeIcon.nowIcon==eyeIcon.hideIcon){
  106. eyeIcon.nowIcon=eyeIcon.showIcon
  107. }else{
  108. eyeIcon.nowIcon=eyeIcon.hideIcon
  109. }
  110. }else if(type=='list'){
  111. console.log("列表切换")
  112. if(showIcon.nowIcon==showIcon.hideIcon){
  113. showIcon.nowIcon=showIcon.showIcon
  114. }else{
  115. showIcon.nowIcon=showIcon.hideIcon
  116. }
  117. }
  118. }
  119. // 跳转到任务详情
  120. const toDetail=()=>{
  121. console.log("跳转到任务详情")
  122. // 提示-只有组长能够开始质控
  123. uni.showModal({
  124. title: '提示',
  125. content: '只有组长能够开始质控',
  126. confirmColor: 'rgba(190, 163, 117, 1)', //确定字体颜色
  127. showCancel: false,//没有取消按钮的弹框
  128. buttonText: '确定',
  129. success: function (res) {
  130. console.log(res)
  131. }
  132. })
  133. }
  134. // 签收
  135. const signTask=()=>{
  136. console.log("签收")
  137. operatorDialog._value.open()
  138. pageData.popupMessage.title='签收'
  139. pageData.popupMessage.showMessage='是否确认签收任务?'
  140. }
  141. // 开始质控
  142. const starTask=()=>{
  143. console.log("开始质控")
  144. operatorDialog._value.open()
  145. pageData.popupMessage.title='开始质控'
  146. pageData.popupMessage.showMessage='是否确认开始质控任务?'
  147. }
  148. onPullDownRefresh(()=>{
  149. console.log("下拉刷新")
  150. setTimeout(uni.stopPullDownRefresh(),2000)
  151. })
  152. const getTaskData=()=>{
  153. http.get("app-api/findList").then(res=>{
  154. console.log(res)
  155. pageData.taskList=res
  156. pageData.taskList.forEach(item=>{
  157. item.finishTime=item.wcrq1.slice(2) +' ~ '+item.wcrq2.slice(0,-2)
  158. if(item.status=='7003'){
  159. item.taskStatusIcon=statusIcon.daiIcon
  160. }else if(item.status=='7004'){
  161. item.taskStatusIcon=statusIcon.wanIcon
  162. }else{
  163. item.taskStatusIcon=statusIcon.zhiIcon
  164. }
  165. })
  166. console.log(pageData.taskList)
  167. })
  168. }
  169. onShow(()=>{
  170. eyeIcon.nowIcon=eyeIcon.hideIcon
  171. showIcon.nowIcon=showIcon.hideIcon
  172. getTaskData()
  173. })
  174. </script>
  175. <style lang="scss" scoped>
  176. @import 'index.scss';
  177. </style>