<template>
|
<div>
|
<div v-if="patientsInfo.id">
|
<!-- <div> <el-button type="primary" @click="getData">刷新</el-button></div> -->
|
<el-table size="default" :data="state.tableData" stripe style="width: 100%" v-loading="state.loading" :height="tableHe">
|
<el-table-column fixed label="NO" type="index" widtd="80" >
|
<template #header>
|
<el-icon @click="getData"><RefreshRight /></el-icon>
|
</template>
|
|
</el-table-column>
|
<el-table-column prop="执行时间" label="用药时间" show-overflow-tooltip />
|
<el-table-column prop="drugName" :width="300" label="医嘱名称" show-overflow-tooltip >
|
<template #default="scope">
|
<el-tooltip placement="bottom">
|
<template #content> {{scope.row.isPushEveryTime===1?'每次都推送':scope.row.pushCondition}} </template>
|
<span :style="{color:scope.row.orderIsPush===true?'#67C23A': (scope.row.stopDoctor ? 'red' : '')}"> {{scope.row.drugName}}</span>
|
</el-tooltip>
|
|
</template>
|
</el-table-column>
|
<el-table-column :width="140" label="规格" show-overflow-tooltip>
|
<template #default="scope">
|
<span >
|
{{scope.row.drugSpec}}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="drugOrderInfo.orderUsage" label="单次用量" show-overflow-tooltip >
|
<template #default="scope">
|
<span v-if="scope.row.orderUsage!==0">
|
{{scope.row.orderUsage}}
|
{{scope.row.drugUnit}}
|
</span>
|
|
</template>
|
</el-table-column>
|
<el-table-column prop="drugFrom" label="给药途径" show-overflow-tooltip >
|
|
</el-table-column>
|
<el-table-column prop="orderFreq" label="执行频率" show-overflow-tooltip >
|
|
</el-table-column>
|
<el-table-column prop="orderDoctor" label="开嘱医生" >
|
|
</el-table-column>
|
</el-table>
|
</div>
|
<el-empty v-else description="无数据,请先选择患者"></el-empty>
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
import { storeToRefs } from 'pinia';
|
import { usePatientsInfo } from '/@/stores/patientsInfo';
|
import {patientDrugList3} from '/@/api/doctors_orders'
|
import { computed, reactive } from 'vue';
|
const storesPat = usePatientsInfo();
|
const { patientsInfo } = storeToRefs(storesPat);
|
const props = defineProps(['tableHeight'])
|
const state = reactive({
|
tableData:[],
|
loading:false,
|
})
|
const tableHe=computed(()=>{
|
return props.tableHeight-130
|
})
|
// 第一步:定义子组件里面的方法
|
const getData = (str: string) => {
|
console.log("子组件获取显示数据!" + str);
|
console.log(props.tableHeight)
|
var pam={
|
patientCode:patientsInfo.value.code,
|
page: 1,
|
size: 100,
|
orderType:1,
|
orderIsUse:2,
|
desc:1,
|
orderName:'',
|
}
|
state.loading=true
|
patientDrugList3(pam).then(re=>{
|
console.log(re)
|
state.tableData=re.data
|
|
}).finally(()=>{
|
state.loading=false
|
})
|
}
|
|
// 第二步:暴露方法
|
defineExpose({ getData })
|
</script>
|
|
<style scoped>
|
</style>
|