修试平衡表

This commit is contained in:
bb_pan 2025-03-25 17:54:25 +08:00
parent 445eb01338
commit b478fa87e9
1 changed files with 36 additions and 13 deletions

View File

@ -30,6 +30,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="onHandleSearch">查询</el-button> <el-button type="primary" icon="el-icon-search" @click="onHandleSearch">查询</el-button>
<el-button icon="el-icon-refresh" @click="onHandleReset">重置</el-button> <el-button icon="el-icon-refresh" @click="onHandleReset">重置</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
@ -96,7 +97,7 @@ export default {
keyWord: '' keyWord: ''
}, },
// //
queryDate: this.getDefaultDateRange(), // queryDate: [], //
cardList_2: [ cardList_2: [
{ {
title: '总接收量', title: '总接收量',
@ -162,23 +163,21 @@ export default {
] ]
} }
}, },
created() {
this.queryDate = this.getDefaultDateRange()
},
methods: { methods: {
async getList() { async getList() {
const params = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
keyWord: this.queryParams.keyWord
}
if (this.queryDate) { if (this.queryDate) {
params.startTime = this.queryDate[0] this.queryParams.startTime = this.queryDate[0]
params.endTime = this.queryDate[1] this.queryParams.endTime = this.queryDate[1]
} else { } else {
params.startTime = '' this.queryParams.startTime = ''
params.endTime = '' this.queryParams.endTime = ''
} }
console.log('🚀 ~ getList ~ params:', params) console.log('🚀 ~ getList ~ this.queryParams:', this.queryParams)
try { try {
// const res = await (params) // const res = await (this.queryParams)
} catch (error) { } catch (error) {
console.log('🚀 ~ getList ~ error:', error) console.log('🚀 ~ getList ~ error:', error)
} }
@ -217,6 +216,30 @@ export default {
// //
return [formatDate(lastMonth), formatDate(today)] return [formatDate(lastMonth), formatDate(today)]
},
//
handleExport() {
//
this.$message({
type: 'warning',
message: '导出功能尚开发中,敬请期待!'
})
if (this.queryDate) {
this.queryParams.startTime = this.queryDate[0]
this.queryParams.endTime = this.queryDate[1]
} else {
this.queryParams.startTime = ''
this.queryParams.endTime = ''
}
try {
let fileName = `数据_${new Date().getTime()}.xLsx`
let url = ''
const params = { ...this.queryParams }
console.log('🚀 ~ 导出 ~ params:', params)
// this.download(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
}
} }
} }
} }
@ -227,7 +250,7 @@ export default {
.card-box { .card-box {
display: flex; display: flex;
height: 110px; height: 110px;
.card-box-content { .card-box-content {
flex: 1; flex: 1;
display: grid; display: grid;