|
|
@@ -10,7 +10,7 @@
|
|
|
>
|
|
|
新增
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
@click="download"
|
|
|
icon="el-icon-upload2"
|
|
|
:loading="downloading"
|
|
|
@@ -18,7 +18,7 @@
|
|
|
class="filter-item"
|
|
|
>
|
|
|
导出
|
|
|
- </el-button>
|
|
|
+ </el-button> -->
|
|
|
</page-title>
|
|
|
<div class="filters-container">
|
|
|
<el-input
|
|
|
@@ -84,16 +84,33 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<el-dialog :visible.sync="showDialog" title="邀请列表" width="800px" top="10vh">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ style="margin: 0 10px 10px 25px"
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ @click="downloadPhone"
|
|
|
+ :disabled="downloading"
|
|
|
+ >导出手机号</el-button
|
|
|
+ >
|
|
|
+ <created-at-picker
|
|
|
+ v-model="createdAt"
|
|
|
+ name="注册"
|
|
|
+ @input="getInviteInfo"
|
|
|
+ size="mini"
|
|
|
+ ></created-at-picker>
|
|
|
+ </div>
|
|
|
<el-table :data="list" v-loading="dialogLoading" height="60vh">
|
|
|
<el-table-column prop="id" label="ID" width="80"></el-table-column>
|
|
|
<el-table-column prop="nickname" label="昵称"></el-table-column>
|
|
|
<el-table-column prop="phone" label="手机"></el-table-column>
|
|
|
+ <el-table-column prop="createdAt" label="注册时间"></el-table-column>
|
|
|
</el-table>
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog :visible.sync="showCodeDialog" title="二维码" width="400px" center>
|
|
|
- <vue-qrcode :value="codeValue" :options="{ width: 300, margin: 2 }" style="margin-left:25px"></vue-qrcode>
|
|
|
- <div style="margin-left:40px;font-size:16px">右键点击二维码可保存</div>
|
|
|
+ <vue-qrcode :value="codeValue" :options="{ width: 300, margin: 2 }" style="margin-left: 25px"></vue-qrcode>
|
|
|
+ <div style="margin-left: 40px; font-size: 16px">右键点击二维码可保存</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -115,7 +132,9 @@ export default {
|
|
|
dialogLoading: false,
|
|
|
list: [],
|
|
|
showCodeDialog: false,
|
|
|
- codeValue: 'Hello, World!'
|
|
|
+ codeValue: 'Hello, World!',
|
|
|
+ inviteCode: '',
|
|
|
+ createdAt: ''
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -199,10 +218,19 @@ export default {
|
|
|
},
|
|
|
detail(row) {
|
|
|
this.list = [];
|
|
|
- this.dialogLoading = true;
|
|
|
+ this.createdAt = '';
|
|
|
this.showDialog = true;
|
|
|
+ this.inviteCode = row.code;
|
|
|
+ this.getInviteInfo();
|
|
|
+ },
|
|
|
+ getInviteInfo() {
|
|
|
+ this.dialogLoading = true;
|
|
|
this.$http
|
|
|
- .post('/user/all', { size: 10000, query: { inviteCode: row.code } }, { body: 'json' })
|
|
|
+ .post(
|
|
|
+ '/user/all',
|
|
|
+ { size: 10000, sort: 'id,desc', query: { inviteCode: this.inviteCode, createdAt: this.createdAt } },
|
|
|
+ { body: 'json' }
|
|
|
+ )
|
|
|
.then(res => {
|
|
|
this.list = res.content;
|
|
|
this.dialogLoading = false;
|
|
|
@@ -211,6 +239,33 @@ export default {
|
|
|
showCode(row) {
|
|
|
this.codeValue = 'https://www.raex.vip/9th/?inviteCode=' + row.code;
|
|
|
this.showCodeDialog = true;
|
|
|
+ },
|
|
|
+ downloadPhone() {
|
|
|
+ this.downloading = true;
|
|
|
+ this.$axios
|
|
|
+ .post(
|
|
|
+ '/user/exportInvite',
|
|
|
+ { size: 10000, sort: 'id,desc', query: { inviteCode: this.inviteCode, createdAt: this.createdAt } },
|
|
|
+ {
|
|
|
+ responseType: 'blob'
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.downloading = false;
|
|
|
+ const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = downloadUrl;
|
|
|
+ link.setAttribute('download', '手机号.xlsx');
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ link.remove();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.downloading = false;
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|