|
|
@@ -72,24 +72,33 @@
|
|
|
:visible.sync="viewShow"
|
|
|
width="500"
|
|
|
>
|
|
|
+ <el-form :model="viewForm">
|
|
|
+ <el-form-item prop="userInfo" label="用户信息">
|
|
|
+ <el-input placeholder="请输入用户信息" v-model="viewForm.userInfo"></el-input>
|
|
|
+ <el-button @click="viewSearch()" type="primary" style="margin-left: 10px;">搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="mid-action">
|
|
|
+ <el-button type="primary" @click="addDownoad">导出</el-button>
|
|
|
+ </div>
|
|
|
<el-table
|
|
|
:data="viewData"
|
|
|
>
|
|
|
<el-table-column type="index" label="序号"></el-table-column>
|
|
|
- <el-table-column label="发起用户"></el-table-column>
|
|
|
- <el-table-column label="红包金额"></el-table-column>
|
|
|
+ <el-table-column prop="userNickName" label="发起用户"></el-table-column>
|
|
|
+ <el-table-column prop="money" label="红包金额"></el-table-column>
|
|
|
<el-table-column label="裂变用户">
|
|
|
<template slot-scope="scope">
|
|
|
- 用户昵称-手机号
|
|
|
+ {{ `${scope.row.helpUserNickName} - ${scope.row.helpUserPhone}` }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
- v-show="total > 0"
|
|
|
- :total="total"
|
|
|
- :page.sync="packetForm.pageNum"
|
|
|
- :limit.sync="packetForm.pageSize"
|
|
|
- @pagination="initList"
|
|
|
+ v-show="total1 > 0"
|
|
|
+ :total="total1"
|
|
|
+ :page.sync="viewForm.pageNum"
|
|
|
+ :limit.sync="viewForm.pageSize"
|
|
|
+ @pagination="initViewList"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -97,6 +106,7 @@
|
|
|
|
|
|
<script>
|
|
|
import * as api from '@/api/lottery'
|
|
|
+import {exportRedEnvelopeRecord} from "@/api/lottery";
|
|
|
|
|
|
export default {
|
|
|
name: "packetList",
|
|
|
@@ -107,11 +117,18 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10
|
|
|
},
|
|
|
- total: 1,
|
|
|
+ total: 0,
|
|
|
+ total1: 0,
|
|
|
+ viewForm: {
|
|
|
+ userInfo: '',
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
loading: false,
|
|
|
tableData: [],
|
|
|
viewShow: false,
|
|
|
- viewData: []
|
|
|
+ viewData: [],
|
|
|
+ viewId: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -172,9 +189,43 @@ export default {
|
|
|
},
|
|
|
handleView(row) {
|
|
|
this.viewShow = true
|
|
|
+ this.viewId = row.actId
|
|
|
+ this.initViewList()
|
|
|
},
|
|
|
handleShare(row) {
|
|
|
|
|
|
+ },
|
|
|
+ viewSearch() {
|
|
|
+ this.initViewList()
|
|
|
+ },
|
|
|
+ initViewList() {
|
|
|
+ api.getRedEnvelopeRecord({
|
|
|
+ actId: this.viewId,
|
|
|
+ ...this.viewForm
|
|
|
+ }).then(res => {
|
|
|
+ this.total1 = res.total
|
|
|
+ this.viewData = res.rows
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addDownoad() {
|
|
|
+ api.exportRedEnvelopeRecord({
|
|
|
+ actId: this.viewId
|
|
|
+ }).then(res => {
|
|
|
+ const blob = new Blob([res], { type: 'application/vnd.ms-excel' });
|
|
|
+ const fileName = '红包记录' + new Date().getTime() + '.xlsx';
|
|
|
+ if ('download' in document.createElement('a')) {
|
|
|
+ const elink = document.createElement('a');
|
|
|
+ elink.download = fileName;
|
|
|
+ elink.style.display = 'none';
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
+ document.body.appendChild(elink);
|
|
|
+ elink.click();
|
|
|
+ URL.revokeObjectURL(elink.href);
|
|
|
+ document.body.removeChild(elink);
|
|
|
+ } else {
|
|
|
+ navigator.msSaveBlob(blob, fileName);
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|