|
|
@@ -9,15 +9,16 @@
|
|
|
<el-col :span="24" class="second-row">
|
|
|
<el-form :inline="true" class="demo-form-inline">
|
|
|
<el-form-item label="" class="riqi">
|
|
|
- <el-date-picker v-model="dateFromTo" type="daterange" range-separator="至" start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期" value-format="yyyy-MM-dd">
|
|
|
+ <el-date-picker v-model="select_datetime" type="daterange" range-separator="至"
|
|
|
+ @change="dateChange" start-placeholder="开始日期" end-placeholder="结束日期"
|
|
|
+ value-format="yyyy-MM-dd">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="" class="shuibiaoId">
|
|
|
- <el-input v-model="searchformUser" clearable placeholder="请输入户号/户名/联系人/手机号"></el-input>
|
|
|
+ <el-input v-model="searchformUser" clearable placeholder="请输入户号/联系人/手机号"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="" class="zhuangtai">
|
|
|
- <el-select v-model="value" clearable placeholder="支付状态">
|
|
|
+ <el-select v-model="selectItem.value" clearable placeholder="支付状态" @change="getItem">
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label"
|
|
|
:value="item.value">
|
|
|
</el-option>
|
|
|
@@ -32,25 +33,34 @@
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <div class="">
|
|
|
+ <span class="item">总计:<span class="green_txt">{{ amount }}</span>元</span> <span
|
|
|
+ class="item">总交易笔数:<span class="green_txt">{{ total_times }}</span>笔</span> <span
|
|
|
+ class="item">次均额:<span class="green_txt">{{ avg }}</span>元</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<hr style="background-color: #CCCCCC;height: 1px;border: 0;">
|
|
|
<el-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-column align="center" label="序号">
|
|
|
- <template slot-scope="scope">{{ scope.row.stu_number }}</template>
|
|
|
+ <el-table-column align="center" label="序号" type="index" :index="indexMethod" width="100px">
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="户号">
|
|
|
- <template slot-scope="scope">{{ scope.row.stu_number }}</template>
|
|
|
+ <template slot-scope="scope">{{ scope.row.card_number }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="user_name" label="联系人" align="center"></el-table-column>
|
|
|
- <el-table-column prop="user_name" label="交易流水号" align="center"></el-table-column>
|
|
|
- <el-table-column prop="balance" label="支付余额(元)" align="center" :formatter="formatBalance"
|
|
|
+ <el-table-column prop="order_num" label="交易流水号" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="account" label="支付余额(元)" align="center" :formatter="formatBalance"
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="balance" label="到账余额(元)" align="center" :formatter="formatBalance"
|
|
|
+ <el-table-column prop="account" label="到账余额(元)" align="center" :formatter="formatBalance"
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="user_name" label="支付状态" align="center"></el-table-column>
|
|
|
- <el-table-column prop="user_name" label="支付时间" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="pay_state" label="支付状态" align="center" :formatter="formatStatus">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="re_time" label="支付时间" align="center" width="200px"></el-table-column>
|
|
|
</el-table>
|
|
|
<div style="margin-top: 20px" class="table-footer">
|
|
|
<div class="pages">
|
|
|
@@ -68,30 +78,31 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- dateFromTo: '',
|
|
|
+ amount: 0.0.toFixed(2),
|
|
|
+ total_times: 0,
|
|
|
+ avg: 0.0.toFixed(2),
|
|
|
+ select_datetime: [],
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
options: [{
|
|
|
- value: '选项1',
|
|
|
+ value: 2,
|
|
|
label: '成功'
|
|
|
}, {
|
|
|
- value: '选项2',
|
|
|
+ value: 1,
|
|
|
label: '失败'
|
|
|
}],
|
|
|
- value: '',
|
|
|
- // total_amount: 0.0.toFixed(2), // 余额共计
|
|
|
- view_total_amount: 0.0.toFixed(2), // 查看记录对话框中的余额共计
|
|
|
+ selectItem: {
|
|
|
+ value: '',
|
|
|
+ label: ''
|
|
|
+ },
|
|
|
searchformUser: '', // 查找的姓名
|
|
|
select_month: '', // 选择的月份
|
|
|
// 余额列表
|
|
|
tableData: [], // 余额列表
|
|
|
rows_total: 0, // 余额列表总记录数
|
|
|
currentPage: 1, // 余额列表当前页
|
|
|
- // 查看记录
|
|
|
- view_tableData: [], // 查看记录列表
|
|
|
- view_rows_total: 0, // 查看记录列表总记录数
|
|
|
- view_currentPage: 1, // 查看记录当前页
|
|
|
|
|
|
- pageRows: 8, // 每页记录数
|
|
|
- stu_number: '' // 学号
|
|
|
+ pageRows: 8 // 每页记录数
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -102,9 +113,34 @@
|
|
|
page: this.currentPage,
|
|
|
rows: this.pageRows
|
|
|
}
|
|
|
- this.get_amount_list(params)
|
|
|
+
|
|
|
+ // 初始化日期为今天天 至 明天
|
|
|
+ this.initDate()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getItem(e) {
|
|
|
+ if (e == 2) {
|
|
|
+ this.selectItem.value = this.options[0].value
|
|
|
+ this.selectItem.label = this.options[0].label
|
|
|
+ } else if (e == 1) {
|
|
|
+ this.selectItem.value = this.options[1].value
|
|
|
+ this.selectItem.label = this.options[1].label
|
|
|
+ } else {
|
|
|
+ this.selectItem = {}
|
|
|
+ }
|
|
|
+
|
|
|
+ // console.log(typeof(this.selectItem));
|
|
|
+ // console.log(this.selectItem);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 序号的计算
|
|
|
+ */
|
|
|
+ indexMethod(index) {
|
|
|
+ return (this.currentPage - 1) * 8 + index + 1;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 格式化列数据
|
|
|
+ */
|
|
|
formatBalance: (row, column, cellValue, index) => {
|
|
|
// row: 行数据
|
|
|
// column: 列属性
|
|
|
@@ -112,32 +148,24 @@
|
|
|
// index: 行索引,注意:2.3.9版本以后才有。
|
|
|
return cellValue.toFixed(2)
|
|
|
},
|
|
|
- /**
|
|
|
- * 获取当月,格式YYYY-MM
|
|
|
- */
|
|
|
- getNowFormatDate() {
|
|
|
- var date = new Date();
|
|
|
- var seperator1 = "-";
|
|
|
- var year = date.getFullYear();
|
|
|
- var month = date.getMonth() + 1;
|
|
|
- var strDate = date.getDate();
|
|
|
- if (month >= 1 && month <= 9) {
|
|
|
- month = "0" + month;
|
|
|
- }
|
|
|
- if (strDate >= 0 && strDate <= 9) {
|
|
|
- strDate = "0" + strDate;
|
|
|
+ formatStatus: (row, column, cellValue, index) => {
|
|
|
+ // row: 行数据
|
|
|
+ // column: 列属性
|
|
|
+ // cellValue: 单元格数据值
|
|
|
+ // index: 行索引,注意:2.3.9版本以后才有。
|
|
|
+ if (cellValue == 2) {
|
|
|
+ return '成功'
|
|
|
}
|
|
|
- var currentdate = year + seperator1 + month;
|
|
|
- return currentdate;
|
|
|
+ return '失败'
|
|
|
},
|
|
|
/**
|
|
|
- * 获取余额列表
|
|
|
+ * 充值记录列表
|
|
|
*/
|
|
|
get_amount_list(params) {
|
|
|
var _this = this
|
|
|
_this.tableData = []
|
|
|
// _this.rows_total = 0
|
|
|
- this.$axios.get('/jxch-smartmp-api/HotWaters/waterMoney.action', {
|
|
|
+ this.$axios.get('/jxch-smartmp-api/HotWaters/waterqueryRe.action', {
|
|
|
params: params
|
|
|
})
|
|
|
.then(res => {
|
|
|
@@ -147,185 +175,137 @@
|
|
|
// _this.$message.success('数据加载成功!');
|
|
|
_this.tableData = res.data.rows
|
|
|
_this.rows_total = res.data.total
|
|
|
+
|
|
|
+ _this.amount = res.data.totalAccount.toFixed(2)
|
|
|
+ _this.total_times = res.data.total
|
|
|
+ _this.avg = res.data.avgAccount.toFixed(2)
|
|
|
} else {
|
|
|
- _this.$message.success('【获取余额列表】暂无数据!');
|
|
|
+ _this.$message.success('【充值记录列表】暂无数据!');
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
|
// console.log(err);
|
|
|
- _this.$message.error('【获取余额列表】请求异常: ' + err);
|
|
|
+ _this.$message.error('【充值记录列表】请求异常: ' + err);
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- * 获取总金额
|
|
|
- */
|
|
|
- // get_total_amount() {
|
|
|
- // var _this = this
|
|
|
- // this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindMoneyTotal.action')
|
|
|
- // .then(res => {
|
|
|
- // // console.log(res.data);
|
|
|
- // if (typeof(res.data.money) != 'undefined' && res.data.money != '' && JSON.stringify(res
|
|
|
- // .data) != '{}') {
|
|
|
- // // _this.$message.success('数据加载成功!');
|
|
|
- // let amount = res.data.money
|
|
|
- // _this.total_amount = parseFloat(amount).toFixed(2)
|
|
|
- // } else {
|
|
|
- // _this.$message.success('【获取总金额】暂无数据!');
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch(err => {
|
|
|
- // // console.log(err);
|
|
|
- // _this.$message.error('【获取总金额】请求异常: ' + err);
|
|
|
- // })
|
|
|
- // },
|
|
|
- /**
|
|
|
- * 余额列表改变页码
|
|
|
+ * 充值记录列表改变页码
|
|
|
* @param {Object} val
|
|
|
*/
|
|
|
handleCurrentChange(val) {
|
|
|
// console.log(val);
|
|
|
this.currentPage = val
|
|
|
- var params = {}
|
|
|
- if (this.searchformUser != '' & typeof(this.searchformUser) != 'undefined') {
|
|
|
- params = {
|
|
|
- page: this.currentPage,
|
|
|
- rows: this.pageRows,
|
|
|
- user_name: this.searchformUser
|
|
|
- }
|
|
|
- } else {
|
|
|
- params = {
|
|
|
- page: this.currentPage,
|
|
|
- rows: this.pageRows
|
|
|
- }
|
|
|
+ var params = {
|
|
|
+ page: this.currentPage,
|
|
|
+ rows: this.pageRows,
|
|
|
+ }
|
|
|
+ if (this.startTime != '' && typeof(this.startTime) != 'undefined') {
|
|
|
+ params.begin_time = this.startTime
|
|
|
+ }
|
|
|
+ if (this.endTime != '' && typeof(this.endTime) != 'undefined') {
|
|
|
+ params.end_time = this.endTime
|
|
|
}
|
|
|
- // 获取余额列表
|
|
|
+ if (this.searchformUser != '' && typeof(this.searchformUser) != 'undefined') {
|
|
|
+ params.user_name = this.searchformUser
|
|
|
+ }
|
|
|
+ if (this.selectItem && this.selectItem.value != '' && this.selectItem.label != '') {
|
|
|
+ params.value = this.selectItem.value
|
|
|
+ params.label = this.selectItem.label
|
|
|
+ }
|
|
|
+ // 获取充值记录列表
|
|
|
this.get_amount_list(params)
|
|
|
},
|
|
|
/**
|
|
|
- * 查找姓名对应的 余额列表
|
|
|
+ * 初始化日期时间
|
|
|
*/
|
|
|
- onSearch() {
|
|
|
- console.log(this.dateFromTo);
|
|
|
- // console.log(this.searchformUser);
|
|
|
- this.currentPage = 1
|
|
|
- this.handleCurrentChange(this.currentPage)
|
|
|
+ initDate() {
|
|
|
+ //当前设定的日期时间
|
|
|
+ let d = new Date;
|
|
|
+ var year1 = d.getFullYear(); // 获取当前年份
|
|
|
+ var mon1 = d.getMonth() + 1; // 获取当前月份
|
|
|
+ var day1 = d.getDate(); // 获取当前日
|
|
|
+
|
|
|
+ //前一天设定的日期时间
|
|
|
+ d.setTime(d.getTime() - 24 * 60 * 60 * 1000);
|
|
|
+ var year2 = d.getFullYear(); // 获取当前年份
|
|
|
+ var mon2 = d.getMonth() + 1; // 获取当前月份
|
|
|
+ var day2 = d.getDate(); // 获取当前日
|
|
|
+
|
|
|
+ this.startTime = this.getDate(year2, mon2, day2)
|
|
|
+ this.endTime = this.getDate(year1, mon1, day1)
|
|
|
+
|
|
|
+ this.select_datetime.push(this.startTime)
|
|
|
+ this.select_datetime.push(this.endTime)
|
|
|
+
|
|
|
+ // 显示列表
|
|
|
+ this.handleCurrentChange(1)
|
|
|
},
|
|
|
/**
|
|
|
- * 查看充值记录列表
|
|
|
- * @param {Object} index
|
|
|
- * @param {Object} row
|
|
|
+ * 获取指定格式 年、月、日
|
|
|
+ * @param {Object} y
|
|
|
+ * @param {Object} m
|
|
|
+ * @param {Object} d
|
|
|
*/
|
|
|
- handleShowDialog(index, row) {
|
|
|
- // console.log(index, row)
|
|
|
- // 获取当月
|
|
|
- this.select_month = this.getNowFormatDate();
|
|
|
- this.stu_number = row.stu_number
|
|
|
- // 组合参数
|
|
|
- let params = {
|
|
|
- stu_number: this.stu_number,
|
|
|
- time: this.select_month,
|
|
|
- page: 1,
|
|
|
- rows: this.pageRows
|
|
|
- }
|
|
|
-
|
|
|
- // 获取查看记录列表
|
|
|
- this.get_view_list(params)
|
|
|
+ getDate(y, m, d) {
|
|
|
+ m = m > 9 ? m : '0' + m;
|
|
|
+ d = d > 9 ? d : '0' + d;
|
|
|
|
|
|
- // 充值记录总计
|
|
|
- // this.get_view_total_amount()
|
|
|
+ return y + "-" + m + "-" + d;
|
|
|
},
|
|
|
/**
|
|
|
- * 充值记录总计
|
|
|
+ * 选择起止日期
|
|
|
+ * @param {Object} val
|
|
|
*/
|
|
|
- // get_view_total_amount() {
|
|
|
- // var _this = this
|
|
|
- // _this.view_total_amount = 0.0.toFixed(2)
|
|
|
- // this.$axios.get('/jxch-smartmp-api/HotWaters/waterrechargeTotal.action', {
|
|
|
- // params: {
|
|
|
- // re_time: this.select_month,
|
|
|
- // stu_number: this.stu_number
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // // console.log(res.data);
|
|
|
- // if (typeof(res.data.money) != 'undefined' && res.data.money != '' && JSON.stringify(res
|
|
|
- // .data) != '{}') {
|
|
|
- // // _this.$message.success('数据加载成功!');
|
|
|
- // let amount = res.data.money
|
|
|
- // _this.view_total_amount = parseFloat(amount).toFixed(2)
|
|
|
- // } else {
|
|
|
- // _this.$message.success('【充值记录总计】暂无数据!');
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch(err => {
|
|
|
- // // console.log(err);
|
|
|
- // _this.$message.error('【充值记录总计】请求异常: ' + err);
|
|
|
- // })
|
|
|
- // },
|
|
|
+ dateChange(val) {
|
|
|
+ this.startTime = val[0]
|
|
|
+ this.endTime = val[1]
|
|
|
+
|
|
|
+ if (this.startTime == this.endTime) {
|
|
|
+ this.$message.error('起止日期不能为同一天!')
|
|
|
+ } else {
|
|
|
+ // 选择日期后,马上搜索
|
|
|
+ // this.handleCurrentChange(1)
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
- * 选择月份,更新查看记录列表
|
|
|
+ * 查找姓名对应的 余额列表
|
|
|
*/
|
|
|
- // handleChangeMonth() {
|
|
|
- // // console.log(this.select_month);
|
|
|
- // this.currentPage = 1
|
|
|
- // // 组合参数
|
|
|
- // let params = {
|
|
|
- // stu_number: this.stu_number,
|
|
|
- // time: this.select_month,
|
|
|
- // page: this.currentPage,
|
|
|
- // rows: this.pageRows
|
|
|
- // }
|
|
|
-
|
|
|
- // // 获取查看记录列表
|
|
|
- // this.get_view_list(params)
|
|
|
+ onSearch() {
|
|
|
+ this.currentPage = 1
|
|
|
|
|
|
- // // 充值记录总计
|
|
|
- // this.get_view_total_amount()
|
|
|
- // },
|
|
|
+ this.handleCurrentChange(this.currentPage)
|
|
|
+ },
|
|
|
/**
|
|
|
- * 获取查看记录列表
|
|
|
+ * 导出为Excel表格
|
|
|
*/
|
|
|
- // get_view_list(params) {
|
|
|
- // var _this = this
|
|
|
- // _this.view_tableData = []
|
|
|
- // // _this.view_rows_total = 0
|
|
|
- // this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindRecharge.action', {
|
|
|
- // params: params
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // // console.log(res.data);
|
|
|
- // if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !=
|
|
|
- // '{}') {
|
|
|
- // // _this.$message.success('数据加载成功!');
|
|
|
- // _this.view_tableData = res.data.rows
|
|
|
- // _this.view_rows_total = res.data.total
|
|
|
- // } else {
|
|
|
- // _this.$message.success('【获取查看记录列表】暂无数据!');
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .catch(err => {
|
|
|
- // // console.log(err);
|
|
|
- // _this.$message.error('【获取查看记录列表】请求异常: ' + err);
|
|
|
- // })
|
|
|
- // },
|
|
|
+ onExport() {
|
|
|
+ console.log('onExport');
|
|
|
+ },
|
|
|
/**
|
|
|
- * 查看记录对话框改变页码
|
|
|
- * @param {Object} val
|
|
|
+ * 获取查看记录列表
|
|
|
*/
|
|
|
- handleViewCurrentChange(val) {
|
|
|
- // console.log(val);
|
|
|
- this.view_currentPage = val
|
|
|
-
|
|
|
- // 组合参数
|
|
|
- let params = {
|
|
|
- stu_number: this.stu_number,
|
|
|
- time: this.select_month,
|
|
|
- page: this.view_currentPage,
|
|
|
- rows: this.pageRows
|
|
|
- }
|
|
|
-
|
|
|
- // 获取余额列表
|
|
|
- this.get_view_list(params)
|
|
|
+ get_view_list(params) {
|
|
|
+ var _this = this
|
|
|
+ _this.view_tableData = []
|
|
|
+ // _this.view_rows_total = 0
|
|
|
+ this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindRecharge.action', {
|
|
|
+ params: params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ // console.log(res.data);
|
|
|
+ if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !=
|
|
|
+ '{}') {
|
|
|
+ // _this.$message.success('数据加载成功!');
|
|
|
+ _this.view_tableData = res.data.rows
|
|
|
+ _this.view_rows_total = res.data.total
|
|
|
+ } else {
|
|
|
+ _this.$message.success('【获取查看记录列表】暂无数据!');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // console.log(err);
|
|
|
+ _this.$message.error('【获取查看记录列表】请求异常: ' + err);
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|