leisure-core 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +21 -0
- package/le-commission/index.js +7 -0
- package/le-commission/src/main.vue +175 -0
- package/le-commission/src/sub.vue +213 -0
- package/le-coupon/index.js +17 -0
- package/le-coupon/src/details.vue +115 -0
- package/le-coupon/src/main.vue +194 -0
- package/le-coupon/src/sub.vue +362 -0
- package/le-help/index.js +12 -0
- package/le-help/src/detail.vue +40 -0
- package/le-help/src/main.vue +130 -0
- package/le-libs/mixins/main.js +15 -7
- package/le-mpurl/index.js +7 -0
- package/le-mpurl/src/main.vue +51 -0
- package/le-promotions/index.js +7 -0
- package/le-promotions/src/main.vue +220 -0
- package/le-promotions/src/sub.vue +248 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -27,7 +27,12 @@ import LeImage from "./le-image/index.js";
|
|
|
27
27
|
import LeBackUp from "./le-backup/index.js";
|
|
28
28
|
import LeSeting from "./le-seting/index.js";
|
|
29
29
|
import LeRate from "./le-rate/index.js";
|
|
30
|
+
import { LeCoupon, LeCouponSub, LeCouponDetails } from "./le-coupon/index.js";
|
|
30
31
|
import LeUpload from "./le-upload/index.js";
|
|
32
|
+
import LePromotions from "./le-promotions/index.js";
|
|
33
|
+
import LeCommission from "./le-commission/index.js";
|
|
34
|
+
import LeMpurl from "./le-mpurl/index.js";
|
|
35
|
+
import { LeHelp, LeHelpDetail } from "./le-help/index.js";
|
|
31
36
|
|
|
32
37
|
const components = [
|
|
33
38
|
LeButton,
|
|
@@ -58,6 +63,14 @@ const components = [
|
|
|
58
63
|
LeSeting,
|
|
59
64
|
LeRate,
|
|
60
65
|
LeUpload,
|
|
66
|
+
LeCoupon,
|
|
67
|
+
LeCouponSub,
|
|
68
|
+
LeCouponDetails,
|
|
69
|
+
LePromotions,
|
|
70
|
+
LeCommission,
|
|
71
|
+
LeMpurl,
|
|
72
|
+
LeHelp,
|
|
73
|
+
LeHelpDetail,
|
|
61
74
|
];
|
|
62
75
|
|
|
63
76
|
const install = function (Vue) {
|
|
@@ -157,4 +170,12 @@ export default {
|
|
|
157
170
|
LeSeting,
|
|
158
171
|
LeRate,
|
|
159
172
|
LeUpload,
|
|
173
|
+
LeCoupon,
|
|
174
|
+
LeCouponSub,
|
|
175
|
+
LeCouponDetails,
|
|
176
|
+
LePromotions,
|
|
177
|
+
LeCommission,
|
|
178
|
+
LeMpurl,
|
|
179
|
+
LeHelp,
|
|
180
|
+
LeHelpDetail,
|
|
160
181
|
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="divSearch">
|
|
4
|
+
<el-form :inline="true" :model="searchData">
|
|
5
|
+
<el-form-item label="账号">
|
|
6
|
+
<el-input
|
|
7
|
+
v-model="searchData.account"
|
|
8
|
+
placeholder="导游/分销员账号"
|
|
9
|
+
></el-input>
|
|
10
|
+
</el-form-item>
|
|
11
|
+
<el-form-item label="部门">
|
|
12
|
+
<el-select
|
|
13
|
+
v-model="searchData.did"
|
|
14
|
+
clearable
|
|
15
|
+
placeholder="请选择部门"
|
|
16
|
+
>
|
|
17
|
+
<el-option
|
|
18
|
+
v-for="item in departs"
|
|
19
|
+
:label="item.dname"
|
|
20
|
+
:value="item.id"
|
|
21
|
+
:key="item.id"
|
|
22
|
+
></el-option>
|
|
23
|
+
</el-select>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
<el-form-item>
|
|
26
|
+
<el-button type="primary" @click="clickList">查询</el-button>
|
|
27
|
+
</el-form-item>
|
|
28
|
+
</el-form>
|
|
29
|
+
</div>
|
|
30
|
+
<vxe-table :data="tableData" align="center" border stripe>
|
|
31
|
+
<vxe-column field="account" title="账号" width="180"> </vxe-column>
|
|
32
|
+
<vxe-column align="center" title="佣金(元)">
|
|
33
|
+
<template slot-scope="scope">
|
|
34
|
+
<span>¥{{ formatMoney(scope.row.commissions) }}</span>
|
|
35
|
+
</template>
|
|
36
|
+
</vxe-column>
|
|
37
|
+
<vxe-column title="操作" align="center" width="220">
|
|
38
|
+
<template slot-scope="scope">
|
|
39
|
+
<el-button
|
|
40
|
+
v-if="scope.row.otype != 2"
|
|
41
|
+
type="primary"
|
|
42
|
+
size="small"
|
|
43
|
+
@click="dispListDetail(scope.row)"
|
|
44
|
+
style="margin-right: 2px"
|
|
45
|
+
>
|
|
46
|
+
详情
|
|
47
|
+
</el-button>
|
|
48
|
+
<el-button
|
|
49
|
+
type="primary"
|
|
50
|
+
size="small"
|
|
51
|
+
:disabled="judgeBtnIs(scope.row)"
|
|
52
|
+
@click="send(scope.row)"
|
|
53
|
+
style="margin-right: 2px"
|
|
54
|
+
>
|
|
55
|
+
发放
|
|
56
|
+
</el-button>
|
|
57
|
+
</template>
|
|
58
|
+
</vxe-column>
|
|
59
|
+
</vxe-table>
|
|
60
|
+
<div style="text-align: center; margin-top: 30px; width: 100%">
|
|
61
|
+
<vxe-pager
|
|
62
|
+
align="center"
|
|
63
|
+
:current-page="searchData.pageNo"
|
|
64
|
+
:page-size="10"
|
|
65
|
+
:total="total"
|
|
66
|
+
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'Total']"
|
|
67
|
+
@page-change="current_change"
|
|
68
|
+
></vxe-pager>
|
|
69
|
+
</div>
|
|
70
|
+
<le-dialog-container
|
|
71
|
+
width="90%"
|
|
72
|
+
title="促销详情"
|
|
73
|
+
:showDialog="showListDetails"
|
|
74
|
+
@close="closeDetailsDialog"
|
|
75
|
+
:showFooter="true"
|
|
76
|
+
:showSaveBtn="false"
|
|
77
|
+
>
|
|
78
|
+
<le-commission-sub
|
|
79
|
+
:account="account"
|
|
80
|
+
v-if="showListDetails"
|
|
81
|
+
></le-commission-sub>
|
|
82
|
+
</le-dialog-container>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
<script>
|
|
86
|
+
import { listSum, send as commissionSend } from "@/api/commission";
|
|
87
|
+
import LeCommissionSub from "./sub.vue";
|
|
88
|
+
import { departList } from "@/api/depart";
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
name: "le-commission",
|
|
92
|
+
components: { LeCommissionSub },
|
|
93
|
+
data() {
|
|
94
|
+
return {
|
|
95
|
+
showListDetails: false,
|
|
96
|
+
account: null,
|
|
97
|
+
tableData: [],
|
|
98
|
+
searchData: {
|
|
99
|
+
account: "",
|
|
100
|
+
pageNo: 1,
|
|
101
|
+
did: "",
|
|
102
|
+
},
|
|
103
|
+
total: 0,
|
|
104
|
+
departs: [],
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
mounted() {
|
|
108
|
+
this.getDeparts();
|
|
109
|
+
this.commissionSumList();
|
|
110
|
+
},
|
|
111
|
+
methods: {
|
|
112
|
+
judgeBtnIs(item) {
|
|
113
|
+
if (item.commissions > 0) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
},
|
|
118
|
+
closeDetailsDialog() {
|
|
119
|
+
this.detailRow = null;
|
|
120
|
+
this.showListDetails = false;
|
|
121
|
+
},
|
|
122
|
+
current_change({ currentPage }) {
|
|
123
|
+
this.searchData.pageNo = currentPage;
|
|
124
|
+
this.commissionSumList();
|
|
125
|
+
},
|
|
126
|
+
clickList() {
|
|
127
|
+
this.searchData.pageNo = 1;
|
|
128
|
+
this.commissionSumList();
|
|
129
|
+
},
|
|
130
|
+
commissionSumList() {
|
|
131
|
+
let param = this.getSearchParam();
|
|
132
|
+
listSum(param).then((response) => {
|
|
133
|
+
this.tableData = response.data.data.list;
|
|
134
|
+
this.total = response.data.data.count;
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
getSearchParam() {
|
|
138
|
+
// let params = {};
|
|
139
|
+
// params.account = this.searchData.account;
|
|
140
|
+
return this.searchData;
|
|
141
|
+
},
|
|
142
|
+
dispListDetail(item) {
|
|
143
|
+
this.showListDetails = true;
|
|
144
|
+
this.account = item.account;
|
|
145
|
+
},
|
|
146
|
+
getDeparts() {
|
|
147
|
+
departList().then((res) => {
|
|
148
|
+
this.departs = res.data.data;
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
send(item) {
|
|
152
|
+
let param = {};
|
|
153
|
+
param.account = item.account;
|
|
154
|
+
param.commissions = item.commissions;
|
|
155
|
+
param.uid_send = this.$store.getters.userinfo.id;
|
|
156
|
+
commissionSend(param).then((res) => {
|
|
157
|
+
this.$message.success("发放状态已经变更");
|
|
158
|
+
this.clickList();
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
</script>
|
|
164
|
+
<style lang="scss" scoped>
|
|
165
|
+
.yeClass {
|
|
166
|
+
padding-left: 10px;
|
|
167
|
+
/* margin-top: 10px; */
|
|
168
|
+
background-color: #f2f6fc;
|
|
169
|
+
height: 40px;
|
|
170
|
+
line-height: 40px;
|
|
171
|
+
font-size: 13px;
|
|
172
|
+
display: flex;
|
|
173
|
+
justify-content: space-between;
|
|
174
|
+
}
|
|
175
|
+
</style>
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="divSearch">
|
|
4
|
+
<el-form :inline="true" :model="searchData">
|
|
5
|
+
<el-form-item label="账号">
|
|
6
|
+
<el-input
|
|
7
|
+
v-model="searchData.account"
|
|
8
|
+
placeholder="导游/分销员账号"
|
|
9
|
+
></el-input>
|
|
10
|
+
</el-form-item>
|
|
11
|
+
<el-form-item label="订单时间">
|
|
12
|
+
<el-date-picker
|
|
13
|
+
v-model="timeArr"
|
|
14
|
+
type="datetimerange"
|
|
15
|
+
value-format="yyyy-MM-dd HH:mm:ss"
|
|
16
|
+
range-separator="至"
|
|
17
|
+
start-placeholder="开始日期"
|
|
18
|
+
end-placeholder="结束日期"
|
|
19
|
+
>
|
|
20
|
+
</el-date-picker>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
<el-form-item>
|
|
23
|
+
<el-button type="primary" @click="clickList">查询</el-button>
|
|
24
|
+
</el-form-item>
|
|
25
|
+
</el-form>
|
|
26
|
+
</div>
|
|
27
|
+
<vxe-table :data="tableData" align="center" border stripe>
|
|
28
|
+
<vxe-column field="account" title="账号"> </vxe-column>
|
|
29
|
+
<vxe-column title="账号类别">
|
|
30
|
+
<template slot-scope="scope">
|
|
31
|
+
<span v-if="scope.row.user_type == 1">导游</span>
|
|
32
|
+
<span v-if="scope.row.user_type == 2">旅行社</span>
|
|
33
|
+
<span v-if="scope.row.user_type == 3">单位促销员</span>
|
|
34
|
+
</template>
|
|
35
|
+
</vxe-column>
|
|
36
|
+
<vxe-column field="phone" title="手机号"></vxe-column>
|
|
37
|
+
<vxe-column title="账号名称">
|
|
38
|
+
<template slot-scope="scope">
|
|
39
|
+
<span v-if="scope.row.depart_name">{{ scope.row.depart_name }}</span>
|
|
40
|
+
<span v-if="scope.row.gname">{{ scope.row.gname }}</span>
|
|
41
|
+
<span v-if="scope.row.aname">{{ scope.row.aname }}</span>
|
|
42
|
+
</template>
|
|
43
|
+
</vxe-column>
|
|
44
|
+
<vxe-column align="center" title="佣金(元)">
|
|
45
|
+
<template slot-scope="scope">
|
|
46
|
+
<span>¥{{ formatMoney(scope.row.commissions) }}</span>
|
|
47
|
+
</template>
|
|
48
|
+
</vxe-column>
|
|
49
|
+
<vxe-column align="center" field="otype" title="订单状态">
|
|
50
|
+
<template slot-scope="scope">
|
|
51
|
+
<span v-if="scope.row.otype == 0">获取佣金</span>
|
|
52
|
+
<span v-if="scope.row.otype == 1">退还佣金</span>
|
|
53
|
+
<span v-if="scope.row.otype == 2">发放佣金</span>
|
|
54
|
+
</template>
|
|
55
|
+
</vxe-column>
|
|
56
|
+
<vxe-column align="center" field="odate" title="订单日期">
|
|
57
|
+
<template slot-scope="scope">
|
|
58
|
+
<span>{{ dateFormat(scope.row.odate) }}</span>
|
|
59
|
+
</template>
|
|
60
|
+
</vxe-column>
|
|
61
|
+
<vxe-column align="center" field="cdate" title="发放日期">
|
|
62
|
+
<template slot-scope="scope">
|
|
63
|
+
<span>{{ dateFormat(scope.row.cdate) }}</span>
|
|
64
|
+
</template>
|
|
65
|
+
</vxe-column>
|
|
66
|
+
<vxe-column title="操作" align="center" width="120">
|
|
67
|
+
<template slot-scope="scope">
|
|
68
|
+
<el-button
|
|
69
|
+
v-if="scope.row.otype != 2"
|
|
70
|
+
type="primary"
|
|
71
|
+
size="small"
|
|
72
|
+
@click="getOder(scope.row)"
|
|
73
|
+
style="margin-right: 2px"
|
|
74
|
+
>
|
|
75
|
+
订单
|
|
76
|
+
</el-button>
|
|
77
|
+
</template>
|
|
78
|
+
</vxe-column>
|
|
79
|
+
</vxe-table>
|
|
80
|
+
<div style="text-align: center; margin-top: 30px; width: 100%">
|
|
81
|
+
<vxe-pager
|
|
82
|
+
align="center"
|
|
83
|
+
:current-page="searchData.pageNo"
|
|
84
|
+
:page-size="10"
|
|
85
|
+
:total="total"
|
|
86
|
+
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'Total']"
|
|
87
|
+
@page-change="current_change"
|
|
88
|
+
></vxe-pager>
|
|
89
|
+
</div>
|
|
90
|
+
<le-dialog-container
|
|
91
|
+
width="80%"
|
|
92
|
+
title="订单详情"
|
|
93
|
+
:showDialog="showDetails"
|
|
94
|
+
@close="closeDetailsDialog"
|
|
95
|
+
:showFooter="true"
|
|
96
|
+
:showSaveBtn="false"
|
|
97
|
+
>
|
|
98
|
+
<le-order-detail
|
|
99
|
+
:rowData="detailRow"
|
|
100
|
+
:orderCanEdit="false"
|
|
101
|
+
v-if="showDetails"
|
|
102
|
+
></le-order-detail>
|
|
103
|
+
</le-dialog-container>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
<script>
|
|
107
|
+
import { list as commissionList } from "@/api/commission";
|
|
108
|
+
import { select } from "@/api/goods_order";
|
|
109
|
+
import moment from "moment";
|
|
110
|
+
|
|
111
|
+
export default {
|
|
112
|
+
name: "le-commission-sub",
|
|
113
|
+
props: ["account"],
|
|
114
|
+
data() {
|
|
115
|
+
return {
|
|
116
|
+
showDetails: false,
|
|
117
|
+
detailRow: null,
|
|
118
|
+
tableData: [],
|
|
119
|
+
searchData: {
|
|
120
|
+
account: "",
|
|
121
|
+
pageNo: 1,
|
|
122
|
+
date_end: "",
|
|
123
|
+
date_start: "",
|
|
124
|
+
},
|
|
125
|
+
total: 0,
|
|
126
|
+
timeArr: "",
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
mounted() {
|
|
130
|
+
this.commissionList();
|
|
131
|
+
},
|
|
132
|
+
methods: {
|
|
133
|
+
judgeBtnIs(item) {
|
|
134
|
+
if (item.commissions > 0) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
},
|
|
139
|
+
closeDetailsDialog() {
|
|
140
|
+
this.detailRow = null;
|
|
141
|
+
this.showDetails = false;
|
|
142
|
+
},
|
|
143
|
+
getOder(item) {
|
|
144
|
+
let param = {};
|
|
145
|
+
param.oid = item.oid;
|
|
146
|
+
select(param).then((res) => {
|
|
147
|
+
this.detailRow = res.data.data;
|
|
148
|
+
this.showDetails = true;
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
filterParams(obj) {
|
|
152
|
+
var _newPar = {};
|
|
153
|
+
for (var key in obj) {
|
|
154
|
+
if (
|
|
155
|
+
(obj[key] === false || obj[key]) &&
|
|
156
|
+
obj[key].toString().replace(/(^\s*)|(\s*$)/g, "") !== ""
|
|
157
|
+
) {
|
|
158
|
+
_newPar[key] = obj[key];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return _newPar;
|
|
162
|
+
},
|
|
163
|
+
current_change({ currentPage }) {
|
|
164
|
+
this.searchData.pageNo = currentPage;
|
|
165
|
+
this.commissionList();
|
|
166
|
+
},
|
|
167
|
+
dateFormat(data) {
|
|
168
|
+
if (data) {
|
|
169
|
+
return moment.unix(data).format("YYYY-MM-DD HH:mm");
|
|
170
|
+
} else return "";
|
|
171
|
+
},
|
|
172
|
+
clickList() {
|
|
173
|
+
this.searchData.pageNo = 1;
|
|
174
|
+
this.commissionList();
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
commissionList() {
|
|
178
|
+
let param = this.getSearchParam();
|
|
179
|
+
if (!param.account || param.account.length <= 0) {
|
|
180
|
+
param.account = this.account;
|
|
181
|
+
}
|
|
182
|
+
commissionList(param).then((response) => {
|
|
183
|
+
this.tableData = response.data.data.list;
|
|
184
|
+
this.total = response.data.data.count;
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
getSearchParam() {
|
|
188
|
+
if (this.timeArr && this.timeArr.length == 2) {
|
|
189
|
+
this.searchData.date_start = new Date(this.timeArr[0]).getTime() / 1000;
|
|
190
|
+
this.searchData.date_end = new Date(this.timeArr[1]).getTime() / 1000;
|
|
191
|
+
} else {
|
|
192
|
+
this.searchData.date_start = 0;
|
|
193
|
+
this.searchData.date_end = 0;
|
|
194
|
+
}
|
|
195
|
+
let params = this.filterParams(this.searchData);
|
|
196
|
+
params.account = this.searchData.account;
|
|
197
|
+
return params;
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
</script>
|
|
202
|
+
<style lang="scss" scoped>
|
|
203
|
+
.yeClass {
|
|
204
|
+
padding-left: 10px;
|
|
205
|
+
/* margin-top: 10px; */
|
|
206
|
+
background-color: #f2f6fc;
|
|
207
|
+
height: 40px;
|
|
208
|
+
line-height: 40px;
|
|
209
|
+
font-size: 13px;
|
|
210
|
+
display: flex;
|
|
211
|
+
justify-content: space-between;
|
|
212
|
+
}
|
|
213
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import LeCoupon from "./src/main.vue";
|
|
2
|
+
import LeCouponSub from "./src/sub.vue";
|
|
3
|
+
import LeCouponDetails from "./src/details.vue";
|
|
4
|
+
|
|
5
|
+
LeCoupon.install = function (Vue) {
|
|
6
|
+
Vue.component(LeCoupon.name, LeCoupon);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
LeCouponSub.install = function (Vue) {
|
|
10
|
+
Vue.component(LeCouponSub.name, LeCouponSub);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
LeCouponDetails.install = function (Vue) {
|
|
14
|
+
Vue.component(LeCouponDetails.name, LeCouponDetails);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { LeCoupon, LeCouponSub, LeCouponDetails };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form :inline="true" :model="searchData">
|
|
4
|
+
<el-form-item label="领用时间">
|
|
5
|
+
<el-date-picker v-model="timeArr" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至"
|
|
6
|
+
start-placeholder="开始日期" end-placeholder="结束日期">
|
|
7
|
+
</el-date-picker>
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="优惠券状态">
|
|
10
|
+
<el-select v-model="status" placeholder="选择状态" clearable>
|
|
11
|
+
<el-option v-for="item in statusOptions" :label="item.value" :value="item.id" :key="item.id"></el-option>
|
|
12
|
+
</el-select>
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<el-form-item><el-button type="primary" @click="list">查询</el-button></el-form-item>
|
|
15
|
+
</el-form>
|
|
16
|
+
<el-table :data="tableData" border row-key="id" :max-height="tableHeight"
|
|
17
|
+
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }" stripe
|
|
18
|
+
style="width: 100%">
|
|
19
|
+
<el-table-column prop="id" label="优惠券id"></el-table-column>
|
|
20
|
+
<el-table-column prop="oid" label="使用的订单id">
|
|
21
|
+
<template slot-scope="scope">
|
|
22
|
+
{{ scope.row.status == 1 ? scope.row.oid : "" }}
|
|
23
|
+
</template>
|
|
24
|
+
</el-table-column>
|
|
25
|
+
<el-table-column prop="title" label="优惠券标题"></el-table-column>
|
|
26
|
+
<el-table-column prop="caption" label="优惠券描述"></el-table-column>
|
|
27
|
+
<el-table-column prop="cdate" label="领用时间" :formatter="dateFormatter"></el-table-column>
|
|
28
|
+
<el-table-column prop="udate" label="使用时间" :formatter="dateFormatter"></el-table-column>
|
|
29
|
+
<el-table-column prop="date_end" label="过期时间" :formatter="dateFormatter"></el-table-column>
|
|
30
|
+
<el-table-column label="是否已经使用">
|
|
31
|
+
<template slot-scope="scope">
|
|
32
|
+
<span v-if="scope.row.status == 0">未使用</span>
|
|
33
|
+
<span v-if="scope.row.status == 1">已经使用</span>
|
|
34
|
+
<span v-if="scope.row.status == 2">已经过期</span>
|
|
35
|
+
<span v-if="scope.row.status == 3">已经作废</span>
|
|
36
|
+
</template>
|
|
37
|
+
</el-table-column>
|
|
38
|
+
<el-table-column prop="note" label="备注"></el-table-column>
|
|
39
|
+
</el-table>
|
|
40
|
+
<div style="text-align: center; margin-top: 30px">
|
|
41
|
+
<el-pagination background layout="prev, pager, next" :total="searchData.total" :page-size="10"
|
|
42
|
+
@current-change="current_change">></el-pagination>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<script>
|
|
47
|
+
import moment from "moment";
|
|
48
|
+
import { listByUid } from "@/api/coupon";
|
|
49
|
+
export default {
|
|
50
|
+
name: "le-coupon-details",
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
tableHeight: 200,
|
|
54
|
+
tableData: [],
|
|
55
|
+
searchData: {
|
|
56
|
+
uid: "",
|
|
57
|
+
pageNo: 1,
|
|
58
|
+
total: 1,
|
|
59
|
+
date_end: "",
|
|
60
|
+
date_start: "",
|
|
61
|
+
},
|
|
62
|
+
timeArr: "",
|
|
63
|
+
status: 0,
|
|
64
|
+
statusOptions: [
|
|
65
|
+
{ id: 0, value: "未使用" },
|
|
66
|
+
{ id: 1, value: "已经使用" },
|
|
67
|
+
{ id: 2, value: "已经过期" },
|
|
68
|
+
{ id: 3, value: "已经作废" },
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
mounted() {
|
|
73
|
+
this.list();
|
|
74
|
+
this.$nextTick(() => {
|
|
75
|
+
this.tableHeight = window.innerHeight - 255;
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
methods: {
|
|
79
|
+
dateFormatter(row, column, cellValue, index) {
|
|
80
|
+
if (cellValue) return moment.unix(cellValue).format("YYYY-MM-DD HH:mm");
|
|
81
|
+
},
|
|
82
|
+
current_change(currentPage) {
|
|
83
|
+
this.searchData.pageNo = currentPage;
|
|
84
|
+
this.list();
|
|
85
|
+
},
|
|
86
|
+
filterParams(obj) {
|
|
87
|
+
var _newPar = {};
|
|
88
|
+
for (var key in obj) {
|
|
89
|
+
if (
|
|
90
|
+
(obj[key] === false || obj[key]) &&
|
|
91
|
+
obj[key].toString().replace(/(^\s*)|(\s*$)/g, "") !== ""
|
|
92
|
+
) {
|
|
93
|
+
_newPar[key] = obj[key];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return _newPar;
|
|
97
|
+
},
|
|
98
|
+
list() {
|
|
99
|
+
if (this.timeArr && this.timeArr.length == 2) {
|
|
100
|
+
this.searchData.date_start = new Date(this.timeArr[0]).getTime() / 1000;
|
|
101
|
+
this.searchData.date_end = new Date(this.timeArr[1]).getTime() / 1000;
|
|
102
|
+
} else {
|
|
103
|
+
this.searchData.date_start = 0;
|
|
104
|
+
this.searchData.date_end = 0;
|
|
105
|
+
}
|
|
106
|
+
let params = this.filterParams(this.searchData);
|
|
107
|
+
params.status = this.status;
|
|
108
|
+
listByUid(params).then((res) => {
|
|
109
|
+
this.tableData = res.data.data.list;
|
|
110
|
+
this.searchData.total = res.data.data.count;
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
</script>
|