病人修改

This commit is contained in:
菲菲
2025-03-03 15:40:28 +08:00
parent 588ba04dee
commit 943f5c6417

View File

@@ -26,20 +26,21 @@
<el-table-column prop="idCard" label="身份证号" width="180" /> <el-table-column prop="idCard" label="身份证号" width="180" />
<el-table-column prop="busNo" label="病人ID" width="180" /> <el-table-column prop="busNo" label="病人ID" width="180" />
<el-table-column prop="name" label="病人名称" width="180" /> <el-table-column prop="name" label="病人名称" width="180" />
<el-table-column prop="genderEnum" label="性别" width="180" /> <el-table-column prop="genderEnum_text" label="性别" width="180" />
<el-table-column prop="maritalStatusEnum" label="婚姻状况" width="180" /><!--:formatter="formatMaritalStatus"--> <el-table-column prop="maritalStatusEnum_text" label="婚姻状况" width="180" /><!--:formatter="formatMaritalStatus"-->
<el-table-column prop="nationalityCode" label="民族" width="180" /> <el-table-column prop="nationalityCode" label="民族" width="180" />
<el-table-column prop="birthDate" label="生日" width="160" /> <el-table-column prop="birthDate" label="生日" width="160" />
<el-table-column prop="phone" label="电话" width="140" /> <el-table-column prop="phone" label="电话" width="140" />
<el-table-column prop="bloodAbo" label="血型ABO" width="140" /> <el-table-column prop="bloodAbo_text" label="血型ABO" width="140" />
<el-table-column prop="bloodRh" label="血型RH" width="140" /> <el-table-column prop="bloodRh_text" label="血型RH" width="140" />
<el-table-column prop="linkName" label="联系人" width="180" /> <el-table-column prop="linkName" label="联系人" width="180" />
<el-table-column prop="linkTelcom" label="联系人电话" width="180" /> <el-table-column prop="linkTelcom" label="联系人电话" width="180" />
<el-table-column prop="linkJsons" label="联系人关系" width="180" /> <el-table-column prop="linkRelationCode_text" label="联系人关系" width="180" />
<el-table-column prop="address" label="家庭地址" width="180" /> <el-table-column prop="address" label="家庭地址" width="180" />
<el-table-column prop="prfsEnum" label="职业" width="180" /> <el-table-column prop="prfsEnum_text" label="职业" width="180" />
<el-table-column prop="workCompany" label="工作单位" width="180" /> <el-table-column prop="workCompany" label="工作单位" width="180" />
<el-table-column prop="organizationName" label="登记医院" width="180" /> <el-table-column prop="organizationName" label="登记医院" width="180" />
<el-table-column prop="deceasedDate" label="死亡时间" width="180" />
<el-table-column prop="createTime" label="登记时间" width="180" /> <el-table-column prop="createTime" label="登记时间" width="180" />
<el-table-column label="操作" align="center" width="210" fixed="right" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" width="210" fixed="right" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
@@ -160,7 +161,7 @@
<el-form-item label="地址选择" prop="addressSelect"> <el-form-item label="地址选择" prop="addressSelect">
<!-- <RegionFullGroup v-model="form.addressSelectvalue" @change="handleChangeAddress" :disabled="isViewMode"/> --> <!-- <RegionFullGroup v-model="form.addressSelectvalue" @change="handleChangeAddress" :disabled="isViewMode"/> -->
<el-cascader :options="options" :props="{ checkStrictly: true, value: 'code', label: 'name' }" <el-cascader :options="options" :props="{ checkStrictly: true, value: 'code', label: 'name' }"
v-model="selectedOptions" @change="handleChange" > v-model="selectedOptions" @change="handleChange" :disabled="isViewMode">
<template #default="{ node, data }"> <template #default="{ node, data }">
<span>{{ data.name }}</span> <span>{{ data.name }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
@@ -237,6 +238,7 @@ const administrativegenderList = ref([]) //性别
const bloodtypeaboList = ref([]) //血型abo const bloodtypeaboList = ref([]) //血型abo
const bloodtypearhList = ref([]) //血型RH const bloodtypearhList = ref([]) //血型RH
const familyrelationshiptypeList = ref([]) //家庭关系 const familyrelationshiptypeList = ref([]) //家庭关系
const addressCom = ref("");
const options = ref(pcas); // 地区数据 const options = ref(pcas); // 地区数据
const selectedOptions = ref([]); // v-model 绑定的选中值 const selectedOptions = ref([]); // v-model 绑定的选中值
@@ -259,7 +261,7 @@ const data = reactive({
name: [{ required: true, message: "姓名不能为空", trigger: "blur" }], name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
idCard: [ idCard: [
{ required: true, message: '证件号码不能为空', trigger: 'blur' }, { required: true, message: '证件号码不能为空', trigger: 'blur' },
{ min: 18, message: '证件号码不能少于18位', trigger: 'blur' } { min: 18, message: '证件号码不能少于18位', trigger: 'blur' }
], ],
phone: [{ required: true, message: "联系方式不能为空", trigger: "blur" }], phone: [{ required: true, message: "联系方式不能为空", trigger: "blur" }],
}, },
@@ -275,6 +277,7 @@ const handleChange = () => {
form.value.addressCity = checkedNodes[1] || ''; form.value.addressCity = checkedNodes[1] || '';
form.value.addressDistrict = checkedNodes[2] || ''; form.value.addressDistrict = checkedNodes[2] || '';
form.value.addressStreet = checkedNodes[3] || ''; form.value.addressStreet = checkedNodes[3] || '';
form.value.address = '';
}; };
// 递归查找节点 // 递归查找节点
@@ -291,7 +294,6 @@ const findNodeByCode = (data, code) => {
/** 查询菜单列表 */ /** 查询菜单列表 */
function getList() { function getList() {
// console.log("v-region",RegionData)
listPatient(queryParams.value).then(response => { listPatient(queryParams.value).then(response => {
console.log("res",response,queryParams.value) console.log("res",response,queryParams.value)
patientList.value = response.data.records patientList.value = response.data.records
@@ -378,7 +380,8 @@ function handleSee(row){
/** 修改按钮操作 */ /** 修改按钮操作 */
function handleUpdate(row) { function handleUpdate(row) {
reset(); reset();
form.value = row; form.value = JSON.parse(JSON.stringify(row));
addressCom.value = row.addressProvince + row.addressCity + row.addressDistrict + row.addressStreet + row.address
const selectedOptions1 = ref([row.addressProvince,row.addressCity,row.addressDistrict,row.addressStreet]) const selectedOptions1 = ref([row.addressProvince,row.addressCity,row.addressDistrict,row.addressStreet])
const codes = convertAddressToCodes(selectedOptions1.value); const codes = convertAddressToCodes(selectedOptions1.value);
selectedOptions.value = codes.filter(code => code !== null); selectedOptions.value = codes.filter(code => code !== null);
@@ -417,17 +420,27 @@ function submitForm() {
proxy.$refs["patientRef"].validate(valid => { proxy.$refs["patientRef"].validate(valid => {
if (valid) { if (valid) {
if (form.value.busNo != undefined) { if (form.value.busNo != undefined) {
const newAddress = form.value.addressProvince+form.value.addressCity + form.value.addressDistrict + form.value.addressStreet + form.value.address
if (addressCom.value !== newAddress) {
console.log("6666666666", form.value.address,addressCom.value);
// 如果不一致,清空并重新赋值
form.value.address = newAddress;
console.log("地址已更新为:", form.value.address);
}
console.log("form.value.up",form.value) console.log("form.value.up",form.value)
updatePatient(form.value).then(response => { updatePatient(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
open.value = false; open.value = false;
reset()
getList(); getList();
}); });
} else { } else {
form.value.address = form.value.addressProvince+form.value.addressCity + form.value.addressDistrict + form.value.addressStreet + form.value.address
console.log("form.value",form.value) console.log("form.value",form.value)
addPatient(form.value).then(response => { addPatient(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
open.value = false; open.value = false;
reset()
getList(); getList();
}); });
} }