患者管理

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

View File

@ -49,48 +49,41 @@
</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">
<el-form-item <div v-for="(item, index) in form.deptAliasVOS" :key="index">
v-for="(item, index) in form.deptAliasVOS" <el-form-item
:key="index" required
:rules="rules.deptAliasVOS.departmentName"
:prop="`deptAliasVOS.${index}.departmentName`"
>
<template slot="label">
{{ item.deptAlias }}
</template>
<el-select
v-model="item.departmentName"
placeholder="请选择科室"
style="width: 208px"
@change="changeway($event, index)"
> >
<el-option <template slot="label">
v-for="item in form.departments" {{ item.deptAlias }}
:key="item.id" </template>
:label="item.departmentName" <el-select
:value="item.id" v-model="item.departmentName"
placeholder="请选择科室"
style="width: 208px"
@change="changeway($event, index)"
> >
</el-option> <el-option
</el-select> v-for="item in form.departments"
<!-- <el-button :key="item.id"
v-if="!form.departments" :label="item.departmentName"
type="primary" :value="item.departmentName"
plain >
style="margin-left: 8px" </el-option>
@click="additem(item, index)" </el-select>
>添加</el-button <el-button
> --> v-if="departmentsshow"
<el-button type="primary"
type="primary" plain
plain style="margin-left: 8px"
style="margin-left: 8px" @click="additem(item, index)"
@click="additem(item, index)" >添加</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,22 +369,28 @@
<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"
width="900px" width="900px"
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
<el-table-column label="年龄" align="center" prop="age" /> label="联系电话"
<el-table-column label="诊断" align="center" prop="mainDiagnosis" /> align="center"
</el-table> prop="patientPhone"
width="120"
/>
<el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="诊断" align="center" prop="mainDiagnosis" />
</el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancelphone"> </el-button> <el-button type="primary" @click="cancelphone"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 遮罩层 --> <!-- 遮罩层 -->
@ -449,14 +450,15 @@ export default {
}, },
data() { data() {
return { return {
loading:false, departmentsshow: false,//
patientInfoList:[], loading: false,
datalist:[], patientInfoList: [],
openphone:false, datalist: [],
openphone: false,
form: {}, form: {},
uploadopen: false, uploadopen: false,
fileList: [], fileList: [],
records:true, records: true,
action: { action: {
data: { data: {
@ -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,38 +553,48 @@ 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("导入成功");
this.$emit('handleRules') this.$emit('handleRules')
} 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
}else{ } else {
this.action.data.records=0 this.action.data.records = 0
} }
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
@ -599,8 +611,8 @@ export default {
); );
}, },
// //
cancelphone(){ cancelphone() {
this.openphone=false; this.openphone = false;
}, },
// //
handleUpload() { handleUpload() {
@ -609,7 +621,7 @@ export default {
this.uploadopen = true; this.uploadopen = true;
this.records=true; this.records = true;
this.fileList = []; this.fileList = [];
this.form = {}; this.form = {};
@ -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, "/"))) {
@ -823,18 +838,21 @@ export default {
this.$refs["formadd"].validate((valid) => { this.$refs["formadd"].validate((valid) => {
if (valid) { if (valid) {
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)
secondaryUpload(this.form).then(response => { console.log(emptyItems, 'this.emptyItems')
if (emptyItems.length > 0) {
this.$modal.msgError("必填项请填写完整,再进行提交");
}else{
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() {
@ -905,12 +939,12 @@ export default {
height: 28px !important; height: 28px !important;
} }
} }
::v-deep .el-checkbox__label{ ::v-deep .el-checkbox__label {
font-size: 12px; font-size: 12px;
} }
::v-deep .el-checkbox__inner{ ::v-deep .el-checkbox__inner {
width: 12px; width: 12px;
height: 12px; height: 12px;
} }
.el-cascader .el-input input::-webkit-input-placeholder { .el-cascader .el-input input::-webkit-input-placeholder {
color: black; color: black;