|
@@ -2,7 +2,7 @@
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import { apiCustomerUser } from '@/api/customer'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import { dayjs, ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import EnableUser from './components/EnableUser.vue'
|
|
|
import UserStatisticDetail from './reportStatistic/components/UserStatisticDetail.vue'
|
|
|
|
|
@@ -21,6 +21,14 @@ const tableColOpt = [
|
|
|
label: '手机号',
|
|
|
key: 'Phone'
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '手机号',
|
|
|
+ key: 'RealName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '营业部',
|
|
|
+ key: 'SellerDepartmentName'
|
|
|
+ },
|
|
|
{
|
|
|
label: '邮箱',
|
|
|
key: 'Email'
|
|
@@ -30,6 +38,10 @@ const tableColOpt = [
|
|
|
key: 'RegisterTime',
|
|
|
sort: true
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '申请时间',
|
|
|
+ key: 'ApplyTime'
|
|
|
+ },
|
|
|
{
|
|
|
label: '最近一次阅读时间',
|
|
|
key: 'LastUpdateTime',
|
|
@@ -40,8 +52,14 @@ const tableColOpt = [
|
|
|
key: 'ReadCnt',
|
|
|
sort: true,
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '申请状态',
|
|
|
+ key: 'ApplyStatus'
|
|
|
+ },
|
|
|
]
|
|
|
const userList = ref([])
|
|
|
+const departmentList = ref([])
|
|
|
+const btnload = ref(false)
|
|
|
const page = ref(1)
|
|
|
const pageSize = ref(10)
|
|
|
const tableLoading = ref(false)
|
|
@@ -54,10 +72,14 @@ async function getUserList() {
|
|
|
KeyWord: filterState.keyword,
|
|
|
RegisterStartDate: filterState.regsiterTime ? filterState.regsiterTime[0] : '',
|
|
|
RegisterEndDate: filterState.regsiterTime ? filterState.regsiterTime[1] : '',
|
|
|
- LastUpdateStartDate:filterState.readTime ? filterState.readTime[0] : '',
|
|
|
- LastUpdateEndDate:filterState.readTime ? filterState.readTime[1] : '',
|
|
|
- SortParam:filterState.sortType,
|
|
|
- SortType:filterState.sortVal
|
|
|
+ LastUpdateStartDate: filterState.readTime ? filterState.readTime[0] : '',
|
|
|
+ LastUpdateEndDate: filterState.readTime ? filterState.readTime[1] : '',
|
|
|
+ ApplyStartDate: filterState.appliTime ? filterState.appliTime[0] : '',
|
|
|
+ ApplyEndDate: filterState.appliTime ? filterState.appliTime[1] : '',
|
|
|
+ ApplyStatus: filterState.ApplyStatus,
|
|
|
+ SellerDepartmentId: filterState.SellerDepartmentId,
|
|
|
+ SortParam: filterState.sortType,
|
|
|
+ SortType: filterState.sortVal
|
|
|
})
|
|
|
tableLoading.value = false
|
|
|
if (res.Ret === 200) {
|
|
@@ -65,7 +87,53 @@ async function getUserList() {
|
|
|
totals.value = res.Data.Paging.Totals
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+async function getSellerDepartment() {
|
|
|
+ tableLoading.value = true
|
|
|
+ const res = await apiCustomerUser.sellerDepartmentList()
|
|
|
+ tableLoading.value = false
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ departmentList.value = res.Data || []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+getSellerDepartment()
|
|
|
getUserList()
|
|
|
+
|
|
|
+async function exportClick() {
|
|
|
+ btnload.value = true
|
|
|
+ const res = await apiCustomerUser.potentialExportExcel(
|
|
|
+ {
|
|
|
+ KeyWord: filterState.keyword,
|
|
|
+ RegisterStartDate: filterState.regsiterTime ? filterState.regsiterTime[0] : '',
|
|
|
+ RegisterEndDate: filterState.regsiterTime ? filterState.regsiterTime[1] : '',
|
|
|
+ LastUpdateStartDate: filterState.readTime ? filterState.readTime[0] : '',
|
|
|
+ LastUpdateEndDate: filterState.readTime ? filterState.readTime[1] : '',
|
|
|
+ ApplyStartDate: filterState.appliTime ? filterState.appliTime[0] : '',
|
|
|
+ ApplyEndDate: filterState.appliTime ? filterState.appliTime[1] : '',
|
|
|
+ ApplyStatus: filterState.ApplyStatus,
|
|
|
+ SellerDepartmentId: filterState.SellerDepartmentId,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ btnload.value = false
|
|
|
+ console.log(res);
|
|
|
+
|
|
|
+ const blob = new Blob([res], {
|
|
|
+ type: "application/vnd.ms-excel;charset=utf-8",
|
|
|
+ });
|
|
|
+ let fileName = '潜在用户列表' + dayjs(new Date()).format('YYYY-MM-DD') + ".xlsx";
|
|
|
+
|
|
|
+ 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); // 释放URL 对象
|
|
|
+ document.body.removeChild(elink); // 释放标
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
function handlePageChange(e) {
|
|
|
page.value = e
|
|
|
getUserList()
|
|
@@ -113,6 +181,22 @@ function handleShowDetail(e){
|
|
|
<template>
|
|
|
<div class="potential-user-list-page">
|
|
|
<div class="flex filter-wrap">
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" @click="exportClick" :loading="btnload"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="flex filter-wrap">
|
|
|
+ <el-select
|
|
|
+ placeholder="请选择营业部"
|
|
|
+ v-model="filterState.SellerDepartmentId"
|
|
|
+ style="width: 165px"
|
|
|
+ clearable
|
|
|
+ @change="handleFilterList"
|
|
|
+ >
|
|
|
+ <el-option v-for="(item, index) in departmentList" :key="index" :label="item.SysDepartmentName" :value="item.SysDepartmentId"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
<div style="width: 235px">
|
|
|
<el-date-picker
|
|
|
style="width: 235px"
|
|
@@ -125,6 +209,18 @@ function handleShowDetail(e){
|
|
|
@change="handleFilterList"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <div style="width: 235px">
|
|
|
+ <el-date-picker
|
|
|
+ style="width: 235px"
|
|
|
+ v-model="filterState.appliTime"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="申请时间"
|
|
|
+ end-placeholder="申请时间"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ @change="handleFilterList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div style="width: 235px">
|
|
|
<el-date-picker
|
|
|
style="width: 235px"
|
|
@@ -137,6 +233,18 @@ function handleShowDetail(e){
|
|
|
@change="handleFilterList"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <div class="flex filter-wrap">
|
|
|
+ <el-select
|
|
|
+ placeholder="请选择申请状态"
|
|
|
+ v-model="filterState.ApplyStatus"
|
|
|
+ style="width: 165px"
|
|
|
+ clearable
|
|
|
+ @change="handleFilterList"
|
|
|
+ >
|
|
|
+ <el-option label="已申请" :value="1"></el-option>
|
|
|
+ <el-option label="未申请" :value="0"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
<el-input
|
|
|
placeholder="手机号/邮箱"
|
|
|
v-model="filterState.keyword"
|
|
@@ -178,10 +286,11 @@ function handleShowDetail(e){
|
|
|
</template>
|
|
|
<template #default="{ row }">
|
|
|
<span
|
|
|
- v-if="column.key === 'Status'"
|
|
|
- :style="{ color: !row.Status ? '#f00' : '' }"
|
|
|
- >{{ row.Status ? "启用" : "禁用" }}</span
|
|
|
+ v-if="column.key === 'ApplyStatus'"
|
|
|
+ :style="{ color: row.ApplyStatus ? 'rgba(0, 136, 88, 1)' : '#f00' }"
|
|
|
>
|
|
|
+ {{ row.ApplyStatus ? "已申请" : "未申请" }}
|
|
|
+ </span>
|
|
|
<el-button v-else-if="column.key === 'ReadCnt'&&row.ReadCnt>0" link type="primary" @click="handleShowDetail(row)">{{row.ReadCnt}}</el-button>
|
|
|
<span v-else>{{ row[column.key] }}</span>
|
|
|
</template>
|