|
@@ -20,7 +20,7 @@
|
|
|
<hr style="background-color: #CCCCCC;height: 1px;border: 0;margin-top: 32px;">
|
|
<hr style="background-color: #CCCCCC;height: 1px;border: 0;margin-top: 32px;">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="24" class="second-row">
|
|
<el-col :span="24" class="second-row">
|
|
|
- <div class="total_balance">总金额:<span class="all-money">{{all_money}}</span> 元</div>
|
|
|
|
|
|
|
+ <div class="total_balance">总金额:<span class="all-money">{{all_money.toFixed(2)}}</span> 元</div>
|
|
|
<el-form :inline="true" class="demo-form-inline">
|
|
<el-form :inline="true" class="demo-form-inline">
|
|
|
<el-form-item label="关键字:" class="order">
|
|
<el-form-item label="关键字:" class="order">
|
|
|
<el-input v-model="selectOrder" placeholder="请输入订单号或者班级"></el-input>
|
|
<el-input v-model="selectOrder" placeholder="请输入订单号或者班级"></el-input>
|
|
@@ -34,15 +34,15 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="24" class="third-row">
|
|
<el-col :span="24" class="third-row">
|
|
|
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" highlight-current-row>
|
|
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" highlight-current-row>
|
|
|
- <el-table-column label="订单号" width="220" align="center">
|
|
|
|
|
|
|
+ <el-table-column label="订单号" width="280" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.order }}</template>
|
|
<template slot-scope="scope">{{ scope.row.order }}</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="id" label="学号" width="250"></el-table-column>
|
|
|
|
|
- <el-table-column prop="stuName" label="姓名" width="180"></el-table-column>
|
|
|
|
|
- <el-table-column prop="class" label="班级" width="220"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column prop="id" label="学号" width="260"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="stuName" label="姓名" width="160"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="class" label="班级" width="180"></el-table-column>
|
|
|
<el-table-column prop="money" label="金额(元)" width="160"></el-table-column>
|
|
<el-table-column prop="money" label="金额(元)" width="160"></el-table-column>
|
|
|
<el-table-column prop="time" label="时间" width="260" widshow-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="time" label="时间" width="260" widshow-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="状态" align="center" width="200">
|
|
|
|
|
|
|
+ <el-table-column label="状态" align="center" width="180">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-tag :type="scope.row.state === '支付失败' ? 'danger' : 'success'" disable-transitions>{{scope.row.state}}
|
|
<el-tag :type="scope.row.state === '支付失败' ? 'danger' : 'success'" disable-transitions>{{scope.row.state}}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
@@ -63,10 +63,11 @@
|
|
|
<el-dialog v-if="selectM" title="请选择月份" :visible.sync="editdialogFormVisible" width="400px" top="0vh"
|
|
<el-dialog v-if="selectM" title="请选择月份" :visible.sync="editdialogFormVisible" width="400px" top="0vh"
|
|
|
class="my-dialog">
|
|
class="my-dialog">
|
|
|
<div id="month">
|
|
<div id="month">
|
|
|
- <el-date-picker v-model="monthValue" type="month" placeholder="选择月" value-format="yyyy-MM">
|
|
|
|
|
|
|
+ <el-date-picker v-model="monthValue" type="month" placeholder="选择月" value-format="yyyy-MM"
|
|
|
|
|
+ @change="handleSelectMonth">
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
<div class="last-row">
|
|
<div class="last-row">
|
|
|
- <el-button @click="selectMonth" class="submitBtn">确定</el-button>
|
|
|
|
|
|
|
+ <el-button @click="selectMonth" class="submitBtn" :disabled="btnChangeEnableMonth">确定</el-button>
|
|
|
<el-button @click="selectLogout" class="submitBtn">取消</el-button>
|
|
<el-button @click="selectLogout" class="submitBtn">取消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -74,10 +75,11 @@
|
|
|
<el-dialog v-if="!selectM" title="请选择日期" :visible.sync="editdialogFormVisible" width="400px" top="0vh"
|
|
<el-dialog v-if="!selectM" title="请选择日期" :visible.sync="editdialogFormVisible" width="400px" top="0vh"
|
|
|
class="my-dialog">
|
|
class="my-dialog">
|
|
|
<div id="month">
|
|
<div id="month">
|
|
|
- <el-date-picker v-model="dayValue" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
|
|
|
|
|
|
|
+ <el-date-picker v-model="dayValue" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"
|
|
|
|
|
+ @change="handleSelectDay">
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
<div class="last-row">
|
|
<div class="last-row">
|
|
|
- <el-button @click="selectDay" class="submitBtn">确定</el-button>
|
|
|
|
|
|
|
+ <el-button @click="selectDay" class="submitBtn" :disabled="btnChangeEnableDay">确定</el-button>
|
|
|
<el-button @click="selectLogout" class="submitBtn">取消</el-button>
|
|
<el-button @click="selectLogout" class="submitBtn">取消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -92,7 +94,9 @@
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
editdialogFormVisible: false, //月份
|
|
editdialogFormVisible: false, //月份
|
|
|
- selectM: true,//显示月份
|
|
|
|
|
|
|
+ btnChangeEnableMonth: true, //确定月份按钮
|
|
|
|
|
+ btnChangeEnableDay: true , //确定日期按钮
|
|
|
|
|
+ selectM: true, //显示月份
|
|
|
formInline: {
|
|
formInline: {
|
|
|
user: '',
|
|
user: '',
|
|
|
options: [{
|
|
options: [{
|
|
@@ -100,10 +104,10 @@
|
|
|
label: '全部'
|
|
label: '全部'
|
|
|
}, {
|
|
}, {
|
|
|
value: 'month',
|
|
value: 'month',
|
|
|
- label: '月'
|
|
|
|
|
|
|
+ label: '按月份选择'
|
|
|
}, {
|
|
}, {
|
|
|
value: 'day',
|
|
value: 'day',
|
|
|
- label: '日'
|
|
|
|
|
|
|
+ label: '按日期选择'
|
|
|
}],
|
|
}],
|
|
|
value: ''
|
|
value: ''
|
|
|
},
|
|
},
|
|
@@ -115,25 +119,91 @@
|
|
|
selectOrder: '', //查找订单号或姓名
|
|
selectOrder: '', //查找订单号或姓名
|
|
|
monthValue: '', //选择的月份
|
|
monthValue: '', //选择的月份
|
|
|
dayValue: '', //选择的日期
|
|
dayValue: '', //选择的日期
|
|
|
|
|
+ flag: 1, //选择的状态
|
|
|
|
|
+ datestr: '', //选择的时间
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created: function() {
|
|
created: function() {
|
|
|
this.user_info = JSON.parse(sessionStorage.getItem('usr_info'))
|
|
this.user_info = JSON.parse(sessionStorage.getItem('usr_info'))
|
|
|
this.user_token = this.user_info.token
|
|
this.user_token = this.user_info.token
|
|
|
- this.getTableData(this.$Api.orderList)
|
|
|
|
|
|
|
+ this.getTableData(this.$Api.orderList, this.flag)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
//分页
|
|
//分页
|
|
|
handleCurrentChange(val) {
|
|
handleCurrentChange(val) {
|
|
|
this.currentPage = val;
|
|
this.currentPage = val;
|
|
|
this.tableData = []
|
|
this.tableData = []
|
|
|
- this.getTableData(this.$Api.orderList, val)
|
|
|
|
|
|
|
+ this.all_money = 0
|
|
|
|
|
+ this.getTableData(this.$Api.orderList, this.flag, val)
|
|
|
|
|
+ },
|
|
|
|
|
+ //选择时间
|
|
|
|
|
+ selectTime(val) {
|
|
|
|
|
+ if (val == 'month') {
|
|
|
|
|
+ this.editdialogFormVisible = true
|
|
|
|
|
+ this.selectM = true
|
|
|
|
|
+ this.flag = 2
|
|
|
|
|
+ } else if (val == 'day') {
|
|
|
|
|
+ this.editdialogFormVisible = true
|
|
|
|
|
+ this.selectM = false
|
|
|
|
|
+ this.flag = 3
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.tableData = []
|
|
|
|
|
+ this.all_money = 0
|
|
|
|
|
+ this.flag = 1
|
|
|
|
|
+ this.getTableData(this.$Api.orderList, this.flag)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //选择月份按钮
|
|
|
|
|
+ handleSelectMonth() {
|
|
|
|
|
+ // console.log(this.monthValue)
|
|
|
|
|
+ if (this.monthValue != '') {
|
|
|
|
|
+ this.btnChangeEnableMonth = false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //确定选择日期
|
|
|
|
|
+ handleSelectDay(){
|
|
|
|
|
+ if (this.dayValue != '') {
|
|
|
|
|
+ this.btnChangeEnableDay = false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //确定选择月份
|
|
|
|
|
+ selectMonth(val) {
|
|
|
|
|
+ console.log(this.monthValue)
|
|
|
|
|
+ this.formInline.value = this.monthValue
|
|
|
|
|
+ this.editdialogFormVisible = false
|
|
|
|
|
+ this.tableData = []
|
|
|
|
|
+ this.all_money = 0
|
|
|
|
|
+ this.getTableData(this.$Api.orderList, this.flag, 1, '', this.monthValue)
|
|
|
|
|
+ },
|
|
|
|
|
+ //确定选择日期
|
|
|
|
|
+ selectDay() {
|
|
|
|
|
+ console.log(this.dayValue)
|
|
|
|
|
+ this.formInline.value = this.dayValue
|
|
|
|
|
+ this.editdialogFormVisible = false
|
|
|
|
|
+ this.tableData = []
|
|
|
|
|
+ this.all_money = 0
|
|
|
|
|
+ this.getTableData(this.$Api.orderList, this.flag, 1, '', this.dayValue)
|
|
|
|
|
+ },
|
|
|
|
|
+ //退出选择
|
|
|
|
|
+ selectLogout() {
|
|
|
|
|
+ this.editdialogFormVisible = false
|
|
|
|
|
+ this.formInline.value = '请重新选择'
|
|
|
|
|
+ },
|
|
|
|
|
+ //根据关键字查找订单
|
|
|
|
|
+ onSubmit() {
|
|
|
|
|
+ // console.log(this.selectOrder)
|
|
|
|
|
+ this.tableData = []
|
|
|
|
|
+ this.all_money = 0
|
|
|
|
|
+ this.getTableData(this.$Api.orderList, this.flag, 1, this.selectOrder)
|
|
|
},
|
|
},
|
|
|
//获取订单数据
|
|
//获取订单数据
|
|
|
- getTableData(url, index) {
|
|
|
|
|
|
|
+ getTableData(url, flag, index, key, dateStr) {
|
|
|
this.$axios.get(url + '?' + this.$qs.stringify({
|
|
this.$axios.get(url + '?' + this.$qs.stringify({
|
|
|
|
|
+ 'flag': flag,
|
|
|
'curPage': index,
|
|
'curPage': index,
|
|
|
- 'pageSize': this.pageSize
|
|
|
|
|
|
|
+ 'pageSize': this.pageSize,
|
|
|
|
|
+ 'keyword': key,
|
|
|
|
|
+ 'dateStr': dateStr
|
|
|
}), {
|
|
}), {
|
|
|
headers: {
|
|
headers: {
|
|
|
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
|
|
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
|
|
@@ -151,7 +221,8 @@
|
|
|
list.class = res.data.data.page.list[i].className
|
|
list.class = res.data.data.page.list[i].className
|
|
|
list.money = res.data.data.page.list[i].orderAmount
|
|
list.money = res.data.data.page.list[i].orderAmount
|
|
|
|
|
|
|
|
- this.all_money += list.money
|
|
|
|
|
|
|
+ // this.all_money = (this.all_money + list.money).toFixed(2)
|
|
|
|
|
+ this.all_money = this.all_money + list.money
|
|
|
|
|
|
|
|
list.time = res.data.data.page.list[i].finishTime
|
|
list.time = res.data.data.page.list[i].finishTime
|
|
|
if (res.data.data.page.list[i].status == 2) {
|
|
if (res.data.data.page.list[i].status == 2) {
|
|
@@ -166,54 +237,19 @@
|
|
|
console.log(err)
|
|
console.log(err)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- //选择时间
|
|
|
|
|
- selectTime(val) {
|
|
|
|
|
- if (val == 'month') {
|
|
|
|
|
- this.editdialogFormVisible = true
|
|
|
|
|
- this.selectM = true
|
|
|
|
|
- } else if (val == 'day') {
|
|
|
|
|
- this.editdialogFormVisible = true
|
|
|
|
|
- this.selectM = false
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- //选择月份
|
|
|
|
|
- selectMonth(val) {
|
|
|
|
|
- console.log(this.monthValue)
|
|
|
|
|
- this.formInline.value = this.monthValue
|
|
|
|
|
- this.editdialogFormVisible = false
|
|
|
|
|
- },
|
|
|
|
|
- //选择日期
|
|
|
|
|
- selectDay() {
|
|
|
|
|
- console.log(this.dayValue)
|
|
|
|
|
- this.formInline.value = this.dayValue
|
|
|
|
|
- this.editdialogFormVisible = false
|
|
|
|
|
- },
|
|
|
|
|
- //退出选择
|
|
|
|
|
- selectLogout() {
|
|
|
|
|
- this.editdialogFormVisible = false
|
|
|
|
|
- this.formInline.value = '请重新选择'
|
|
|
|
|
- },
|
|
|
|
|
- onSubmit() {
|
|
|
|
|
- console.log('submit!')
|
|
|
|
|
- },
|
|
|
|
|
- handleOpen(key, keyPath) {
|
|
|
|
|
- console.log(key, keyPath)
|
|
|
|
|
- },
|
|
|
|
|
- handleClose(key, keyPath) {
|
|
|
|
|
- console.log(key, keyPath)
|
|
|
|
|
- },
|
|
|
|
|
- toggleSelection(rows) {
|
|
|
|
|
- if (rows) {
|
|
|
|
|
- rows.forEach(row => {
|
|
|
|
|
- this.$refs.multipleTable.toggleRowSelection(row)
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$refs.multipleTable.clearSelection()
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
//下载文件
|
|
//下载文件
|
|
|
downLoadFile() {
|
|
downLoadFile() {
|
|
|
- this.$axios.get(this.$Api.orderDownload, {
|
|
|
|
|
|
|
+ if (this.flag == 1) {
|
|
|
|
|
+ this.datestr = ''
|
|
|
|
|
+ } else if (this.flag == 2) {
|
|
|
|
|
+ this.datestr = this.monthValue
|
|
|
|
|
+ } else if (this.flag == 3) {
|
|
|
|
|
+ this.datestr = this.dayValue
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$axios.get(this.$Api.orderDownload + '?' + this.$qs.stringify({
|
|
|
|
|
+ 'flag': this.flag,
|
|
|
|
|
+ 'dateStr': this.datestr
|
|
|
|
|
+ }), {
|
|
|
headers: {
|
|
headers: {
|
|
|
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
|
|
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
|
|
|
'Author': 'codingliang',
|
|
'Author': 'codingliang',
|
|
@@ -221,7 +257,7 @@
|
|
|
},
|
|
},
|
|
|
responseType: 'blob'
|
|
responseType: 'blob'
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
|
|
|
|
+ // console.log(res)
|
|
|
this.download(res.data)
|
|
this.download(res.data)
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
console.log(err)
|
|
console.log(err)
|
|
@@ -236,7 +272,7 @@
|
|
|
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', '订单列表' + this.datestr + '.xlsx')
|
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
|
link.click()
|
|
link.click()
|
|
|
}
|
|
}
|