|
|
@@ -18,6 +18,34 @@
|
|
|
@size-change="sizeChange"
|
|
|
@refresh-change="refreshChange"
|
|
|
@on-load="onLoad">
|
|
|
+ <template slot-scope="{type,size}" slot="createTimeSearch">
|
|
|
+ <el-radio-group v-model="query.createTime" :size="size" style="float: left">
|
|
|
+ <el-radio-button @click="searchStateChange" :label="-1">全部</el-radio-button>
|
|
|
+ <el-radio-button @click="searchStateChange" :label="1">今天</el-radio-button>
|
|
|
+ <el-radio-button @click="searchStateChange" :label="2">昨天</el-radio-button>
|
|
|
+ <el-radio-button @click="searchStateChange" :label="3">最近七天</el-radio-button>
|
|
|
+ <el-radio-button @click="searchStateChange" :label="4">最近30天</el-radio-button>
|
|
|
+ <el-radio-button @click="searchStateChange" :label="5">本月</el-radio-button>
|
|
|
+ <el-radio-button @click="searchStateChange" :label="6">本年</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ <avue-date v-model="query.createTimeRange" type="datetimerange" format="yyyy年MM月dd日 hh:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择日期"
|
|
|
+ :size="size"
|
|
|
+ @change="searchStateChange"
|
|
|
+ style="width: 280px;margin-left:5px;float: left"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"></avue-date>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{type,size}" slot="keySearch">
|
|
|
+ <el-input type="text" placeholder="订单ID" v-model="query.key" :size="size"
|
|
|
+ style="width: 300px;margin: 1px 5px 1px 0;">
|
|
|
+ <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
|
|
|
+ @click="searchStateChange"></el-button>
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
|
|
|
+ <!-- <el-button type="primary" :size="size">导出已生成列表</el-button>-->
|
|
|
+ </template>
|
|
|
<template slot="menuLeft">
|
|
|
<span style="font-family: '宋体',serif" v-if="this.userInfo.role_name !== 'administrator'">
|
|
|
余额(易宝):
|
|
|
@@ -66,14 +94,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {add, censusPrice, getDetail, getList, handlePointBills, remove, update} from "@/api/ldt_bills/pointbills";
|
|
|
+import {add, censusPrice, getDetail, getList, handlePointBills, remove, update, generateList} from "@/api/ldt_bills/pointbills";
|
|
|
import {mapGetters} from "vuex";
|
|
|
+import moment from "moment";
|
|
|
+import FileUtil from "@/util/fileUtil";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
form: {},
|
|
|
- query: {},
|
|
|
+ query: {
|
|
|
+ createTime: -1,
|
|
|
+ createTimeRange: [],
|
|
|
+ },
|
|
|
loading: true,
|
|
|
censusPrice: {},
|
|
|
page: {
|
|
|
@@ -139,7 +172,7 @@ export default {
|
|
|
{
|
|
|
label: "交易标题",
|
|
|
prop: "title",
|
|
|
- search: true,
|
|
|
+ search: false,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入交易标题",
|
|
|
@@ -149,7 +182,7 @@ export default {
|
|
|
{
|
|
|
label: "交易状态",
|
|
|
prop: "payStatus",
|
|
|
- search: true,
|
|
|
+ search: false,
|
|
|
type: "select",
|
|
|
dicData: [{
|
|
|
label: "待付款",
|
|
|
@@ -191,7 +224,7 @@ export default {
|
|
|
{
|
|
|
label: "交易类型",
|
|
|
prop: "type",
|
|
|
- search: true,
|
|
|
+ search: false,
|
|
|
type: "select",
|
|
|
dicData: [{
|
|
|
label: "用户付款",
|
|
|
@@ -277,17 +310,29 @@ export default {
|
|
|
type: "datetime",
|
|
|
format: "yyyy-MM-dd hh:mm:ss",
|
|
|
valueFormat: "yyyy-MM-dd hh:mm:ss",
|
|
|
- searchRange: true,
|
|
|
+ searchRange:true,
|
|
|
addDisplay: false,
|
|
|
editDisplay: false,
|
|
|
search: true,
|
|
|
- searchSpan: 6,
|
|
|
+ searchSpan: 24,
|
|
|
+ searchOrder: 0,
|
|
|
+ searchslot: true,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入通知时间",
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "关键字",
|
|
|
+ prop: "key",
|
|
|
+ hide: true,
|
|
|
+ search: true,
|
|
|
+ searchslot: true,
|
|
|
+ searchOrder: 1,
|
|
|
+ searchSpan: 24,
|
|
|
+ editDisplay: false,
|
|
|
+ },
|
|
|
{
|
|
|
label: "交易说明",
|
|
|
prop: "billsDesc",
|
|
|
@@ -321,6 +366,60 @@ export default {
|
|
|
return ids.join(",");
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ //监听创建时间变化
|
|
|
+ "query.createTime": {
|
|
|
+ handler(value) {
|
|
|
+ //防止重复调用
|
|
|
+ if (value !== undefined) {
|
|
|
+ this.query.createTimeRange = [];
|
|
|
+ switch (value) {
|
|
|
+ case -1:
|
|
|
+ this.query.createTimeStart = undefined;
|
|
|
+ this.query.createTimeEnd = undefined;
|
|
|
+ break;
|
|
|
+ case 1: //今天
|
|
|
+ this.query.createTimeStart = moment().format("yyyy-MM-DD 00:00:00");
|
|
|
+ this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
|
|
|
+ break;
|
|
|
+ case 2: //昨天
|
|
|
+ this.query.createTimeStart = moment().subtract(1, 'days').format("yyyy-MM-DD 00:00:00");
|
|
|
+ this.query.createTimeEnd = moment().subtract(1, 'days').format("yyyy-MM-DD 23:59:59");
|
|
|
+ break;
|
|
|
+ case 3: //近7天
|
|
|
+ this.query.createTimeStart = moment().subtract(7, 'days').format("yyyy-MM-DD HH:mm:ss");
|
|
|
+ this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
|
|
|
+ break;
|
|
|
+ case 4: //近30天
|
|
|
+ this.query.createTimeStart = moment().subtract(30, 'days').format("yyyy-MM-DD HH:mm:ss");
|
|
|
+ this.query.createTimeEnd = moment().format("yyyy-MM-DD HH:mm:ss");
|
|
|
+ break;
|
|
|
+ case 5: //本月
|
|
|
+ this.query.createTimeStart = moment().format("yyyy-MM-01 00:00:00");
|
|
|
+ this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
|
|
|
+ break;
|
|
|
+ case 6: //本年
|
|
|
+ this.query.createTimeStart = moment().format("yyyy-01-01 00:00:00");
|
|
|
+ this.query.createTimeEnd = moment().format(`yyyy-MM-DD HH:mm:ss`);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //监听创建时间变化
|
|
|
+ "query.createTimeRange": {
|
|
|
+ handler(value) {
|
|
|
+ //防止重复调用
|
|
|
+ if (value.length === 2) {
|
|
|
+ this.query.createTimeStart = value[0];
|
|
|
+ this.query.createTimeEnd = value[1];
|
|
|
+ this.query.createTime = undefined;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getCensusPrice();
|
|
|
},
|
|
|
@@ -473,7 +572,46 @@ export default {
|
|
|
censusPrice().then(res => {
|
|
|
this.censusPrice = res.data.data;
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ //搜索状态改变
|
|
|
+ searchStateChange() {
|
|
|
+ setTimeout(() => {
|
|
|
+ const newQuery = {};
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ for (const item in this.query) {
|
|
|
+ if (this.query[item] !== undefined && this.query[item] !== -1) {
|
|
|
+ newQuery[item] = this.query[item];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.onLoad(this.page, newQuery);
|
|
|
+ }, 100);
|
|
|
+ },
|
|
|
+ //生成列表并到处
|
|
|
+ generateListAndDownload() {
|
|
|
+ const newQuery = {};
|
|
|
+ for (const item in this.query) {
|
|
|
+ if (this.query[item] !== undefined && this.query[item] !== -1) {
|
|
|
+ newQuery[item] = this.query[item];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ newQuery.createTime = null;
|
|
|
+ newQuery.createTimeRange = null;
|
|
|
+ //获取列表键值对
|
|
|
+ newQuery.keyValue = {};
|
|
|
+ this.option.column.forEach(ele=>{
|
|
|
+ newQuery.keyValue[ele.prop] = ele.label;
|
|
|
+ });
|
|
|
+ newQuery.keyValue = JSON.stringify(newQuery.keyValue);
|
|
|
+ this.loading = true;
|
|
|
+ //生成列表
|
|
|
+ generateList(this.page.currentPage, this.page.pageSize, newQuery).then(res => {
|
|
|
+ FileUtil.download(res.data,{
|
|
|
+ type: "application/vnd.ms-excel"
|
|
|
+ },`生成积分账单-${moment().format("yyyy-MM-DD HH:mm:ss")}.xls`);
|
|
|
+ }).finally(_=>{
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|