<template>
	<view class="container">
		<view class="center">
			<view class="auditList_item" v-for="(item,index) in auditList">
				<view class="flex">
					<view class="auditInfo">{{item.operatorName}}<span>{{item.endTime}}</span> </view>
				<view class="result reject" v-if="!item.approved">驳回</view>
				<view class="result adopt" v-if="item.approved">通过</view>
				</view>
				
				<view class="opinion">
					{{item.auditMind}}
				</view>
			</view>
			<view class="auditList_item" v-if="show">
			<u-empty
			        mode="data"
			        icon="http://cdn.uviewui.com/uview/empty/car.png">
			</u-empty>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				workflowId: "",
				id: "",
				auditList: [],
				show:false,
			}
		},
		onLoad(options) {
			this.id = options.id
			this.workflowId = options.workflowId
		},
		onShow() {
			this.getList()
		},
		methods: {
			getList() {
				this.$api.doRequest('get', '/workflowHistory/query/taskHistories', {
					businessKey: this.id,
					workflowId: this.workflowId
				}).then(res => {
					this.auditList = res.data.data
					if(this.auditList.length == 0 ){
						this.show = true
					}
				}).catch(res => {
					if (res.errmsg) {
						uni.showToast({
							title: res.errmsg,
							icon: 'none',
							duration: 2000
						})
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 20rpx 12rpx 250rpx 12rpx;
	}

	.center {
		background: #fff;
		margin: 10px;
		border-radius: 10px;
		padding: 20rpx 30rpx;

		.auditList_item {
			padding: 40rpx 10rpx;
			width: 100%;
			border-bottom: 2rpx solid #EEEEEE;
			// display: flex;
			.auditInfo {
				width: 90%;	
				font-size: 34rpx;
				font-weight: 600;
				span{
					font-size: 26rpx;
					margin-left: 30rpx;
					font-weight: 500;
				}
			}
			.result {
				width: 10%;
				display: flex;
				justify-content: flex-end;
				font-size: 30rpx;
			}
			.reject{
				color: #FE6430;
			}
			.adopt{
				color: #22C572;
			}
			.opinion{
				width: 100%;
				color: #AFB3BF;
				font-size: 26rpx;
				margin-top: 40rpx;
				padding: 0 10rpx;
			}
		}
	}
</style>
