导入修改

This commit is contained in:
shidongli 2024-12-06 15:46:13 +08:00
parent 2a2da2558f
commit 80b7091a92

View File

@ -32,7 +32,7 @@
icon="el-icon-upload2" icon="el-icon-upload2"
size="mini" size="mini"
@click="handleUpload" @click="handleUpload"
v-if="patientUploadButtonVisible=='true'" v-if="patientUploadButtonVisible == 'true'"
>导入</el-button >导入</el-button
> >
<Button <Button
@ -52,10 +52,7 @@
<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="110px"> <el-form ref="form" :model="form" :rules="rules" label-width="110px">
<div v-for="(item, index) in form.deptAliasVOS" :key="index"> <div v-for="(item, index) in form.deptAliasVOS" :key="index">
<el-form-item <el-form-item required>
required
>
<template slot="label"> <template slot="label">
{{ item.deptAlias }} {{ item.deptAlias }}
</template> </template>
@ -415,17 +412,11 @@ import { listCompare } from "@/api/system/compare";
import { listSubdivision } from "@/api/system/subdivision"; import { listSubdivision } from "@/api/system/subdivision";
import { agencyList, getAgencytype } from "@/api/system/agency"; import { agencyList, getAgencytype } from "@/api/system/agency";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { import {
addDepartment, addDepartment,
updateDepartment,
patientUpload,
getDepartmentList, getDepartmentList,
secondaryUpload, secondaryUpload,
} from "@/api/system/department"; } from "@/api/system/department";
export default { export default {
name: 'SearchFilter', name: 'SearchFilter',
components: { Form, FormItem, Button }, components: { Form, FormItem, Button },
@ -446,9 +437,9 @@ export default {
type: String, type: String,
default: 'small', default: 'small',
}, },
patientUploadButtonVisible:{ patientUploadButtonVisible: {
type:String, type: String,
default:'false' default: 'false'
} }
}, },
data() { data() {
@ -561,7 +552,7 @@ export default {
} else if (response.code == 5002) { } else if (response.code == 5002) {
this.openphone = true; this.openphone = true;
this.patientInfoList=response.data this.patientInfoList = response.data
} else if (response.code == 500 && response.data) { } else if (response.code == 500 && response.data) {
if (response.data.departments) { if (response.data.departments) {
@ -572,18 +563,15 @@ export default {
this.departmentsshow = true this.departmentsshow = true
} }
this.open = true; this.open = true;
} }
else if (response.code == 200 && !response.data) { else if (response.code == 200 && !response.data) {
this.$modal.msgSuccess("导入成功"); this.$modal.msgSuccess(response.msg);
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) {
@ -872,19 +860,16 @@ export default {
submitForm() { submitForm() {
// this.$forceUpdate() // this.$forceUpdate()
var emptyItems = [] var emptyItems = []
emptyItems = this.form.deptAliasVOS.filter(f => f.departmentName=="" || f.departmentName==null) emptyItems = this.form.deptAliasVOS.filter(f => f.departmentName == "" || f.departmentName == null)
console.log(emptyItems, 'this.emptyItems') console.log(emptyItems, 'this.emptyItems')
if (emptyItems.length > 0) { if (emptyItems.length > 0) {
this.$modal.msgError("必填项请填写完整,再进行提交"); this.$modal.msgError("必填项请填写完整,再进行提交");
}else{ } else {
secondaryUpload(this.form).then(response => { secondaryUpload(this.form).then(response => {
this.$modal.msgSuccess("保存成功"); this.$modal.msgSuccess(response.msg);
this.open = false; this.open = false;
this.$emit('handleRules') this.$emit('handleRules')
}); });
} }
// this.$refs["form"].validate(valid => { // this.$refs["form"].validate(valid => {