123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <template>
- <view class="shopTourDetails-wrap">
- <scroll-view scroll-y class="scroll-con-l">
- <view class="item-con" v-for="(item, index) in itemList" :key="index">
- <view :class="['item-tit', nowInd==index ? 'active' : '']" @click="changeType(index)">{{item.assessItemName}}</view>
- </view>
- </scroll-view>
- <scroll-view scroll-y class="scroll-con-r">
- <view class="item-con" v-for="(item, index) in evaluationItemsList" :key="index">
- <view class="item-tit">{{item.assessTargetName}}</view>
- <view class="item-main">
- <view class="item-state">状态:
- <text :class="item.result == 'PASS' ? 'green' : item.result == 'NOT_PASS' ? 'red' : item.result == 'NOT_WORK' ? 'yellow' : ''">{{item.resultDictValue}}</text>
- </view>
- <text v-if="item.comments || item.taskTargetPhotoList" class="item-btn" @click="getComments(item)">查看评论</text>
- </view>
- <view class="item-footer">
- 考核时间:2020-09-09 14:29
- </view>
- </view>
- <u-empty text="暂无数据" img-width="120" v-if="evaluationItemsList.length == 0" mode="list"></u-empty>
- </scroll-view>
-
- <comment-popup :openPopup="openPopup" :comments="comments" :taskTargetPhotoList="taskTargetPhotoList" @close="closePopup" />
- </view>
- </template>
- <script>
- import CommentPopup from './commentPopup.vue'
- import { getTaskItem } from '@/api/taskItem.js'
- export default{
- components: { CommentPopup },
- data(){
- return{
- itemList: [],
- evaluationItemsList: [],
- nowInd: 0,
- openPopup: false,
- detail: null,
- taskId: '',
- comments: '',
- taskTargetPhotoList: [],
- }
- },
- onLoad(opts) {
- this.taskId = opts.taskId
- this.getTaskItem()
- },
- methods: {
- getTaskItem(){
- getTaskItem({ id: this.taskId }).then(res => {
- if(res.status == 200){
- this.itemList = res.data
- this.nowInd = 0
- this.evaluationItemsList = this.itemList[this.nowInd].taskTargetVOList ? this.itemList[this.nowInd].taskTargetVOList : []
- }
- })
- },
-
- changeType(ind){
- this.nowInd = ind
- this.evaluationItemsList = this.itemList[this.nowInd].taskTargetVOList ? this.itemList[this.nowInd].taskTargetVOList : []
- },
-
- getComments(item){
- this.comments = item.comments ? item.comments : ''
- if(item.taskTargetPhotoList){
- let arr = []
- item.taskTargetPhotoList.map(params => {
- arr.push(params.photoBasePath + params.photoPath)
- })
- this.taskTargetPhotoList = arr
- }else{
- this.taskTargetPhotoList = []
- }
- this.openPopup = true
- },
-
- closePopup(){
- this.openPopup = false
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #f8f8f8;
- height: calc(100vh - 48px);
- }
- .shopTourDetails-wrap{
- height: 100%;
- background-color: #f8f8f8;
- .scroll-con-l{
- display: inline-block;
- width: 28%;
- height: 99%;
- margin: 1% 1% 0;
- box-sizing: border-box;
- .item-con{
- .item-tit{
- text-align: center;
- padding: 26upx 0;
- margin-bottom: 12upx;
- background-color: #fff;
- position: relative;
- &:before{
- content: '';
- background-color: #fff;
- width: 8upx;
- height: 50upx;
- display: block;
- position: absolute;
- right: 0;
- top: 18upx;
- }
- }
- .item-tit.active{
- &:before{
- background-color: #fa3534;
- }
- }
- }
- }
- .scroll-con-r{
- display: inline-block;
- width: 69%;
- height: 99%;
- margin: 1% 1% 0 0;
- .item-con{
- padding: 14upx 30upx;
- margin-bottom: 18upx;
- border-radius: 12upx;
- background-color: #fff;
- .item-tit{
- font-weight: bold;
- }
- .item-main{
- padding: 14upx 0;
- display: flex;
- justify-content: space-between;
- .item-state{
- font-size: 26upx;
- text.green{
- color: #19be6b;
- }
- text.yellow{
- color: #ff9900;
- }
- text.red{
- color: #fa3534;
- }
- }
- .item-btn{
- font-size: 24upx;
- color: #2979ff;
- }
- }
- .item-footer{
- font-size: 24upx;
- color: #464646;
- }
- }
- }
- }
- </style>
|