CRM:优化合同列表界面

This commit is contained in:
YunaiV 2024-02-04 12:10:49 +08:00
parent 3ad68c3227
commit 6d0231d409
2 changed files with 75 additions and 19 deletions

View File

@ -22,7 +22,7 @@
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id"
:value="item.id!"
/>
</el-select>
</el-form-item>

View File

@ -57,44 +57,84 @@
<!-- TODO 芋艿各种字段要调整 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
<el-table-column align="center" label="合同编号" prop="no" width="130" />
<el-table-column align="center" fixed="left" label="合同编号" prop="no" width="130" />
<el-table-column align="center" label="合同名称" prop="name" width="130" />
<el-table-column align="center" label="合同状态" prop="auditStatus" width="130" />
<el-table-column align="center" label="客户名称" prop="customerName" width="130" />
<el-table-column align="center" label="客户名称" prop="customerName" width="120">
<template #default="scope">
<el-link
:underline="false"
type="primary"
@click="openCustomerDetail(scope.row.customerId)"
>
{{ scope.row.customerName }}
</el-link>
</template>
</el-table-column>
<!-- TODO @puhui999做了商机详情后可以把这个超链接加上 -->
<el-table-column align="center" label="商机名称" prop="businessName" width="130" />
<el-table-column align="center" label="合同金额(元)" prop="price" width="130" />
<el-table-column
:formatter="dateFormatter"
align="center"
label="下单时间"
prop="orderDate"
width="180"
width="120"
:formatter="dateFormatter2"
/>
<el-table-column
:formatter="dateFormatter"
align="center"
label="开始时间"
label="合同金额"
prop="price"
width="130"
:formatter="fenToYuanFormat"
/>
<el-table-column
align="center"
label="合同开始时间"
prop="startTime"
width="180"
width="120"
:formatter="dateFormatter2"
/>
<el-table-column
:formatter="dateFormatter"
align="center"
label="结束时间"
label="合同结束时间"
prop="endTime"
width="180"
width="120"
:formatter="dateFormatter2"
/>
<el-table-column align="center" label="客户签约人" prop="contactName" width="130" />
<el-table-column align="center" label="客户签约人" prop="contactName" width="130">
<template #default="scope">
<el-link
:underline="false"
type="primary"
@click="openContactDetail(scope.row.contactId)"
>
{{ scope.row.contactName }}
</el-link>
</template>
</el-table-column>
<el-table-column align="center" label="公司签约人" prop="signUserName" width="130" />
<el-table-column align="center" label="备注" prop="remark" width="130" />
<el-table-column align="center" label="审核状态" prop="auditStatus" width="130" />
<!-- TODO @puhui999后续可加 已收款金额未收款金额 -->
<el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
<el-table-column align="center" label="创建人" prop="creatorName" width="120" />
<el-table-column
:formatter="dateFormatter"
align="center"
label="最后跟进时间"
prop="contactLastTime"
width="180"
label="更新时间"
prop="updateTime"
width="180px"
/>
<el-table-column
:formatter="dateFormatter"
align="center"
label="创建时间"
prop="createTime"
width="180px"
/>
<el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="250">
<template #default="scope">
<el-button
@ -105,6 +145,7 @@
>
编辑
</el-button>
<!-- TODO @puhui999可以加下判断什么情况下可以审批 -->
<el-button
v-hasPermi="['crm:contract:update']"
link
@ -145,10 +186,12 @@
<ContractForm ref="formRef" @success="getList" />
</template>
<script lang="ts" setup>
import { dateFormatter } from '@/utils/formatTime'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ContractApi from '@/api/crm/contract'
import ContractForm from './ContractForm.vue'
import { fenToYuanFormat } from '@/utils/formatter'
import { DICT_TYPE } from '@/utils/dict'
defineOptions({ name: 'CrmContract' })
@ -237,10 +280,23 @@ const handleApprove = async (row: ContractApi.ContractVO) => {
message.success('提交审核成功!')
await getList()
}
/** 打开合同详情 */
const { push } = useRouter()
const openDetail = (id: number) => {
push({ name: 'CrmContractDetail', params: { id } })
}
/** 打开客户详情 */
const openCustomerDetail = (id: number) => {
push({ name: 'CrmCustomerDetail', params: { id } })
}
/** 打开联系人详情 */
const openContactDetail = (id: number) => {
push({ name: 'CrmContactDetail', params: { id } })
}
/** 初始化 **/
onMounted(() => {
getList()