Skip to content

Commit d9e1ffd

Browse files
author
puhui999
committed
Merge remote-tracking branch 'yudao/dev' into dev-crm
2 parents 41e5cf6 + 12972cd commit d9e1ffd

20 files changed

+300
-100
lines changed

src/api/crm/backlog/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import request from '@/config/axios'
22
// TODO 芋艿:融合下
33

4-
// 3. 获得分配给我的客户数量
5-
export const getFollowCustomerCount = async () => {
6-
return await request.get({ url: '/crm/customer/follow-customer-count' })
7-
}
8-
94
// 5. 获得待审核合同数量
105
export const getCheckContractCount = async () => {
116
return await request.get({ url: '/crm/contract/check-contract-count' })

src/api/crm/contact/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export interface ContactBusinessReqVO {
3737
businessIds: number[]
3838
}
3939

40+
export interface ContactBusiness2ReqVO {
41+
businessId: number
42+
contactIds: number[]
43+
}
44+
4045
// 查询 CRM 联系人列表
4146
export const getContactPage = async (params) => {
4247
return await request.get({ url: `/crm/contact/page`, params })
@@ -87,11 +92,21 @@ export const createContactBusinessList = async (data: ContactBusinessReqVO) => {
8792
return await request.post({ url: `/crm/contact/create-business-list`, data })
8893
}
8994

95+
// 批量新增联系人商机关联
96+
export const createContactBusinessList2 = async (data: ContactBusiness2ReqVO) => {
97+
return await request.post({ url: `/crm/contact/create-business-list2`, data })
98+
}
99+
90100
// 解除联系人商机关联
91101
export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
92102
return await request.delete({ url: `/crm/contact/delete-business-list`, data })
93103
}
94104

105+
// 解除联系人商机关联
106+
export const deleteContactBusinessList2 = async (data: ContactBusiness2ReqVO) => {
107+
return await request.delete({ url: `/crm/contact/delete-business-list2`, data })
108+
}
109+
95110
// 联系人转移
96111
export const transferContact = async (data: TransferReqVO) => {
97112
return await request.put({ url: '/crm/contact/transfer', data })

src/api/crm/contract/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,13 @@ export const submitContract = async (id: number) => {
101101
export const transferContract = async (data: TransferReqVO) => {
102102
return await request.put({ url: '/crm/contract/transfer', data })
103103
}
104+
105+
// 获得待审核合同数量
106+
export const getAuditContractCount = async () => {
107+
return await request.get({ url: '/crm/contract/audit-count' })
108+
}
109+
110+
// 获得即将到期(提醒)的合同数量
111+
export const getRemindContractCount = async () => {
112+
return await request.get({ url: '/crm/contract/remind-count' })
113+
}

src/api/crm/bi/rank.ts renamed to src/api/crm/statistics/rank.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
11
import request from '@/config/axios'
22

3-
export interface BiRankRespVO {
3+
export interface StatisticsRankRespVO {
44
count: number
55
nickname: string
66
deptName: string
77
}
88

99
// 排行 API
10-
export const RankApi = {
10+
export const StatisticsRankApi = {
1111
// 获得合同排行榜
1212
getContractPriceRank: (params: any) => {
1313
return request.get({
14-
url: '/crm/bi-rank/get-contract-price-rank',
14+
url: '/crm/statistics-rank/get-contract-price-rank',
1515
params
1616
})
1717
},
1818
// 获得回款排行榜
1919
getReceivablePriceRank: (params: any) => {
2020
return request.get({
21-
url: '/crm/bi-rank/get-receivable-price-rank',
21+
url: '/crm/statistics-rank/get-receivable-price-rank',
2222
params
2323
})
2424
},
2525
// 签约合同排行
2626
getContractCountRank: (params: any) => {
2727
return request.get({
28-
url: '/crm/bi-rank/get-contract-count-rank',
28+
url: '/crm/statistics-rank/get-contract-count-rank',
2929
params
3030
})
3131
},
3232
// 产品销量排行
3333
getProductSalesRank: (params: any) => {
3434
return request.get({
35-
url: '/crm/bi-rank/get-product-sales-rank',
35+
url: '/crm/statistics-rank/get-product-sales-rank',
3636
params
3737
})
3838
},
3939
// 新增客户数排行
4040
getCustomerCountRank: (params: any) => {
4141
return request.get({
42-
url: '/crm/bi-rank/get-customer-count-rank',
42+
url: '/crm/statistics-rank/get-customer-count-rank',
4343
params
4444
})
4545
},
4646
// 新增联系人数排行
4747
getContactsCountRank: (params: any) => {
4848
return request.get({
49-
url: '/crm/bi-rank/get-contacts-count-rank',
49+
url: '/crm/statistics-rank/get-contacts-count-rank',
5050
params
5151
})
5252
},
5353
// 跟进次数排行
5454
getFollowCountRank: (params: any) => {
5555
return request.get({
56-
url: '/crm/bi-rank/get-follow-count-rank',
56+
url: '/crm/statistics-rank/get-follow-count-rank',
5757
params
5858
})
5959
},
6060
// 跟进客户数排行
6161
getFollowCustomerCountRank: (params: any) => {
6262
return request.get({
63-
url: '/crm/bi-rank/get-follow-customer-count-rank',
63+
url: '/crm/statistics-rank/get-follow-customer-count-rank',
6464
params
6565
})
6666
}

src/views/crm/backlog/tables/CheckContract.vue renamed to src/views/crm/backlog/components/ContractAuditList.vue

Lines changed: 74 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@
3030

3131
<ContentWrap>
3232
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
33-
<el-table-column align="center" fixed="left" label="合同编号" prop="no" width="130" />
34-
<el-table-column align="center" label="合同名称" prop="name" width="130" />
33+
<el-table-column align="center" fixed="left" label="合同编号" prop="no" width="180" />
34+
<el-table-column align="center" fixed="left" label="合同名称" prop="name" width="160">
35+
<template #default="scope">
36+
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
37+
{{ scope.row.name }}
38+
</el-link>
39+
</template>
40+
</el-table-column>
3541
<el-table-column align="center" label="客户名称" prop="customerName" width="120">
3642
<template #default="scope">
3743
<el-link
@@ -43,22 +49,31 @@
4349
</el-link>
4450
</template>
4551
</el-table-column>
46-
<!-- TODO @puhui999:做了商机详情后,可以把这个超链接加上 -->
47-
<el-table-column align="center" label="商机名称" prop="businessName" width="130" />
52+
<el-table-column align="center" label="商机名称" prop="businessName" width="130">
53+
<template #default="scope">
54+
<el-link
55+
:underline="false"
56+
type="primary"
57+
@click="openBusinessDetail(scope.row.businessId)"
58+
>
59+
{{ scope.row.businessName }}
60+
</el-link>
61+
</template>
62+
</el-table-column>
63+
<el-table-column
64+
align="center"
65+
label="合同金额(元)"
66+
prop="totalPrice"
67+
width="140"
68+
:formatter="erpPriceTableColumnFormatter"
69+
/>
4870
<el-table-column
4971
align="center"
5072
label="下单时间"
5173
prop="orderDate"
5274
width="120"
5375
:formatter="dateFormatter2"
5476
/>
55-
<el-table-column
56-
align="center"
57-
label="合同金额"
58-
prop="price"
59-
width="130"
60-
:formatter="fenToYuanFormat"
61-
/>
6277
<el-table-column
6378
align="center"
6479
label="合同开始时间"
@@ -78,17 +93,24 @@
7893
<el-link
7994
:underline="false"
8095
type="primary"
81-
@click="openContactDetail(scope.row.contactId)"
96+
@click="openContactDetail(scope.row.signContactId)"
8297
>
83-
{{ scope.row.contactName }}
98+
{{ scope.row.signContactName }}
8499
</el-link>
85100
</template>
86101
</el-table-column>
87102
<el-table-column align="center" label="公司签约人" prop="signUserName" width="130" />
88-
<el-table-column align="center" label="备注" prop="remark" width="130" />
103+
<el-table-column align="center" label="备注" prop="remark" width="200" />
89104
<!-- TODO @puhui999:后续可加 【已收款金额】、【未收款金额】 -->
105+
<el-table-column
106+
:formatter="dateFormatter"
107+
align="center"
108+
label="最后跟进时间"
109+
prop="contactLastTime"
110+
width="180px"
111+
/>
90112
<el-table-column align="center" label="负责人" prop="ownerUserName" width="120" />
91-
<el-table-column align="center" label="创建人" prop="creatorName" width="120" />
113+
<el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
92114
<el-table-column
93115
:formatter="dateFormatter"
94116
align="center"
@@ -103,11 +125,24 @@
103125
prop="createTime"
104126
width="180px"
105127
/>
128+
<el-table-column align="center" label="创建人" prop="creatorName" width="120" />
106129
<el-table-column align="center" fixed="right" label="合同状态" prop="auditStatus" width="120">
107130
<template #default="scope">
108131
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
109132
</template>
110133
</el-table-column>
134+
<el-table-column fixed="right" label="操作" width="90">
135+
<template #default="scope">
136+
<el-button
137+
link
138+
v-hasPermi="['crm:contract:update']"
139+
type="primary"
140+
@click="handleProcessDetail(scope.row)"
141+
>
142+
查看审批
143+
</el-button>
144+
</template>
145+
</el-table-column>
111146
</el-table>
112147
<!-- 分页 -->
113148
<Pagination
@@ -122,17 +157,18 @@
122157
<script setup lang="ts" name="CheckContract">
123158
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
124159
import * as ContractApi from '@/api/crm/contract'
125-
import { fenToYuanFormat } from '@/utils/formatter'
126160
import { DICT_TYPE } from '@/utils/dict'
127161
import { AUDIT_STATUS } from './common'
162+
import { erpPriceTableColumnFormatter } from '@/utils'
128163
129164
const loading = ref(true) // 列表的加载中
130165
const total = ref(0) // 列表的总页数
131166
const list = ref([]) // 列表的数据
132167
const queryParams = reactive({
133168
pageNo: 1,
134169
pageSize: 10,
135-
auditStatus: 20
170+
sceneType: 1, // 我负责的
171+
auditStatus: 10
136172
})
137173
const queryFormRef = ref() // 搜索的表单
138174
@@ -154,8 +190,18 @@ const handleQuery = () => {
154190
getList()
155191
}
156192
193+
/** 查看审批 */
194+
const handleProcessDetail = (row: ContractApi.ContractVO) => {
195+
push({ name: 'BpmProcessInstanceDetail', query: { id: row.processInstanceId } })
196+
}
197+
198+
/** 打开合同详情 */
199+
const { push } = useRouter()
200+
const openDetail = (id: number) => {
201+
push({ name: 'CrmContractDetail', params: { id } })
202+
}
203+
157204
/** 打开客户详情 */
158-
const { push } = useRouter() // 路由
159205
const openCustomerDetail = (id: number) => {
160206
push({ name: 'CrmCustomerDetail', params: { id } })
161207
}
@@ -165,6 +211,16 @@ const openContactDetail = (id: number) => {
165211
push({ name: 'CrmContactDetail', params: { id } })
166212
}
167213
214+
/** 打开商机详情 */
215+
const openBusinessDetail = (id: number) => {
216+
push({ name: 'CrmBusinessDetail', params: { id } })
217+
}
218+
219+
/** 激活时 */
220+
onActivated(async () => {
221+
await getList()
222+
})
223+
168224
/** 初始化 **/
169225
onMounted(() => {
170226
getList()

0 commit comments

Comments
 (0)