<template>
	<view>
		<view class="textbox">
			<textarea name="" maxlength="-1" v-model="content" placeholder="请输入审核意见" id="" class="textcontent"></textarea>
		</view>
		<view class="btn" @click="$noMultipleClicks(saveExamine)">确定</view>
	</view>
</template>

<script>
	import { netExamine } from '@/api/kehu.js'
	export default{
		data() {
			return{
				noClick:true,    //防止  重复点击
				status:'',    //1成功   2失败
				id:'',
				type:'',   //receivables 回款 contract 合同 consume 费用
				content:''
			}
		},
		onLoad(options) {
			this.status = options.status
			this.id = options.id
			this.type = options.type
		},
		onShow() {
			if(this.status == 1) {
				uni.setNavigationBarTitle({
					title:'通过审核'
				})
			}else{
				uni.setNavigationBarTitle({
					title:'拒绝审核'
				})
			}
		},
		methods:{
			saveExamine() {
				let params = {
					relation_type: this.type,
					relation_id:this.id,
					content:this.content,
					status: this.status
				}
				netExamine(params).then(res=>{
					uni.showToast({
						title:res.msg,
						icon:'none'
					})
					setTimeout(()=>{
						uni.navigateBack({
							delta:1
						})
					},2000)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.textbox{
		background:#fff;
		padding:20rpx 24rpx;
		// margin: 20rpx;
		.textcontent{
			width:94%;
			height:300rpx;
			border-radius: 8rpx;
			border:1rpx solid #CCCCCC;
			padding:20rpx;
			margin: 0 auto;
		}
	}
	.btn{
		width:680rpx;
		height:80rpx;
		border-radius: 40rpx;
		background:$uni-text-color;
		margin:100rpx auto;
		font-size:24rpx;
		color:#fff;
		text-align: center;
		line-height: 80rpx;
	}
</style>
