| | |
| | | |
| | | import { useRouter } from 'vue-router'; |
| | | |
| | | import { Button } from 'ant-design-vue'; |
| | | import { Button, Tag } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { getContractPage } from '#/api/crm/contract'; |
| | |
| | | } |
| | | /** 打开客户详情 */ |
| | | function handleCustomerDetail(row: CrmContractApi.Contract) { |
| | | push({ name: 'CrmCustomerDetail', params: { id: row.id } }); |
| | | if (row.customerId) push({ name: 'CrmCustomerDetail', params: { id: row.customerId } }); |
| | | } |
| | | |
| | | /** 打开联系人详情 */ |
| | | function handleContactDetail(row: CrmContractApi.Contract) { |
| | | push({ name: 'CrmContactDetail', params: { id: row.id } }); |
| | | if (row.signContactId) push({ name: 'CrmContactDetail', params: { id: row.signContactId } }); |
| | | } |
| | | |
| | | /** 打开商机详情 */ |
| | | function handleBusinessDetail(row: CrmContractApi.Contract) { |
| | | push({ name: 'CrmBusinessDetail', params: { id: row.id } }); |
| | | if (row.businessId) push({ name: 'CrmBusinessDetail', params: { id: row.businessId } }); |
| | | } |
| | | |
| | | function handleViewOrder(row: CrmContractApi.Contract) { |
| | | if (row.orderId) push({ name: 'ErpSaleOrder', query: { id: row.orderId } }); |
| | | } |
| | | |
| | | const [Grid] = useVbenVxeGrid({ |
| | |
| | | |
| | | <template> |
| | | <Grid> |
| | | <template #no="{ row }"> |
| | | <Button type="link" @click="handleContractDetail(row)"> |
| | | {{ row.no }} |
| | | </Button> |
| | | </template> |
| | | <template #name="{ row }"> |
| | | <Button type="link" @click="handleContractDetail(row)"> |
| | | {{ row.name }} |
| | |
| | | {{ row.businessName }} |
| | | </Button> |
| | | </template> |
| | | <template #contactName="{ row }"> |
| | | <template #signContactName="{ row }"> |
| | | <Button type="link" @click="handleContactDetail(row)"> |
| | | {{ row.contactName }} |
| | | {{ row.signContactName }} |
| | | </Button> |
| | | </template> |
| | | <template #auditStatus="{ row }"> |
| | | <Tag v-if="row.auditStatus === 0">未提交</Tag> |
| | | <Tag v-else-if="row.auditStatus === 10" color="warning">审批中</Tag> |
| | | <Tag v-else-if="row.auditStatus === 20" color="success">审核通过</Tag> |
| | | <Tag v-else-if="row.auditStatus === 30" color="error">审核不通过</Tag> |
| | | <Tag v-else-if="row.auditStatus === 40">已取消</Tag> |
| | | <Tag v-else-if="row.auditStatus === 50" color="error">已作废</Tag> |
| | | <span v-else>—</span> |
| | | </template> |
| | | <template #orderNo="{ row }"> |
| | | <Button v-if="row.orderId" type="link" @click="handleViewOrder(row)">{{ row.orderNo }}</Button> |
| | | <span v-else>—</span> |
| | | </template> |
| | | <template #actions="{ row }"> |
| | | <TableAction |
| | |
| | | label: '查看审批', |
| | | type: 'link', |
| | | icon: ACTION_ICON.VIEW, |
| | | auth: ['crm:contract:update'], |
| | | ifShow: !!row.processInstanceId, |
| | | onClick: handleProcessDetail.bind(null, row), |
| | | }, |
| | | ]" |