feat(shop): 添加分销商申请审核相关功能
- 新增审核通过、驳回和批量审核通过分销商申请的 API 接口 - 移除无用的网站 ID 相关代码 - 优化导入导出功能 - 修复一些组件中的小问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
VITE_APP_NAME=后台管理(开发环境)
|
VITE_APP_NAME=后台管理(开发环境)
|
||||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
VITE_API_URL=http://127.0.0.1:9200/api
|
||||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
68
index.html
68
index.html
@@ -1,68 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<link rel="icon" href="/favicon.ico" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>网宿软件</title>
|
|
||||||
<style>
|
|
||||||
.ele-admin-loading {
|
|
||||||
width: 36px;
|
|
||||||
font-size: 0;
|
|
||||||
display: inline-block;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
animation: loadingRotate 1.2s infinite linear;
|
|
||||||
position: relative;
|
|
||||||
top: calc(50% - 18px);
|
|
||||||
left: calc(50% - 18px);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.ele-admin-loading span {
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
margin: 4px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #1890ff;
|
|
||||||
display: inline-block;
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
.ele-admin-logo-auto.ele-admin-layout .ele-admin-logo{
|
|
||||||
padding: 0 12px 0 12px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ele-admin-loading span:nth-child(2) {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ele-admin-loading span:nth-child(3) {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ele-admin-loading span:nth-child(4) {
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes loadingRotate {
|
|
||||||
to {
|
|
||||||
transform: rotate(405deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#app > .ele-admin-loading {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app">
|
|
||||||
<div class="ele-admin-loading">
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script type="module" src="/src/main.ts"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -103,3 +103,44 @@ export async function getShopDealerApply(id: number) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核通过分销商申请
|
||||||
|
*/
|
||||||
|
export async function approveShopDealerApply(id: number) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
`/shop/shop-dealer-apply/${id}/approve`
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回分销商申请
|
||||||
|
*/
|
||||||
|
export async function rejectShopDealerApply(id: number, data: { rejectReason: string }) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
`/shop/shop-dealer-apply/${id}/reject`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量审核通过分销商申请
|
||||||
|
*/
|
||||||
|
export async function batchApproveShopDealerApply(ids: number[]) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/shop/shop-dealer-apply/batch-approve',
|
||||||
|
{ ids }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,9 +45,6 @@
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 网站ID
|
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'search', where?: CmsAdParam): void;
|
(e: 'search', where?: CmsAdParam): void;
|
||||||
(e: 'add'): void;
|
(e: 'add'): void;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
@ok="save"
|
@ok="save"
|
||||||
>
|
>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
|
<a-button @click="cancel">打印</a-button>
|
||||||
<a-button type="primary" style="margin-right: 8px" @click="save">保存</a-button>
|
<a-button type="primary" style="margin-right: 8px" @click="save">保存</a-button>
|
||||||
</template>
|
</template>
|
||||||
<a-form
|
<a-form
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ const xlsFileName = ref<string>();
|
|||||||
const articleList = ref<CmsArticle[]>([]);
|
const articleList = ref<CmsArticle[]>([]);
|
||||||
// 是否显示用户导入弹窗
|
// 是否显示用户导入弹窗
|
||||||
const showImport = ref(false);
|
const showImport = ref(false);
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const {where, resetFields} = useSearch<CmsArticleParam>({
|
const {where, resetFields} = useSearch<CmsArticleParam>({
|
||||||
|
|||||||
@@ -52,9 +52,6 @@
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
// 网站ID
|
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'search', where?: GradeParam): void;
|
(e: 'search', where?: GradeParam): void;
|
||||||
(e: 'add'): void;
|
(e: 'add'): void;
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
(e: 'batchMove'): void;
|
(e: 'batchMove'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
const add = () => {
|
const add = () => {
|
||||||
emit('add');
|
emit('add');
|
||||||
|
|||||||
@@ -263,7 +263,6 @@ const {push} = useRouter();
|
|||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
const modelList = ref<CmsModel[]>([])
|
const modelList = ref<CmsModel[]>([])
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
const currentId = ref<number>();
|
const currentId = ref<number>();
|
||||||
const modelName = ref<string>();
|
const modelName = ref<string>();
|
||||||
// 国际化
|
// 国际化
|
||||||
|
|||||||
@@ -1,15 +1,112 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-button @click="add" type="primary" >添加字段</a-button>
|
<a-space>
|
||||||
|
<a-button @click="add" type="primary">添加字段</a-button>
|
||||||
|
<a-input-search
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
style="width: 280px"
|
||||||
|
v-model:value="where.keywords"
|
||||||
|
@search="reload"
|
||||||
|
/>
|
||||||
|
<a-button type="text" v-if="hasRole('superAdmin')" @click="handleExport">导出xls</a-button>
|
||||||
|
<a-button type="text" v-if="hasRole('superAdmin')" @click="openImport">导入xls</a-button>
|
||||||
|
</a-space>
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<import v-model:visible="showImport" @done="reload"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const emit = defineEmits<{
|
import {ref} from 'vue';
|
||||||
(e: 'add'): void;
|
import {CmsWebsiteField, CmsWebsiteFieldParam} from "@/api/cms/cmsWebsiteField/model";
|
||||||
}>();
|
import useSearch from "@/utils/use-search";
|
||||||
|
import {hasRole} from "@/utils/permission";
|
||||||
|
import {utils, writeFile} from 'xlsx';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import {message} from 'ant-design-vue';
|
||||||
|
import Import from "@/views/cms/cmsArticle/components/Import.vue";
|
||||||
|
import {listCmsWebsiteField} from "@/api/cms/cmsWebsiteField";
|
||||||
|
|
||||||
const add = () => {
|
|
||||||
emit('add');
|
|
||||||
};
|
|
||||||
|
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
const loading = ref(false);
|
||||||
|
const xlsFileName = ref<string>();
|
||||||
|
const fields = ref<CmsWebsiteField[]>([]);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: CmsWebsiteFieldParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const {where} = useSearch<CmsWebsiteFieldParam>({
|
||||||
|
keywords: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
emit('search', where);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const handleExport = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const array: (string | number)[][] = [
|
||||||
|
[
|
||||||
|
'类型',
|
||||||
|
'字段',
|
||||||
|
'值',
|
||||||
|
'描述'
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
// 按搜索结果导出
|
||||||
|
await listCmsWebsiteField(where)
|
||||||
|
.then((list) => {
|
||||||
|
fields.value = list;
|
||||||
|
list?.forEach((d: CmsWebsiteField) => {
|
||||||
|
array.push([
|
||||||
|
`${d.type}`,
|
||||||
|
`${d.name}`,
|
||||||
|
`${d.value}`,
|
||||||
|
`${d.comments}`
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
const sheetName = `导出字段${dayjs(new Date()).format('YYYYMMDD')}`;
|
||||||
|
const workbook = {
|
||||||
|
SheetNames: [sheetName],
|
||||||
|
Sheets: {}
|
||||||
|
};
|
||||||
|
const sheet = utils.aoa_to_sheet(array);
|
||||||
|
workbook.Sheets[sheetName] = sheet;
|
||||||
|
// 设置列宽
|
||||||
|
sheet['!cols'] = [];
|
||||||
|
message.loading('正在导出...');
|
||||||
|
setTimeout(() => {
|
||||||
|
writeFile(
|
||||||
|
workbook,
|
||||||
|
`${
|
||||||
|
where.createTimeEnd ? xlsFileName.value + '_' : ''
|
||||||
|
}${sheetName}.xlsx`
|
||||||
|
);
|
||||||
|
loading.value = false;
|
||||||
|
}, 1000);
|
||||||
|
})
|
||||||
|
.catch((msg) => {
|
||||||
|
message.error(msg);
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<CmsWebsiteSearch />
|
<CmsWebsiteSearch/>
|
||||||
</template>
|
</template>
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<div class="website-field">
|
<div class="website-field">
|
||||||
@@ -17,11 +17,15 @@
|
|||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
>
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<Search @add="openEdit" />
|
<Search @add="openEdit" @search="reload"/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'name'">
|
<template v-if="column.key === 'name'">
|
||||||
<div class="ele-text-heading" @mouseover="onCopyIcon(record.name)" @mouseleave="hideCopyIcon">{{ record.name }}<CopyOutlined class="px-2" v-if="currentName == record.name" @click="copyText(`config.${record.name}`)"/></div>
|
<div class="ele-text-heading" @mouseover="onCopyIcon(record.name)" @mouseleave="hideCopyIcon">
|
||||||
|
{{ record.name }}
|
||||||
|
<CopyOutlined class="px-2" v-if="currentName == record.name"
|
||||||
|
@click="copyText(`config.${record.name}`)"/>
|
||||||
|
</div>
|
||||||
<div class="text-gray-300">{{ record.comments }}</div>
|
<div class="text-gray-300">{{ record.comments }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'value'">
|
<template v-if="column.key === 'value'">
|
||||||
@@ -37,15 +41,15 @@
|
|||||||
<template #content>
|
<template #content>
|
||||||
{{ record.comments }}
|
{{ record.comments }}
|
||||||
</template>
|
</template>
|
||||||
<ExclamationCircleOutlined />
|
<ExclamationCircleOutlined/>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a @click="copyText(`config.${record.name}`)">复制</a>
|
<a @click="copyText(`config.${record.name}`)">复制</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical"/>
|
||||||
<a @click="openEdit(record)">编辑</a>
|
<a @click="openEdit(record)">编辑</a>
|
||||||
<template v-if="record.deleted == 0">
|
<template v-if="record.deleted == 0">
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确定要删除此记录吗?"
|
title="确定要删除此记录吗?"
|
||||||
@confirm="remove(record)"
|
@confirm="remove(record)"
|
||||||
@@ -54,7 +58,7 @@
|
|||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="record.deleted == 1">
|
<template v-if="record.deleted == 1">
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确定要放回原处吗?"
|
title="确定要放回原处吗?"
|
||||||
@confirm="recovery(record)"
|
@confirm="recovery(record)"
|
||||||
@@ -66,183 +70,183 @@
|
|||||||
</template>
|
</template>
|
||||||
</ele-pro-table>
|
</ele-pro-table>
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<Edit v-model:visible="showEdit" :data="current" @done="reload" />
|
<Edit v-model:visible="showEdit" :data="current" @done="reload"/>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-page-header>
|
</a-page-header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watch } from 'vue';
|
import {ref, watch} from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import {useI18n} from 'vue-i18n';
|
||||||
import { message } from 'ant-design-vue';
|
import {message} from 'ant-design-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type {EleProTable} from 'ele-admin-pro';
|
||||||
import { ExclamationCircleOutlined, CopyOutlined } from '@ant-design/icons-vue';
|
import {ExclamationCircleOutlined, CopyOutlined} from '@ant-design/icons-vue';
|
||||||
import type { DatasourceFunction } from 'ele-admin-pro/es/ele-pro-table/types';
|
import type {DatasourceFunction} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue";
|
import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue";
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import Edit from './components/edit.vue';
|
import Edit from './components/edit.vue';
|
||||||
import {
|
import {
|
||||||
CmsWebsiteField,
|
CmsWebsiteField,
|
||||||
CmsWebsiteFieldParam
|
CmsWebsiteFieldParam
|
||||||
} from '@/api/cms/cmsWebsiteField/model';
|
} from '@/api/cms/cmsWebsiteField/model';
|
||||||
import {
|
import {
|
||||||
listCmsWebsiteField,
|
listCmsWebsiteField,
|
||||||
removeCmsWebsiteField,
|
removeCmsWebsiteField,
|
||||||
undeleteWebsiteField
|
undeleteWebsiteField
|
||||||
} from '@/api/cms/cmsWebsiteField';
|
} from '@/api/cms/cmsWebsiteField';
|
||||||
import { copyText, getPageTitle } from '@/utils/common';
|
import {copyText, getPageTitle} from '@/utils/common';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
websiteId: any;
|
websiteId: any;
|
||||||
data: CmsWebsiteField;
|
data: CmsWebsiteField;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
const selection = ref<any[]>();
|
const selection = ref<any[]>();
|
||||||
// 当前编辑数据
|
// 当前编辑数据
|
||||||
const current = ref<CmsWebsiteField | null>(null);
|
const current = ref<CmsWebsiteField | null>(null);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
const currentName = ref<string>();
|
const currentName = ref<string>();
|
||||||
const { locale } = useI18n();
|
const {locale} = useI18n();
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
const datasource: DatasourceFunction = ({page, limit, where, orders}) => {
|
||||||
// 搜索条件
|
// 搜索条件
|
||||||
where.lang = locale.value || undefined;
|
where.lang = locale.value || undefined;
|
||||||
return listCmsWebsiteField({
|
return listCmsWebsiteField({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
page,
|
page,
|
||||||
limit
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
const columns = ref<any[]>([
|
||||||
|
// {
|
||||||
|
// title: 'ID',
|
||||||
|
// dataIndex: 'id',
|
||||||
|
// width: 120
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '字段',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '值',
|
||||||
|
dataIndex: 'value',
|
||||||
|
key: 'value',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '描述',
|
||||||
|
dataIndex: 'comments',
|
||||||
|
key: 'comments',
|
||||||
|
width: 120,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '排序',
|
||||||
|
dataIndex: 'sortNumber',
|
||||||
|
width: 120,
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
const onCopyIcon = (text: string) => {
|
||||||
|
currentName.value = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideCopyIcon = () => {
|
||||||
|
currentName.value = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CmsWebsiteField) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CmsWebsiteFieldParam) => {
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({where: where});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CmsWebsiteField) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCmsWebsiteField(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
if (row.name == 'i18n') {
|
||||||
|
localStorage.removeItem('i18n');
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表格列配置
|
// 从回收站放回原处
|
||||||
const columns = ref<any[]>([
|
const recovery = (row: CmsWebsiteField) => {
|
||||||
// {
|
const hide = message.loading('请求中..', 0);
|
||||||
// title: 'ID',
|
undeleteWebsiteField(row.id)
|
||||||
// dataIndex: 'id',
|
.then((msg) => {
|
||||||
// width: 120
|
hide();
|
||||||
// },
|
message.success(msg);
|
||||||
{
|
reload();
|
||||||
title: '字段',
|
})
|
||||||
dataIndex: 'name',
|
.catch((e) => {
|
||||||
key: 'name',
|
hide();
|
||||||
ellipsis: true
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CmsWebsiteField) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
},
|
},
|
||||||
{
|
// 行双击事件
|
||||||
title: '值',
|
onDblclick: () => {
|
||||||
dataIndex: 'value',
|
openEdit(record);
|
||||||
key: 'value',
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '描述',
|
|
||||||
dataIndex: 'comments',
|
|
||||||
key: 'comments',
|
|
||||||
width: 120,
|
|
||||||
align: 'center',
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '排序',
|
|
||||||
dataIndex: 'sortNumber',
|
|
||||||
width: 120,
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
key: 'action',
|
|
||||||
width: 180,
|
|
||||||
align: 'center',
|
|
||||||
hideInSetting: true
|
|
||||||
}
|
}
|
||||||
]);
|
|
||||||
|
|
||||||
const onCopyIcon = (text: string) => {
|
|
||||||
currentName.value = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hideCopyIcon = () => {
|
|
||||||
currentName.value = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 打开编辑弹窗 */
|
|
||||||
const openEdit = (row?: CmsWebsiteField) => {
|
|
||||||
current.value = row ?? null;
|
|
||||||
showEdit.value = true;
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/* 搜索 */
|
watch(
|
||||||
const reload = (where?: CmsWebsiteFieldParam) => {
|
() => props.websiteId,
|
||||||
selection.value = [];
|
(websiteId) => {
|
||||||
tableRef?.value?.reload({ where: where });
|
if (websiteId) {
|
||||||
};
|
reload();
|
||||||
|
}
|
||||||
/* 删除单个 */
|
},
|
||||||
const remove = (row: CmsWebsiteField) => {
|
{immediate: true}
|
||||||
const hide = message.loading('请求中..', 0);
|
);
|
||||||
removeCmsWebsiteField(row.id)
|
|
||||||
.then((msg) => {
|
|
||||||
hide();
|
|
||||||
message.success(msg);
|
|
||||||
if (row.name == 'i18n') {
|
|
||||||
localStorage.removeItem('i18n');
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
hide();
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 从回收站放回原处
|
|
||||||
const recovery = (row: CmsWebsiteField) => {
|
|
||||||
const hide = message.loading('请求中..', 0);
|
|
||||||
undeleteWebsiteField(row.id)
|
|
||||||
.then((msg) => {
|
|
||||||
hide();
|
|
||||||
message.success(msg);
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
hide();
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 自定义行属性 */
|
|
||||||
const customRow = (record: CmsWebsiteField) => {
|
|
||||||
return {
|
|
||||||
// 行点击事件
|
|
||||||
onClick: () => {
|
|
||||||
// console.log(record);
|
|
||||||
},
|
|
||||||
// 行双击事件
|
|
||||||
onDblclick: () => {
|
|
||||||
openEdit(record);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.websiteId,
|
|
||||||
(websiteId) => {
|
|
||||||
if (websiteId) {
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'CmsWebsiteFieldIndex'
|
name: 'CmsWebsiteFieldIndex'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -74,7 +74,6 @@
|
|||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
const dictId = ref(0);
|
const dictId = ref(0);
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
import { message, Modal } from 'ant-design-vue/es';
|
import { message, Modal } from 'ant-design-vue/es';
|
||||||
import {
|
import {
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
DeleteOutlined,
|
|
||||||
ExclamationCircleOutlined
|
ExclamationCircleOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro/es';
|
import type { EleProTable } from 'ele-admin-pro/es';
|
||||||
@@ -73,8 +72,6 @@
|
|||||||
import { addDict, listDictionaries } from '@/api/system/dict';
|
import { addDict, listDictionaries } from '@/api/system/dict';
|
||||||
import { Dictionary } from '@/api/system/dictionary/model';
|
import { Dictionary } from '@/api/system/dictionary/model';
|
||||||
|
|
||||||
// 网站ID
|
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
const dictId = ref(0);
|
const dictId = ref(0);
|
||||||
|
|||||||
@@ -162,8 +162,6 @@
|
|||||||
const current = ref<FileRecord | null>(null);
|
const current = ref<FileRecord | null>(null);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
// 网站ID
|
|
||||||
const websiteId = localStorage.getItem('WebsiteId')
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -156,6 +156,10 @@
|
|||||||
<FileTextOutlined/>
|
<FileTextOutlined/>
|
||||||
系统日志
|
系统日志
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-button block @click="clearSiteInfoCache">
|
||||||
|
<ClearOutlined/>
|
||||||
|
清除缓存
|
||||||
|
</a-button>
|
||||||
<a-button block @click="$router.push('/system/setting')">
|
<a-button block @click="$router.push('/system/setting')">
|
||||||
<SettingOutlined/>
|
<SettingOutlined/>
|
||||||
系统设置
|
系统设置
|
||||||
@@ -178,20 +182,23 @@ import {
|
|||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
AccountBookOutlined,
|
AccountBookOutlined,
|
||||||
FileTextOutlined,
|
FileTextOutlined,
|
||||||
|
ClearOutlined,
|
||||||
MoneyCollectOutlined
|
MoneyCollectOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
|
import {message} from 'ant-design-vue/es';
|
||||||
import {openNew} from "@/utils/common";
|
import {openNew} from "@/utils/common";
|
||||||
import { useSiteStore } from '@/store/modules/site';
|
import {useSiteStore} from '@/store/modules/site';
|
||||||
import { useStatisticsStore } from '@/store/modules/statistics';
|
import {useStatisticsStore} from '@/store/modules/statistics';
|
||||||
import { storeToRefs } from 'pinia';
|
import {storeToRefs} from 'pinia';
|
||||||
|
import {removeSiteInfoCache} from "@/api/cms/cmsWebsite";
|
||||||
|
|
||||||
// 使用状态管理
|
// 使用状态管理
|
||||||
const siteStore = useSiteStore();
|
const siteStore = useSiteStore();
|
||||||
const statisticsStore = useStatisticsStore();
|
const statisticsStore = useStatisticsStore();
|
||||||
|
|
||||||
// 从 store 中获取响应式数据
|
// 从 store 中获取响应式数据
|
||||||
const { siteInfo, loading: siteLoading } = storeToRefs(siteStore);
|
const {siteInfo, loading: siteLoading} = storeToRefs(siteStore);
|
||||||
const { loading: statisticsLoading } = storeToRefs(statisticsStore);
|
const {loading: statisticsLoading} = storeToRefs(statisticsStore);
|
||||||
|
|
||||||
// 系统信息
|
// 系统信息
|
||||||
const systemInfo = ref({
|
const systemInfo = ref({
|
||||||
@@ -215,6 +222,17 @@ const totalSales = computed(() => statisticsStore.totalSales);
|
|||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = computed(() => siteLoading.value || statisticsLoading.value);
|
const loading = computed(() => siteLoading.value || statisticsLoading.value);
|
||||||
|
|
||||||
|
// 清除缓存
|
||||||
|
const clearSiteInfoCache = () => {
|
||||||
|
removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId')).then(
|
||||||
|
(msg) => {
|
||||||
|
if (msg) {
|
||||||
|
message.success(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 加载网站信息和统计数据
|
// 加载网站信息和统计数据
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ const loading = ref(false);
|
|||||||
const searchForm = reactive<ShopCouponParam>({
|
const searchForm = reactive<ShopCouponParam>({
|
||||||
keywords: '',
|
keywords: '',
|
||||||
name: undefined,
|
name: undefined,
|
||||||
type: 0
|
type: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
|
|||||||
@@ -76,12 +76,12 @@
|
|||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" @click="add" class="ele-btn-icon">
|
<!-- <a-button type="primary" @click="add" class="ele-btn-icon">-->
|
||||||
<template #icon>
|
<!-- <template #icon>-->
|
||||||
<PlusOutlined />
|
<!-- <PlusOutlined />-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
新增申请
|
<!-- 新增申请-->
|
||||||
</a-button>
|
<!-- </a-button>-->
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
ghost
|
ghost
|
||||||
|
|||||||
@@ -1,455 +1,431 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
row-key="shopDealerApplyId"
|
row-key="shopDealerApplyId"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
v-model:selection="selection"
|
||||||
<template #toolbar>
|
>
|
||||||
<search
|
<template #toolbar>
|
||||||
@search="reload"
|
<search
|
||||||
:selection="selection"
|
@search="reload"
|
||||||
@add="openEdit"
|
:selection="selection"
|
||||||
@batchApprove="batchApprove"
|
@add="openEdit"
|
||||||
@export="exportData"
|
@batchApprove="batchApprove"
|
||||||
/>
|
@export="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'applyStatus'">
|
||||||
|
<a-tag v-if="record.applyStatus === 10" color="orange">待审核</a-tag>
|
||||||
|
<a-tag v-if="record.applyStatus === 20" color="green">已通过</a-tag>
|
||||||
|
<a-tag v-if="record.applyStatus === 30" color="red">已驳回</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template v-if="column.key === 'action'">
|
||||||
<template v-if="column.key === 'action'">
|
<a @click="openEdit(record)" class="ele-text-primary">
|
||||||
<a @click="viewDetail(record)" class="ele-text-info">
|
<EditOutlined/>
|
||||||
<EyeOutlined /> 详情
|
编辑
|
||||||
|
</a>
|
||||||
|
<template v-if="record.applyStatus !== 20">
|
||||||
|
<a-divider type="vertical"/>
|
||||||
|
<a @click="approveApply(record)" class="ele-text-success">
|
||||||
|
<CheckOutlined/>
|
||||||
|
通过
|
||||||
|
</a>
|
||||||
|
<a-divider type="vertical"/>
|
||||||
|
<a @click="rejectApply(record)" class="ele-text-warning">
|
||||||
|
<CloseOutlined/>
|
||||||
|
驳回
|
||||||
|
</a>
|
||||||
|
<a-divider type="vertical"/>
|
||||||
|
<a-popconfirm
|
||||||
|
v-if="record.applyStatus != 20"
|
||||||
|
title="确定要删除此申请记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
placement="topRight"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">
|
||||||
|
<DeleteOutlined/>
|
||||||
|
删除
|
||||||
</a>
|
</a>
|
||||||
<template v-if="record.applyStatus === 10">
|
</a-popconfirm>
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a @click="approveApply(record)" class="ele-text-success">
|
|
||||||
<CheckOutlined /> 通过
|
|
||||||
</a>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a @click="rejectApply(record)" class="ele-text-warning">
|
|
||||||
<CloseOutlined /> 驳回
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a @click="openEdit(record)" class="ele-text-primary">
|
|
||||||
<EditOutlined /> 编辑
|
|
||||||
</a>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a-popconfirm
|
|
||||||
title="确定要删除此申请记录吗?"
|
|
||||||
@confirm="remove(record)"
|
|
||||||
placement="topRight"
|
|
||||||
>
|
|
||||||
<a class="ele-text-danger">
|
|
||||||
<DeleteOutlined /> 删除
|
|
||||||
</a>
|
|
||||||
</a-popconfirm>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</ele-pro-table>
|
</template>
|
||||||
</a-card>
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<ShopDealerApplyEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<ShopDealerApplyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
|
||||||
</a-page-header>
|
</a-page-header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref } from 'vue';
|
import {createVNode, ref} from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue';
|
import {message, Modal} from 'ant-design-vue';
|
||||||
import {
|
import {
|
||||||
ExclamationCircleOutlined,
|
ExclamationCircleOutlined,
|
||||||
EyeOutlined,
|
CheckOutlined,
|
||||||
CheckOutlined,
|
CloseOutlined,
|
||||||
CloseOutlined,
|
EditOutlined,
|
||||||
EditOutlined,
|
DeleteOutlined
|
||||||
DeleteOutlined
|
} from '@ant-design/icons-vue';
|
||||||
} from '@ant-design/icons-vue';
|
import type {EleProTable} from 'ele-admin-pro';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type {
|
||||||
import { toDateString } from 'ele-admin-pro';
|
DatasourceFunction,
|
||||||
import type {
|
ColumnItem
|
||||||
DatasourceFunction,
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
ColumnItem
|
import Search from './components/search.vue';
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
import {getPageTitle} from '@/utils/common';
|
||||||
import Search from './components/search.vue';
|
import ShopDealerApplyEdit from './components/shopDealerApplyEdit.vue';
|
||||||
import {getPageTitle} from '@/utils/common';
|
import {
|
||||||
import ShopDealerApplyEdit from './components/shopDealerApplyEdit.vue';
|
pageShopDealerApply,
|
||||||
import { pageShopDealerApply, removeShopDealerApply, removeBatchShopDealerApply } from '@/api/shop/shopDealerApply';
|
removeShopDealerApply,
|
||||||
import type { ShopDealerApply, ShopDealerApplyParam } from '@/api/shop/shopDealerApply/model';
|
removeBatchShopDealerApply,
|
||||||
|
batchApproveShopDealerApply,
|
||||||
|
updateShopDealerApply
|
||||||
|
} from '@/api/shop/shopDealerApply';
|
||||||
|
import type {ShopDealerApply, ShopDealerApplyParam} from '@/api/shop/shopDealerApply/model';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const selection = ref<ShopDealerApply[]>([]);
|
const selection = ref<ShopDealerApply[]>([]);
|
||||||
// 当前编辑数据
|
// 当前编辑数据
|
||||||
const current = ref<ShopDealerApply | null>(null);
|
const current = ref<ShopDealerApply | null>(null);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
// 是否显示批量移动弹窗
|
// 加载状态
|
||||||
const showMove = ref(false);
|
const loading = ref(true);
|
||||||
// 加载状态
|
|
||||||
const loading = ref(true);
|
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where,
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
if (filters) {
|
||||||
|
where.status = filters.status;
|
||||||
|
}
|
||||||
|
return pageShopDealerApply({
|
||||||
|
...where,
|
||||||
|
...orders,
|
||||||
page,
|
page,
|
||||||
limit,
|
limit
|
||||||
where,
|
});
|
||||||
orders,
|
};
|
||||||
filters
|
|
||||||
}) => {
|
// 表格列配置
|
||||||
if (filters) {
|
const columns = ref<ColumnItem[]>([
|
||||||
where.status = filters.status;
|
{
|
||||||
|
title: '用户ID',
|
||||||
|
dataIndex: 'userId',
|
||||||
|
key: 'userId',
|
||||||
|
align: 'center',
|
||||||
|
width: 80,
|
||||||
|
fixed: 'left'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '申请人信息',
|
||||||
|
key: 'applicantInfo',
|
||||||
|
align: 'left',
|
||||||
|
fixed: 'left',
|
||||||
|
customRender: ({record}) => {
|
||||||
|
return `${record.realName || '-'} (${record.mobile || '-'})`;
|
||||||
}
|
}
|
||||||
return pageShopDealerApply({
|
},
|
||||||
...where,
|
{
|
||||||
...orders,
|
title: '申请方式',
|
||||||
page,
|
dataIndex: 'applyType',
|
||||||
limit
|
key: 'applyType',
|
||||||
});
|
align: 'center',
|
||||||
};
|
width: 120,
|
||||||
|
customRender: ({text}) => {
|
||||||
// 表格列配置
|
const typeMap = {
|
||||||
const columns = ref<ColumnItem[]>([
|
10: {text: '需审核', color: 'orange'},
|
||||||
{
|
20: {text: '免审核', color: 'green'}
|
||||||
title: '用户ID',
|
};
|
||||||
dataIndex: 'userId',
|
const type = typeMap[text] || {text: '未知', color: 'default'};
|
||||||
key: 'userId',
|
return {type: 'tag', props: {color: type.color}, children: type.text};
|
||||||
align: 'center',
|
|
||||||
width: 80,
|
|
||||||
fixed: 'left'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '申请人信息',
|
|
||||||
key: 'applicantInfo',
|
|
||||||
align: 'left',
|
|
||||||
fixed: 'left',
|
|
||||||
customRender: ({ record }) => {
|
|
||||||
return `${record.realName || '-'} (${record.mobile || '-'})`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '申请方式',
|
|
||||||
dataIndex: 'applyType',
|
|
||||||
key: 'applyType',
|
|
||||||
align: 'center',
|
|
||||||
width: 120,
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
const typeMap = {
|
|
||||||
10: { text: '需审核', color: 'orange' },
|
|
||||||
20: { text: '免审核', color: 'green' }
|
|
||||||
};
|
|
||||||
const type = typeMap[text] || { text: '未知', color: 'default' };
|
|
||||||
return { type: 'tag', props: { color: type.color }, children: type.text };
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '审核状态',
|
|
||||||
dataIndex: 'applyStatus',
|
|
||||||
key: 'applyStatus',
|
|
||||||
align: 'center',
|
|
||||||
width: 120,
|
|
||||||
customRender: ({ text }) => {
|
|
||||||
const statusMap = {
|
|
||||||
10: { text: '待审核', color: 'processing' },
|
|
||||||
20: { text: '已通过', color: 'success' },
|
|
||||||
30: { text: '已驳回', color: 'error' }
|
|
||||||
};
|
|
||||||
const status = statusMap[text] || { text: '未知', color: 'default' };
|
|
||||||
return { type: 'tag', props: { color: status.color }, children: status.text };
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '推荐人',
|
|
||||||
dataIndex: 'refereeId',
|
|
||||||
key: 'refereeId',
|
|
||||||
align: 'center',
|
|
||||||
width: 100,
|
|
||||||
customRender: ({ text }) => text ? `ID: ${text}` : '无'
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: '申请时间',
|
|
||||||
// dataIndex: 'applyTime',
|
|
||||||
// key: 'applyTime',
|
|
||||||
// align: 'center',
|
|
||||||
// width: 120,
|
|
||||||
// customRender: ({ text }) => text ? toDateString(new Date(text), 'yyyy-MM-dd HH:mm') : '-'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '审核时间',
|
|
||||||
// dataIndex: 'auditTime',
|
|
||||||
// key: 'auditTime',
|
|
||||||
// align: 'center',
|
|
||||||
// customRender: ({ text }) => text ? toDateString(new Date(text), 'yyyy-MM-dd HH:mm') : '-'
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
title: '驳回原因',
|
|
||||||
dataIndex: 'rejectReason',
|
|
||||||
key: 'rejectReason',
|
|
||||||
align: 'left',
|
|
||||||
ellipsis: true,
|
|
||||||
customRender: ({ text }) => text || '-'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建时间',
|
|
||||||
dataIndex: 'createTime',
|
|
||||||
key: 'createTime',
|
|
||||||
align: 'center',
|
|
||||||
sorter: true,
|
|
||||||
ellipsis: true,
|
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
key: 'action',
|
|
||||||
fixed: 'right',
|
|
||||||
align: 'center',
|
|
||||||
width: 380,
|
|
||||||
hideInSetting: true
|
|
||||||
}
|
}
|
||||||
]);
|
},
|
||||||
|
{
|
||||||
|
title: '审核状态',
|
||||||
|
dataIndex: 'applyStatus',
|
||||||
|
key: 'applyStatus',
|
||||||
|
align: 'center',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '推荐人',
|
||||||
|
dataIndex: 'refereeId',
|
||||||
|
key: 'refereeId',
|
||||||
|
align: 'center',
|
||||||
|
width: 100,
|
||||||
|
customRender: ({text}) => text ? `ID: ${text}` : '无'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '申请时间',
|
||||||
|
// dataIndex: 'applyTime',
|
||||||
|
// key: 'applyTime',
|
||||||
|
// align: 'center',
|
||||||
|
// width: 120,
|
||||||
|
// customRender: ({ text }) => text ? toDateString(new Date(text), 'yyyy-MM-dd HH:mm') : '-'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '审核时间',
|
||||||
|
// dataIndex: 'auditTime',
|
||||||
|
// key: 'auditTime',
|
||||||
|
// align: 'center',
|
||||||
|
// customRender: ({ text }) => text ? toDateString(new Date(text), 'yyyy-MM-dd HH:mm') : '-'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '驳回原因',
|
||||||
|
dataIndex: 'rejectReason',
|
||||||
|
key: 'rejectReason',
|
||||||
|
align: 'left',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({text}) => text || '-'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
align: 'center',
|
||||||
|
sorter: true,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
width: 380,
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
/* 搜索 */
|
/* 搜索 */
|
||||||
const reload = (where?: ShopDealerApplyParam) => {
|
const reload = (where?: ShopDealerApplyParam) => {
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
tableRef?.value?.reload({ where: where });
|
tableRef?.value?.reload({where: where});
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 查看详情 */
|
/* 审核通过 */
|
||||||
const viewDetail = (row: ShopDealerApply) => {
|
const approveApply = (row: ShopDealerApply) => {
|
||||||
Modal.info({
|
Modal.confirm({
|
||||||
title: '经销商申请详情',
|
title: '审核通过确认',
|
||||||
width: 600,
|
content: `确定要通过 ${row.realName} 的经销商申请吗?`,
|
||||||
content: createVNode('div', { style: 'max-height: 400px; overflow-y: auto;' }, [
|
icon: createVNode(CheckOutlined),
|
||||||
createVNode('div', { class: 'detail-item' }, [
|
okText: '确认通过',
|
||||||
createVNode('strong', null, '申请人信息'),
|
okType: 'primary',
|
||||||
createVNode('p', null, `申请ID: ${row.applyId || '-'}`),
|
cancelText: '取消',
|
||||||
createVNode('p', null, `用户ID: ${row.userId || '-'}`),
|
onOk: async () => {
|
||||||
createVNode('p', null, `姓名: ${row.realName || '-'}`),
|
const hide = message.loading('正在处理审核...', 0);
|
||||||
createVNode('p', null, `手机号: ${row.mobile || '-'}`),
|
try {
|
||||||
createVNode('p', null, `推荐人ID: ${row.refereeId || '无'}`),
|
await updateShopDealerApply({
|
||||||
]),
|
...row,
|
||||||
createVNode('div', { class: 'detail-item', style: 'margin-top: 16px;' }, [
|
applyId: row.applyId,
|
||||||
createVNode('strong', null, '申请信息'),
|
applyStatus: 20
|
||||||
createVNode('p', null, `申请方式: ${row.applyType === 10 ? '需后台审核' : row.applyType === 20 ? '无需审核' : '未知'}`),
|
});
|
||||||
createVNode('p', null, `申请时间: ${row.applyTime ? toDateString(new Date(row.applyTime), 'yyyy-MM-dd HH:mm:ss') : '-'}`),
|
|
||||||
]),
|
|
||||||
createVNode('div', { class: 'detail-item', style: 'margin-top: 16px;' }, [
|
|
||||||
createVNode('strong', null, '审核信息'),
|
|
||||||
createVNode('p', null, `审核状态: ${row.applyStatus === 10 ? '待审核' : row.applyStatus === 20 ? '已通过' : row.applyStatus === 30 ? '已驳回' : '未知'}`),
|
|
||||||
createVNode('p', null, `审核时间: ${row.auditTime ? toDateString(new Date(row.auditTime), 'yyyy-MM-dd HH:mm:ss') : '-'}`),
|
|
||||||
createVNode('p', null, `驳回原因: ${row.rejectReason || '-'}`),
|
|
||||||
]),
|
|
||||||
createVNode('div', { class: 'detail-item', style: 'margin-top: 16px;' }, [
|
|
||||||
createVNode('strong', null, '其他信息'),
|
|
||||||
createVNode('p', null, `创建时间: ${row.createTime ? toDateString(row.createTime, 'yyyy-MM-dd HH:mm:ss') : '-'}`),
|
|
||||||
createVNode('p', null, `更新时间: ${row.updateTime ? toDateString(row.updateTime, 'yyyy-MM-dd HH:mm:ss') : '-'}`),
|
|
||||||
])
|
|
||||||
]),
|
|
||||||
okText: '关闭'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 审核通过 */
|
|
||||||
const approveApply = (row: ShopDealerApply) => {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '审核通过确认',
|
|
||||||
content: `确定要通过 ${row.realName} 的经销商申请吗?`,
|
|
||||||
icon: createVNode(CheckOutlined),
|
|
||||||
okText: '确认通过',
|
|
||||||
okType: 'primary',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
const hide = message.loading('正在处理审核...', 0);
|
|
||||||
// 这里需要调用审核通过的API
|
|
||||||
// approveShopDealerApply(row.applyId, { applyStatus: 20 })
|
|
||||||
setTimeout(() => {
|
|
||||||
hide();
|
|
||||||
message.success('审核通过成功');
|
|
||||||
reload();
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 审核驳回 */
|
|
||||||
const rejectApply = (row: ShopDealerApply) => {
|
|
||||||
let rejectReason = '';
|
|
||||||
Modal.confirm({
|
|
||||||
title: '审核驳回',
|
|
||||||
content: createVNode('div', null, [
|
|
||||||
createVNode('p', null, `申请人: ${row.realName} (${row.mobile})`),
|
|
||||||
createVNode('p', { style: 'margin-top: 12px;' }, '请输入驳回原因:'),
|
|
||||||
createVNode('textarea', {
|
|
||||||
placeholder: '请输入驳回原因...',
|
|
||||||
style: 'width: 100%; height: 80px; margin-top: 8px; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px;',
|
|
||||||
onInput: (e: any) => {
|
|
||||||
rejectReason = e.target.value;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
]),
|
|
||||||
icon: createVNode(CloseOutlined),
|
|
||||||
okText: '确认驳回',
|
|
||||||
okType: 'danger',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
if (!rejectReason.trim()) {
|
|
||||||
message.error('请输入驳回原因');
|
|
||||||
return Promise.reject();
|
|
||||||
}
|
|
||||||
const hide = message.loading('正在处理审核...', 0);
|
|
||||||
// 这里需要调用审核驳回的API
|
|
||||||
// rejectShopDealerApply(row.applyId, { applyStatus: 30, rejectReason })
|
|
||||||
setTimeout(() => {
|
|
||||||
hide();
|
|
||||||
message.success('审核驳回成功');
|
|
||||||
reload();
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 打开编辑弹窗 */
|
|
||||||
const openEdit = (row?: ShopDealerApply) => {
|
|
||||||
current.value = row ?? null;
|
|
||||||
showEdit.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 打开批量移动弹窗 */
|
|
||||||
const openMove = () => {
|
|
||||||
showMove.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 删除单个 */
|
|
||||||
const remove = (row: ShopDealerApply) => {
|
|
||||||
if (!row.applyId) {
|
|
||||||
message.error('删除失败:缺少必要参数');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hide = message.loading('正在删除申请记录...', 0);
|
|
||||||
removeShopDealerApply(row.applyId)
|
|
||||||
.then((msg) => {
|
|
||||||
hide();
|
hide();
|
||||||
message.success(msg || '删除成功');
|
message.success('审核通过成功');
|
||||||
reload();
|
reload();
|
||||||
})
|
} catch (error: any) {
|
||||||
.catch((e) => {
|
|
||||||
hide();
|
hide();
|
||||||
message.error(e.message || '删除失败');
|
message.error(error.message || '审核失败,请重试');
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 批量删除 */
|
|
||||||
const removeBatch = () => {
|
|
||||||
if (!selection.value.length) {
|
|
||||||
message.error('请至少选择一条数据');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const validIds = selection.value.filter(d => d.applyId).map(d => d.applyId);
|
|
||||||
if (!validIds.length) {
|
|
||||||
message.error('选中的数据中没有有效的ID');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.confirm({
|
|
||||||
title: '批量删除确认',
|
|
||||||
content: `确定要删除选中的 ${validIds.length} 条申请记录吗?此操作不可恢复。`,
|
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
|
||||||
maskClosable: true,
|
|
||||||
okText: '确认删除',
|
|
||||||
okType: 'danger',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
const hide = message.loading(`正在删除 ${validIds.length} 条记录...`, 0);
|
|
||||||
removeBatchShopDealerApply(validIds)
|
|
||||||
.then((msg) => {
|
|
||||||
hide();
|
|
||||||
message.success(msg || `成功删除 ${validIds.length} 条记录`);
|
|
||||||
selection.value = [];
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
hide();
|
|
||||||
message.error(e.message || '批量删除失败');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 批量通过 */
|
|
||||||
const batchApprove = () => {
|
|
||||||
if (!selection.value.length) {
|
|
||||||
message.error('请至少选择一条数据');
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const pendingApplies = selection.value.filter(item => item.applyStatus === 10);
|
/* 审核驳回 */
|
||||||
if (!pendingApplies.length) {
|
const rejectApply = (row: ShopDealerApply) => {
|
||||||
message.error('所选申请中没有待审核的记录');
|
let rejectReason = '';
|
||||||
return;
|
Modal.confirm({
|
||||||
}
|
title: '审核驳回',
|
||||||
|
content: createVNode('div', null, [
|
||||||
Modal.confirm({
|
createVNode('p', null, `申请人: ${row.realName} (${row.mobile})`),
|
||||||
title: '批量通过确认',
|
createVNode('p', {style: 'margin-top: 12px;'}, '请输入驳回原因:'),
|
||||||
content: `确定要通过选中的 ${pendingApplies.length} 个申请吗?`,
|
createVNode('textarea', {
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
placeholder: '请输入驳回原因...',
|
||||||
okText: '确认通过',
|
style: 'width: 100%; height: 80px; margin-top: 8px; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px;',
|
||||||
okType: 'primary',
|
onInput: (e: any) => {
|
||||||
cancelText: '取消',
|
rejectReason = e.target.value;
|
||||||
onOk: () => {
|
}
|
||||||
const hide = message.loading('正在批量通过...', 0);
|
})
|
||||||
// 这里调用批量通过API
|
]),
|
||||||
setTimeout(() => {
|
icon: createVNode(CloseOutlined),
|
||||||
hide();
|
okText: '确认驳回',
|
||||||
message.success(`成功通过 ${pendingApplies.length} 个申请`);
|
okType: 'danger',
|
||||||
reload();
|
cancelText: '取消',
|
||||||
}, 1500);
|
onOk: async () => {
|
||||||
|
if (!rejectReason.trim()) {
|
||||||
|
message.error('请输入驳回原因');
|
||||||
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
});
|
const hide = message.loading('正在处理审核...', 0);
|
||||||
};
|
try {
|
||||||
|
await updateShopDealerApply({
|
||||||
|
...row,
|
||||||
|
applyStatus: 30,
|
||||||
|
rejectReason: rejectReason.trim()
|
||||||
|
});
|
||||||
|
hide();
|
||||||
|
message.success('审核驳回成功');
|
||||||
|
reload();
|
||||||
|
} catch (error: any) {
|
||||||
|
hide();
|
||||||
|
message.error(error.message || '审核失败,请重试');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/* 导出数据 */
|
/* 打开编辑弹窗 */
|
||||||
const exportData = () => {
|
const openEdit = (row?: ShopDealerApply) => {
|
||||||
const hide = message.loading('正在导出申请数据...', 0);
|
current.value = row ?? null;
|
||||||
// 这里调用导出API
|
showEdit.value = true;
|
||||||
setTimeout(() => {
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: ShopDealerApply) => {
|
||||||
|
if (!row.applyId) {
|
||||||
|
message.error('删除失败:缺少必要参数');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const hide = message.loading('正在删除申请记录...', 0);
|
||||||
|
removeShopDealerApply(row.applyId)
|
||||||
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success('申请数据导出成功');
|
message.success(msg || '删除成功');
|
||||||
}, 2000);
|
reload();
|
||||||
};
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message || '删除失败');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/* 查询 */
|
/* 批量删除 */
|
||||||
const query = () => {
|
const removeBatch = () => {
|
||||||
loading.value = true;
|
if (!selection.value.length) {
|
||||||
};
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* 自定义行属性 */
|
const validIds = selection.value.filter(d => d.applyId).map(d => d.applyId);
|
||||||
const customRow = (record: ShopDealerApply) => {
|
if (!validIds.length) {
|
||||||
return {
|
message.error('选中的数据中没有有效的ID');
|
||||||
// 行点击事件
|
return;
|
||||||
onClick: () => {
|
}
|
||||||
// console.log(record);
|
|
||||||
},
|
Modal.confirm({
|
||||||
// 行双击事件
|
title: '批量删除确认',
|
||||||
onDblclick: () => {
|
content: `确定要删除选中的 ${validIds.length} 条申请记录吗?此操作不可恢复。`,
|
||||||
openEdit(record);
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
okText: '确认删除',
|
||||||
|
okType: 'danger',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading(`正在删除 ${validIds.length} 条记录...`, 0);
|
||||||
|
removeBatchShopDealerApply(validIds)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg || `成功删除 ${validIds.length} 条记录`);
|
||||||
|
selection.value = [];
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message || '批量删除失败');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量通过 */
|
||||||
|
const batchApprove = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pendingApplies = selection.value.filter(item => item.applyStatus === 10);
|
||||||
|
if (!pendingApplies.length) {
|
||||||
|
message.error('所选申请中没有待审核的记录');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.confirm({
|
||||||
|
title: '批量通过确认',
|
||||||
|
content: `确定要通过选中的 ${pendingApplies.length} 个申请吗?`,
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
okText: '确认通过',
|
||||||
|
okType: 'primary',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
const hide = message.loading('正在批量通过...', 0);
|
||||||
|
try {
|
||||||
|
const ids = pendingApplies.map(item => item.applyId);
|
||||||
|
await batchApproveShopDealerApply(ids);
|
||||||
|
hide();
|
||||||
|
message.success(`成功通过 ${pendingApplies.length} 个申请`);
|
||||||
|
selection.value = [];
|
||||||
|
reload();
|
||||||
|
} catch (error: any) {
|
||||||
|
hide();
|
||||||
|
message.error(error.message || '批量审核失败,请重试');
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出数据 */
|
||||||
|
const exportData = () => {
|
||||||
|
const hide = message.loading('正在导出申请数据...', 0);
|
||||||
|
// 这里调用导出API
|
||||||
|
setTimeout(() => {
|
||||||
|
hide();
|
||||||
|
message.success('申请数据导出成功');
|
||||||
|
}, 2000);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: ShopDealerApply) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
query();
|
};
|
||||||
|
query();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'ShopDealerApply'
|
name: 'ShopDealerApply'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@@ -478,26 +454,41 @@
|
|||||||
|
|
||||||
.ele-text-primary {
|
.ele-text-primary {
|
||||||
color: #1890ff;
|
color: #1890ff;
|
||||||
&:hover { color: #40a9ff; }
|
|
||||||
|
&:hover {
|
||||||
|
color: #40a9ff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ele-text-info {
|
.ele-text-info {
|
||||||
color: #13c2c2;
|
color: #13c2c2;
|
||||||
&:hover { color: #36cfc9; }
|
|
||||||
|
&:hover {
|
||||||
|
color: #36cfc9;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ele-text-success {
|
.ele-text-success {
|
||||||
color: #52c41a;
|
color: #52c41a;
|
||||||
&:hover { color: #73d13d; }
|
|
||||||
|
&:hover {
|
||||||
|
color: #73d13d;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ele-text-warning {
|
.ele-text-warning {
|
||||||
color: #faad14;
|
color: #faad14;
|
||||||
&:hover { color: #ffc53d; }
|
|
||||||
|
&:hover {
|
||||||
|
color: #ffc53d;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ele-text-danger {
|
.ele-text-danger {
|
||||||
color: #ff4d4f;
|
color: #ff4d4f;
|
||||||
&:hover { color: #ff7875; }
|
|
||||||
|
&:hover {
|
||||||
|
color: #ff7875;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -136,12 +136,6 @@
|
|||||||
key: 'sortNumber',
|
key: 'sortNumber',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '是否删除, 0否, 1是',
|
|
||||||
dataIndex: 'deleted',
|
|
||||||
key: 'deleted',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
@@ -151,12 +145,6 @@
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '修改时间',
|
|
||||||
dataIndex: 'updateTime',
|
|
||||||
key: 'updateTime',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
|||||||
@@ -521,7 +521,7 @@ const createPrintHtml = (data: ShopGift[]) => {
|
|||||||
body {
|
body {
|
||||||
font-family: Arial, "Microsoft YaHei", sans-serif;
|
font-family: Arial, "Microsoft YaHei", sans-serif;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 20px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import {getPageTitle} from '@/utils/common';
|
import {getPageTitle} from '@/utils/common';
|
||||||
import ShopGiftEdit from './components/shopGiftEdit.vue';
|
import ShopGiftEdit from './components/shopGiftEdit.vue';
|
||||||
import { pageShopGift, removeShopGift, removeBatchShopGift, listShopGift } from '@/api/shop/shopGift';
|
import { pageShopGift, removeShopGift, removeBatchShopGift } from '@/api/shop/shopGift';
|
||||||
import type { ShopGift, ShopGiftParam } from '@/api/shop/shopGift/model';
|
import type { ShopGift, ShopGiftParam } from '@/api/shop/shopGift/model';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
|
|||||||
Reference in New Issue
Block a user