<template>
	<view>
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index" @click="go_approval(item.flow_set_id,item.flow_set_name)">
				<view class="title">{{item.flow_set_name}}</view>
				<view class="box">
					<view class="left">
						<view class="line">申请人：{{item.optname}}</view>
						<view class="line">单号：{{item.flow_set_id}}</view>
						<view class="line">申请日期：{{item.optdt}}</view>
					</view>
				</view>
				<view class="tip" v-if="item.status == 0">待审核</view>
				<view class="tip" v-if="item.status == 1" style="background-color: #67C23A;">已通过</view>
				<view class="tip" v-if="item.status == 2" style="background-color: #F56C6C;">已驳回</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			};
		},
		onLoad() {
			this.get_workflow_get_check_list()
		},
		methods:{
			get_workflow_get_check_list(){
				this.$api.workflow_get_check_list({
					staff_num: uni.getStorageSync('user').staff_num,
					status:""
				}).then((res)=>{
					console.log(res.data.content.data)
					
					this.list = res.data.content.data
				})
			},
			
			// 前往审核
			go_approval(id,flow_set_name){
				uni.navigateTo({
					url:"./approval/approval?flow_set_id="+id+"&title="+flow_set_name
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F2FAF7;

		box-sizing: border-box;
		padding: 20rpx 25rpx;
	}

	.list {
		.item {
			position: relative;
			overflow: hidden;
			background-color: #FFFFFF;
			
			box-sizing: border-box;
			padding: 25rpx;

			border-radius: 15rpx;
			margin-bottom: 30rpx;
			
			.title{
				height: 70rpx;
				line-height: 70rpx;
				font-size: 36rpx;
				font-weight: 700;
			}
			.box{
				margin-top: 10rpx;
				display: flex;
				justify-content: space-between;
				.left {
					height: 140rpx;
					
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					.line{
						font-size: 28rpx;
						color: #7f7f7f;
					}
				}
				
				.right {
					height: 140rpx;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					
					.btn{
						font-size: 28rpx;
						background-color: #E1F7FF;
						color: #1e88e5;
						padding: 10rpx 30rpx;
						border-radius: 40rpx;
					}
				}
			}
			.tip{
				transform: rotate(45deg);
				
				background-color: #04A0E6;
				color: #FFFFFF;
				
				position: absolute;
				top: -10rpx;
				right: -50rpx;
				
				font-size: 24rpx;
				padding: 30rpx 40rpx 10rpx;
				
			}
		}
	}
</style>
