|
@@ -524,7 +524,10 @@
|
|
|
|
|
|
|
|
<!-- 用户详情列表 -->
|
|
<!-- 用户详情列表 -->
|
|
|
<div v-else class="user-detail-content">
|
|
<div v-else class="user-detail-content">
|
|
|
- <el-button type="text" icon="el-icon-arrow-left" @click="showUserDetail = false" style="margin-bottom: 20px;">返回</el-button>
|
|
|
|
|
|
|
+ <div style="margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;">
|
|
|
|
|
+ <el-button type="text" icon="el-icon-arrow-left" @click="showUserDetail = false">返回</el-button>
|
|
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-download" :loading="userDetailExportLoading" @click="handleExportUserDetail">导出用户详情</el-button>
|
|
|
|
|
+ </div>
|
|
|
<el-table
|
|
<el-table
|
|
|
:data="userDetailList"
|
|
:data="userDetailList"
|
|
|
v-loading="userDetailLoading"
|
|
v-loading="userDetailLoading"
|
|
@@ -558,7 +561,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { listLiveData, exportLiveData, autoTagAndRemark, dashboardData, getLiveDataDetailBySql, getLiveUserDetailListBySql } from "@/api/live/liveData";
|
|
|
|
|
|
|
+import { listLiveData, exportLiveData, autoTagAndRemark, dashboardData, getLiveDataDetailBySql, getLiveUserDetailListBySql, exportLiveUserDetail } from "@/api/live/liveData";
|
|
|
import { batchUpdateExternalContactNotes } from "@/api/qw/externalContact";
|
|
import { batchUpdateExternalContactNotes } from "@/api/qw/externalContact";
|
|
|
import { addTag } from "@/api/qw/externalContact";
|
|
import { addTag } from "@/api/qw/externalContact";
|
|
|
|
|
|
|
@@ -629,7 +632,8 @@ export default {
|
|
|
detailData: {},
|
|
detailData: {},
|
|
|
userDetailList: [],
|
|
userDetailList: [],
|
|
|
userDetailLoading: false,
|
|
userDetailLoading: false,
|
|
|
- showUserDetail: false
|
|
|
|
|
|
|
+ showUserDetail: false,
|
|
|
|
|
+ userDetailExportLoading: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -904,6 +908,33 @@ export default {
|
|
|
formatMoney(value) {
|
|
formatMoney(value) {
|
|
|
if (value == null || value === undefined) return '¥0.00';
|
|
if (value == null || value === undefined) return '¥0.00';
|
|
|
return '¥' + (typeof value === 'number' ? value : parseFloat(value)).toFixed(2);
|
|
return '¥' + (typeof value === 'number' ? value : parseFloat(value)).toFixed(2);
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 导出用户详情数据 */
|
|
|
|
|
+ handleExportUserDetail() {
|
|
|
|
|
+ if (!this.currentLiveId) {
|
|
|
|
|
+ this.$message.warning('无法获取直播间ID');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!this.userDetailList || this.userDetailList.length === 0) {
|
|
|
|
|
+ this.$message.warning('暂无用户详情数据可导出');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$confirm('是否确认导出当前直播间的用户详情数据?', "提示", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ this.userDetailExportLoading = true;
|
|
|
|
|
+ return exportLiveUserDetail(this.currentLiveId);
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ this.download(response.msg);
|
|
|
|
|
+ this.$message.success('导出成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ this.userDetailExportLoading = false;
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.userDetailExportLoading = false;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|