chenyc
2024-12-25 21ef2641f0292f01cb0bb362c24b30b5014dae8e
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
88
89
90
91
92
93
94
95
96
97
<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>