<style lang="scss">
	.container{
		min-height:100%;
		background:#F6F6F6;
		padding:30rpx 0;
		.card{
			margin-top:0;
			&.info{
				view{
					display: flex;
					justify-content: space-between;
					height:80rpx;
					align-items: center;
					&+view{
						border-top:2rpx solid rgba(216, 216, 216, 0.3);
					}
				}
			}
			&.detail{
				.item{
					border-top:2rpx solid rgba(216, 216, 216, 0.6);
					padding:18rpx 0;
					&>.info{
						display: flex;
						margin-bottom:14rpx;
						text{
							&:first-child{
								color:#fff;
								font-size: 20rpx;
								width:80rpx;
								height:40rpx;
								line-height: 40rpx;
								text-align: center;
								background:#10C176;
								border-radius: 0px 20rpx 0px 20rpx;
								margin-right:16rpx;
							}
							&:nth-child(2){
								// line-height: 40rpx;
								&:after{
									content:"("attr(data-unit)")";
									color:#999;
									margin-left:7rpx;
									font-size:20rpx;
								}
							}
							&:nth-child(3){
								margin-left:auto;
								color:#999;
								font-size:24rpx;
								display: flex;
    							align-items: center;
								&:before{
									color:#10C176;
									font-size: 30rpx;
								}
							}
						}
					}
					&>.company{
						display: flex;
						text{
							color:var(--c);
							font-size:20rpx;
							
						}
					}
				}
				&>.plant-xinzeng{
					border-top:2rpx solid rgba(216, 216, 216, 0.6);
					text-align: center;
					color:#10C176;
					padding-top:20rpx;
					&:before{
						margin-right:12rpx;
					}
				}
			}
			&.type{
				.title_mast{
					margin-bottom:0;
					&:after{
						content:attr(data-type);
						color:#FBA83C;
						margin-left:auto;
					}
				}
			}
		}
	}
</style>
<template>
	<view class="container">
		<view class="card info">
			<view>
				<text>申请人</text> <text>{{info.name}}</text>
			</view>
			<view>
				<text>所在基地</text> <text>{{info.baseName}}</text>
			</view>
			<view>
				<text>申请时间</text> <text>{{new Date().format('yyyy-MM-dd')}}</text>
			</view>
		</view>

		<view class="card detail">
			<view class="title_mast">采购详情</view>
			
			<view class="item" v-for="i in 3">
				<view class="info">
					<text>化肥</text>
					<text data-unit="100kg/袋">中量元素水溶肥</text>
					<text class="plant-shanchu">删除</text>
				</view>
				<view class="company">
					<text style="--c:#707070;flex-shrink: 0;">云南云天化股份有限公司</text>
					<text style="--c:#FBA83C;flex-grow:1;text-align:center;">微量元素肥</text>
				</view>
			</view>

			<view class="plant-xinzeng" @click="$u.route({url:'pages/purchase/agrProdList'})">添加物品</view>
		</view>

		<view class="card type">
			<view class="title_mast" data-type="审核中">申请状态</view>
		</view>

		<button class="cu-btn round bg-green shadow submit" @click="submit">确定提交</button>
	</view>
</template>
<script>
import request from '@/common/request'
export default {
	data(){
		return{
			info:{},
		}
	},
	onLoad(){
		this.init()
	},
	methods:{
		async init(){
			//
			var res=await request("/api/purchase/purchaseUserShow")
			if(res.statu){
				this.info=res.data
			}else{
				uni.showModal({
					title:"提示",
					content:res.msg||"获取采购申请信息失败！",
					showCancel:false,
				})
			}
		},
		async submit(){
			var res=await request("/api/purchase/applicantStatus",{
				params:{
					status:2,
					purchaseId:"",
				}
			})
		},
	}
}
</script>