From 6ffc58d51704e70c94057d5b2bfca2cbc19a782a Mon Sep 17 00:00:00 2001
From: dzc <2388224167@qq.com>
Date: Fri, 12 Sep 2025 15:43:41 +0800
Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=96=B0=E7=89=88=E4=BA=A4?=
=?UTF-8?q?=E6=8E=A5=E7=8F=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Upload/Excel.vue | 8 +-
.../duty/sysDuty/components/duty-table.vue | 136 ++++++++++++++++++
src/views/duty/sysDuty/index.vue | 28 +++-
3 files changed, 165 insertions(+), 7 deletions(-)
create mode 100644 src/views/duty/sysDuty/components/duty-table.vue
diff --git a/src/components/Upload/Excel.vue b/src/components/Upload/Excel.vue
index 002e47b..1e0941c 100644
--- a/src/components/Upload/Excel.vue
+++ b/src/components/Upload/Excel.vue
@@ -2,7 +2,7 @@
@@ -48,6 +48,10 @@ const prop = defineProps({
url: {
type: String,
},
+ importData: {
+ type: Object,
+ default: () => { },
+ },
title: {
type: String,
},
@@ -75,7 +79,7 @@ const state = reactive({
* 下载模板文件
*/
const downExcelTemp = async () => {
- if (prop.tempUrl) {
+ if (prop.tempUrl && prop.tempUrl !== 'null') {
try {
await other.downBlobFile(other.adaptationUrl(prop.tempUrl), {}, 'temp.xlsx');
} catch (error) {
diff --git a/src/views/duty/sysDuty/components/duty-table.vue b/src/views/duty/sysDuty/components/duty-table.vue
new file mode 100644
index 0000000..7657bfc
--- /dev/null
+++ b/src/views/duty/sysDuty/components/duty-table.vue
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/duty/sysDuty/index.vue b/src/views/duty/sysDuty/index.vue
index 2bfee80..430376a 100644
--- a/src/views/duty/sysDuty/index.vue
+++ b/src/views/duty/sysDuty/index.vue
@@ -43,11 +43,14 @@
{{ row.endTime }}
-
+
导入
+
+ 排班表
+
编辑
@@ -64,9 +67,11 @@
+
+
-
+
@@ -81,10 +86,13 @@ import { useDict } from '/@/hooks/dict';
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
+const DutyTableDialog = defineAsyncComponent(() => import('./components/duty-table.vue'));
+
// 定义查询字典
// 定义变量内容
const formDialogRef = ref()
+const dutyTableDialogRef = ref()
const excelUploadRef = ref()
// 搜索变量
const queryRef = ref()
@@ -92,6 +100,8 @@ const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
+const currentRow = ref()
+const importData = ref({})
const state: BasicTableProps = reactive({
queryForm: {},
@@ -129,14 +139,22 @@ const selectionChangHandle = (objs: { id: string }[]) => {
};
const importDutyItem = (row: any) => {
+ currentRow.value = row
+ importData.value = {
+ id: currentRow.value.id
+ }
excelUploadRef.value.show()
}
+const dutyTable = (row: any) => {
+ dutyTableDialogRef.value.openDialog(row.id)
+}
+
const downExcelTemp = async () => {
try {
- await other.downBlobFile(other.adaptationUrl(""), {}, 'temp.xlsx');
+ await other.downBlobFile("/admin/sys-duty/export-template", { dutyId: currentRow.value.id }, "基地周值班表模版.xlsx");
} catch (error) {
- useMessage().error("模板下载失败");
+ useMessage().error("基地周值班表模版下载失败");
}
}