fix:项目初始化
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<div class="pf-warpper">
|
||||
<el-row class="table-form">
|
||||
<el-form :inline="true" :model="searchData.param" class="form-inline" size="mini">
|
||||
<el-form-item>
|
||||
<el-input @clear="onClear('gold')" clearable placeholder="请输入金额" v-model.number="searchData.gold" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker :default-time="['00:00:00', '23:59:59']" end-placeholder="结束日期" range-separator="至" start-placeholder="开始日期" type="datetimerange" v-model="time" value-format="yyyy-MM-ddTHH:mm:ss+08:00" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="onSearch()" icon="el-icon-search" plain type="primary">搜索</el-button>
|
||||
<el-button @click="refreshView" icon="el-icon-refresh" plain type="info">刷新</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-table :data="tableData" element-loading-text="拼命加载中" v-loading="loading" border height="700" highlight-current-row style="width: 100%">
|
||||
<el-table-column fixed="left" align="center" label="金币金额">
|
||||
<template slot-scope="scope">{{ scope.row.gold | changeMoneyYuan }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="left" label="总售卖金额">
|
||||
<template slot-scope="scope">{{ scope.row.totalSaleMoney | changeMoneyYuan }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="left" label="总销售数量">
|
||||
<template slot-scope="scope">{{ scope.row.saleCount }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 分页 -->
|
||||
<div class="table-pagination">
|
||||
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[10, 20, 30, 50, 100]" :total="totals" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { goldSaleinfoList } from '@/api/tran/ticketSaleinfo'
|
||||
export default {
|
||||
name: 'Saleinfo',
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 列表加载状态
|
||||
totals: 0, // 数据总条数
|
||||
time: undefined,
|
||||
gold: undefined,
|
||||
searchData: {
|
||||
param: {
|
||||
// 表单参数
|
||||
gold: undefined, // id
|
||||
start: undefined, // 开始时间
|
||||
end: undefined, // 结束时间
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
},
|
||||
|
||||
tableData: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.onSubmit()
|
||||
},
|
||||
methods: {
|
||||
// TODO:请求金币售卖统计列表
|
||||
onSubmit() {
|
||||
this.loading = true
|
||||
if (this.time) {
|
||||
this.searchData.param.start = this.time[0]
|
||||
this.searchData.param.end = this.time[1]
|
||||
} else {
|
||||
this.searchData.param.start = undefined
|
||||
this.searchData.param.end = undefined
|
||||
}
|
||||
let param = JSON.parse(JSON.stringify(this.searchData))
|
||||
param.param.gold = this.searchData.param.gold * 100
|
||||
goldSaleinfoList(this.searchData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data.list
|
||||
this.totals = res.data.total
|
||||
} else {
|
||||
this.tableData = []
|
||||
this.totals = 0
|
||||
this.$message.error('请求列表失败')
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
onSearch() {
|
||||
this.searchData.pageNum = 1
|
||||
this.searchData.pageSize = 20
|
||||
this.onSubmit()
|
||||
},
|
||||
|
||||
// 刷新
|
||||
refreshView() {
|
||||
this.onSubmit()
|
||||
},
|
||||
|
||||
// 清理搜索框
|
||||
onClear(key) {
|
||||
this.searchData.param[key] = undefined
|
||||
this.onSubmit()
|
||||
},
|
||||
|
||||
// 切换列表条数
|
||||
handleSizeChange(val) {
|
||||
this.searchData.pageSize = Number(val)
|
||||
this.onSubmit()
|
||||
},
|
||||
|
||||
// 切换列表页码
|
||||
handleCurrentChange(val) {
|
||||
this.searchData.pageNum = Number(val)
|
||||
this.onSubmit()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user