|
|
@@ -76,6 +76,10 @@
|
|
|
<Icon icon="ep:upload" class="mr-5px"/>
|
|
|
提交
|
|
|
</el-button>
|
|
|
+ <el-button type="success" @click="handleExport" :loading="exportLoading">
|
|
|
+ <Icon icon="ep:download" class="mr-5px"/>
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</ContentWrap>
|
|
|
@@ -226,6 +230,7 @@ import {Icon} from '@/components/Icon'
|
|
|
import {UserQualificationsApi} from "@/api/pressure2/userQualifications";
|
|
|
import {Edit} from '@element-plus/icons-vue'
|
|
|
import {EquipPipeSchedulingApi} from "@/api/pressure2/pipescheduling";
|
|
|
+import download from '@/utils/download'
|
|
|
import dayjs from 'dayjs'
|
|
|
import 'dayjs/locale/zh-cn'
|
|
|
import {formatArrayDate} from "@/utils/formatTime";
|
|
|
@@ -255,6 +260,7 @@ interface ScheduleRow {
|
|
|
}
|
|
|
|
|
|
const loading = ref(false)
|
|
|
+const exportLoading = ref(false)
|
|
|
const queryFormRef = ref()
|
|
|
const tableData = ref<ScheduleRow[]>([])
|
|
|
const selectedRows = ref<ScheduleRow[]>([])
|
|
|
@@ -494,6 +500,21 @@ const handleRowClick = (row: ScheduleRow) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 导出排班表
|
|
|
+const handleExport = async () => {
|
|
|
+ try {
|
|
|
+ exportLoading.value = true
|
|
|
+ const data = await EquipPipeSchedulingApi.exportShiftSchedule(queryParams)
|
|
|
+ download.excel(data, '排班表')
|
|
|
+ ElMessage.success('导出成功')
|
|
|
+ } catch (error) {
|
|
|
+ console.error('导出失败:', error)
|
|
|
+ ElMessage.error('导出失败')
|
|
|
+ } finally {
|
|
|
+ exportLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// ==================== 生命周期 ====================
|
|
|
onMounted(async () => {
|
|
|
await resetQuery()
|