djhjTaskDetail.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="djhjTaskDetail">
  3. <!-- 任务进度 -->
  4. <view class="djhjTaskDetail_progress">
  5. <text class="djhjTaskDetail_progress_title">任务进度:<text class="djhjTaskDetail_progress_text">{{wcnumber()+'/'+hjTaskList.length}}</text></text>
  6. <text class="djhjTaskDetail_progress_title">不合格数<text class="djhjTaskDetail_progress_text">{{hjbhg}}</text></text>
  7. </view>
  8. <view v-if="props.hjTaskList.length!=0">
  9. <!-- 创建人 -->
  10. <view class="creator">
  11. <text class="creator_title">操作人<text class="creator_text">{{props.creatorName}}</text></text>
  12. </view>
  13. <!-- 检查结果 -->
  14. <uni-card padding="0" spacing="0" v-for="(item,index) in props.hjTaskList" class="djhjList">
  15. <view class="djhjList_title">
  16. <view class="djhjList_text">检查项目</view>
  17. <view class="djhjList_righttext">{{item.item}}</view>
  18. </view>
  19. <view class="djhjList_title">
  20. <view class="djhjList_text">检查方式</view>
  21. <view class="djhjList_righttext">{{item.assessmentCriteria}}</view>
  22. </view>
  23. <view class="djhjList_title">
  24. <view class="djhjList_text">检查内容</view>
  25. <view class="djhjList_righttext">{{item.assessmentContent}}</view>
  26. </view>
  27. <view class="djhjList_title">
  28. <view class="djhjList_text">检查结果</view>
  29. <view class="djhjList_righttext" :class="item.assessmentResult=='不合格'? 'djhjList_redtext' : item.assessmentResult=='待检' ? 'djhjList_bluetext':'djhjList_greentext'">{{item.assessmentResult}}</view>
  30. </view>
  31. <view class="djhjList_title" v-if="item.assessmentResult=='不合格'">
  32. <view class="djhjList_text">原因</view>
  33. <view class="djhjList_righttext">{{item.resultContent}}</view>
  34. </view>
  35. </uni-card>
  36. <!-- 图片 -->
  37. <view class="image_upload" v-if="props.imageUrl.length!=0">
  38. <uni-card>
  39. <uni-section title="图片" type="line"></uni-section>
  40. <view class="img_upload">
  41. <uni-file-picker :readonly="true" limit="4" :modelValue="showImage(props.imageUrl)"></uni-file-picker>
  42. </view>
  43. </uni-card>
  44. </view>
  45. </view>
  46. <view v-else>
  47. <dataEmpty></dataEmpty>
  48. </view>
  49. <!-- 开始质控 -->
  50. <view class="finish_button"
  51. v-if="props.taskStatus!='7004' && props.taskStatus!='7007' && props.taskStatus!='7008' && props.taskStatus!='7009' && props.taskStatus!='7010'">
  52. <button class="button" @click="startTask()">开始质控</button>
  53. </view>
  54. </view>
  55. </template>
  56. <script setup>
  57. import { reactive } from "vue";
  58. import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
  59. import http from '@/utils/request';
  60. import dataEmpty from "@/pages/ypczk/zkTask/zkTaskDetail/noStartTaskDetail.vue";
  61. import {uploadImageModelValue} from '@/pages/controls/image/OssService'
  62. import { UrlPath } from "@/utils/commonuni"
  63. const props = defineProps({
  64. // 环境质控详情列表
  65. hjTaskList: Array,
  66. // 图片url
  67. imageUrl:Array,
  68. // 环境质控不合格数
  69. hjbhg: Number,
  70. // 创建人
  71. creatorName:String,
  72. // 任务状态
  73. taskStatus:String
  74. });
  75. // 开始质控
  76. const startTask=()=>{
  77. uni.$emit("startTaskInfo")
  78. }
  79. // 显示图片
  80. const showImage=(urlStr)=>{
  81. const filesArray = urlStr.split(',');
  82. const rawPrefix = UrlPath.getBaseUrl()
  83. const prefix = rawPrefix.replace(/\/+$/, '');
  84. const result = filesArray.map(url => {
  85. return prefix + url;
  86. });
  87. return result;
  88. }
  89. const wcnumber = () =>{
  90. let wcNumber = 0;
  91. props.hjTaskList.forEach(a =>{
  92. if (a.assessmentResult != '待检') wcNumber ++;
  93. })
  94. return wcNumber;
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. @import './index.scss';
  99. </style>