患者管理

This commit is contained in:
shidongli 2024-12-02 17:54:53 +08:00
parent 7fae09d0e9
commit 657d09468c

View File

@ -49,14 +49,13 @@
</Button> </Button>
</div> </div>
<!-- 导入--> <!-- 导入添加-->
<el-dialog title="导入" :visible.sync="open" width="600px" append-to-body> <el-dialog title="导入" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="110px">
<div v-for="(item, index) in form.deptAliasVOS" :key="index">
<el-form-item <el-form-item
v-for="(item, index) in form.deptAliasVOS" required
:key="index"
:rules="rules.deptAliasVOS.departmentName"
:prop="`deptAliasVOS.${index}.departmentName`"
> >
<template slot="label"> <template slot="label">
{{ item.deptAlias }} {{ item.deptAlias }}
@ -71,19 +70,12 @@
v-for="item in form.departments" v-for="item in form.departments"
:key="item.id" :key="item.id"
:label="item.departmentName" :label="item.departmentName"
:value="item.id" :value="item.departmentName"
> >
</el-option> </el-option>
</el-select> </el-select>
<!-- <el-button
v-if="!form.departments"
type="primary"
plain
style="margin-left: 8px"
@click="additem(item, index)"
>添加</el-button
> -->
<el-button <el-button
v-if="departmentsshow"
type="primary" type="primary"
plain plain
style="margin-left: 8px" style="margin-left: 8px"
@ -91,6 +83,7 @@
>添加</el-button >添加</el-button
> >
</el-form-item> </el-form-item>
</div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -130,7 +123,9 @@
</div> </div>
<div>2.最大支持2MB的xls/xlsx文件</div> <div>2.最大支持2MB的xls/xlsx文件</div>
<div>3.一次导入患者数量不能超过5000</div> <div>3.一次导入患者数量不能超过5000</div>
<el-checkbox v-model="records" style="font-size: 12px;">自动去除当日重复记录</el-checkbox> <el-checkbox v-model="records" style="font-size: 12px"
>自动去除当日重复记录</el-checkbox
>
</div> </div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -374,6 +369,7 @@
<el-button @click="canceladd"> </el-button> <el-button @click="canceladd"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 手机号 -->
<el-dialog <el-dialog
title="查看" title="查看"
:visible.sync="openphone" :visible.sync="openphone"
@ -381,10 +377,15 @@
append-to-body append-to-body
> >
<el-table v-loading="loading" :data="patientInfoList"> <el-table v-loading="loading" :data="patientInfoList">
<el-table-column label="科室名称" align="center" prop="patientName" /> <el-table-column label="科室名称" align="center" prop="deptAlias" />
<el-table-column label="就诊时间" align="center" prop="patientName" /> <el-table-column label="就诊时间" align="center" prop="visitDate" />
<el-table-column label="姓名" align="center" prop="patientName" /> <el-table-column label="姓名" align="center" prop="patientName" />
<el-table-column label="联系电话" align="center" prop="patientPhone" width="120" /> <el-table-column
label="联系电话"
align="center"
prop="patientPhone"
width="120"
/>
<el-table-column label="年龄" align="center" prop="age" /> <el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="诊断" align="center" prop="mainDiagnosis" /> <el-table-column label="诊断" align="center" prop="mainDiagnosis" />
</el-table> </el-table>
@ -449,6 +450,7 @@ export default {
}, },
data() { data() {
return { return {
departmentsshow: false,//
loading: false, loading: false,
patientInfoList: [], patientInfoList: [],
datalist: [], datalist: [],
@ -478,7 +480,7 @@ export default {
rules: { rules: {
deptAliasVOS: { deptAliasVOS: {
departmentName: [ departmentName: [
{ required: true, message: "科室不能为空", trigger: "blur" } { required: true, message: "1111111", trigger: "blur", }
] ]
}, },
@ -495,7 +497,7 @@ export default {
departmentoptions: [], departmentoptions: [],
nodeTypeoptions: [], nodeTypeoptions: [],
isResouceShow: 1, isResouceShow: 1,
indexadd: "", indexadd: undefined,
showMask: false,// showMask: false,//
progress: 0, progress: 0,
// -- // --
@ -551,11 +553,23 @@ export default {
methods: { methods: {
handleAvatarSuccess(response, file, fileList) { handleAvatarSuccess(response, file, fileList) {
console.log(response, file, fileList, 'response, file, fileList') console.log(response, file, fileList, 'response, file, fileList')
if (response.code == 500) { if (response.code == 500 && !response.data) {
this.$modal.msgError(response.msg); this.$modal.msgError(response.msg);
}else if(response.code == 500_2){ } else if (response.code == 5002) {
this.openphone = true; this.openphone = true;
this.patientInfoList=response.data
} else if (response.code == 500 && response.data) {
if (response.data.departments) {
this.form = response.data
} else {
this.form.deptAliasVOS = response.data.deptAliasVOS
this.form.departments = []
this.departmentsshow = true
}
this.open = true;
} }
else if (response.code == 200 && !response.data) { else if (response.code == 200 && !response.data) {
this.$modal.msgSuccess("导入成功"); this.$modal.msgSuccess("导入成功");
@ -563,21 +577,19 @@ export default {
} else if (response.code == 200 && response.data) { } else if (response.code == 200 && response.data) {
this.form = response.data this.form = response.data
this.open = true; this.open = true;
} }
this.uploadcancel(); this.uploadcancel();
this.fileList = []; this.fileList = [];
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log(file, fileList); console.log(file, fileList);
}, },
handlePreview(file) { handlePreview(file) {
console.log(file, '000000');
}, },
// //
submitUpload() { submitUpload() {
console.log(this.action,'action')
if (this.records == true) { if (this.records == true) {
this.action.data.records = 1 this.action.data.records = 1
@ -660,7 +672,9 @@ export default {
// //
changeway(e, index) { changeway(e, index) {
console.log(e, index, 'e') console.log(e, index, 'e')
this.form.deptAliasVOS[index].departmentName = this.form.departments.find(f => f.id == e).departmentName // this.$set(this.form.deptAliasVOS[this.indexadd], 'departmentName', this.formadd.departmentName)
// this.form.deptAliasVOS[index].departmentName = this.form.departments.find(f => f.id == e).departmentName
// this.form.deptAliasVOS[index].departmentId = e // this.form.deptAliasVOS[index].departmentId = e
this.$nextTick(() => { this.$nextTick(() => {
@ -814,6 +828,7 @@ export default {
}, },
/** 提交按钮 --添加*/ /** 提交按钮 --添加*/
submitFormadd() { submitFormadd() {
console.log(this.form, 'this.forma000000000000000000')
let reg = new RegExp("-", "g"); let reg = new RegExp("-", "g");
if (this.formadd.establishDate && this.formadd.revokeDate && new Date(this.formadd.establishDate.replace(reg, "/")) > if (this.formadd.establishDate && this.formadd.revokeDate && new Date(this.formadd.establishDate.replace(reg, "/")) >
new Date(this.formadd.revokeDate.replace(reg, "/"))) { new Date(this.formadd.revokeDate.replace(reg, "/"))) {
@ -825,16 +840,19 @@ export default {
if (!this.formadd.hospitalAgencyId) { if (!this.formadd.hospitalAgencyId) {
this.formadd.hospitalAgencyId = this.formadd.hospitalAgencyIdtwo this.formadd.hospitalAgencyId = this.formadd.hospitalAgencyIdtwo
} }
// this.formadd.hospitalAgencyId = this.formadd.hospitalAgencyIdtwo
var obj = { var obj = {
departmentName: this.formadd.departmentName, departmentName: this.formadd.departmentName,
id: '' id: ''
} }
this.form.departments.push(obj)
this.form.deptAliasVOS[this.indexadd].departmentName = this.formadd.departmentName
console.log(this.formadd, 'this.formadd') console.log(this.formadd, 'this.formadd')
console.log(this.form, 'this.form')
addDepartment(this.formadd).then((response) => { addDepartment(this.formadd).then((response) => {
this.$modal.msgSuccess("添加成功"); this.$modal.msgSuccess("添加成功");
this.form.departments.push(obj)
console.log(this.form.deptAliasVOS)
// this.form.deptAliasVOS[this.indexadd].departmentName = this.formadd.departmentName
this.$set(this.form.deptAliasVOS[this.indexadd], 'departmentName', this.formadd.departmentName)
// this.$forceUpdate()
this.openadd = false; this.openadd = false;
// this.getList(); // this.getList();
}); });
@ -844,16 +862,32 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log(this.form, 'this.form确定') // this.$forceUpdate()
this.$refs["form"].validate(valid => { var emptyItems = []
if (valid) { emptyItems = this.form.deptAliasVOS.filter(f => f.departmentName=="" || f.departmentName==null)
console.log(emptyItems, 'this.emptyItems')
if (emptyItems.length > 0) {
this.$modal.msgError("必填项请填写完整,再进行提交");
}else{
secondaryUpload(this.form).then(response => { secondaryUpload(this.form).then(response => {
this.$modal.msgSuccess("保存成功"); this.$modal.msgSuccess("保存成功");
this.open = false; this.open = false;
this.$emit('handleRules') this.$emit('handleRules')
}); });
} }
});
// this.$refs["form"].validate(valid => {
// if (valid) {
// secondaryUpload(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.$emit('handleRules')
// });
// }
// });
}, },
// resize // resize
screenChange() { screenChange() {