导入修改

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