ViewPrescription.vue
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
<view class="slot-content" @click="emit('click')">
<view>
<view class="text mb24">问诊病情 :{{ PrescriptionDetail?.prescriptionForm || '病情描述' }}</view>
<view class="text mb24">处方药:</view>
<view class="list" v-if="PrescriptionDetail?.drugList?.length">
<view class="flexJ" v-for="(_, index) in PrescriptionDetail?.drugList" :key="index" style="margin-bottom: 42rpx">
<view>
<view class="blacktext" style="margin-bottom: 8rpx">{{ _.name || '药物名称' }}</view>
<view class="graytext">{{ _.des || '药物描述' }}</view>
</view>
<view>
<view class="blacktext" style="margin-bottom: 8rpx">¥{{ _.amount || 0 }}</view>
<view class="graytext">x{{ _.num || 0 }}</view>
</view>
</view>
</view>
<view v-else class="text">暂无处方药</view>
<view class="text mb24">处方单证明</view>
<view class="flexW" v-if="PrescriptionDetail?.prescriptionFile?.length">
<template v-for="_ in PrescriptionDetail?.prescriptionFile.split(',')">
<image :src="proxy.$h.downFile(_)" mode="aspectFill" class="zmimg" />
</template>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { onMounted, ref, getCurrentInstance, ComponentPublicInstance } from 'vue'
import { getPrescription_detail_information } from '../api'
import type { PrescriptionDetailType } from '../types'
interface IProps {
orderId: string | number
}
const props = defineProps<IProps>()
const emit = defineEmits(['click'])
const { proxy } = getCurrentInstance() as { proxy: ComponentPublicInstance }
const PrescriptionDetail = ref<PrescriptionDetailType>()
onMounted(() => {
viewPrescriptionDetailHandler()
})
const viewPrescriptionDetailHandler = async () => {
const { result }: { result: PrescriptionDetailType } = await getPrescription_detail_information({ id: props.orderId })
PrescriptionDetail.value = result
}
</script>
<style lang="scss" scoped>
.mb24 {
margin-bottom: 24rpx;
}
.text {
color: #323233;
font-size: 28rpx;
font-weight: 700;
}
.blacktext {
color: #323233;
font-size: 30rpx;
font-weight: 700;
}
.graytext {
color: #999999;
font-size: 24rpx;
font-weight: 700;
}
.list {
width: 460rpx;
box-sizing: border-box;
padding: 34rpx 28rpx;
background: #f8f8fa;
margin-bottom: 32rpx;
}
.zmimg {
width: 210rpx;
height: 210rpx;
border-radius: 24rpx;
margin-right: 16rpx;
}
</style>