djhjTaskDetail.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="djhjTaskDetail">
  3. <!-- 任务进度 -->
  4. <view class="djhjTaskDetail_progress">
  5. <text class="djhjTaskDetail_progress_title">任务进度:<text class="djhjTaskDetail_progress_text">4/10</text></text>
  6. <text class="djhjTaskDetail_progress_title">不合格数<text class="djhjTaskDetail_progress_text">1</text></text>
  7. </view>
  8. <!-- 创建人 -->
  9. <view class="creator">
  10. <text class="creator_title">创建人<text class="creator_text">张星</text></text>
  11. </view>
  12. <!-- 检查结果 -->
  13. <uni-card padding="0" spacing="0" v-for="(item,index) in pageData.djhjList" class="djhjList">
  14. <view class="djhjList_title">
  15. <view class="djhjList_text">检查项目</view>
  16. <view class="djhjList_righttext">{{item.item}}</view>
  17. </view>
  18. <view class="djhjList_title">
  19. <view class="djhjList_text">检查方式</view>
  20. <view class="djhjList_righttext">{{item.mean}}</view>
  21. </view>
  22. <view class="djhjList_title">
  23. <view class="djhjList_text">检查内容</view>
  24. <view class="djhjList_righttext">{{item.content}}</view>
  25. </view>
  26. <view class="djhjList_title">
  27. <view class="djhjList_text">检查结果</view>
  28. <view class="djhjList_righttext" :class="item.result=='不合格'? 'djhjList_redtext' : 'djhjList_righttext'">{{item.result}}</view>
  29. </view>
  30. <view class="djhjList_title" v-if="item.result=='不合格'">
  31. <view class="djhjList_text">原因</view>
  32. <view class="djhjList_righttext">{{item.reason}}</view>
  33. </view>
  34. </uni-card>
  35. <!-- 图片上传 -->
  36. <view class="image_upload">
  37. <uni-card>
  38. <uni-section title="图片上传" type="line"></uni-section>
  39. <view class="img_upload">
  40. <uni-file-picker limit="4" :v-model="pageData.imageList" @select="selectImg" @delete="deleteImg"></uni-file-picker>
  41. </view>
  42. </uni-card>
  43. </view>
  44. </view>
  45. </template>
  46. <script setup>
  47. import { reactive } from "vue";
  48. const pageData=reactive({
  49. djhjList:[
  50. {
  51. item:'项目111',
  52. mean:'方式1111',
  53. content:'内容1111',
  54. result:'结果1111',
  55. reason:'原因1111'
  56. },
  57. {
  58. item:'项目222',
  59. mean:'方式2222',
  60. content:'内容2222',
  61. result:'结果2222',
  62. reason:'原因2222'
  63. }
  64. ],
  65. imageList:[]
  66. })
  67. // 选中图片,将选中的图片添加列表
  68. const selectImg=(e)=>{
  69. console.log(e)
  70. e.tempFiles.forEach(item=>{
  71. pageData.imageList.push(item)
  72. })
  73. }
  74. // 删除图片,并将其从列表中删除
  75. const deleteImg=(e)=>{
  76. console.log(e)
  77. let index=0
  78. index = pageData.imageList.indexOf(e.tempFilePaths)
  79. pageData.imageList.splice(index, 1)
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. @import './index.scss'
  84. </style>