|
57 | 57 | <!-- TODO 芋艿:各种字段要调整 -->
|
58 | 58 | <ContentWrap>
|
59 | 59 | <el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
60 |
| - <el-table-column align="center" label="合同编号" prop="no" width="130" /> |
| 60 | + <el-table-column align="center" fixed="left" label="合同编号" prop="no" width="130" /> |
61 | 61 | <el-table-column align="center" label="合同名称" prop="name" width="130" />
|
62 |
| - <el-table-column align="center" label="合同状态" prop="auditStatus" width="130" /> |
63 |
| - <el-table-column align="center" label="客户名称" prop="customerName" width="130" /> |
| 62 | + <el-table-column align="center" label="客户名称" prop="customerName" width="120"> |
| 63 | + <template #default="scope"> |
| 64 | + <el-link |
| 65 | + :underline="false" |
| 66 | + type="primary" |
| 67 | + @click="openCustomerDetail(scope.row.customerId)" |
| 68 | + > |
| 69 | + {{ scope.row.customerName }} |
| 70 | + </el-link> |
| 71 | + </template> |
| 72 | + </el-table-column> |
| 73 | + <!-- TODO @puhui999:做了商机详情后,可以把这个超链接加上 --> |
64 | 74 | <el-table-column align="center" label="商机名称" prop="businessName" width="130" />
|
65 |
| - <el-table-column align="center" label="合同金额(元)" prop="price" width="130" /> |
66 | 75 | <el-table-column
|
67 |
| - :formatter="dateFormatter" |
68 | 76 | align="center"
|
69 | 77 | label="下单时间"
|
70 | 78 | prop="orderDate"
|
71 |
| - width="180" |
| 79 | + width="120" |
| 80 | + :formatter="dateFormatter2" |
72 | 81 | />
|
73 | 82 | <el-table-column
|
74 |
| - :formatter="dateFormatter" |
75 | 83 | align="center"
|
76 |
| - label="开始时间" |
| 84 | + label="合同金额" |
| 85 | + prop="price" |
| 86 | + width="130" |
| 87 | + :formatter="fenToYuanFormat" |
| 88 | + /> |
| 89 | + <el-table-column |
| 90 | + align="center" |
| 91 | + label="合同开始时间" |
77 | 92 | prop="startTime"
|
78 |
| - width="180" |
| 93 | + width="120" |
| 94 | + :formatter="dateFormatter2" |
79 | 95 | />
|
80 | 96 | <el-table-column
|
81 |
| - :formatter="dateFormatter" |
82 | 97 | align="center"
|
83 |
| - label="结束时间" |
| 98 | + label="合同结束时间" |
84 | 99 | prop="endTime"
|
85 |
| - width="180" |
| 100 | + width="120" |
| 101 | + :formatter="dateFormatter2" |
86 | 102 | />
|
87 |
| - <el-table-column align="center" label="客户签约人" prop="contactName" width="130" /> |
| 103 | + <el-table-column align="center" label="客户签约人" prop="contactName" width="130"> |
| 104 | + <template #default="scope"> |
| 105 | + <el-link |
| 106 | + :underline="false" |
| 107 | + type="primary" |
| 108 | + @click="openContactDetail(scope.row.contactId)" |
| 109 | + > |
| 110 | + {{ scope.row.contactName }} |
| 111 | + </el-link> |
| 112 | + </template> |
| 113 | + </el-table-column> |
88 | 114 | <el-table-column align="center" label="公司签约人" prop="signUserName" width="130" />
|
89 | 115 | <el-table-column align="center" label="备注" prop="remark" width="130" />
|
90 |
| - <el-table-column align="center" label="审核状态" prop="auditStatus" width="130" /> |
| 116 | + <!-- TODO @puhui999:后续可加 【已收款金额】、【未收款金额】 --> |
| 117 | + <el-table-column align="center" label="负责人" prop="ownerUserName" width="120" /> |
| 118 | + <el-table-column align="center" label="创建人" prop="creatorName" width="120" /> |
91 | 119 | <el-table-column
|
92 | 120 | :formatter="dateFormatter"
|
93 | 121 | align="center"
|
94 |
| - label="最后跟进时间" |
95 |
| - prop="contactLastTime" |
96 |
| - width="180" |
| 122 | + label="更新时间" |
| 123 | + prop="updateTime" |
| 124 | + width="180px" |
97 | 125 | />
|
| 126 | + <el-table-column |
| 127 | + :formatter="dateFormatter" |
| 128 | + align="center" |
| 129 | + label="创建时间" |
| 130 | + prop="createTime" |
| 131 | + width="180px" |
| 132 | + /> |
| 133 | + <el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120"> |
| 134 | + <template #default="scope"> |
| 135 | + <dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" /> |
| 136 | + </template> |
| 137 | + </el-table-column> |
98 | 138 | <el-table-column fixed="right" label="操作" width="250">
|
99 | 139 | <template #default="scope">
|
100 | 140 | <el-button
|
|
105 | 145 | >
|
106 | 146 | 编辑
|
107 | 147 | </el-button>
|
| 148 | + <!-- TODO @puhui999:可以加下判断,什么情况下,可以审批; --> |
108 | 149 | <el-button
|
109 | 150 | v-hasPermi="['crm:contract:update']"
|
110 | 151 | link
|
|
145 | 186 | <ContractForm ref="formRef" @success="getList" />
|
146 | 187 | </template>
|
147 | 188 | <script lang="ts" setup>
|
148 |
| -import { dateFormatter } from '@/utils/formatTime' |
| 189 | +import { dateFormatter, dateFormatter2 } from '@/utils/formatTime' |
149 | 190 | import download from '@/utils/download'
|
150 | 191 | import * as ContractApi from '@/api/crm/contract'
|
151 | 192 | import ContractForm from './ContractForm.vue'
|
| 193 | +import { fenToYuanFormat } from '@/utils/formatter' |
| 194 | +import { DICT_TYPE } from '@/utils/dict' |
152 | 195 |
|
153 | 196 | defineOptions({ name: 'CrmContract' })
|
154 | 197 |
|
@@ -237,10 +280,23 @@ const handleApprove = async (row: ContractApi.ContractVO) => {
|
237 | 280 | message.success('提交审核成功!')
|
238 | 281 | await getList()
|
239 | 282 | }
|
| 283 | +
|
| 284 | +/** 打开合同详情 */ |
240 | 285 | const { push } = useRouter()
|
241 | 286 | const openDetail = (id: number) => {
|
242 | 287 | push({ name: 'CrmContractDetail', params: { id } })
|
243 | 288 | }
|
| 289 | +
|
| 290 | +/** 打开客户详情 */ |
| 291 | +const openCustomerDetail = (id: number) => { |
| 292 | + push({ name: 'CrmCustomerDetail', params: { id } }) |
| 293 | +} |
| 294 | +
|
| 295 | +/** 打开联系人详情 */ |
| 296 | +const openContactDetail = (id: number) => { |
| 297 | + push({ name: 'CrmContactDetail', params: { id } }) |
| 298 | +} |
| 299 | +
|
244 | 300 | /** 初始化 **/
|
245 | 301 | onMounted(() => {
|
246 | 302 | getList()
|
|
0 commit comments