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

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

parent 1ca4a7cd
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
批量加入 批量加入
</a-button> </a-button>
<a-button type="primary" @click="addMatter"> 新增事项 </a-button> <a-button type="primary" @click="addMatter"> 新增事项 </a-button>
<a-button type="primary" @click="handleImport"> 导入 </a-button>
</a-space> </a-space>
</div> </div>
<div> <div>
...@@ -249,6 +250,7 @@ import { ...@@ -249,6 +250,7 @@ import {
addMatterToSite, addMatterToSite,
delSiteMatter, delSiteMatter,
delMatter, delMatter,
importDataCustom,
} from "@/services/matter"; } from "@/services/matter";
import { businessMatterList, delBusinessMatter } from "@/services/business"; import { businessMatterList, delBusinessMatter } from "@/services/business";
import { getDeptList } from "@/services/dept"; import { getDeptList } from "@/services/dept";
...@@ -630,6 +632,28 @@ export default { ...@@ -630,6 +632,28 @@ export default {
this.formVisible = true; this.formVisible = true;
this.$refs.EditSiteMatter.onEdit(row); 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> </script>
...@@ -645,11 +669,10 @@ export default { ...@@ -645,11 +669,10 @@ export default {
position: absolute; position: absolute;
background-color: #eeeeee; background-color: #eeeeee;
top: 44px; top: 44px;
left: 50%; left: 45%;
} }
.left, .left,
.right { .right {
width: 50%;
padding: 0 20px; padding: 0 20px;
.header { .header {
height: 100px; height: 100px;
...@@ -667,6 +690,12 @@ export default { ...@@ -667,6 +690,12 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
} }
.left {
width: 45%;
}
.right {
width: 55%;
}
.header-bottom { .header-bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
......
...@@ -72,6 +72,7 @@ module.exports = { ...@@ -72,6 +72,7 @@ module.exports = {
addMatterToSite: `${BASE_URL}/base/matter/addMatterToSite`, addMatterToSite: `${BASE_URL}/base/matter/addMatterToSite`,
exportExcel: `${BASE_URL}/base/matter/exportExcel`, exportExcel: `${BASE_URL}/base/matter/exportExcel`,
matterList: `${BASE_URL}/base/matter/sublist`, matterList: `${BASE_URL}/base/matter/sublist`,
importDataCustom: `${BASE_URL}/base/matter/importDataCustom`, // 自定义导入
}, },
// 事项申请材料 // 事项申请材料
matterdatum: { matterdatum: {
......
...@@ -60,7 +60,10 @@ export async function getMatterListSubList(data) { ...@@ -60,7 +60,10 @@ export async function getMatterListSubList(data) {
export async function getMatterInfo(data) { export async function getMatterInfo(data) {
return request(matter.info, METHOD.GET, 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