Skip to content

Commit b982397

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 3c8ffc8 + b0c1e55 commit b982397

File tree

11 files changed

+287
-270
lines changed

11 files changed

+287
-270
lines changed

src/api/crm/receivable/index.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,47 @@ export interface ReceivableVO {
66
planId: number
77
customerId: number
88
contractId: number
9-
checkStatus: number
9+
auditStatus: number
1010
processInstanceId: number
1111
returnTime: Date
1212
returnType: string
1313
price: number
1414
ownerUserId: number
15-
batchId: number
1615
sort: number
17-
dataScope: number
18-
dataScopeDeptIds: string
19-
status: number
2016
remark: string
2117
}
2218

23-
// 查询回款管理列表
19+
// 查询回款列表
2420
export const getReceivablePage = async (params) => {
2521
return await request.get({ url: `/crm/receivable/page`, params })
2622
}
2723

28-
// 查询回款管理详情
24+
// 查询回款列表
25+
export const getReceivablePageByCustomer = async (params) => {
26+
return await request.get({ url: `/crm/receivable/page-by-customer`, params })
27+
}
28+
29+
// 查询回款详情
2930
export const getReceivable = async (id: number) => {
3031
return await request.get({ url: `/crm/receivable/get?id=` + id })
3132
}
3233

33-
// 新增回款管理
34+
// 新增回款
3435
export const createReceivable = async (data: ReceivableVO) => {
3536
return await request.post({ url: `/crm/receivable/create`, data })
3637
}
3738

38-
// 修改回款管理
39+
// 修改回款
3940
export const updateReceivable = async (data: ReceivableVO) => {
4041
return await request.put({ url: `/crm/receivable/update`, data })
4142
}
4243

43-
// 删除回款管理
44+
// 删除回款
4445
export const deleteReceivable = async (id: number) => {
4546
return await request.delete({ url: `/crm/receivable/delete?id=` + id })
4647
}
4748

48-
// 导出回款管理 Excel
49+
// 导出回款 Excel
4950
export const exportReceivable = async (params) => {
5051
return await request.download({ url: `/crm/receivable/export-excel`, params })
5152
}

src/api/crm/receivablePlan/index.ts renamed to src/api/crm/receivable/plan/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ export const getReceivablePlanPage = async (params) => {
2323
return await request.get({ url: `/crm/receivable-plan/page`, params })
2424
}
2525

26+
// 查询回款计划列表
27+
export const getReceivablePlanPageByCustomer = async (params) => {
28+
return await request.get({ url: `/crm/receivable-plan/page-by-customer`, params })
29+
}
30+
2631
// 查询回款计划详情
2732
export const getReceivablePlan = async (id: number) => {
2833
return await request.get({ url: `/crm/receivable-plan/get?id=` + id })

src/utils/dict.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export enum DICT_TYPE {
192192
// ========== CRM - 客户管理模块 ==========
193193
CRM_AUDIT_STATUS = 'crm_audit_status', // CRM 审批状态
194194
CRM_BIZ_TYPE = 'crm_biz_type', // CRM 业务类型
195-
CRM_RETURN_TYPE = 'crm_return_type',
195+
CRM_RECEIVABLE_RETURN_TYPE = 'crm_receivable_return_type', // CRM 回款的还款方式
196196
CRM_CUSTOMER_INDUSTRY = 'crm_customer_industry',
197197
CRM_CUSTOMER_LEVEL = 'crm_customer_level',
198198
CRM_CUSTOMER_SOURCE = 'crm_customer_source',

src/views/crm/contact/components/ContactList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.master" />
2626
</template>
2727
</el-table-column>
28+
<!-- TODO 芋艿:【操作:设为首要联系人】 -->
2829
</el-table>
2930
<!-- 分页 -->
3031
<Pagination

src/views/crm/customer/detail/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
<el-tab-pane label="合同" lazy>
1919
<ContractList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
2020
</el-tab-pane>
21-
<el-tab-pane label="回款" lazy>TODO待开发 </el-tab-pane>
21+
<el-tab-pane label="回款" lazy>
22+
<ReceivablePlanList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
23+
<ReceivableList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
24+
</el-tab-pane>
2225
<el-tab-pane label="回访" lazy>TODO 待开发</el-tab-pane>
2326
</el-tabs>
2427
</el-col>
@@ -31,6 +34,8 @@ import CustomerDetailsHeader from './CustomerDetailsHeader.vue' // 客户明细
3134
import ContactList from '@/views/crm/contact/components/ContactList.vue' // 联系人列表
3235
import ContractList from '@/views/crm/contract/components/ContractList.vue' // 合同列表
3336
import BusinessList from '@/views/crm/business/components/BusinessList.vue' // 商机列表
37+
import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue' // 回款列表
38+
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表
3439
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
3540
import { BizTypeEnum } from '@/api/crm/permission'
3641

src/views/crm/receivable/ReceivableForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<el-form-item label="回款方式" prop="returnType">
4444
<el-select v-model="formData.returnType" placeholder="请选择回款方式">
4545
<el-option
46-
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_RETURN_TYPE)"
46+
v-for="dict in getStrDictOptions(DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE)"
4747
:key="dict.value"
4848
:label="dict.label"
4949
:value="dict.value"
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<template>
2+
<!-- 操作栏 -->
3+
<el-row justify="end">
4+
<el-button @click="openForm">
5+
<Icon class="mr-5px" icon="icon-park:income-one" />
6+
创建回款
7+
</el-button>
8+
</el-row>
9+
10+
<!-- 列表 -->
11+
<ContentWrap class="mt-10px">
12+
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
13+
<el-table-column label="回款编号" fixed="left" align="center" prop="no">
14+
<template #default="scope">
15+
<el-link type="primary" :underline="false" @click="openDetail(scope.row.id)">
16+
{{ scope.row.no }}
17+
</el-link>
18+
</template>
19+
</el-table-column>
20+
<el-table-column label="合同编号" align="center" prop="contractNo" />
21+
<el-table-column
22+
label="回款金额(元)"
23+
align="center"
24+
prop="price"
25+
:formatter="fenToYuanFormat"
26+
/>
27+
<el-table-column label="负责人" align="center" prop="ownerUserName" />
28+
<el-table-column align="center" label="状态" prop="auditStatus">
29+
<template #default="scope">
30+
<dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
31+
</template>
32+
</el-table-column>
33+
<el-table-column
34+
label="回款日期"
35+
align="center"
36+
prop="returnTime"
37+
:formatter="dateFormatter"
38+
width="180px"
39+
/>
40+
</el-table>
41+
<!-- 分页 -->
42+
<Pagination
43+
:total="total"
44+
v-model:page="queryParams.pageNo"
45+
v-model:limit="queryParams.pageSize"
46+
@pagination="getList"
47+
/>
48+
</ContentWrap>
49+
50+
<!-- 表单弹窗:添加 -->
51+
<ReceivableForm ref="formRef" @success="getList" />
52+
</template>
53+
<script setup lang="ts">
54+
import * as ReceivableApi from '@/api/crm/receivable'
55+
import ReceivableForm from './../ReceivableForm.vue'
56+
import { BizTypeEnum } from '@/api/crm/permission'
57+
import { dateFormatter } from '@/utils/formatTime'
58+
import { fenToYuanFormat } from '@/utils/formatter'
59+
import { DICT_TYPE } from '@/utils/dict'
60+
61+
defineOptions({ name: 'CrmReceivableList' })
62+
const props = defineProps<{
63+
bizType: number // 业务类型
64+
bizId: number // 业务编号
65+
}>()
66+
67+
const loading = ref(true) // 列表的加载中
68+
const total = ref(0) // 列表的总页数
69+
const list = ref([]) // 列表的数据
70+
const queryParams = reactive({
71+
pageNo: 1,
72+
pageSize: 10,
73+
customerId: undefined as unknown // 允许 undefined + number
74+
})
75+
76+
/** 查询列表 */
77+
const getList = async () => {
78+
loading.value = true
79+
try {
80+
// 置空参数
81+
queryParams.customerId = undefined
82+
// 执行查询
83+
let data = { list: [], total: 0 }
84+
switch (props.bizType) {
85+
case BizTypeEnum.CRM_CUSTOMER:
86+
queryParams.customerId = props.bizId
87+
data = await ReceivableApi.getReceivablePageByCustomer(queryParams)
88+
break
89+
default:
90+
return
91+
}
92+
list.value = data.list
93+
total.value = data.total
94+
} finally {
95+
loading.value = false
96+
}
97+
}
98+
99+
/** 搜索按钮操作 */
100+
const handleQuery = () => {
101+
queryParams.pageNo = 1
102+
getList()
103+
}
104+
105+
/** 添加 */
106+
const formRef = ref()
107+
const openForm = () => {
108+
formRef.value.open('create')
109+
}
110+
111+
/** 打开合同详情 */
112+
const { push } = useRouter()
113+
const openDetail = (id: number) => {
114+
push({ name: 'CrmReceivableDetail', params: { id } })
115+
}
116+
117+
/** 监听打开的 bizId + bizType,从而加载最新的列表 */
118+
watch(
119+
() => [props.bizId, props.bizType],
120+
() => {
121+
handleQuery()
122+
},
123+
{ immediate: true, deep: true }
124+
)
125+
</script>

0 commit comments

Comments
 (0)