添加收益和提现页面
This commit is contained in:
@@ -59,6 +59,7 @@ export interface Order {
|
||||
startTime?: string;
|
||||
deliveryTime?: string;
|
||||
expirationTime?: string;
|
||||
expirationDay?: number;
|
||||
// 状态
|
||||
status?: string;
|
||||
// 用户ID
|
||||
|
||||
19
src/api/profit/index.ts
Normal file
19
src/api/profit/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Profit, ProfitParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询收益明细
|
||||
*/
|
||||
export async function profitPage(params: ProfitParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Profit>>>(
|
||||
'/shop/profit-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
38
src/api/profit/model/index.ts
Normal file
38
src/api/profit/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 收益
|
||||
*/
|
||||
export interface Profit {
|
||||
profitId?: number;
|
||||
orderId?: number;
|
||||
userId?: number;
|
||||
orderNo?: string;
|
||||
isRenew?: number;
|
||||
scene?: number;
|
||||
sceneDis?: string;
|
||||
money?: string;
|
||||
remark?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
merchantName?: string;
|
||||
equipmentCode?: string;
|
||||
orderUserName?: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收益搜索条件
|
||||
*/
|
||||
export interface ProfitParam extends PageParam {
|
||||
keywords?: string;
|
||||
orderNo?: string;
|
||||
orderUserName?: string;
|
||||
merchantName?: string;
|
||||
beginDate?: string;
|
||||
endDate?: string;
|
||||
scene?: number;
|
||||
}
|
||||
39
src/api/withdraw/index.ts
Normal file
39
src/api/withdraw/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Withdraw, WithdrawParam, AuditPassParam, AuditRejectParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询收益明细
|
||||
*/
|
||||
export async function withdrawPage(params: WithdrawParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Withdraw>>>(
|
||||
'/shop/merchant-withdraw/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function pass(params: AuditPassParam) {
|
||||
const res = await request.post<ApiResult<ApiResult>>(
|
||||
'/shop/merchant-withdraw/audit/pass', params
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function reject(params: AuditRejectParam) {
|
||||
const res = await request.post<ApiResult<ApiResult>>(
|
||||
'/shop/merchant-withdraw/audit/reject', params
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
50
src/api/withdraw/model/index.ts
Normal file
50
src/api/withdraw/model/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 收益
|
||||
*/
|
||||
export interface Withdraw {
|
||||
id?: number;
|
||||
withdrawCode?: string;
|
||||
nickname?: string;
|
||||
payTypeDis?: string;
|
||||
cardTypeDis?: string;
|
||||
alipayName?: string;
|
||||
alipayAccount?: string;
|
||||
money?: number;
|
||||
applyStatusDis?: string;
|
||||
rejectReason?: string;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收益搜索条件
|
||||
*/
|
||||
export interface WithdrawParam extends PageParam {
|
||||
keywords?: string;
|
||||
nickname?: string;
|
||||
cardType?: number;
|
||||
payType?: number;
|
||||
applyStatus?: number;
|
||||
beginDate?: string;
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*/
|
||||
export interface AuditPassParam {
|
||||
id?: number;
|
||||
payType?: number;
|
||||
comments?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核拒绝
|
||||
*/
|
||||
export interface AuditRejectParam {
|
||||
id?: number;
|
||||
rejectReason?: string;
|
||||
}
|
||||
@@ -21,6 +21,11 @@ export default [
|
||||
component: '/order',
|
||||
meta: { title: '订单管理', icon: 'CalendarOutlined' }
|
||||
},
|
||||
{
|
||||
path: '/profit',
|
||||
component: '/profit',
|
||||
meta: { title: '收益管理', icon: 'CalendarOutlined' }
|
||||
},
|
||||
{
|
||||
path: '/content/article',
|
||||
component: '/content/article',
|
||||
|
||||
@@ -50,7 +50,8 @@ export const MAP_CODE = '7225174a116c1c44e1bd7a177d1787d5';
|
||||
export const LICENSE_CODE =
|
||||
'dk9mcwJyetRWQlxWRiojIzJCLi8mcQ5Wa4ojI0NWZqJWd6ICZpJCL0kjNwl1NnhENahnIvl2cyVmdiwiIiATMuEjI6IibQf0NW==';
|
||||
// 文件服务器地址
|
||||
export const FILE_SERVER = 'https://file.wsdns.cn';
|
||||
// export const FILE_SERVER = 'https://file.wsdns.cn';
|
||||
export const FILE_SERVER = 'https://yxw.wsdns.cn';
|
||||
// 缩略图前缀
|
||||
export const FILE_THUMBNAIL = FILE_SERVER + '/thumbnail';
|
||||
// 文件下载前缀
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@advanced="openAdvanced"
|
||||
/>
|
||||
</template>
|
||||
@@ -305,7 +303,15 @@
|
||||
{
|
||||
title: '到期时间',
|
||||
dataIndex: 'expirationTime',
|
||||
key: 'expirationTime'
|
||||
key: 'expirationTime',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '逾期天数',
|
||||
dataIndex: 'expirationDay',
|
||||
key: 'expirationDay',
|
||||
align: 'center',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '买家',
|
||||
|
||||
235
src/views/yunxinwei/profit/index.vue
Normal file
235
src/views/yunxinwei/profit/index.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="profitId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
v-model:selection="selection"
|
||||
tool-class="ele-toolbar-form"
|
||||
:scroll="{ x: 1200 }"
|
||||
class="sys-org-table"
|
||||
:striped="true"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@advanced="openAdvanced"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'profitId'">
|
||||
{{ record.profitId}}
|
||||
</template>
|
||||
<template v-if="column.key === 'orderUserName'">
|
||||
{{ record.orderUserName}}
|
||||
</template>
|
||||
<template v-if="column.key === 'merchantName'">
|
||||
<div style="display: flex; flex-direction: column">
|
||||
<span>{{ record.merchantName }}</span>
|
||||
<span class="ele-text-placeholder">
|
||||
{{ record.merchantCode }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="column.key === 'sceneDis'">
|
||||
{{ record.sceneDis }}
|
||||
</template>
|
||||
<template v-if="column.key === 'orderNo'">
|
||||
{{ record.orderNo }}
|
||||
</template>
|
||||
<template v-if="column.key === 'money'">
|
||||
<p>
|
||||
<span class="ele-text-warning price-edit">
|
||||
¥{{ record.money }}
|
||||
</span></p>
|
||||
</template>
|
||||
<template v-if="column.key === 'comments'">
|
||||
{{ record.comments }}
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === '0'" color="green">正常</a-tag>
|
||||
<a-tag v-if="record.status === '1'" color="red">冻结</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'createTime'">
|
||||
{{ record.createTime }}
|
||||
</template>
|
||||
<!-- <template v-if="column.key === 'updateTime'">
|
||||
{{ record.updateTime }}
|
||||
</template> -->
|
||||
<template v-if="column.key === 'action'">
|
||||
<!-- <a-space>
|
||||
<a-button @click="openInfo(record)">详情</a-button>
|
||||
</a-space> -->
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import Search from './search.vue';
|
||||
import type { Profit, ProfitParam } from '@/api/profit/model';
|
||||
import { profitPage } from '@/api/profit';
|
||||
|
||||
// 当前用户信息
|
||||
// const userStore = useUserStore();
|
||||
// const loginUser = computed(() => userStore.info ?? {});
|
||||
// const orderType = localStorage.getItem('orderType');
|
||||
defineProps<{
|
||||
activeKey?: boolean;
|
||||
data?: any;
|
||||
}>();
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
/* 获取字典数据 */
|
||||
// const orderSource = getDictionaryOptions('equipmentCategory');
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
key: 'index',
|
||||
width: 20,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
hideInSetting: true,
|
||||
hideInTable: true,
|
||||
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
},
|
||||
/* {
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
hideInSetting: true
|
||||
}, */
|
||||
{
|
||||
title: '编号',
|
||||
dataIndex: 'profitId',
|
||||
key: 'profitId',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '下单用户',
|
||||
dataIndex: 'orderUserName',
|
||||
key: 'orderUserName'
|
||||
},
|
||||
{
|
||||
title: '门店',
|
||||
dataIndex: 'merchantName',
|
||||
key: 'merchantName'
|
||||
},
|
||||
{
|
||||
title: '收益类别',
|
||||
dataIndex: 'sceneDis',
|
||||
key: 'sceneDis'
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'orderNo',
|
||||
key: 'orderNo'
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
key: 'money',
|
||||
dataIndex: 'money',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
sorter: true/* ,
|
||||
customRender: ({ text }) => toDateString(text) */
|
||||
}
|
||||
]);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<Profit[]>([]);
|
||||
|
||||
// 是否显示高级搜索
|
||||
const showAdvancedSearch = ref(false);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
// 搜索条件
|
||||
if (filters.scene) {
|
||||
where.scene = filters.scene;
|
||||
}
|
||||
where.tenantId = localStorage.getItem('tenantId');
|
||||
return profitPage({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ProfitParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开高级搜索 */
|
||||
const openAdvanced = () => {
|
||||
showAdvancedSearch.value = !showAdvancedSearch.value;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ProfitIndex'
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
p {
|
||||
line-height: 0.8;
|
||||
}
|
||||
.sys-org-table :deep(.ant-table-body) {
|
||||
overflow: auto !important;
|
||||
overflow: overlay !important;
|
||||
}
|
||||
|
||||
.sys-org-table :deep(.ant-table-pagination.ant-pagination) {
|
||||
padding: 0 4px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.price-edit {
|
||||
padding-right: 5px;
|
||||
}
|
||||
.comments {
|
||||
max-width: 200px;
|
||||
}
|
||||
</style>
|
||||
106
src/views/yunxinwei/profit/search.vue
Normal file
106
src/views/yunxinwei/profit/search.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-radio-group v-model:value="sceneType" @change="handleTabs">
|
||||
<a-radio-button :value="0">全部</a-radio-button>
|
||||
<a-radio-button :value="1">资产收益</a-radio-button>
|
||||
<a-radio-button :value="2">服务费收益</a-radio-button>
|
||||
<a-radio-button :value="3">推广收益</a-radio-button>
|
||||
<a-radio-button :value="4">门店业绩提成</a-radio-button>
|
||||
<a-radio-button :value="5">站点业绩提成</a-radio-button>
|
||||
</a-radio-group>
|
||||
<a-range-picker
|
||||
v-model:value="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入关键词"
|
||||
v-model:value="searchText"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
>
|
||||
<template #addonBefore>
|
||||
<a-select v-model:value="type" style="width: 100px; margin: -5px -12px">
|
||||
<a-select-option value="keywords">模糊搜索</a-select-option>
|
||||
<a-select-option value="orderNo">订单号</a-select-option>
|
||||
<a-select-option value="merchantName">门店名称</a-select-option>
|
||||
<a-select-option value="orderUserName">用户名</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
</a-input-search>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useSearch from '@/utils/use-search';
|
||||
import { ref, watch } from 'vue';
|
||||
import type { ProfitParam } from '@/api/profit/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: ProfitParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'advanced'): void;
|
||||
}>();
|
||||
|
||||
// 表单数据
|
||||
const { where, resetFields } = useSearch<ProfitParam>({
|
||||
scene: 0
|
||||
|
||||
});
|
||||
// 下来选项
|
||||
const type = ref('keywords');
|
||||
// 搜索内容
|
||||
const searchText = ref('');
|
||||
// 日期范围选择
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const sceneType = ref<number>(0);
|
||||
|
||||
/* 搜索 */
|
||||
const search = () => {
|
||||
const [d1, d2] = dateRange.value ?? [];
|
||||
if (type.value == 'orderNo') {
|
||||
where.orderNo = searchText.value;
|
||||
}
|
||||
if (type.value == 'orderUserName') {
|
||||
where.orderUserName = searchText.value;
|
||||
}
|
||||
if (type.value == 'merchantName') {
|
||||
where.merchantName = searchText.value;
|
||||
}
|
||||
if (type.value == 'keywords') {
|
||||
where.keywords = searchText.value;
|
||||
}
|
||||
emit('search', {
|
||||
...where,
|
||||
beginDate: d1,
|
||||
endDate: d2
|
||||
});
|
||||
};
|
||||
|
||||
const handleTabs = (e) => {
|
||||
resetFields();
|
||||
const sceneType = Number(e.target.value);
|
||||
if(sceneType > 0){
|
||||
where.scene = sceneType;
|
||||
}
|
||||
|
||||
emit('search', {
|
||||
...where
|
||||
});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
122
src/views/yunxinwei/withdraw/fail.vue
Normal file
122
src/views/yunxinwei/withdraw/fail.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<!-- 服务编辑弹窗 -->
|
||||
<template >
|
||||
<ele-modal
|
||||
:width="400"
|
||||
:visible="visible"
|
||||
:confirm-loading="loading"
|
||||
:title="'审批拒绝'"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="360"
|
||||
name="rejectReason"
|
||||
placeholder="请输入拒绝理由"
|
||||
v-model:value="form.rejectReason"
|
||||
/>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import useFormData from '@/utils/use-form-data';
|
||||
import { reject } from '@/api/withdraw';
|
||||
import type {AuditRejectParam } from '@/api/withdraw/model';
|
||||
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: AuditRejectParam | null;
|
||||
}>();
|
||||
|
||||
//
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const { form, resetFields, assignFields } = useFormData<AuditRejectParam>({
|
||||
id: undefined,
|
||||
rejectReason: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive<Record<string, Rule[]>>({
|
||||
rejectReason: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入拒绝理由',
|
||||
type: 'string',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value.validate()
|
||||
.then(() => {
|
||||
loading.value = true
|
||||
console.log("提交审核数据:",form)
|
||||
reject(form)
|
||||
.then((msg) => {
|
||||
loading.value = false
|
||||
message.success("审核拒绝成功!");
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
assignFields(props.data);
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
formRef.value?.clearValidate();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
304
src/views/yunxinwei/withdraw/index.vue
Normal file
304
src/views/yunxinwei/withdraw/index.vue
Normal file
@@ -0,0 +1,304 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="withdrawCode"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
v-model:selection="selection"
|
||||
tool-class="ele-toolbar-form"
|
||||
:scroll="{ x: 1200 }"
|
||||
class="sys-org-table"
|
||||
:striped="true"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@advanced="openAdvanced"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action' && record.applyStatus == 10">
|
||||
<a-space>
|
||||
<a-popconfirm
|
||||
title="确定已完成线下打款?"
|
||||
@confirm="auditOffline(record)">
|
||||
<a class="ele-text-success">通过</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical" />
|
||||
<!-- <a-popconfirm
|
||||
title="确定通过支付宝打款?"
|
||||
@confirm="auditAlipay(record)">
|
||||
<a class="ele-text-primary">支付宝</a>
|
||||
</a-popconfirm> -->
|
||||
<a class="ele-text-danger" @click="openFail(record)">拒绝</a>
|
||||
<!-- <div class="pointer cannotselect margin-top-l margin-left-l btn-blue-full" @click="auditFail(record)">拒绝</div>
|
||||
<input-box :caption="caption" :show="showInput" :value="inputValue" @close="showInput=false" @confirm="inputBoxYes" @cancel="showInput=false">
|
||||
</input-box> -->
|
||||
<fail v-model:visible="showFail" :data="current" @done="reload"/>
|
||||
</a-space>
|
||||
</template>
|
||||
<template v-if="column.key === 'withdrawCode'">
|
||||
{{ record.withdrawCode}}
|
||||
</template>
|
||||
<template v-if="column.key === 'nickname'">
|
||||
{{ record.nickname}}
|
||||
</template>
|
||||
<template v-if="column.key === 'cardTypeDis'">
|
||||
{{ record.cardTypeDis }}
|
||||
</template>
|
||||
<template v-if="column.key === 'alipayName'">
|
||||
{{ record.alipayName }}
|
||||
</template>
|
||||
<template v-if="column.key === 'alipayAccount'">
|
||||
{{ record.alipayAccount }}
|
||||
</template>
|
||||
<template v-if="column.key === 'payTypeDis'">
|
||||
{{ record.payTypeDis }}
|
||||
</template>
|
||||
<template v-if="column.key === 'money'">
|
||||
<span class="ele-text-warning price-edit">
|
||||
¥{{ record.money }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'applyStatusDis'">
|
||||
{{ record.applyStatusDis }}
|
||||
</template>
|
||||
<template v-if="column.key === 'comments'">
|
||||
{{ record.comments }}
|
||||
</template>
|
||||
<template v-if="column.key === 'rejectReason'">
|
||||
{{ record.rejectReason }}
|
||||
</template>
|
||||
<template v-if="column.key === 'createTime'">
|
||||
{{ record.createTime }}
|
||||
</template>
|
||||
<template v-if="column.key === 'updateTime'">
|
||||
{{ record.updateTime }}
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode,ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue/es';
|
||||
import {
|
||||
PlusOutlined,
|
||||
DeleteOutlined,
|
||||
ExclamationCircleOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import { messageLoading,toDateString } from 'ele-admin-pro';
|
||||
import Search from './search.vue';
|
||||
import type { Withdraw, WithdrawParam, AuditRejectParam } from '@/api/withdraw/model';
|
||||
import { withdrawPage, pass, reject } from '@/api/withdraw';
|
||||
import Fail from './fail.vue';
|
||||
|
||||
// 当前用户信息
|
||||
// const userStore = useUserStore();
|
||||
// const loginUser = computed(() => userStore.info ?? {});
|
||||
// const orderType = localStorage.getItem('orderType');
|
||||
defineProps<{
|
||||
activeKey?: boolean;
|
||||
data?: any;
|
||||
}>();
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
/* 获取字典数据 */
|
||||
// const orderSource = getDictionaryOptions('equipmentCategory');
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
key: 'index',
|
||||
width: 20,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
hideInSetting: true,
|
||||
hideInTable: true,
|
||||
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
hideInSetting: true
|
||||
},
|
||||
{
|
||||
title: '编号',
|
||||
dataIndex: 'withdrawCode',
|
||||
key: 'withdrawCode',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '用户',
|
||||
dataIndex: 'nickname',
|
||||
key: 'nickname'
|
||||
},
|
||||
{
|
||||
title: '收入卡类型',
|
||||
dataIndex: 'cardTypeDis',
|
||||
key: 'cardTypeDis'
|
||||
},
|
||||
{
|
||||
title: '支付宝名',
|
||||
dataIndex: 'alipayName',
|
||||
key: 'alipayName'
|
||||
},
|
||||
{
|
||||
title: '支付宝账号',
|
||||
dataIndex: 'alipayAccount',
|
||||
key: 'alipayAccount'
|
||||
},
|
||||
{
|
||||
title: '打款方式',
|
||||
dataIndex: 'payTypeDis',
|
||||
key: 'payTypeDis'
|
||||
},
|
||||
{
|
||||
title: '申请金额',
|
||||
key: 'money',
|
||||
dataIndex: 'money',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'applyStatusDis',
|
||||
key: 'applyStatusDis'
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments'
|
||||
},
|
||||
{
|
||||
title: '拒绝理由',
|
||||
dataIndex: 'rejectReason',
|
||||
key: 'rejectReason'
|
||||
},
|
||||
{
|
||||
title: '申请时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
sorter: true/* ,
|
||||
customRender: ({ text }) => toDateString(text) */
|
||||
},
|
||||
{
|
||||
title: '审核时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
sorter: true/* ,
|
||||
customRender: ({ text }) => toDateString(text) */
|
||||
},
|
||||
]);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<Withdraw[]>([]);
|
||||
|
||||
// 是否显示高级搜索
|
||||
const showAdvancedSearch = ref(false);
|
||||
const showFail = ref(false);
|
||||
|
||||
const current = ref<AuditRejectParam | null>(null);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
// 搜索条件
|
||||
if (filters.scene) {
|
||||
where.scene = filters.scene;
|
||||
}
|
||||
where.tenantId = localStorage.getItem('tenantId');
|
||||
return withdrawPage({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: WithdrawParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开高级搜索 */
|
||||
const openAdvanced = () => {
|
||||
showAdvancedSearch.value = !showAdvancedSearch.value;
|
||||
};
|
||||
|
||||
const auditOffline = (param) => {
|
||||
pass({
|
||||
id: param.id,
|
||||
payType: 40
|
||||
}).then(result => {
|
||||
message.success(result)
|
||||
reload()
|
||||
}).catch(err => {
|
||||
message.error(err)
|
||||
})
|
||||
}
|
||||
|
||||
/* const auditAlipay = (param) => {
|
||||
|
||||
} */
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openFail = (row?: AuditRejectParam) => {
|
||||
current.value = row ?? null;
|
||||
showFail.value = true;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'WithdrawIndex'
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
p {
|
||||
line-height: 0.8;
|
||||
}
|
||||
// .sys-org-table :deep(.ant-table-body) {
|
||||
// overflow: auto !important;
|
||||
// overflow: overlay !important;
|
||||
// }
|
||||
|
||||
// .sys-org-table :deep(.ant-table-pagination.ant-pagination) {
|
||||
// padding: 0 4px;
|
||||
// margin-bottom: 0;
|
||||
// }
|
||||
.price-edit {
|
||||
padding-right: 5px;
|
||||
align-items: center;
|
||||
}
|
||||
.comments {
|
||||
max-width: 200px;
|
||||
}
|
||||
</style>
|
||||
99
src/views/yunxinwei/withdraw/search.vue
Normal file
99
src/views/yunxinwei/withdraw/search.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-radio-group v-model:value="applyStatus" @change="handleApplyStatus">
|
||||
<a-radio-button :value="0">全部</a-radio-button>
|
||||
<a-radio-button :value="10">待审核</a-radio-button>
|
||||
<a-radio-button :value="20">审核通过</a-radio-button>
|
||||
<a-radio-button :value="30">审核拒绝</a-radio-button>
|
||||
</a-radio-group>
|
||||
<a-range-picker
|
||||
v-model:value="dateRange"
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入关键词"
|
||||
v-model:value="searchText"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
>
|
||||
<template #addonBefore>
|
||||
<a-select v-model:value="type" style="width: 100px; margin: -5px -12px">
|
||||
<a-select-option value="keywords">模糊搜索</a-select-option>
|
||||
<a-select-option value="withdrawCode">单号</a-select-option>
|
||||
<a-select-option value="nickname">用户名</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
</a-input-search>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useSearch from '@/utils/use-search';
|
||||
import { ref, watch } from 'vue';
|
||||
import type { WithdrawParam } from '@/api/withdraw/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: WithdrawParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'advanced'): void;
|
||||
}>();
|
||||
|
||||
// 表单数据
|
||||
const { where, resetFields } = useSearch<WithdrawParam>({
|
||||
|
||||
});
|
||||
// 下来选项
|
||||
const type = ref('keywords');
|
||||
// 搜索内容
|
||||
const searchText = ref('');
|
||||
// 日期范围选择
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const applyStatus = ref<number>(0);
|
||||
|
||||
/* 搜索 */
|
||||
const search = () => {
|
||||
const [d1, d2] = dateRange.value ?? [];
|
||||
if (type.value == 'withdrawCode') {
|
||||
where.withdrawCode = searchText.value;
|
||||
}
|
||||
if (type.value == 'nickname') {
|
||||
where.nickname = searchText.value;
|
||||
}
|
||||
if (type.value == 'keywords') {
|
||||
where.keywords = searchText.value;
|
||||
}
|
||||
emit('search', {
|
||||
...where,
|
||||
beginDate: d1,
|
||||
endDate: d2
|
||||
});
|
||||
};
|
||||
|
||||
const handleApplyStatus = (e) => {
|
||||
resetFields();
|
||||
const applyStatus = Number(e.target.value);
|
||||
if(applyStatus > 0){
|
||||
where.applyStatus = applyStatus;
|
||||
}
|
||||
|
||||
emit('search', {
|
||||
...where
|
||||
});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
Reference in New Issue
Block a user