|
@@ -6,13 +6,14 @@ import {
|
|
|
Storehouse_IOTNetworkCard_Edit, Storehouse_IOTNetworkCard_Edit_Device_Number,
|
|
|
Storehouse_IOTNetworkCard_Import,
|
|
|
Storehouse_IOTNetworkCard_List,
|
|
|
+ Storehouse_IOTNetworkCard_Export, exportOperationFile,
|
|
|
} from '@/api/storehouse/index'
|
|
|
import {nextTick, reactive, ref} from 'vue'
|
|
|
import Upload from '@/components/Upload/index.vue'
|
|
|
import Drawer from '@/components/Drawer/index.vue'
|
|
|
import type {FormInstance, FormRules} from 'element-plus'
|
|
|
import {ElLoading, ElMessage, ElMessageBox} from 'element-plus'
|
|
|
-import {Delete, Edit,View} from '@element-plus/icons-vue'
|
|
|
+import {Delete, Edit, Finished, View} from '@element-plus/icons-vue'
|
|
|
import type {ColumnProps} from '@/components/TableBase/interface/index'
|
|
|
import {useTablePublic} from '@/hooks/useTablePublic'
|
|
|
import ReceiveUser from "@/views/storehouse/outStock/receiveUser.vue";
|
|
@@ -338,6 +339,42 @@ const onclickT_device_number = async (row:any)=>{
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+const exportStatExcel = async () => {
|
|
|
+ // const result:any = await Storehouse_IOTNetworkCard_Export({
|
|
|
+ // User_tokey: globalStore.GET_User_tokey,
|
|
|
+ // T_name: initParam.T_name,
|
|
|
+ // T_company_name: initParam.T_company_name,
|
|
|
+ // T_state: initParam.T_state,
|
|
|
+ // })
|
|
|
+ // if (result.Code === 200) {
|
|
|
+ // window.open(result.Data)
|
|
|
+ // }
|
|
|
+
|
|
|
+ try {
|
|
|
+ const response: any = await Storehouse_IOTNetworkCard_Export({
|
|
|
+ User_tokey: globalStore.GET_User_tokey,
|
|
|
+ T_name: initParam.T_name,
|
|
|
+ T_company_name: initParam.T_company_name,
|
|
|
+ T_state: initParam.T_state,
|
|
|
+ })
|
|
|
+
|
|
|
+ // 处理返回的二进制文件并触发下载
|
|
|
+ const blob = new Blob([response], {type: 'application/vnd.ms-excel;charset=utf8'})
|
|
|
+ const url = window.URL.createObjectURL(blob)
|
|
|
+ const a = document.createElement('a')
|
|
|
+ a.href = url
|
|
|
+ const now = new Date();
|
|
|
+ const formattedDate = `${now.getFullYear()}${(now.getMonth()+1).toString().padStart(2, '0')}${now.getDate().toString().padStart(2, '0')}_${now.getHours().toString().padStart(2, '0')}${now.getMinutes().toString().padStart(2, '0')}`;
|
|
|
+ a.download = `物联网卡_${formattedDate}.xlsx`;
|
|
|
+ document.body.appendChild(a)
|
|
|
+ a.click()
|
|
|
+ a.remove()
|
|
|
+ window.URL.revokeObjectURL(url)
|
|
|
+ ElMessage.success('导出成功')
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('导出失败,请检查网络连接')
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -371,6 +408,7 @@ const onclickT_device_number = async (row:any)=>{
|
|
|
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"/>
|
|
|
</el-select>
|
|
|
<el-button type="primary" @click="searchModelHandle">搜索</el-button>
|
|
|
+ <el-button type="success" @click="exportStatExcel">导出</el-button>
|
|
|
</el-col>
|
|
|
<el-col :xl="8" :lg="8" :md="11" class="btn">
|
|
|
<el-button type="primary" @click="openDrawer('new')">入库</el-button>
|