spotCheckDetails.vue 2.8 KB

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