spotCheckDetails.vue 2.9 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. <text class="item-sub">{{index + 1}}、</text>
  7. <view class="item-c">
  8. {{item.assessTargetName}}
  9. </view>
  10. </view>
  11. <text :class="['header-r', item.result == 'PASS' ? 'green' : item.result == 'NOT_PASS' ? 'red' : item.result == 'NOT_WORK' ? 'yellow' : '']">{{item.resultDictValue}}</text>
  12. </view>
  13. <view class="comment-con">
  14. <u-row gutter="16" class="pic-con">
  15. <u-col span="3" v-for="(pic, ind) in item.taskTargetPhotoList" :key="ind">
  16. <u-image class="pic" width="100%" height="150upx" :src="pic.photoPath" @click="clickPic(index, ind)"></u-image>
  17. </u-col>
  18. </u-row>
  19. <view class="comment-main">{{item.comments}}</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. // subItem.image = subItem.photoBasePath + subItem.photoPath
  55. item.photoList.push(subItem.photoPath)
  56. })
  57. }
  58. })
  59. this.list = res.data
  60. }
  61. })
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. page {
  68. background-color: #f8f8f8;
  69. height: calc(100vh - 44px);
  70. }
  71. .spotCheckDetails-wrap{
  72. padding-top: 20upx;
  73. .item-con{
  74. background-color: #fff;
  75. margin: 0 20upx 20upx;
  76. padding: 16upx 20upx 20upx;
  77. .item-header{
  78. display: flex;
  79. justify-content: space-between;
  80. .header-l{
  81. flex-grow: 1;
  82. position: relative;
  83. .item-sub{
  84. position: absolute;
  85. left: 0;
  86. top: 0;
  87. width: 66upx;
  88. text-align: center;
  89. }
  90. .item-c{
  91. padding-left: 66upx;
  92. .item-c-tit{
  93. font-weight: bold;
  94. }
  95. }
  96. }
  97. .header-r{
  98. flex-shrink: 0;
  99. }
  100. .header-r.green{
  101. color: #19be6b;
  102. }
  103. .header-r.yellow{
  104. color: #ff9900;
  105. }
  106. .header-r.red{
  107. color: #fa3534;
  108. }
  109. }
  110. .comment-con{
  111. .pic-con{
  112. margin: 20upx 0;
  113. }
  114. .comment-main{
  115. font-size: 26upx;
  116. padding: 16upx 20upx;
  117. line-height: 1.5em;
  118. border-radius: 12upx;
  119. background-color: #f8f8f8;
  120. .comment-tit{
  121. font-weight: bold;
  122. }
  123. .comment-txt{
  124. }
  125. }
  126. }
  127. }
  128. }
  129. </style>