feat:优化了门店搜索组件、优化了模态框默认的内容
This commit is contained in:
@@ -20,5 +20,5 @@ VITE_INJECT_APP_LOADING=true
|
|||||||
VITE_ARCHIVER=true
|
VITE_ARCHIVER=true
|
||||||
|
|
||||||
# WebSocket 连接地址
|
# WebSocket 连接地址
|
||||||
# VITE_WS_URL=wss://api.ws.g.xiaokang88.com/ws
|
VITE_WS_URL=wss://api.ws.g.xiaokang88.com/ws
|
||||||
VITE_WS_URL=wss://xk.ws.nailaoyun.cn/ws
|
# VITE_WS_URL=wss://xk.ws.nailaoyun.cn/ws
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { ref } from 'vue';
|
|||||||
import { type AnalysisOverviewItem, useVbenModal } from '@vben/common-ui';
|
import { type AnalysisOverviewItem, useVbenModal } from '@vben/common-ui';
|
||||||
import { AnalysisOverview } from '@vben/common-ui';
|
import { AnalysisOverview } from '@vben/common-ui';
|
||||||
import { SvgCakeIcon } from '@vben/icons';
|
import { SvgCakeIcon } from '@vben/icons';
|
||||||
|
import { useUserStore } from '@vben/stores';
|
||||||
|
|
||||||
import { Button, Card, message } from 'ant-design-vue';
|
import { Button, Card, message } from 'ant-design-vue';
|
||||||
|
|
||||||
@@ -22,6 +23,12 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
/** 门店账号无「未确认收货」冻结概念,不展示该卡片(提现冻结走「审核中金额」) */
|
||||||
|
const isStoreUser =
|
||||||
|
Number((userStore.userInfo as Record<string, any> | null)?.roles?.user_type) ===
|
||||||
|
1;
|
||||||
|
|
||||||
const balance = ref(0);
|
const balance = ref(0);
|
||||||
const pendingEarnings = ref(0);
|
const pendingEarnings = ref(0);
|
||||||
const settledEarnings = ref(0);
|
const settledEarnings = ref(0);
|
||||||
@@ -38,6 +45,7 @@ const overviewItems = ref<AnalysisOverviewItem[]>([]);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取余额卡片列表数据
|
* 获取余额卡片列表数据
|
||||||
|
* 门店不组装「冻结金额(用户未确认收货)」,避免把提现审核款误展示成未确认收货
|
||||||
*/
|
*/
|
||||||
function showCard() {
|
function showCard() {
|
||||||
showMyCard();
|
showMyCard();
|
||||||
@@ -47,11 +55,11 @@ function showCard() {
|
|||||||
settledEarnings.value = res.settled_earnings;
|
settledEarnings.value = res.settled_earnings;
|
||||||
totalEarnings.value = res.total; // 累计收益
|
totalEarnings.value = res.total; // 累计收益
|
||||||
withdrawnAmount.value = res.withdrawn; // 已提现金额
|
withdrawnAmount.value = res.withdrawn; // 已提现金额
|
||||||
withdrawnFrozenAmount.value = res.withdrawn_frozen; // 已提现金额
|
withdrawnFrozenAmount.value = res.withdrawn_frozen; // 审核中金额
|
||||||
frozenAmount.value = res.frozen; // 已提现金额
|
frozenAmount.value = res.frozen; // 未确认收货款(仅供应商/配送仓有意义)
|
||||||
// arrivedAmount.value = res.data.arrived_amount.toNumber();
|
// arrivedAmount.value = res.data.arrived_amount.toNumber();
|
||||||
fee.value = res.charge;
|
fee.value = res.charge;
|
||||||
overviewItems.value = [
|
const items: AnalysisOverviewItem[] = [
|
||||||
{
|
{
|
||||||
icon: SvgCakeIcon,
|
icon: SvgCakeIcon,
|
||||||
title: '累计收益',
|
title: '累计收益',
|
||||||
@@ -66,13 +74,18 @@ function showCard() {
|
|||||||
totalValue: balance.value,
|
totalValue: balance.value,
|
||||||
value: balance.value,
|
value: balance.value,
|
||||||
},
|
},
|
||||||
{
|
];
|
||||||
|
// 供应商/配送仓才有确认收货前冻结;门店现金账户无此字段
|
||||||
|
if (!isStoreUser) {
|
||||||
|
items.push({
|
||||||
icon: 'game-icons:frozen-orb',
|
icon: 'game-icons:frozen-orb',
|
||||||
title: '冻结金额(用户未确认收货)',
|
title: '冻结金额(用户未确认收货)',
|
||||||
totalTitle: '冻结金额(用户未确认收货)',
|
totalTitle: '冻结金额(用户未确认收货)',
|
||||||
totalValue: frozenAmount.value,
|
totalValue: frozenAmount.value,
|
||||||
value: frozenAmount.value,
|
value: frozenAmount.value,
|
||||||
},
|
});
|
||||||
|
}
|
||||||
|
items.push(
|
||||||
{
|
{
|
||||||
icon: 'fxemoji:hourglassflowingsand',
|
icon: 'fxemoji:hourglassflowingsand',
|
||||||
title: '待结算收益',
|
title: '待结算收益',
|
||||||
@@ -94,28 +107,8 @@ function showCard() {
|
|||||||
totalValue: withdrawnAmount.value,
|
totalValue: withdrawnAmount.value,
|
||||||
value: withdrawnAmount.value,
|
value: withdrawnAmount.value,
|
||||||
},
|
},
|
||||||
// {
|
);
|
||||||
// icon: SvgCardIcon,
|
overviewItems.value = items;
|
||||||
// title: '已提现金额',
|
|
||||||
// totalTitle: '已提现金额',
|
|
||||||
// totalValue: withdrawnAmount.value,
|
|
||||||
// value: withdrawnAmount.value,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// icon: 'flat-color-icons:ok',
|
|
||||||
// title: '到账金额',
|
|
||||||
// totalTitle: '到账金额',
|
|
||||||
// totalValue: arrivedAmount.value,
|
|
||||||
// value: arrivedAmount.value,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// icon: 'icon-park:flash-payment',
|
|
||||||
// title: '手续费',
|
|
||||||
// totalTitle: '手续费',
|
|
||||||
// totalValue: fee.value,
|
|
||||||
// value: fee.value,
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function showMyCard() {
|
function showMyCard() {
|
||||||
|
|||||||
@@ -1,54 +1,71 @@
|
|||||||
import type { VbenFormProps } from '#/adapter/form';
|
import type { VbenFormProps } from '#/adapter/form';
|
||||||
|
|
||||||
export const accountChangeSearchOptions: VbenFormProps = {
|
import { useUserStore } from '@vben/stores';
|
||||||
collapsed: false,
|
|
||||||
schema: [
|
/**
|
||||||
{
|
* 资金变动筛选:门店现金账户无 frozen(未确认收货),筛选项需按角色裁剪
|
||||||
component: 'VbenSelect',
|
* 须在组件 setup 内调用,保证 Pinia 已就绪
|
||||||
componentProps: {
|
*/
|
||||||
placeholder: '来源类型',
|
export function getAccountChangeSearchOptions(): VbenFormProps {
|
||||||
allowClear: true,
|
const userStore = useUserStore();
|
||||||
options: [
|
const isStoreUser =
|
||||||
{ label: '分账', value: 'settle' },
|
Number(
|
||||||
{ label: '提现', value: 'withdraw' },
|
(userStore.userInfo as Record<string, any> | null)?.roles?.user_type,
|
||||||
{ label: '退款', value: 'refund' },
|
) === 1;
|
||||||
],
|
const fieldNameOptions = [
|
||||||
|
{ label: '可提现金额', value: 'able_cash' },
|
||||||
|
{ label: '可提现余额', value: 'balance' },
|
||||||
|
// 仅供应商/配送仓余额账户有「确认收货前冻结」
|
||||||
|
...(!isStoreUser
|
||||||
|
? [{ label: '冻结金额(用户未确认收货)', value: 'frozen' }]
|
||||||
|
: []),
|
||||||
|
{ label: '审核中金额', value: 'frozen_cash' },
|
||||||
|
{ label: '审核中金额(余额账户)', value: 'withdrawn_frozen' },
|
||||||
|
];
|
||||||
|
return {
|
||||||
|
collapsed: false,
|
||||||
|
schema: [
|
||||||
|
{
|
||||||
|
component: 'VbenSelect',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '来源类型',
|
||||||
|
allowClear: true,
|
||||||
|
options: [
|
||||||
|
{ label: '分账', value: 'settle' },
|
||||||
|
{ label: '提现', value: 'withdraw' },
|
||||||
|
{ label: '退款', value: 'refund' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
defaultValue: '',
|
||||||
|
fieldName: 'source_type',
|
||||||
|
label: '来源类型',
|
||||||
},
|
},
|
||||||
defaultValue: '',
|
{
|
||||||
fieldName: 'source_type',
|
component: 'VbenSelect',
|
||||||
label: '来源类型',
|
componentProps: {
|
||||||
},
|
placeholder: '变更字段',
|
||||||
{
|
allowClear: true,
|
||||||
component: 'VbenSelect',
|
options: fieldNameOptions,
|
||||||
componentProps: {
|
},
|
||||||
placeholder: '变更字段',
|
defaultValue: '',
|
||||||
allowClear: true,
|
fieldName: 'field_name',
|
||||||
options: [
|
label: '变更字段',
|
||||||
{ label: '可提现金额', value: 'able_cash' },
|
|
||||||
{ label: '可提现余额', value: 'balance' },
|
|
||||||
{ label: '冻结金额(用户未确认收货)', value: 'frozen' },
|
|
||||||
{ label: '审核中金额', value: 'frozen_cash' },
|
|
||||||
{ label: '审核中金额(余额账户)', value: 'withdrawn_frozen' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
defaultValue: '',
|
{
|
||||||
fieldName: 'field_name',
|
component: 'VbenInput',
|
||||||
label: '变更字段',
|
componentProps: {
|
||||||
},
|
placeholder: '输入订单号',
|
||||||
{
|
},
|
||||||
component: 'VbenInput',
|
defaultValue: '',
|
||||||
componentProps: {
|
fieldName: 'order_no',
|
||||||
placeholder: '输入订单号',
|
label: '订单号',
|
||||||
},
|
},
|
||||||
defaultValue: '',
|
],
|
||||||
fieldName: 'order_no',
|
showCollapseButton: true,
|
||||||
label: '订单号',
|
submitButtonOptions: {
|
||||||
|
content: '查询',
|
||||||
},
|
},
|
||||||
],
|
submitOnChange: true,
|
||||||
showCollapseButton: true,
|
submitOnEnter: false,
|
||||||
submitButtonOptions: {
|
};
|
||||||
content: '查询',
|
}
|
||||||
},
|
|
||||||
submitOnChange: true,
|
|
||||||
submitOnEnter: false,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import DetailModal from '#/views/business/order/product-order/components/detail.
|
|||||||
|
|
||||||
import SettlementDetailDrawer from './components/settlement-detail-drawer.vue';
|
import SettlementDetailDrawer from './components/settlement-detail-drawer.vue';
|
||||||
import Statistics from './components/statistics.vue';
|
import Statistics from './components/statistics.vue';
|
||||||
import { accountChangeSearchOptions } from './config/account-change-search';
|
import { getAccountChangeSearchOptions } from './config/account-change-search';
|
||||||
import { accountChangeGridOptions } from './config/account-change-table';
|
import { accountChangeGridOptions } from './config/account-change-table';
|
||||||
import { formOptions } from './config/search';
|
import { formOptions } from './config/search';
|
||||||
import { formOptions3 } from './config/settlement-log-search';
|
import { formOptions3 } from './config/settlement-log-search';
|
||||||
@@ -47,8 +47,9 @@ const [Grid3] = useVbenVxeGrid({
|
|||||||
gridOptions: gridOptions3,
|
gridOptions: gridOptions3,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 门店侧裁剪掉「冻结金额(用户未确认收货)」筛选项,须在 setup 内按当前角色生成
|
||||||
const [Grid4] = useVbenVxeGrid({
|
const [Grid4] = useVbenVxeGrid({
|
||||||
formOptions: accountChangeSearchOptions,
|
formOptions: getAccountChangeSearchOptions(),
|
||||||
gridOptions: accountChangeGridOptions,
|
gridOptions: accountChangeGridOptions,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user