diff --git a/apps/web-antd/src/router/routes/modules/crm.ts b/apps/web-antd/src/router/routes/modules/crm.ts index 7f25f91a..0177076f 100644 --- a/apps/web-antd/src/router/routes/modules/crm.ts +++ b/apps/web-antd/src/router/routes/modules/crm.ts @@ -64,7 +64,7 @@ const routes: RouteRecordRaw[] = [ title: '回款详情', activePath: '/crm/receivable', }, - component: () => import('#/views/crm/receivable/modules/detail.vue'), + component: () => import('#/views/crm/receivable/detail/index.vue'), }, { path: 'contact/detail/:id', diff --git a/apps/web-antd/src/views/crm/receivable/components/data.ts b/apps/web-antd/src/views/crm/receivable/components/data.ts new file mode 100644 index 00000000..4f3f0e13 --- /dev/null +++ b/apps/web-antd/src/views/crm/receivable/components/data.ts @@ -0,0 +1,73 @@ +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '@vben/constants'; + +/** 详情列表的字段 */ +export function useDetailListColumns(): VxeTableGridOptions['columns'] { + return [ + { + title: '回款编号', + field: 'no', + minWidth: 150, + fixed: 'left', + }, + { + title: '客户名称', + field: 'customerName', + minWidth: 150, + }, + { + title: '合同编号', + field: 'contract.no', + minWidth: 150, + }, + { + title: '回款日期', + field: 'returnTime', + minWidth: 150, + formatter: 'formatDateTime', + }, + { + title: '回款金额(元)', + field: 'price', + minWidth: 150, + formatter: 'formatAmount2', + }, + { + title: '回款方式', + field: 'returnType', + minWidth: 150, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE }, + }, + }, + { + title: '负责人', + field: 'ownerUserName', + minWidth: 150, + }, + { + title: '备注', + field: 'remark', + minWidth: 150, + }, + { + title: '回款状态', + field: 'auditStatus', + minWidth: 100, + fixed: 'right', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, + }, + }, + { + title: '操作', + field: 'actions', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/crm/receivable/modules/detail-list.vue b/apps/web-antd/src/views/crm/receivable/components/detail-list.vue similarity index 97% rename from apps/web-antd/src/views/crm/receivable/modules/detail-list.vue rename to apps/web-antd/src/views/crm/receivable/components/detail-list.vue index e8af1464..9e7eba78 100644 --- a/apps/web-antd/src/views/crm/receivable/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/receivable/components/detail-list.vue @@ -13,8 +13,8 @@ import { } from '#/api/crm/receivable'; import { $t } from '#/locales'; -import { useDetailListColumns } from './detail-data'; -import Form from './form.vue'; +import { useDetailListColumns } from './data'; +import Form from '../modules/form.vue'; const props = defineProps<{ contractId?: number; // 合同编号 diff --git a/apps/web-antd/src/views/crm/receivable/data.ts b/apps/web-antd/src/views/crm/receivable/data.ts index eb6bd397..7997ecf9 100644 --- a/apps/web-antd/src/views/crm/receivable/data.ts +++ b/apps/web-antd/src/views/crm/receivable/data.ts @@ -198,7 +198,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { title: '回款编号', field: 'no', - minWidth: 150, + minWidth: 160, fixed: 'left', slots: { default: 'no' }, }, @@ -211,7 +211,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { title: '合同编号', field: 'contract', - minWidth: 150, + minWidth: 160, slots: { default: 'contractNo' }, }, { @@ -286,7 +286,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { title: '操作', field: 'actions', - width: 130, + minWidth: 130, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-antd/src/views/crm/receivable/modules/detail-data.ts b/apps/web-antd/src/views/crm/receivable/detail/data.ts similarity index 55% rename from apps/web-antd/src/views/crm/receivable/modules/detail-data.ts rename to apps/web-antd/src/views/crm/receivable/detail/data.ts index 56c18ede..f78afcc2 100644 --- a/apps/web-antd/src/views/crm/receivable/modules/detail-data.ts +++ b/apps/web-antd/src/views/crm/receivable/detail/data.ts @@ -1,4 +1,3 @@ -import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -78,73 +77,3 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] { }, ]; } - -/** 详情列表的字段 */ -export function useDetailListColumns(): VxeTableGridOptions['columns'] { - return [ - { - title: '回款编号', - field: 'no', - minWidth: 150, - fixed: 'left', - }, - { - title: '客户名称', - field: 'customerName', - minWidth: 150, - }, - { - title: '合同编号', - field: 'contract.no', - minWidth: 150, - }, - { - title: '回款日期', - field: 'returnTime', - minWidth: 150, - formatter: 'formatDateTime', - }, - { - title: '回款金额(元)', - field: 'price', - minWidth: 150, - formatter: 'formatAmount2', - }, - { - title: '回款方式', - field: 'returnType', - minWidth: 150, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE }, - }, - }, - { - title: '负责人', - field: 'ownerUserName', - minWidth: 150, - }, - { - title: '备注', - field: 'remark', - minWidth: 150, - }, - { - title: '回款状态', - field: 'auditStatus', - minWidth: 100, - fixed: 'right', - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, - }, - }, - { - title: '操作', - field: 'actions', - width: 130, - fixed: 'right', - slots: { default: 'actions' }, - }, - ]; -} diff --git a/apps/web-antd/src/views/crm/receivable/modules/detail.vue b/apps/web-antd/src/views/crm/receivable/detail/index.vue similarity index 94% rename from apps/web-antd/src/views/crm/receivable/modules/detail.vue rename to apps/web-antd/src/views/crm/receivable/detail/index.vue index e61d5bdb..1d3b1a5b 100644 --- a/apps/web-antd/src/views/crm/receivable/modules/detail.vue +++ b/apps/web-antd/src/views/crm/receivable/detail/index.vue @@ -17,10 +17,10 @@ import { getReceivable } from '#/api/crm/receivable'; import { useDescription } from '#/components/description'; import { AsyncOperateLog } from '#/components/operate-log'; import { PermissionList } from '#/views/crm/permission'; -import { ReceivableDetailsInfo } from '#/views/crm/receivable'; -import { useDetailSchema } from './detail-data'; -import ReceivableForm from './form.vue'; +import ReceivableForm from '../modules/form.vue'; +import { useDetailSchema } from './data'; +import Info from './modules/info.vue'; const loading = ref(false); @@ -110,7 +110,7 @@ onMounted(() => { - + import('./modules/detail-info.vue'), -); - -export const ReceivableForm = defineAsyncComponent( - () => import('./modules/form.vue'), -); - -export const ReceivableDetails = defineAsyncComponent( - () => import('./modules/detail.vue'), -); - export const ReceivableDetailsList = defineAsyncComponent( - () => import('./modules/detail-list.vue'), + () => import('./components/detail-list.vue'), ); export const ReceivablePlanDetailsInfo = defineAsyncComponent( @@ -23,7 +11,3 @@ export const ReceivablePlanDetailsInfo = defineAsyncComponent( export const ReceivablePlanDetailsList = defineAsyncComponent( () => import('./plan/modules/detail-list.vue'), ); - -export const ReceivablePlanDetails = defineAsyncComponent( - () => import('./plan/modules/detail.vue'), -); diff --git a/apps/web-antd/src/views/crm/receivable/index.vue b/apps/web-antd/src/views/crm/receivable/index.vue index 7b15cd34..f5ace879 100644 --- a/apps/web-antd/src/views/crm/receivable/index.vue +++ b/apps/web-antd/src/views/crm/receivable/index.vue @@ -31,12 +31,19 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { + gridApi.query(); +} + +/** 处理场景类型的切换 */ +function handleChangeSceneType(key: number | string) { + sceneType.value = key.toString(); gridApi.query(); } /** 导出表格 */ async function handleExport() { + // TODO @AI:缺少了 sceneType 参考,参考下别的模块? const data = await exportReceivable(await gridApi.formApi.getValues()); downloadFileFromBlobPart({ fileName: '回款.xls', source: data }); } @@ -59,10 +66,8 @@ async function handleDelete(row: CrmReceivableApi.Receivable) { }); try { await deleteReceivable(row.id!); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.no]), - }); - onRefresh(); + message.success($t('ui.actionMessage.deleteSuccess', [row.no])); + handleRefresh(); } finally { hideLoading(); } @@ -76,10 +81,8 @@ async function handleSubmit(row: CrmReceivableApi.Receivable) { }); try { await submitReceivable(row.id!); - message.success({ - content: '提交审核成功', - }); - onRefresh(); + message.success('提交审核成功'); + handleRefresh(); } finally { hideLoading(); } @@ -130,6 +133,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -137,11 +141,6 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, } as VxeTableGridOptions, }); - -function onChangeSceneType(key: number | string) { - sceneType.value = key.toString(); - gridApi.query(); -} - + + \ No newline at end of file