✨ CRM:完善合同的审批逻辑
This commit is contained in:
parent
9acd01e768
commit
c1f507bcae
@ -539,6 +539,18 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
component: () => import('@/views/crm/contract/detail/index.vue')
|
component: () => import('@/views/crm/contract/detail/index.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'contract/detail',
|
||||||
|
name: 'CrmContractDetail2', // 特殊:用于适配 BPM 打开详情
|
||||||
|
meta: {
|
||||||
|
title: '合同详情XXX',
|
||||||
|
noCache: true,
|
||||||
|
hidden: true,
|
||||||
|
canTo: true,
|
||||||
|
activeMenu: '/crm/contract'
|
||||||
|
},
|
||||||
|
component: () => import('@/views/crm/contract/detail/index.vue')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'contact/detail/:id',
|
path: 'contact/detail/:id',
|
||||||
name: 'CrmContactDetail',
|
name: 'CrmContactDetail',
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
{{ erpPriceInputFormatter(contract.totalPrice) }}
|
{{ erpPriceInputFormatter(contract.totalPrice) }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="下单时间">
|
<el-descriptions-item label="下单时间">
|
||||||
{{ contract.orderDate ? formatDate(contract.orderDate) : '空' }}
|
{{ formatDate(contract.orderDate) }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!-- TODO 芋艿:回款金额 -->
|
<!-- TODO 芋艿:回款金额 -->
|
||||||
<el-descriptions-item label="回款金额(元)"> 待实现 </el-descriptions-item>
|
<el-descriptions-item label="回款金额(元)"> 待实现 </el-descriptions-item>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
import { erpPriceInputFormatter, floatToFixed2 } from '@/utils'
|
import { erpPriceInputFormatter } from '@/utils'
|
||||||
|
|
||||||
defineOptions({ name: 'ContractDetailsHeader' })
|
defineOptions({ name: 'ContractDetailsHeader' })
|
||||||
defineProps<{ contract: ContractApi.ContractVO }>()
|
defineProps<{ contract: ContractApi.ContractVO }>()
|
||||||
|
@ -43,8 +43,8 @@
|
|||||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
import { OperateLogV2VO } from '@/api/system/operatelog'
|
import { OperateLogV2VO } from '@/api/system/operatelog'
|
||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
import ContractDetailsHeader from './ContractDetailsHeader.vue'
|
|
||||||
import ContractDetailsInfo from './ContractDetailsInfo.vue'
|
import ContractDetailsInfo from './ContractDetailsInfo.vue'
|
||||||
|
import ContractDetailsHeader from './ContractDetailsHeader.vue'
|
||||||
import ContractProductList from './ContractProductList.vue'
|
import ContractProductList from './ContractProductList.vue'
|
||||||
import { BizTypeEnum } from '@/api/crm/permission'
|
import { BizTypeEnum } from '@/api/crm/permission'
|
||||||
import { getOperateLogPage } from '@/api/crm/operateLog'
|
import { getOperateLogPage } from '@/api/crm/operateLog'
|
||||||
@ -54,6 +54,7 @@ import PermissionList from '@/views/crm/permission/components/PermissionList.vue
|
|||||||
import FollowUpList from '@/views/crm/followup/index.vue'
|
import FollowUpList from '@/views/crm/followup/index.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'CrmContractDetail' })
|
defineOptions({ name: 'CrmContractDetail' })
|
||||||
|
const props = defineProps<{ id?: number }>()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
@ -72,8 +73,8 @@ const openForm = (type: string, id?: number) => {
|
|||||||
const getContractData = async () => {
|
const getContractData = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
await getOperateLog(contractId.value)
|
|
||||||
contract.value = await ContractApi.getContract(contractId.value)
|
contract.value = await ContractApi.getContract(contractId.value)
|
||||||
|
await getOperateLog(contractId.value)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
@ -108,7 +109,7 @@ const close = () => {
|
|||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const id = route.params.id
|
const id = props.id || route.params.id
|
||||||
if (!id) {
|
if (!id) {
|
||||||
message.warning('参数错误,合同不能为空!')
|
message.warning('参数错误,合同不能为空!')
|
||||||
close()
|
close()
|
||||||
|
@ -183,6 +183,7 @@
|
|||||||
<el-table-column fixed="right" label="操作" width="250">
|
<el-table-column fixed="right" label="操作" width="250">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="scope.row.auditStatus === 0"
|
||||||
v-hasPermi="['crm:contract:update']"
|
v-hasPermi="['crm:contract:update']"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -190,8 +191,8 @@
|
|||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- TODO @puhui999:可以加下判断,什么情况下,可以审批;然后加个【查看审批】按钮 -->
|
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="scope.row.auditStatus === 0"
|
||||||
v-hasPermi="['crm:contract:update']"
|
v-hasPermi="['crm:contract:update']"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -199,6 +200,15 @@
|
|||||||
>
|
>
|
||||||
提交审核
|
提交审核
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
link
|
||||||
|
v-hasPermi="['crm:contract:update']"
|
||||||
|
type="primary"
|
||||||
|
@click="handleProcessDetail(scope.row)"
|
||||||
|
>
|
||||||
|
查看审批
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['crm:contract:query']"
|
v-hasPermi="['crm:contract:query']"
|
||||||
link
|
link
|
||||||
@ -328,6 +338,11 @@ const handleSubmit = async (row: ContractApi.ContractVO) => {
|
|||||||
await getList()
|
await getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 查看审批 */
|
||||||
|
const handleProcessDetail = (row: ContractApi.ContractVO) => {
|
||||||
|
push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开合同详情 */
|
/** 打开合同详情 */
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
const openDetail = (id: number) => {
|
const openDetail = (id: number) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user