shopTourDetails.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="shopTourDetails-wrap">
  3. <scroll-view scroll-y class="scroll-con-l">
  4. <view class="item-con" v-for="(item, index) in itemList" :key="index">
  5. <view :class="['item-tit', nowInd==index ? 'active' : '']" @click="changeType(index)">{{item.assessItemName}}</view>
  6. </view>
  7. </scroll-view>
  8. <scroll-view scroll-y class="scroll-con-r">
  9. <view class="item-con" v-for="(item, index) in evaluationItemsList" :key="index">
  10. <view class="item-tit">{{item.assessTargetName}}</view>
  11. <view class="item-main">
  12. <view class="item-state">状态:
  13. <text :class="item.result == 'PASS' ? 'green' : item.result == 'NOT_PASS' ? 'red' : item.result == 'NOT_WORK' ? 'yellow' : ''">{{item.resultDictValue}}</text>
  14. </view>
  15. <text v-if="item.comments || item.taskTargetPhotoList" class="item-btn" @click="getComments(item)">查看评论</text>
  16. </view>
  17. <view class="item-footer">
  18. 考核时间:2020-09-09 14:29
  19. </view>
  20. </view>
  21. <u-empty text="暂无数据" img-width="120" v-if="evaluationItemsList.length == 0" mode="list"></u-empty>
  22. </scroll-view>
  23. <!-- 查看评论 -->
  24. <comment-popup :openPopup="openPopup" :comments="comments" :taskTargetPhotoList="taskTargetPhotoList" @close="closePopup" />
  25. </view>
  26. </template>
  27. <script>
  28. import CommentPopup from './commentPopup.vue'
  29. import { getTaskItem } from '@/api/taskItem.js'
  30. export default{
  31. components: { CommentPopup },
  32. data(){
  33. return{
  34. itemList: [], // 考评项目
  35. evaluationItemsList: [], // 考评项
  36. nowInd: 0, // 当前考评分类
  37. openPopup: false, // 查看评论
  38. detail: null, // 详情
  39. taskId: '', // 任务id
  40. comments: '', // 评论
  41. taskTargetPhotoList: [], // 评论图片
  42. }
  43. },
  44. onLoad(opts) {
  45. this.taskId = opts.taskId
  46. this.getTaskItem()
  47. },
  48. methods: {
  49. // 获取详情
  50. getTaskItem(){
  51. getTaskItem({ id: this.taskId }).then(res => {
  52. if(res.status == 200){
  53. this.itemList = res.data
  54. this.nowInd = 0
  55. this.evaluationItemsList = this.itemList[this.nowInd].taskTargetVOList ? this.itemList[this.nowInd].taskTargetVOList : []
  56. }
  57. })
  58. },
  59. // 切换分类
  60. changeType(ind){
  61. this.nowInd = ind
  62. this.evaluationItemsList = this.itemList[this.nowInd].taskTargetVOList ? this.itemList[this.nowInd].taskTargetVOList : []
  63. },
  64. // 查看评论
  65. getComments(item){
  66. this.comments = item.comments ? item.comments : ''
  67. if(item.taskTargetPhotoList){
  68. let arr = []
  69. item.taskTargetPhotoList.map(params => {
  70. arr.push(params.photoBasePath + params.photoPath)
  71. })
  72. this.taskTargetPhotoList = arr
  73. }else{
  74. this.taskTargetPhotoList = []
  75. }
  76. this.openPopup = true
  77. },
  78. // 关闭 查看评论
  79. closePopup(){
  80. this.openPopup = false
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. page {
  87. background-color: #f8f8f8;
  88. height: calc(100vh - 48px);
  89. }
  90. .shopTourDetails-wrap{
  91. height: 100%;
  92. background-color: #f8f8f8;
  93. .scroll-con-l{
  94. display: inline-block;
  95. width: 28%;
  96. height: 99%;
  97. margin: 1% 1% 0;
  98. box-sizing: border-box;
  99. .item-con{
  100. .item-tit{
  101. text-align: center;
  102. padding: 26upx 0;
  103. margin-bottom: 12upx;
  104. background-color: #fff;
  105. position: relative;
  106. &:before{
  107. content: '';
  108. background-color: #fff;
  109. width: 8upx;
  110. height: 50upx;
  111. display: block;
  112. position: absolute;
  113. right: 0;
  114. top: 18upx;
  115. }
  116. }
  117. .item-tit.active{
  118. &:before{
  119. background-color: #fa3534;
  120. }
  121. }
  122. }
  123. }
  124. .scroll-con-r{
  125. display: inline-block;
  126. width: 69%;
  127. height: 99%;
  128. margin: 1% 1% 0 0;
  129. .item-con{
  130. padding: 14upx 30upx;
  131. margin-bottom: 18upx;
  132. border-radius: 12upx;
  133. background-color: #fff;
  134. .item-tit{
  135. font-weight: bold;
  136. }
  137. .item-main{
  138. padding: 14upx 0;
  139. display: flex;
  140. justify-content: space-between;
  141. .item-state{
  142. font-size: 26upx;
  143. text.green{
  144. color: #19be6b;
  145. }
  146. text.yellow{
  147. color: #ff9900;
  148. }
  149. text.red{
  150. color: #fa3534;
  151. }
  152. }
  153. .item-btn{
  154. font-size: 24upx;
  155. color: #2979ff;
  156. }
  157. }
  158. .item-footer{
  159. font-size: 24upx;
  160. color: #464646;
  161. }
  162. }
  163. }
  164. }
  165. </style>