Commit 45a769c2 authored by “yiyousong”'s avatar “yiyousong”

feat: 基础事项添加自定义导入

parent 1ca4a7cd
......@@ -129,6 +129,7 @@
批量加入
</a-button>
<a-button type="primary" @click="addMatter"> 新增事项 </a-button>
<a-button type="primary" @click="handleImport"> 导入 </a-button>
</a-space>
</div>
<div>
......@@ -249,6 +250,7 @@ import {
addMatterToSite,
delSiteMatter,
delMatter,
importDataCustom,
} from "@/services/matter";
import { businessMatterList, delBusinessMatter } from "@/services/business";
import { getDeptList } from "@/services/dept";
......@@ -630,6 +632,28 @@ export default {
this.formVisible = true;
this.$refs.EditSiteMatter.onEdit(row);
},
handleImport() {
let input = document.createElement("input");
input.type = "file";
input.accept = ".xlsx";
input.style.display = 'none';
document.body.appendChild(input);
input.click();
input.onchange = async () => {
if (input.files && input.files[0]) {
let file = input.files[0];
const formData = new FormData();
formData.append("file", file, file.name);
let res = await importDataCustom(formData);
if (res.data.code === 1) {
let { msg } = res.data;
this.$message.success(msg);
this.getMatterListData();
}
}
};
document.body.removeChild(input);
},
},
};
</script>
......@@ -645,11 +669,10 @@ export default {
position: absolute;
background-color: #eeeeee;
top: 44px;
left: 50%;
left: 45%;
}
.left,
.right {
width: 50%;
padding: 0 20px;
.header {
height: 100px;
......@@ -667,6 +690,12 @@ export default {
white-space: nowrap;
}
}
.left {
width: 45%;
}
.right {
width: 55%;
}
.header-bottom {
display: flex;
justify-content: space-between;
......
......@@ -72,6 +72,7 @@ module.exports = {
addMatterToSite: `${BASE_URL}/base/matter/addMatterToSite`,
exportExcel: `${BASE_URL}/base/matter/exportExcel`,
matterList: `${BASE_URL}/base/matter/sublist`,
importDataCustom: `${BASE_URL}/base/matter/importDataCustom`, // 自定义导入
},
// 事项申请材料
matterdatum: {
......
......@@ -60,7 +60,10 @@ export async function getMatterListSubList(data) {
export async function getMatterInfo(data) {
return request(matter.info, METHOD.GET, data);
}
// 自定义导入
export async function importDataCustom(data) {
return request(matter.importDataCustom, METHOD.POST, data);
}
/**
* 事项申请材料
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment