ViewPrescription.vue 2.5 KB
<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>