|
|
@@ -0,0 +1,221 @@
|
|
|
+<template>
|
|
|
+ <ele-page flex-table>
|
|
|
+ <page-search @search="reload"></page-search>
|
|
|
+
|
|
|
+ <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
|
|
|
+ <template #toolbar>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-permission="'customer:blacklist:add'"
|
|
|
+ @click="handleUpdate()"
|
|
|
+ :icon="PlusOutlined"
|
|
|
+ >
|
|
|
+ 添加黑名单
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ v-permission="'customer:blacklist:export'"
|
|
|
+ @click="handleExportExcel"
|
|
|
+ :icon="DownloadOutlined"
|
|
|
+ >
|
|
|
+ 导出EXCEL
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #picture="{ row }">
|
|
|
+ <div class="flex flex-col">
|
|
|
+ <el-avatar
|
|
|
+ src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
|
|
|
+ />
|
|
|
+ <el-text style="text-align: center">{{ row.schoolName }}</el-text>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #schoolTag="{ row }">
|
|
|
+ <dict-data code="school_tag" type="tag" :model-value="row.schoolTag" />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #action="{ row }">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ link
|
|
|
+ v-permission="'customer:blacklist:detail'"
|
|
|
+ @click="handleDetail(row)"
|
|
|
+ >
|
|
|
+ [用户详情]
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ link
|
|
|
+ v-permission="'customer:blacklist:userTag'"
|
|
|
+ @click="handleUpdate(row)"
|
|
|
+ >
|
|
|
+ [用户标签]
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ link
|
|
|
+ v-permission="'customer:blacklist:accountDetail'"
|
|
|
+ @click="handleUpdate(row)"
|
|
|
+ >
|
|
|
+ [账户明细]
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ link
|
|
|
+ v-permission="'customer:blacklist:history'"
|
|
|
+ @click="handleBlacklistHistory(row)"
|
|
|
+ >
|
|
|
+ [拉黑历史]
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ link
|
|
|
+ v-permission="'customer:blacklist:remove'"
|
|
|
+ @click="handleAddBlacklist(row)"
|
|
|
+ >
|
|
|
+ [移出黑名单]
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </common-table>
|
|
|
+
|
|
|
+ <page-edit ref="editRef" @success="reload()"></page-edit>
|
|
|
+ <blacklist-history ref="historyRef"></blacklist-history>
|
|
|
+ <customer-detail ref="detailRef"></customer-detail>
|
|
|
+ </ele-page>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import { ref, reactive } from 'vue';
|
|
|
+ import { ElMessageBox } from 'element-plus/es';
|
|
|
+ import { EleMessage } from 'ele-admin-plus/es';
|
|
|
+ import { DownloadOutlined, PlusOutlined } from '@/components/icons';
|
|
|
+ import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
+ import pageSearch from './components/page-search.vue';
|
|
|
+ import pageEdit from './components/page-edit.vue'
|
|
|
+ import blacklistHistory from '@/views/customer/list/components/blacklist-history.vue';
|
|
|
+ import customerDetail from '@/views/customer/list/components/customer-detail.vue';
|
|
|
+ import { useDictData } from '@/utils/use-dict-data';
|
|
|
+ import request from '@/utils/request';
|
|
|
+
|
|
|
+ defineOptions({ name: 'customerList' });
|
|
|
+ const [schoolLevelDicts, schoolTagDicts] = useDictData([
|
|
|
+ 'school_level',
|
|
|
+ 'school_tag'
|
|
|
+ ]);
|
|
|
+
|
|
|
+ /** 表格列配置 */
|
|
|
+ const columns = ref([
|
|
|
+ {
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ width: 50,
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '用户昵称',
|
|
|
+ prop: 'schoolName',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 100,
|
|
|
+ slot: 'picture'
|
|
|
+ },
|
|
|
+ { label: '用户名', prop: 'provinceName', align: 'center' },
|
|
|
+ { label: '用户OpenId', prop: 'cityName', align: 'center' },
|
|
|
+ { label: '手机号', prop: 'departmentName', align: 'center' },
|
|
|
+ {
|
|
|
+ label: '用户类型',
|
|
|
+ prop: 'schoolLevel',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) =>
|
|
|
+ schoolLevelDicts.value.find((d) => d.dictValue == row.schoolLevel)
|
|
|
+ ?.dictLabel
|
|
|
+ },
|
|
|
+ { label: '用户标签', prop: 'departmentName', align: 'center' },
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'schoolTag',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'schoolTag',
|
|
|
+ formatter: (row) =>
|
|
|
+ schoolTagDicts.value.find((d) => d.dictValue == row.schoolTag)
|
|
|
+ ?.dictLabel
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '创建时间',
|
|
|
+ prop: 'createTime',
|
|
|
+ align: 'center',
|
|
|
+ width: 160,
|
|
|
+ formatter: (row) => {
|
|
|
+ return row.createTime ? new Date(row.createTime).toLocaleString() : '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 200,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'action'
|
|
|
+ }
|
|
|
+ ]);
|
|
|
+
|
|
|
+ /** 页面组件实例 */
|
|
|
+ const pageRef = ref(null);
|
|
|
+
|
|
|
+ const pageConfig = reactive({
|
|
|
+ pageUrl: '/baseinfo/schoolInfo/list',
|
|
|
+ exportUrl: '/baseinfo/schoolInfo/export',
|
|
|
+ fileName: '客户列表',
|
|
|
+ cacheKey: 'customerListTable'
|
|
|
+ });
|
|
|
+
|
|
|
+ //刷新表格
|
|
|
+ function reload(where) {
|
|
|
+ pageRef.value?.reload(where);
|
|
|
+ }
|
|
|
+
|
|
|
+ //批量删除
|
|
|
+ function handleBatchDelete(row) {
|
|
|
+ let selections = row ? [row] : pageRef.value?.getSelections();
|
|
|
+ let ids = selections.map((item) => item.id).join(',');
|
|
|
+ let url = `/baseinfo/schoolInfo/removeById/${ids}`;
|
|
|
+ pageRef.value?.operatBatch({
|
|
|
+ title: '确认删除?',
|
|
|
+ method: 'post',
|
|
|
+ url,
|
|
|
+ row
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //导出excel
|
|
|
+ function handleExportExcel() {
|
|
|
+ pageRef.value?.exportData('高校列表');
|
|
|
+ }
|
|
|
+
|
|
|
+ //移出黑名单
|
|
|
+ function handleAddBlacklist(row) {
|
|
|
+ pageRef.value?.messageBoxConfirm({
|
|
|
+ message: '确认移出黑名单?',
|
|
|
+ fetch: () => request.post('/baseinfo/schoolInfo/edit', data)
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //编辑页面
|
|
|
+ const editRef = ref(null);
|
|
|
+ function handleUpdate(row) {
|
|
|
+ editRef.value?.handleOpen(row);
|
|
|
+ }
|
|
|
+ //详情页面
|
|
|
+ const detailRef = ref(null);
|
|
|
+ function handleDetail(row) {
|
|
|
+ detailRef.value?.handleOpen(row);
|
|
|
+ }
|
|
|
+
|
|
|
+ //拉黑历史
|
|
|
+ const historyRef = ref(null);
|
|
|
+ function handleBlacklistHistory(row) {
|
|
|
+ historyRef.value?.handleOpen(row);
|
|
|
+ }
|
|
|
+</script>
|