25
25
placeholder =" 请输入合同名称"
26
26
@keyup.enter =" handleQuery"
27
27
/>
28
+ <el-form-item label =" 客户" prop =" customerId" >
29
+ <el-select
30
+ v-model =" queryParams.customerId"
31
+ class =" !w-240px"
32
+ clearable
33
+ lable-key =" name"
34
+ placeholder =" 请选择客户"
35
+ value-key =" id"
36
+ @keyup.enter =" handleQuery"
37
+ >
38
+ <el-option
39
+ v-for =" item in customerList"
40
+ :key =" item.id"
41
+ :label =" item.name"
42
+ :value =" item.id!"
43
+ />
44
+ </el-select >
45
+ </el-form-item >
28
46
</el-form-item >
29
47
<el-form-item >
30
48
<el-button @click =" handleQuery" >
55
73
56
74
<!-- 列表 -->
57
75
<ContentWrap >
76
+ <el-tabs v-model =" activeName" @tab-click =" handleTabClick" >
77
+ <el-tab-pane label =" 我负责的" name =" 1" />
78
+ <el-tab-pane label =" 我参与的" name =" 2" />
79
+ <el-tab-pane label =" 下属负责的" name =" 3" />
80
+ </el-tabs >
58
81
<el-table v-loading =" loading" :data =" list" :show-overflow-tooltip =" true" :stripe =" true" >
59
82
<el-table-column align =" center" fixed =" left" label =" 合同编号" prop =" no" width =" 130" />
60
- <el-table-column align =" center" label =" 合同名称" prop =" name" width =" 130" />
83
+ <el-table-column align =" center" fixed =" left" label =" 合同名称" prop =" name" width =" 160" >
84
+ <template #default =" scope " >
85
+ <el-link :underline =" false" type =" primary" @click =" openDetail(scope.row.id)" >
86
+ {{ scope.row.name }}
87
+ </el-link >
88
+ </template >
89
+ </el-table-column >
61
90
<el-table-column align =" center" label =" 客户名称" prop =" customerName" width =" 120" >
62
91
<template #default =" scope " >
63
92
<el-link
69
98
</el-link >
70
99
</template >
71
100
</el-table-column >
72
- <!-- TODO @puhui999:做了商机详情后,可以把这个超链接加上 -->
73
- <el-table-column align =" center" label =" 商机名称" prop =" businessName" width =" 130" />
101
+ <el-table-column align =" center" label =" 商机名称" prop =" businessName" width =" 130" >
102
+ <template #default =" scope " >
103
+ <el-link
104
+ :underline =" false"
105
+ type =" primary"
106
+ @click =" openBusinessDetail(scope.row.businessId)"
107
+ >
108
+ {{ scope.row.businessName }}
109
+ </el-link >
110
+ </template >
111
+ </el-table-column >
112
+ <el-table-column
113
+ align =" center"
114
+ label =" 合同金额(元)"
115
+ prop =" totalPrice"
116
+ width =" 140"
117
+ :formatter =" erpPriceTableColumnFormatter"
118
+ />
74
119
<el-table-column
75
120
align =" center"
76
121
label =" 下单时间"
77
122
prop =" orderDate"
78
123
width =" 120"
79
124
:formatter =" dateFormatter2"
80
125
/>
81
- <el-table-column
82
- align =" center"
83
- label =" 合同金额"
84
- prop =" price"
85
- width =" 130"
86
- :formatter =" fenToYuanFormat"
87
- />
88
126
<el-table-column
89
127
align =" center"
90
128
label =" 合同开始时间"
104
142
<el-link
105
143
:underline =" false"
106
144
type =" primary"
107
- @click =" openContactDetail(scope.row.contactId )"
145
+ @click =" openContactDetail(scope.row.signContactId )"
108
146
>
109
- {{ scope.row.contactName }}
147
+ {{ scope.row.signContactName }}
110
148
</el-link >
111
149
</template >
112
150
</el-table-column >
113
151
<el-table-column align =" center" label =" 公司签约人" prop =" signUserName" width =" 130" />
114
- <el-table-column align =" center" label =" 备注" prop =" remark" width =" 130 " />
152
+ <el-table-column align =" center" label =" 备注" prop =" remark" width =" 200 " />
115
153
<!-- TODO @puhui999:后续可加 【已收款金额】、【未收款金额】 -->
154
+ <el-table-column
155
+ :formatter =" dateFormatter"
156
+ align =" center"
157
+ label =" 最后跟进时间"
158
+ prop =" contactLastTime"
159
+ width =" 180px"
160
+ />
116
161
<el-table-column align =" center" label =" 负责人" prop =" ownerUserName" width =" 120" />
117
- <el-table-column align =" center" label =" 创建人 " prop =" creatorName " width =" 120 " />
162
+ <el-table-column align =" center" label =" 所属部门 " prop =" ownerUserDeptName " width =" 100px " />
118
163
<el-table-column
119
164
:formatter =" dateFormatter"
120
165
align =" center"
129
174
prop =" createTime"
130
175
width =" 180px"
131
176
/>
177
+ <el-table-column align =" center" label =" 创建人" prop =" creatorName" width =" 120" />
132
178
<el-table-column align =" center" fixed =" right" label =" 合同状态" prop =" auditStatus" width =" 120" >
133
179
<template #default =" scope " >
134
180
<dict-tag :type =" DICT_TYPE.CRM_AUDIT_STATUS" :value =" scope.row.auditStatus" />
@@ -191,6 +237,8 @@ import * as ContractApi from '@/api/crm/contract'
191
237
import ContractForm from ' ./ContractForm.vue'
192
238
import { fenToYuanFormat } from ' @/utils/formatter'
193
239
import { DICT_TYPE } from ' @/utils/dict'
240
+ import { erpPriceTableColumnFormatter } from ' @/utils'
241
+ import * as CustomerApi from ' @/api/crm/customer'
194
242
195
243
defineOptions ({ name: ' CrmContract' })
196
244
@@ -203,16 +251,16 @@ const list = ref([]) // 列表的数据
203
251
const queryParams = reactive ({
204
252
pageNo: 1 ,
205
253
pageSize: 10 ,
254
+ sceneType: ' 1' , // 默认和 activeName 相等
206
255
name: null ,
207
256
customerId: null ,
208
- businessId: null ,
209
257
orderDate: [],
210
- no: null ,
211
- discountPercent: null ,
212
- productPrice: null
258
+ no: null
213
259
})
214
260
const queryFormRef = ref () // 搜索的表单
215
261
const exportLoading = ref (false ) // 导出的加载中
262
+ const activeName = ref (' 1' ) // 列表 tab
263
+ const customerList = ref <CustomerApi .CustomerVO []>([]) // 客户列表
216
264
217
265
/** 查询列表 */
218
266
const getList = async () => {
@@ -296,8 +344,14 @@ const openContactDetail = (id: number) => {
296
344
push ({ name: ' CrmContactDetail' , params: { id } })
297
345
}
298
346
347
+ /** 打开商机详情 */
348
+ const openBusinessDetail = (id : number ) => {
349
+ push ({ name: ' CrmBusinessDetail' , params: { id } })
350
+ }
351
+
299
352
/** 初始化 **/
300
- onMounted (() => {
301
- getList ()
353
+ onMounted (async () => {
354
+ await getList ()
355
+ customerList .value = await CustomerApi .getCustomerSimpleList ()
302
356
})
303
357
</script >
0 commit comments