<template>
	<view style="width: 100%;height: 100%;background-color: #F6F6F6;">
		<u-gap height="30" bg-color="#f6f6f6"></u-gap>
		<view style="padding: 20rpx 28rpx;background-color: #FFFFFF;">
			<!-- 头部 -->
			<view class="flex align-center" style="font-weight: bold;font-size: 30rpx;margin:30rpx 0;">
				<view style="width: 25%;">订单号:</view>
				<view style="width: 50%;">{{orderID}}</view>
				<view style="width: 25%;" class="flex justify-center">
					<view class="but">意见单</view>
				</view>
			</view>
			<!-- 线 -->
			<u-line color="#dadada" />
			<!-- 中部内容 -->
			<view style="font-size: 26rpx;background-color: #FFFFFF;">
				<view class="nr">
					<view class="left">病症:</view>
					<view class="right">{{bz}}</view>
				</view>
				<view class="nr">
					<view class="left">病因:</view>
					<view class="right">{{by}}</view>
				</view>
				<view class="nr">
					<view class="left">身份证号:</view>
					<view class="right">{{ID}}</view>
				</view>
				<view class="nr">
					<view class="left">结论建议:</view>
					<view class="right">{{jielun}}</view>
				</view>
			</view>
		</view>

		<u-gap height="30" bg-color="#f6f6f6"></u-gap>
		<!-- 客户资料 -->
		<view class="" style="background-color: #FFFFFF;padding: 10rpx 28rpx;">
			<view class="nr">
				<view class="left">下单客户:</view>
				<view class="right">{{xiadankh}}</view>
			</view>
			<view class="nr">
				<view class="left">填写时间:</view>
				<view class="right">{{time}}</view>
			</view>
		</view>

		<u-gap height="30" bg-color="#f6f6f6"></u-gap>
		<!-- 补充 -->
		<view style="background-color: #FFFFFF;padding: 10rpx 28rpx;">
			<view class="nr">
				<view class="left" style="font-size: 30rpx;font-weight: bold;color: #000000;">补充意见</view>
				<view class="right" style="display: flex;flex-direction: row-reverse;">
					<view class="but" @click="addyj">补充意见</view>
				</view>
			</view>
			
			<view v-for="(item,index) in byList" :key='index'>
				<view class="">
					<view class="nr">
						<view class="left">补充原因:</view>
						<view class="right">{{item.supplement_reason}}</view>
					</view>
					<view class="nr">
						<view class="left">补充内容:</view>
						<view class="right">{{item.supplement_content}}</view>
					</view>
				</view>
			</view>
			
			
			
			
		</view>
	</view>
</template>

<script>
	export default {
		onLoad(options) {
			let id = options.id
			
			if(id!='' && typeof id!=undefined){
				this.getDetaile(id);
				
			}
			
			this.sugg_id = options.id;
			// console.log(options)
		},
		mounted() {

		},
		data() {
			return {
				sugg_id:'',
				name: '',
				xiadankh: '',
				age: '',
				orderID: '',
				time: '',
				bz: '',
				by: '',
				ID: '',
				jielun: '',
				byList:[],
			}
		},
		methods: {
			// 补充意见
			addyj(e) {

			},
			getDetaile:async function(id){
				let res = await this.$request.post('suggest/getSuggestDetail',{'suggest_id':id});
				if(res.status==0 && res.data!=''){
					let data = res.data;
					this.name=data.patient_name;
					this.xiadankh=data.username;
					this.age=data.birthday;
					this.orderID=data.order_sn;
					this.time=data.created_at;
					this.bz=data.symptoms;
					this.by=data.pathogen;
					this.ID=data.patient_card_number;
					this.jielun=data.suggest;
					this.byList=data.details;
					// this.bcneirong=data;
				}
				console.log('我是返回来的值',res);
			}

		}
	};
</script>

<style lang="scss">
	.but {
		padding: 16rpx 30rpx;
		border-radius: 20rpx;
		background-color: #eaeaea;
		height: 50rpx;
		color: b1b1b1;
		display: flex;
		justify-content: center;
		align-items: center;
		font-weight: 400;
		font-size: 28rpx;
	}

	.nr {
		margin: 28rpx 0;
		display: flex;

		.left {
			width: 25%;
			color: #666666;
		}

		.right {
			width: 75%;
		}
	}
</style>
