2025-07-21 17:49:25 +08:00

144 lines
5.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="compact-form">
<el-col :span="24" :xs="24">
<el-form :model="labPat" label-width="100px" class="compact-form" label-position="left">
<el-form-item label="病人来源" label-width="70px">
<el-col :span="16">
<dict-input v-model="labPat.brly" :dict-type="'PT'" placeholder="请输入病人来源" :fetch-dict="fetchDict" @update:labelValue="(label) => labPat.brlyLabel = label" dialog-title="选择病人来源"/>
</el-col>
<el-col :span="8">
<el-switch v-model="labPat.jzbz" active-text="急诊" active-color="#FD0101"></el-switch>
</el-col>
</el-form-item>
<el-form-item label="病 历 号" label-width="70px">
<el-input v-model="labPat.brdh" placeholder="请输入病历号"></el-input>
</el-form-item>
<el-form-item label="姓 名" label-width="70px">
<el-input v-model="labPat.brxm" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="性 别" label-width="70px">
<el-col :span="8">
<dict-input v-model="labPat.brxb" placeholder="性别" :dict-type="'SX'" :fetch-dict="fetchDict" @update:labelValue="(label) => labPat.brxbLabel = label"/>
</el-col>
<el-col :span="4"><div>年龄</div></el-col>
<el-col :span="6">
<el-input v-model="labPat.nl" placeholder="年龄"></el-input>
</el-col>
<el-col :span="6">
<dict-input v-model="labPat.nldw" placeholder="年月" :dict-type="'AU'" :fetch-dict="fetchDict" @update:labelValue="(label) => labPat.nldwLabel = label"/>
</el-col>
</el-form-item>
<el-form-item label="送检科室" label-width="70px">
<dict-input v-model="labPat.ksdh" placeholder="请输入科室" :dict-type="'DP'" :fetch-dict="fetchDict" @update:labelValue="(label) => labPat.ksdhLabel = label"/>
</el-form-item>
<el-form-item label="床 号" label-width="70px">
<el-input v-model="labPat.ch" placeholder="请输入床号"></el-input>
</el-form-item>
<el-form-item label="样本类型" label-width="70px">
<dict-input v-model="labPat.yblx" placeholder="请输入样本类型" :dict-type="'BT'" :fetch-dict="fetchDict" @update:labelValue="(label) => labPat.yblxLabel = label"/>
</el-form-item>
<el-form-item label="申请医生" label-width="70px">
<dict-input v-model="labPat.sjys" placeholder="请输入申请医生" :dict-type="'SRD'" :fetch-dict="fetchDict" @update:labelValue="(label) => labPat.sjysLabel = label"/>
</el-form-item>
<el-form-item label="上机时间" label-width="70px">
<el-date-picker v-model="labPat.sqsj" type="datetime" placeholder="上机时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item label="采样时间" label-width="70px">
<el-date-picker v-model="labPat.cyrq" type="datetime" placeholder="采样时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item label="报告时间" label-width="70px">
<el-date-picker v-model="labPat.dysj" type="datetime" placeholder="报告时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item label="临床诊断" label-width="70px">
<el-input v-model="labPat.zd" placeholder="请输入临床诊断"></el-input>
</el-form-item>
<el-form-item label="备 注" label-width="70px">
<el-input v-model="labPat.bz" placeholder="请输入备注"></el-input>
</el-form-item>
<el-form-item label="检验医生" label-width="70px">
<el-input v-model="labPat.yhdh" placeholder="请输入检验医生"></el-input>
</el-form-item>
<el-form-item label="审核医生" label-width="70px">
<el-input v-model="labPat.hdys" placeholder="请输入审核医生"></el-input>
</el-form-item>
<el-form-item label="审核状态" >
<el-radio-group v-model="labPat.jgbz">
<el-radio :label="0">未审核</el-radio>
<el-radio :label="2">已审核</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div class="compact-form">
<el-button type="primary" @click="saveMain">保存</el-button>
<el-button @click="resetMain">重置</el-button>
</div>
</el-col>
</div>
</template>
<script setup>
import DictInput from './DictInput.vue';
const props = defineProps({
labPat: {
type: Object,
required: true
},
//结果主键
labPatKey:{
type: Array,
default: () => []
}
});
const emit = defineEmits(['update:labPat']);
// 通过inject获取全局方法
const comDict = inject('comDict');
// 保存方法
const saveMain = () => {
// 提交时可获取原始值(brly)和标签(brlyLabel)
console.log('提交数据:', {
rawValue: props.labPat.brly,
label: props.labPat.brlyLabel,
...props.labPat
});
// 实际项目中调用接口提交数据
};
// 重置方法
const resetMain = () => {
emit('update:labPat', {
brly: '',
brlyLabel: '',
ksdh: '',
ksdhLabel: '',
sjys: '',
sjysLabel: '',
brxb: '',
brxbLabel: '',
nldw: '',
nldwLabel: '',
yblx: '',
yblxLabel: '',
// 保留其他字段的默认值
...props.labPat,
jzbz: props.labPat.jzbz || 0,
jgbz: props.labPat.jgbz || 0
});
}
// 字典获取方法(适配子组件)
const fetchDict = async (dictType) => {
const dictRefs = await comDict(dictType);
// 根据实际字典结构返回数组(需与子组件匹配)
return dictRefs[dictType]?.value || [];
};
</script>
<style scoped lang="scss">
.compact-form .el-form-item {
margin-bottom: 10px;
}
.compact-form .el-form-item__label {
padding-bottom: 5px;
}
</style>