门诊挂号项目画面 up by dh

This commit is contained in:
duhe
2025-03-07 17:52:35 +08:00
parent 6547415f8a
commit ac63ce64c6
14 changed files with 1582 additions and 165 deletions

View File

@@ -0,0 +1,174 @@
<template>
<div class="app-container">
<el-dialog :title="title" v-model="visible" width="800px" append-to-body>
<el-table
:data="patientInfoList"
@selection-change="handleSelectionChange"
width="90%"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="患者姓名"
align="center"
key="name"
prop="name"
:show-overflow-tooltip="true"
/>
<el-table-column
label="性别"
align="center"
key="genderEnum_enumText"
prop="genderEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="身份证号"
align="center"
key="idCard"
prop="idCard"
:show-overflow-tooltip="true"
/>
<el-table-column
label="电话"
align="center"
key="phone"
prop="phone"
:show-overflow-tooltip="true"
width="100"
/>
<el-table-column
label="生日"
align="center"
key="birthDate"
prop="birthDate"
:show-overflow-tooltip="true"
width="50"
/>
<el-table-column
label="年龄"
align="center"
key="age"
prop="age"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="PatientInfoDialog">
import {
getOutpatientRegistrationList,
} from "./outpatientregistration";
const { proxy } = getCurrentInstance();
const patientInfoList = ref([]);
const selectedData = ref([]); // 存储选择的行数据
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("病人信息");
const visible = ref(false);
const emits = defineEmits(['submit']); // 声明自定义事件
const data = reactive({
form: {},
queryParams: {
pageNo: 1,
pageSize: 50,
searchKey: undefined, // 品名/商品名/英文品名/编码/拼音
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
const props = defineProps({
patientInfoData: {
type: Object,
required: false,
default: () => ({}), // 提供默认值
},
searchInfo: {
type: String,
required: true,
default: "",
},
});
// 显示弹框
function show() {
patientInfoList.value = props.patientInfoData.records;
total.value = props.patientInfoData.total;
console.log(props.patientInfoData, "props.patientInfoData");
visible.value = true;
}
/** 查询病种目录列表 */
function getList() {
const query = {
searchKey: props.searchInfo,
pageNo: queryParams.value.pageNo,
pageSize: queryParams.value.pageSize,
};
getOutpatientRegistrationList(query).then((res) => {
if (res.data.records.length > 0) {
patientInfoList.value = res.data.records;
total.value = res.data.total;
console.log(patientInfoList.value, "patientInfoList.value");
}
});
}
/** 选择条数 */
function handleSelectionChange(selection) {
console.log(selection, "selection");
selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 取消按钮 */
function cancel() {
visible.value = false;
patientInfoList.value = [];
}
/** 提交按钮 */
function submitForm() {
if (selectedData.value.length > 1) {
proxy.$modal.msgSuccess("只能选中一条数据操作!");
} else if (selectedData.value.length === 1) {
console.log(selectedData.value[0], "selectedData.value");
const data = selectedData.value[0];
// 将表单数据发送给父组件
emits("submit", data);
}
visible.value = false;
}
defineExpose({
show,
});
</script>
<style scoped>
.el-form--inline .el-form-item {
display: inline-flex;
vertical-align: middle;
margin-right: 10px !important;
}
</style>