|
|
@@ -42,14 +42,14 @@
|
|
|
start-placeholder="开始时间"
|
|
|
end-placeholder="结束时间"
|
|
|
style="width: 230px"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
-
|
|
|
<div>
|
|
|
- <!-- <el-button type="primary" @click="handleExport">导出 </el-button> -->
|
|
|
- <el-button type="primary" @click="queryTableList">查询</el-button>
|
|
|
- <el-button @click="handleRestParams">重置</el-button>
|
|
|
+ <el-button type="primary" @click="queryTableList">查询</el-button>
|
|
|
+ <el-button @click="handleRestParams">重置</el-button>
|
|
|
+ <el-button @click="handleExport">导出 </el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -60,6 +60,7 @@
|
|
|
<el-table-column label="类别名称" prop="departmentName" width="200"/>
|
|
|
<el-table-column label="分组名称" prop="userGroupName" width="200"/>
|
|
|
<el-table-column label="责任人姓名" prop="responsiblePersonName" width="200"/>
|
|
|
+ <el-table-column label="责任人所在部门" prop="deptName" width="200" />
|
|
|
<el-table-column label="是否并签" prop="signConfigName" width="200"/>
|
|
|
<el-table-column label="责任书文档" width="200">
|
|
|
<template #default="scope">
|
|
|
@@ -210,6 +211,20 @@
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+// const handleExport = async () => {
|
|
|
+// try {
|
|
|
+// const response = await safetyResponsibilityAdminExportIssuedObject(queryParams.queryParam);
|
|
|
+// if (response) {
|
|
|
+// const fileName = `下发对象数据_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
+// downloadByData(response, fileName);
|
|
|
+// ElMessage.success('导出成功');
|
|
|
+// }
|
|
|
+// } catch (e:any) {
|
|
|
+// console.error('导出下发对象失败:', e);
|
|
|
+// ElMessage.error('导出失败,请重试');
|
|
|
+// }
|
|
|
+// };
|
|
|
+
|
|
|
// 预览
|
|
|
const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
|
const previewOnline = (url: string | undefined, type: keyof typeof FILE_TYPE_ICON) => {
|
|
|
@@ -218,24 +233,20 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- // const handleExport = () => {
|
|
|
- // safetyResponsibilityAdminExportIssuedObject({
|
|
|
- // ...omit(queryParams.queryParam, 'date'),
|
|
|
- // adminId: Number(queryParams.queryParam.adminId),
|
|
|
- // startTime: queryParams.queryParam.date?.[0]
|
|
|
- // ? dayjs(queryParams.queryParam.date?.[0]).format('YYYY-MM-DD')
|
|
|
- // : undefined,
|
|
|
- // endTime: queryParams.queryParam.date?.[1]
|
|
|
- // ? dayjs(queryParams.queryParam.date?.[1]).format('YYYY-MM-DD')
|
|
|
- // : undefined,
|
|
|
- // }).then((res) => {
|
|
|
- // if (!res) {
|
|
|
- // throw new Error('下载文件失败');
|
|
|
- // }
|
|
|
- // downloadByData(res, `${Date.now()}.xlsx`);
|
|
|
- // ElMessage.success('导出文件成功');
|
|
|
- // });
|
|
|
- // };
|
|
|
+ const handleExport = async () => {
|
|
|
+ await safetyResponsibilityAdminExportIssuedObject({
|
|
|
+ ...omit(queryParams.queryParam, 'date'),
|
|
|
+ adminId: Number(queryParams.queryParam.adminId),
|
|
|
+ startTime: queryParams.queryParam.date?.[0],
|
|
|
+ endTime: queryParams.queryParam.date?.[1]
|
|
|
+ }).then((res) => {
|
|
|
+ if (!res) {
|
|
|
+ throw new Error('下载文件失败');
|
|
|
+ }
|
|
|
+ downloadByData(res, `下发对象数据_${new Date().toISOString().split('T')[0]}.xlsx`);
|
|
|
+ ElMessage.success('导出文件成功');
|
|
|
+ });
|
|
|
+ };
|
|
|
const handleConfirmDeleteRow = (scope) => {
|
|
|
safetyResponsibilityAdminDeleteIssuedObject(scope.row.id).then(() => {
|
|
|
ElMessage.success('删除成功!');
|
|
|
@@ -248,12 +259,8 @@
|
|
|
queryParam: {
|
|
|
...omit(queryParams.queryParam, 'date'),
|
|
|
adminId: queryParams.queryParam.adminId,
|
|
|
- startTime: queryParams.queryParam.date?.[0]
|
|
|
- ? dayjs(queryParams.queryParam.date?.[0]).format('YYYY-MM-DD')
|
|
|
- : undefined,
|
|
|
+ startTime: queryParams.queryParam.date?.[0],
|
|
|
endTime: queryParams.queryParam.date?.[1]
|
|
|
- ? dayjs(queryParams.queryParam.date?.[1]).format('YYYY-MM-DD')
|
|
|
- : undefined,
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
|