<template>
  <view class="main">
		<uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" status-bar left-icon="left" left-text="返回" :leftWidth=120 :rightWidth=120 :height=100 :width="1200"
			title="处方详情" @clickLeft="handleBack"
		/>
		
		<view class="content">
			<view class="header">
				<view class="ti">
					<view class="left">
						<view class="baracode">
							<w-barcode :options="preseObj"></w-barcode>
							<view class="barnum">{{v.preNo}}</view>
						</view>
					</view>
					<view class="mid">
						<text class="title">中药处方笺</text>	
					</view>
					<view class="rig"><text class="title">{{v.pres_type}}</text></view>
				</view>
				<view class="patiinfo">
					<view class="r1">
						<view class="row">姓名：{{v.name}}</view>
						<view class="row">性别：{{v.sex}}</view>
						<view class="row">年龄：{{v.age}}岁</view>
						<view class="row">电话：{{v.tel}}</view>
						<view class="row">当前处方状态：{{v.pres_status}}</view>
					</view>
					<view class="r2">
						<view class="row">就诊科室：{{v.office}}</view>
						<view class="row">临床诊断：{{v.dis_name}}—{{v.sym_name}}</view>
						<view class="row">开方时间：{{v.prescriptionTime}}</view>
					</view>
					<view class="r3">联系地址：{{v.addr}}</view>
				</view>
			</view>
			<view class="rp">
				<view class="title">
					<text class="text">Rp:</text>
				</view>
				<view class="lists">
					<view class="item"  v-for="(x, i) in v.rp" :key="i">
						<view class="le">{{x.name}} {{x.num}}</view>
						<view class="rig">
							<view class="up"> {{x.tips}}</view>
							<view class="do"> {{x.sign}}</view>
						</view>
					</view>
				</view>
				<view class="footer">
					<view class="js">
						剂数：{{v.pies}}
						<view v-if="v.pies_tips!==''" class="pies_tips">
							({{v.pies_tips}})
						</view>
					</view>
					<view class="js">{{v.med_type}}</view>
					<view class="js">{{v.eat_type}}</view>
					<view class="js">每次{{v.capa}}</view>
					<view class="js">{{v.freque}}</view>
					<view class="freque">{{v.eat_tips}}</view>
				</view>
				<view class="rp-tips">{{v.rp_tips}}</view>
			</view>
			<view class="amountarea">
				<view class="amount">
					<view class="r1">
						<view class="pijw">药品金额：{{v.money.drugs_amount}}</view>
					</view>
					<view class="r2">
						<view class="jyf">煎药费：{{v.money.cook_fee}}</view>
						<view class="psf">配送费：{{v.money.delie_fee}}</view>
					</view>
					<view class="r3">
						总金额：{{v.money.summary}}
						<!-- <view class="zjw"></view> -->
					</view>
				</view>
				<view class="service">
					<view class="kf">开方：{{v.service.extra_doc}}</view>
					<view class="kf">审核：{{v.service.check_doc}}</view>
					<view class="kf">调配：{{v.service.depoly}}</view>
					<view class="kf">复核：{{v.service.review}}</view>
					<view class="kf">浸泡：{{v.service.steep}}</view>
					<view class="kf">煎煮：{{v.service.cook}}</view>
					<view class="kf">打包：{{v.service.pack}}</view>
					<view class="kf">发药：{{v.service.dispen}}</view>
				</view>
			</view>
			<view class="comment">
				<view class="z">注：</view>
				<text>{{v.comment}}</text>
			</view>
		</view>
  </view>
</template>

<script>
  export default {
    name: ''
  }
</script>

<script setup>
import { onMounted, ref } from 'vue'
import { selectOrderDetail } from "@/static/api.js"
import { onLoad } from '@dcloudio/uni-app'

const preseObj = ref({
		code: '11220822134401',
		color:['#000'], // 条形码的颜色
		bgColor: '#FFFFFF', // 背景色
		width: 200, // 宽度
		height: 50 // 高度
})
const barOpations = ref({
	height: 80,
	displayValue: false
})

const v=ref({
	pres_id:11220822134401,
	pres_type:'普通处方',
	name:'李某',
	sex:'男',
	age:35,
	tel:'13888888888',
	pres_status: '发药',
	office:'中医内科',
	dis_name:'胃脘痛病',
	sym_name:'脾胃虚寒证',
	prescriptionTime:'2023-06-01 15:58',
	addr:'浙江省某某事某某去某某事中医院门诊楼三楼302是',
	rp:[
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'先煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'先煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'包煎',sign:''},
		{name:'车前子',num:'6g',tips:'包煎',sign:''},
		{name:'车前子',num:'6g',tips:'包煎',sign:''},
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'先煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'先煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'先煎',sign:''},
		{name:'车前子',num:'6g',tips:'包煎',sign:''},
		{name:'车前子',num:'6g',tips:'包煎',sign:''},
		{name:'车前子',num:'6g',tips:'包煎',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''},
		{name:'车前子',num:'6g',tips:'',sign:''}
	],
	pies:3,
	pies_tips:'待见',
	med_type:'汤剂',
	eat_type:'煎服',
	capa:'200ml',
	freque:'一日三次',
	eat_tips:'饭后服',
	rp_tips:'注意多休息，饮食清单。',
	money:{
		drugs_amount: 187.00,
		cook_fee:30.00,
		delie_fee:10.00,
		summary: 227.00,
	},
	service:{
		extra_doc:'A医生',
		check_doc:'B医生',
		depoly:'调陪人',
		review:'复核人',
		steep:'浸泡',
		cook:'煎煮人',
		pack:'大宝人',
		dispen:'发药人',
	},
	comment:'1、本处方当日有效\n  2、取药时请您当面核对。。。。 \n  3、延长处方用量时间原油：慢性病 其他老年病 外地 其他'
})
onMounted(() => {

})

onLoad(async() => {
	const params = {
		token: token,
		data: {
			id: userId,
		}
	}
	const {data:res } = selectOrderDetail(params)
	if (res.code === 200) {
		v.prescriptionTime = res.data.prescriptionTime,
		v.value.name = res.data.name,
		v.value.sex = res.data.sex,
		v.value.age = res.data.age,
		v.value.deployState = res.data.deployState,
		v.value.disName = res.data.disName,
		v.value.symName = res.data.symName,
		v.value.preNo = res.data.preNo,
		v.value.department = res.data.department,
		v.value.dosageForm = res.data.dosageForm,
		v.value.number = res.data.number,
		v.value.prescriptionSum = res.data.prescriptionSum,
		v.value.prescriptionTotalSum = res.data.prescriptionTotalSum,
		v.value.daijianCost = res.data.daijianCost,
		v.value.distributionCost = res.data.distributionCost,
		v.value.entrust = res.data.entrust,
		v.value.rp = res.data.detailList
		
		
		preseObj.value.code = res.data.preNo,
	}
})

const handleBack =()=>{
	uni.navigateBack({
		delta: 1
	})
}

</script>

<style lang="scss">
.main {
	display: flex;
	flex-direction:column;
	justify-content:flex-start;
	height: 2000px;
	width: 1200px;
	.content{
		margin: 10px;
		background-color: #fff;
		flex-direction:column;
		align-items: center;
		.header{
			display: flex;
			flex-direction:column;
			margin:16px 16px 0;
			.ti{
				display: flex;
				flex-direction:row;
				justify-content: space-between;
				.left{
					align-items: flex-start;
					.baracode{
						display: flex;
						flex-direction:column;
						width: 320px;
						// align-items: center;
						.barnum{
							width:320px;
							font-size: 40px;
							display: flex;
							justify-content:center;
							align-items: center;
							letter-spacing: 0.1em;
						}
					}
				}
				.mid{
					align-items: flex-start;
					justify-content:center;
					width:320px;
					display: flex;
					.title{
						font-size: 40px;
						margin-top: 20px;
						font-weight: 800;
					}
				}
				.rig{
					align-items: flex-start;
					justify-content:flex-end;
					width:320px;
					display: flex;
					.title{
						font-size: 26px;
						width: 60px;
						font-weight: 300;
					}
				}
			}
			.patiinfo{
				display: flex;
				flex-direction:column;
				margin-top: 5px;
				padding-bottom: 10px;
				border-bottom: 1px solid #000;
				.r1{
					display: flex;
					flex-direction:row;
					height: 50px;
					.row{
						font-size: 28px;
						font-weight: 400;
						margin-right: 30px;
					}
				}
				.r2{
					display: flex;
					flex-direction:row;
					margin-top: 5px;
					height: 50px;
					.row{
						font-size: 28px;
						font-weight: 400;
						margin-right: 20px;
					}
				}
				.r3{
					display: flex;
					flex-direction:row;
					height: 50px;
					margin-top: 5px;
					font-size: 28px;
					font-weight: 400;
				}
			}
		}
		.rp{
			display: flex;
			flex-direction:column;
			margin:0 16px 0;
			border-bottom: 1px solid #000;
			.title{
				font-size: 40px;
			}
			.lists{
				display: flex;
				flex-wrap: wrap;
				flex-direction: row;
				justify-content:flex-start;
				align-content:flex-start;
				margin-left:80px;
				// width: 1000px;
				// height: 1800px;
				.item{
					display: flex;
					justify-content:center;
					align-items: center;
					height:80px;
					width: 220px;
					margin-right: 40px;
					// flex-basis: 25%;
					.le{
						display: flex;
						width: 130px;
						font-size: 28px;
					}
					.rig{
						display: flex;
						flex-direction:column;
						margin-left: 10px;
						.up{
							width: 80px;
							height: 22px;
						}
						.do{
							width: 80px;
							height: 22px;
						}
					}
				}
			}
			.footer{
				margin: 20px 0 0 80px;
				display: flex;
				font-size: 25px;
				.js{
					display: flex;
					margin-right: 100px;
					.pies_tips{}
				}
				.freque{}
			}
			.rp-tips{
				display: flex;
				justify-content:flex-end;
				font-size: 25px;
			}
		}
		.amountarea{
			display: flex;
			margin: 10px 16px 0;
			padding-bottom: 10px;
			border-bottom: 1px solid #000;
			.amount{
				display: flex;
				flex-direction:column;
				.r1{
					border: 1px solid #000;
					font-size: 30px;
					width: 400px;
					display: flex;
					justify-content:center;
					align-items: center;
					height: 50px;
				}
				.r2{
					display: flex;
					justify-content:center;
					align-items: center;
					font-size: 30px;
					height: 50px;
					width: 400px;
					border-left: 1px solid #000;
					border-right: 1px solid #000;
					.jyf{
						
						width: 200px;
						display: flex;
						justify-content:center;
						align-items: center;
					}
					.psf{
						border-left: 1px solid #000;
						width: 201px;
						display: flex;
						justify-content:center;
						align-items: center;
					}
				}
				.r3{
					display: flex;
					justify-content:center;
					height: 50px;
					align-items: center;
					font-size: 30px;
					border: 1px solid #000;
				}
			}
			.service{
				display: flex;
				flex-wrap: wrap;
				margin-left: 50px;
				.kf{
					font-size: 30px;
					margin-right: 55px;
				}
			}
		}
		.comment{
			margin: 10px 16px 10px;
			font-size: 30px;
			line-height: 50px;
			display: flex;
		}
	}
	
	
	
}


</style>
