spotCheckDetails.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="spotCheckDetails-wrap">
  3. <view class="item-con" v-for="(item,index) in list" :key="index">
  4. <view class="item-header">
  5. <view class="header-l">
  6. <view class="item-c">
  7. {{item.assessTargetName}}
  8. </view>
  9. </view>
  10. <text :class="['header-r', item.result == 'PASS' ? 'green' : item.result == 'NOT_PASS' ? 'red' : item.result == 'NOT_WORK' ? 'yellow' : '']">{{item.resultDictValue ? item.resultDictValue : '状态:--'}}</text>
  11. </view>
  12. <view class="comment-con">
  13. <u-row gutter="16" class="pic-con">
  14. <u-col span="3" v-for="(pic, ind) in item.taskTargetPhotoList" :key="ind">
  15. <u-image class="pic" width="100%" height="150upx" :src="pic.photoPath" @click="clickPic(index, ind)"></u-image>
  16. </u-col>
  17. </u-row>
  18. <view class="comment-main">评论:{{item.comments ? item.comments : '--'}}</view>
  19. </view>
  20. </view>
  21. <view style="width: 100%;padding-top: 10vh;" v-if="list.length == 0">
  22. <u-empty text="暂无数据" img-width="120" mode="list"></u-empty>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { getTaskTargetById } from '@/api/taskTarget.js'
  28. export default{
  29. data(){
  30. return{
  31. list: [], // 列表数据
  32. taskId: '' // 任务id
  33. }
  34. },
  35. onLoad(opts) {
  36. this.taskId = opts.taskId ? opts.taskId : ''
  37. this.getDetails()
  38. },
  39. methods: {
  40. // 查看评论大图
  41. clickPic(index,ind){
  42. // 预览图片
  43. uni.previewImage({
  44. current: ind,
  45. urls: this.list[index].photoList
  46. })
  47. },
  48. // 获取详情
  49. getDetails(){
  50. getTaskTargetById({ taskId: this.taskId }).then(res => {
  51. if(res.status == 200){
  52. res.data.map(item => {
  53. if(item.taskTargetPhotoList){
  54. item.photoList = []
  55. item.taskTargetPhotoList.map(subItem => {
  56. item.photoList.push(subItem.photoPath)
  57. })
  58. }
  59. })
  60. this.list = res.data
  61. }
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. page {
  69. background-color: #f8f8f8;
  70. }
  71. .spotCheckDetails-wrap{
  72. padding-top: 20upx;
  73. .item-con{
  74. background-color: #fff;
  75. margin: 0 20upx 20upx;
  76. border: 1px solid #F8F8F8;
  77. border-radius: 6upx;
  78. box-shadow: 1px 1px 3px #eee;
  79. .item-header{
  80. display: flex;
  81. justify-content: space-between;
  82. padding: 20upx;
  83. border-bottom: 1px solid #F8F8F8;
  84. .header-l{
  85. flex-grow: 1;
  86. position: relative;
  87. .item-sub{
  88. position: absolute;
  89. left: 0;
  90. top: 0;
  91. width: 66upx;
  92. text-align: center;
  93. }
  94. .item-c{
  95. .item-c-tit{
  96. font-weight: bold;
  97. }
  98. }
  99. }
  100. .header-r{
  101. flex-shrink: 0;
  102. }
  103. .header-r.green{
  104. color: #19be6b;
  105. }
  106. .header-r.yellow{
  107. color: #ff9900;
  108. }
  109. .header-r.red{
  110. color: #fa3534;
  111. }
  112. }
  113. .comment-con{
  114. padding: 20upx;
  115. .comment-main{
  116. font-size: 26upx;
  117. padding: 16upx 20upx;
  118. line-height: 1.5em;
  119. margin-top: 20upx;
  120. .comment-tit{
  121. font-weight: bold;
  122. }
  123. .comment-txt{
  124. }
  125. }
  126. }
  127. }
  128. }
  129. </style>