Commit a8ded68a authored by “yiyousong”'s avatar “yiyousong”

feat: 工作人员新增导出,窗口信息添加自定义显示上传

parent 6d354b00
...@@ -88,6 +88,17 @@ ...@@ -88,6 +88,17 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="12">
<a-form-model-item class="upload" label="自定义显示" prop="filePath">
<YUpload
accept=".png,.jpg,.jpeg,.svg"
:limit="1"
v-model="form.filePath"
></YUpload>
</a-form-model-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col span="12"> <a-col span="12">
<a-form-model-item label="无人值守" prop="duty"> <a-form-model-item label="无人值守" prop="duty">
...@@ -199,11 +210,13 @@ ...@@ -199,11 +210,13 @@
<script> <script>
import { addWindow } from "@/services/dept"; import { addWindow } from "@/services/dept";
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YSwitch from "@/components/yswitch/YSwitch.vue";
import YUpload from "@/components/YUpload.vue";
import { checkWindowNumber } from "@/utils/validate"; import { checkWindowNumber } from "@/utils/validate";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
components: { components: {
YSwitch, YSwitch,
YUpload,
}, },
data() { data() {
return { return {
...@@ -232,6 +245,7 @@ export default { ...@@ -232,6 +245,7 @@ export default {
dutyEnglish: "", // 无人值守显示英文内容 dutyEnglish: "", // 无人值守显示英文内容
nameDesc: "", // 窗口屏显示名称 nameDesc: "", // 窗口屏显示名称
englishNameDesc: "", // 英文名称 englishNameDesc: "", // 英文名称
filePath: "", // 自定义显示
}, },
rules: { rules: {
siteName: [ siteName: [
...@@ -360,4 +374,7 @@ export default { ...@@ -360,4 +374,7 @@ export default {
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
} }
.upload {
align-items: flex-start !important;
}
</style> </style>
...@@ -175,6 +175,11 @@ ...@@ -175,6 +175,11 @@
批量导入照片 批量导入照片
</a> --> </a> -->
</a-menu-item> </a-menu-item>
<a-menu-item key="4">
<div style="color: #1890ff" @click="exportWorkman">
导出工作人员
</div>
</a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> <a-button style="margin-left: 8px">
更多操作 <a-icon type="down" /> 更多操作 <a-icon type="down" />
...@@ -309,6 +314,7 @@ import { ...@@ -309,6 +314,7 @@ import {
downLoadTemplate, downLoadTemplate,
// uploadFile, // uploadFile,
uploadAllImg, uploadAllImg,
exportWorkman,
// editWorkman, // editWorkman,
// importData, // importData,
} from "@/services/dept"; } from "@/services/dept";
...@@ -629,6 +635,32 @@ export default { ...@@ -629,6 +635,32 @@ export default {
images: [url], images: [url],
}); });
}, },
// 导出工作人员
async exportWorkman() {
this.loading = true;
let obj = {
siteId: this.siteId,
page: this.page,
size: this.size,
deptId: this.deptSearch,
windowId: this.windowSearch,
};
let value = `%${this.searchVal}%`;
obj[this.searchType] = value;
let res = await exportWorkman(obj, { responseType: "blob" });
const blob = new Blob([res.data], {
type: "application/octet-stream",
});
let fileName = "工作人员列表" + this.$moment().format("YYYY-MM-DD");
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.setAttribute("download", `${fileName}.xlsx`); // 设置下载文件名称
document.body.appendChild(link);
link.click();
document.body.appendChild(link);
this.loading = false;
},
}, },
}; };
</script> </script>
......
...@@ -113,6 +113,10 @@ export function changePwd(data) { ...@@ -113,6 +113,10 @@ export function changePwd(data) {
export function uploadAllImg(data) { export function uploadAllImg(data) {
return request(workman.doImportPic, METHOD.POST, data); return request(workman.doImportPic, METHOD.POST, data);
} }
// 导出工作人员
export function exportWorkman(data, config) {
return request(workman.exportExcel, METHOD.POST, data, config);
}
/** /**
* 窗口事项 * 窗口事项
......
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