perf: crm
This commit is contained in:
@@ -14,7 +14,7 @@ import { useClueFollowColumns, useClueFollowFormSchema } from '../data';
|
||||
const { push } = useRouter();
|
||||
|
||||
/** 打开线索详情 */
|
||||
function onDetail(row: CrmClueApi.Clue) {
|
||||
function handleDetail(row: CrmClueApi.Clue) {
|
||||
push({ name: 'CrmClueDetail', params: { id: row.id } });
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
<template>
|
||||
<Grid table-title="分配给我的线索">
|
||||
<template #name="{ row }">
|
||||
<Button type="link" @click="onDetail(row)">{{ row.name }}</Button>
|
||||
<Button type="link" @click="handleDetail(row)">{{ row.name }}</Button>
|
||||
</template>
|
||||
</Grid>
|
||||
</template>
|
||||
@@ -1,13 +1,12 @@
|
||||
<!-- 待审核合同 -->
|
||||
<script lang="ts" setup>
|
||||
import type { OnActionClickParams } from '#/adapter/vxe-table';
|
||||
import type { CrmContractApi } from '#/api/crm/contract';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { getContractPage } from '#/api/crm/contract';
|
||||
|
||||
import { useContractAuditFormSchema, useContractColumns } from '../data';
|
||||
@@ -15,7 +14,7 @@ import { useContractAuditFormSchema, useContractColumns } from '../data';
|
||||
const { push } = useRouter();
|
||||
|
||||
/** 查看审批 */
|
||||
function openProcessDetail(row: CrmContractApi.Contract) {
|
||||
function handleProcessDetail(row: CrmContractApi.Contract) {
|
||||
push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
query: { id: row.processInstanceId },
|
||||
@@ -23,43 +22,30 @@ function openProcessDetail(row: CrmContractApi.Contract) {
|
||||
}
|
||||
|
||||
/** 打开合同详情 */
|
||||
function openContractDetail(row: CrmContractApi.Contract) {
|
||||
function handleContractDetail(row: CrmContractApi.Contract) {
|
||||
push({ name: 'CrmContractDetail', params: { id: row.id } });
|
||||
}
|
||||
/** 打开客户详情 */
|
||||
function openCustomerDetail(row: CrmContractApi.Contract) {
|
||||
function handleCustomerDetail(row: CrmContractApi.Contract) {
|
||||
push({ name: 'CrmCustomerDetail', params: { id: row.id } });
|
||||
}
|
||||
|
||||
/** 打开联系人详情 */
|
||||
function openContactDetail(row: CrmContractApi.Contract) {
|
||||
function handleContactDetail(row: CrmContractApi.Contract) {
|
||||
push({ name: 'CrmContactDetail', params: { id: row.id } });
|
||||
}
|
||||
|
||||
/** 打开商机详情 */
|
||||
function openBusinessDetail(row: CrmContractApi.Contract) {
|
||||
function handleBusinessDetail(row: CrmContractApi.Contract) {
|
||||
push({ name: 'CrmBusinessDetail', params: { id: row.id } });
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<CrmContractApi.Contract>) {
|
||||
switch (code) {
|
||||
case 'processDetail': {
|
||||
openProcessDetail(row);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const [Grid] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useContractAuditFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useContractColumns(onActionClick),
|
||||
columns: useContractColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
@@ -88,24 +74,36 @@ const [Grid] = useVbenVxeGrid({
|
||||
<template>
|
||||
<Grid table-title="待审核合同">
|
||||
<template #name="{ row }">
|
||||
<Button type="link" @click="openContractDetail(row)">
|
||||
<Button type="link" @click="handleContractDetail(row)">
|
||||
{{ row.name }}
|
||||
</Button>
|
||||
</template>
|
||||
<template #customerName="{ row }">
|
||||
<Button type="link" @click="openCustomerDetail(row)">
|
||||
<Button type="link" @click="handleCustomerDetail(row)">
|
||||
{{ row.customerName }}
|
||||
</Button>
|
||||
</template>
|
||||
<template #businessName="{ row }">
|
||||
<Button type="link" @click="openBusinessDetail(row)">
|
||||
<Button type="link" @click="handleBusinessDetail(row)">
|
||||
{{ row.businessName }}
|
||||
</Button>
|
||||
</template>
|
||||
<template #contactName="{ row }">
|
||||
<Button type="link" @click="openContactDetail(row)">
|
||||
<Button type="link" @click="handleContactDetail(row)">
|
||||
{{ row.contactName }}
|
||||
</Button>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '查看审批',
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.VIEW,
|
||||
onClick: handleProcessDetail.bind(null, row),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</template>
|
||||
Reference in New Issue
Block a user