|
|
@@ -145,13 +145,18 @@
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="22">
|
|
|
<el-radio-group v-model="dateType" size="default" fill="#409eff">
|
|
|
<el-radio-button label="年" value="year" />
|
|
|
<el-radio-button label="月" value="month" />
|
|
|
<el-radio-button label="日" value="day" />
|
|
|
</el-radio-group>
|
|
|
</el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-button type="success" plain @click="handleExport" :loading="exportLoading"
|
|
|
+ ><Icon icon="ep:download" class="mr-3px" /> 导出</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
@@ -328,8 +333,9 @@ import { IotInspectOrderApi, IotInspectOrderVO } from '@/api/pms/inspect/order'
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
import DeptTree from '@/views/system/user/DeptTree.vue'
|
|
|
import { IotInspectItemVO, IotInspectOrderDetailApi } from '@/api/pms/inspect/order/detail'
|
|
|
-
|
|
|
+const message = useMessage() // 消息弹窗
|
|
|
import { watch } from 'vue'
|
|
|
+import download from '@/utils/download'
|
|
|
|
|
|
const { push } = useRouter()
|
|
|
const { params } = useRoute()
|
|
|
@@ -419,6 +425,32 @@ const handleRowClick = (row, column: any, event: Event) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+let exportLoading = ref(false)
|
|
|
+const handleExport = async () => {
|
|
|
+ try {
|
|
|
+ // 导出的二次确认
|
|
|
+ await message.exportConfirm()
|
|
|
+ // 发起导出
|
|
|
+ exportLoading.value = true
|
|
|
+
|
|
|
+ if (isException.value) {
|
|
|
+ const data = await IotInspectOrderApi.exportExceptionDeviceInspectReport(queryParams)
|
|
|
+ download.excel(data, '异常设备报表.xlsx')
|
|
|
+ } else if (isExceptionPoint.value) {
|
|
|
+ const data = await IotInspectOrderApi.exportExceptionPointInspectReport(queryParams)
|
|
|
+ download.excel(data, '异常点报表.xlsx')
|
|
|
+ } else {
|
|
|
+ const data = await IotInspectOrderApi.exportInspectReport(queryParams)
|
|
|
+ download.excel(data, '巡检报表.xlsx')
|
|
|
+ }
|
|
|
+ // const data = await IotInspectOrderApi.exportInspectReport(queryParams)
|
|
|
+ // download.excel(data, '巡检报表.xlsx')
|
|
|
+ } catch {
|
|
|
+ } finally {
|
|
|
+ exportLoading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
let isExceptionPoint = ref(false)
|
|
|
const list2 = ref<IotInspectItemVO[]>([]) // 列表的数据
|
|
|
|