Browse Source

报表导出

master
songguoqiang 8 months ago
parent
commit
efc589cc69
  1. 20
      src/api/tjanalysis/index.ts
  2. 13
      src/views/tjanalysis/electricdata/index.vue
  3. 14
      src/views/tjanalysis/irealdata/index.vue
  4. 6
      src/views/tjanalysis/irealdatatotal/index.vue
  5. 14
      src/views/tjanalysis/natgasdatacd/index.vue

20
src/api/tjanalysis/index.ts

@ -5,16 +5,31 @@ export const queryIrealdataTj = async (params) => {
return await request.get({ url: `/tjanalysis/queryIrealdataTj`, params }) return await request.get({ url: `/tjanalysis/queryIrealdataTj`, params })
} }
// 导出一次主表日统计报表
export const exportIrealdataTj = async (params) => {
return await request.download({ url: `/tjanalysis/exportIrealdataTj`, params})
}
// 获取一次主表时间范围统计报表数据 // 获取一次主表时间范围统计报表数据
export const queryIrealdataTimeTj = async (params) => { export const queryIrealdataTimeTj = async (params) => {
return await request.get({ url: `/tjanalysis/queryIrealdataTimeTj`, params }) return await request.get({ url: `/tjanalysis/queryIrealdataTimeTj`, params })
} }
// 导出一次主表时间范围统计报表数据
export const exportIrealdataTimeTj = async (params) => {
return await request.download({ url: `/tjanalysis/exportIrealdataTimeTj`, params })
}
// 获取智能电表日统计报表数据 // 获取智能电表日统计报表数据
export const queryElectricdataTj = async (params) => { export const queryElectricdataTj = async (params) => {
return await request.get({ url: `/tjanalysis/queryElectricdataTj`, params }) return await request.get({ url: `/tjanalysis/queryElectricdataTj`, params })
} }
// 导出智能电表日统计报表数据数据
export const exportElectricdataTj = async (params) => {
return await request.download({ url: `/tjanalysis/exportElectricdataTj`, params })
}
// 获取地衡数据统计 // 获取地衡数据统计
export const queryTjPlatScales = async (params) => { export const queryTjPlatScales = async (params) => {
return await request.get({ url: `/tjanalysis/queryTjPlatScales`, params }) return await request.get({ url: `/tjanalysis/queryTjPlatScales`, params })
@ -45,6 +60,11 @@ export const queryNatgasDatacdDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryNatgasDatacdDay`, params}) return await request.get({ url: `/tjanalysis/queryNatgasDatacdDay`, params})
} }
// 导出冷拔天然气数据日统计报表
export const exportNatgasDatacdDay = async (params) => {
return await request.download({ url: `/tjanalysis/exportNatgasDatacdDay`, params})
}
// 热轧天然气数据日统计报表 // 热轧天然气数据日统计报表
export const queryNatgasdataDay = async (params) => { export const queryNatgasdataDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryNatgasdataDay`, params}) return await request.get({ url: `/tjanalysis/queryNatgasdataDay`, params})

13
src/views/tjanalysis/electricdata/index.vue

@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -106,6 +107,18 @@ const getList = async () => {
loading.value = false loading.value = false
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportElectricdataTj(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "智能电表日统计数据.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

14
src/views/tjanalysis/irealdata/index.vue

@ -14,6 +14,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -115,6 +116,19 @@ function tableCellClassName({row, column, rowIndex, columnIndex}) {
} }
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportIrealdataTj(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "一次主表日统计数据.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

6
src/views/tjanalysis/irealdatatotal/index.vue

@ -24,7 +24,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<!-- <el-button type="success" @click="exportElecTotal" size="mini">导出</el-button> --> <el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -103,13 +103,13 @@ const getList = async () => {
} }
const exportElecTotal = async () => { const exportElecTotal = async () => {
const res = await TjanalysisApi.queryIrealdataTimeTj(queryParams) const res = await TjanalysisApi.exportIrealdataTimeTj(queryParams)
if (res != null) { if (res != null) {
let url = window.URL.createObjectURL(new Blob([res])); let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
link.setAttribute("download", "一次主表统计表.xlsx"); link.setAttribute("download", "一次主表日统计数据.xlsx");
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
} }

14
src/views/tjanalysis/natgasdatacd/index.vue

@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -103,6 +104,19 @@ const getList = async () => {
loading.value = false loading.value = false
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportNatgasDatacdDay(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "冷拔天然气数据日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

Loading…
Cancel
Save