shopTourDetails.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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.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. display: flex;
  94. justify-content: space-between;
  95. .scroll-con-l{
  96. display: inline-block;
  97. width: 28%;
  98. height: 99%;
  99. margin: 1% 1% 0;
  100. box-sizing: border-box;
  101. .item-con{
  102. .item-tit{
  103. text-align: center;
  104. padding: 26upx 0;
  105. margin-bottom: 12upx;
  106. background-color: #fff;
  107. position: relative;
  108. &:before{
  109. content: '';
  110. background-color: #fff;
  111. width: 8upx;
  112. height: 50upx;
  113. display: block;
  114. position: absolute;
  115. right: 0;
  116. top: 18upx;
  117. }
  118. }
  119. .item-tit.active{
  120. &:before{
  121. background-color: #fa3534;
  122. }
  123. }
  124. }
  125. }
  126. .scroll-con-r{
  127. display: inline-block;
  128. width: 68%;
  129. height: 99%;
  130. margin: 1% 1% 0 0;
  131. .item-con{
  132. padding: 14upx 30upx;
  133. margin-bottom: 18upx;
  134. border-radius: 12upx;
  135. background-color: #fff;
  136. .item-tit{
  137. font-weight: bold;
  138. }
  139. .item-main{
  140. padding: 14upx 0;
  141. display: flex;
  142. justify-content: space-between;
  143. .item-state{
  144. font-size: 26upx;
  145. text.green{
  146. color: #19be6b;
  147. }
  148. text.yellow{
  149. color: #ff9900;
  150. }
  151. text.red{
  152. color: #fa3534;
  153. }
  154. }
  155. .item-btn{
  156. font-size: 24upx;
  157. color: #2979ff;
  158. }
  159. }
  160. .item-footer{
  161. font-size: 24upx;
  162. color: #464646;
  163. }
  164. }
  165. }
  166. }
  167. </style>