Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
25665f54
authored
Feb 25, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
CRM:完善回款在合同、客户的引入
parent
c5e5228e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
28 deletions
+58
-28
src/views/crm/contract/detail/index.vue
+3
-3
src/views/crm/customer/detail/index.vue
+3
-3
src/views/crm/receivable/ReceivableForm.vue
+7
-3
src/views/crm/receivable/components/ReceivableList.vue
+16
-6
src/views/crm/receivable/detail/index.vue
+3
-2
src/views/crm/receivable/plan/ReceivablePlanForm.vue
+10
-1
src/views/crm/receivable/plan/components/ReceivablePlanList.vue
+16
-10
No files found.
src/views/crm/contract/detail/index.vue
View file @
25665f54
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<ReceivablePlanList
<ReceivablePlanList
:contract-id=
"contract.id!"
:contract-id=
"contract.id!"
:customer-id=
"contract.customerId"
:customer-id=
"contract.customerId"
@
cr
ate-receivable=
"cr
ateReceivable"
@
cr
eate-receivable=
"cre
ateReceivable"
/>
/>
<ReceivableList
<ReceivableList
ref=
"receivableListRef"
ref=
"receivableListRef"
...
@@ -108,8 +108,8 @@ const getOperateLog = async (contractId: number) => {
...
@@ -108,8 +108,8 @@ const getOperateLog = async (contractId: number) => {
/** 从回款计划创建回款 */
/** 从回款计划创建回款 */
const
receivableListRef
=
ref
<
InstanceType
<
typeof
ReceivableList
>>
()
// 回款列表 Ref
const
receivableListRef
=
ref
<
InstanceType
<
typeof
ReceivableList
>>
()
// 回款列表 Ref
const
crateReceivable
=
(
planData
:
any
)
=>
{
const
cr
e
ateReceivable
=
(
planData
:
any
)
=>
{
receivableListRef
.
value
?.
crateReceivable
(
planData
)
receivableListRef
.
value
?.
cr
e
ateReceivable
(
planData
)
}
}
/** 转移 */
/** 转移 */
...
...
src/views/crm/customer/detail/index.vue
View file @
25665f54
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
<ContractList
:biz-id=
"customer.id!"
:biz-type=
"BizTypeEnum.CRM_CUSTOMER"
/>
<ContractList
:biz-id=
"customer.id!"
:biz-type=
"BizTypeEnum.CRM_CUSTOMER"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"回款"
lazy
>
<el-tab-pane
label=
"回款"
lazy
>
<ReceivablePlanList
:customer-id=
"customer.id!"
@
cr
ate-receivable=
"cr
ateReceivable"
/>
<ReceivablePlanList
:customer-id=
"customer.id!"
@
cr
eate-receivable=
"cre
ateReceivable"
/>
<ReceivableList
ref=
"receivableListRef"
:customer-id=
"customer.id!"
/>
<ReceivableList
ref=
"receivableListRef"
:customer-id=
"customer.id!"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"操作日志"
>
<el-tab-pane
label=
"操作日志"
>
...
@@ -199,8 +199,8 @@ const getOperateLog = async () => {
...
@@ -199,8 +199,8 @@ const getOperateLog = async () => {
/** 从回款计划创建回款 */
/** 从回款计划创建回款 */
const
receivableListRef
=
ref
<
InstanceType
<
typeof
ReceivableList
>>
()
// 回款列表 Ref
const
receivableListRef
=
ref
<
InstanceType
<
typeof
ReceivableList
>>
()
// 回款列表 Ref
const
crateReceivable
=
(
planData
:
any
)
=>
{
const
cr
e
ateReceivable
=
(
planData
:
any
)
=>
{
receivableListRef
.
value
?.
crateReceivable
(
planData
)
receivableListRef
.
value
?.
cr
e
ateReceivable
(
planData
)
}
}
const
close
=
()
=>
{
const
close
=
()
=>
{
...
...
src/views/crm/receivable/ReceivableForm.vue
View file @
25665f54
...
@@ -201,10 +201,14 @@ const open = async (
...
@@ -201,10 +201,14 @@ const open = async (
// 从回款计划创建回款
// 从回款计划创建回款
if
(
receivablePlan
)
{
if
(
receivablePlan
)
{
formData
.
value
.
customerId
=
receivablePlan
.
customerId
formData
.
value
.
customerId
=
receivablePlan
.
customerId
await
handleCustomerChange
(
receivablePlan
.
customerId
)
formData
.
value
.
contractId
=
receivablePlan
.
contractId
formData
.
value
.
contractId
=
receivablePlan
.
contractId
formData
.
value
.
planId
=
receivablePlan
.
id
await
handleContractChange
(
receivablePlan
.
contractId
)
formData
.
value
.
price
=
receivablePlan
.
price
if
(
receivablePlan
.
id
)
{
formData
.
value
.
returnType
=
receivablePlan
.
returnType
formData
.
value
.
planId
=
receivablePlan
.
id
formData
.
value
.
price
=
receivablePlan
.
price
formData
.
value
.
returnType
=
receivablePlan
.
returnType
}
}
}
}
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
...
...
src/views/crm/receivable/components/ReceivableList.vue
View file @
25665f54
<
template
>
<
template
>
<!-- 操作栏 -->
<!-- 操作栏 -->
<el-row
justify=
"end"
>
<el-row
justify=
"end"
>
<el-button
@
click=
"openForm"
>
<el-button
@
click=
"openForm
('create')
"
>
<Icon
class=
"mr-5px"
icon=
"icon-park:income-one"
/>
<Icon
class=
"mr-5px"
icon=
"icon-park:income-one"
/>
创建回款
创建回款
</el-button>
</el-button>
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<el-table
v-loading=
"loading"
:data=
"list"
:show-overflow-tooltip=
"true"
:stripe=
"true"
>
<el-table
v-loading=
"loading"
:data=
"list"
:show-overflow-tooltip=
"true"
:stripe=
"true"
>
<el-table-column
align=
"center"
label=
"回款编号"
prop=
"no"
/>
<el-table-column
align=
"center"
label=
"回款编号"
prop=
"no"
/>
<el-table-column
align=
"center"
label=
"客户"
prop=
"customerName"
/>
<el-table-column
align=
"center"
label=
"客户"
prop=
"customerName"
/>
<el-table-column
align=
"center"
label=
"合同"
prop=
"contract
Name
"
/>
<el-table-column
align=
"center"
label=
"合同"
prop=
"contract
.no
"
/>
<el-table-column
<el-table-column
:formatter=
"dateFormatter2"
:formatter=
"dateFormatter2"
align=
"center"
align=
"center"
...
@@ -25,7 +25,12 @@
...
@@ -25,7 +25,12 @@
<dict-tag
:type=
"DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE"
:value=
"scope.row.returnType"
/>
<dict-tag
:type=
"DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE"
:value=
"scope.row.returnType"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"回款金额(元)"
prop=
"price"
/>
<el-table-column
align=
"center"
label=
"回款金额(元)"
prop=
"price"
:formatter=
"erpPriceTableColumnFormatter"
/>
<el-table-column
align=
"center"
label=
"负责人"
prop=
"ownerUserName"
/>
<el-table-column
align=
"center"
label=
"负责人"
prop=
"ownerUserName"
/>
<el-table-column
align=
"center"
label=
"备注"
prop=
"remark"
/>
<el-table-column
align=
"center"
label=
"备注"
prop=
"remark"
/>
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
width=
"130px"
>
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
width=
"130px"
>
...
@@ -67,6 +72,7 @@ import * as ReceivableApi from '@/api/crm/receivable'
...
@@ -67,6 +72,7 @@ import * as ReceivableApi from '@/api/crm/receivable'
import
ReceivableForm
from
'./../ReceivableForm.vue'
import
ReceivableForm
from
'./../ReceivableForm.vue'
import
{
dateFormatter2
}
from
'@/utils/formatTime'
import
{
dateFormatter2
}
from
'@/utils/formatTime'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
erpPriceTableColumnFormatter
}
from
'@/utils'
defineOptions
({
name
:
'CrmReceivableList'
})
defineOptions
({
name
:
'CrmReceivableList'
})
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
...
@@ -117,7 +123,10 @@ const handleQuery = () => {
...
@@ -117,7 +123,10 @@ const handleQuery = () => {
/** 添加/修改操作 */
/** 添加/修改操作 */
const
formRef
=
ref
()
const
formRef
=
ref
()
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
formRef
.
value
.
open
(
type
,
id
)
formRef
.
value
.
open
(
type
,
id
,
{
customerId
:
props
.
customerId
,
contractId
:
props
.
contractId
})
}
}
/** 删除按钮操作 */
/** 删除按钮操作 */
...
@@ -134,11 +143,12 @@ const handleDelete = async (id: number) => {
...
@@ -134,11 +143,12 @@ const handleDelete = async (id: number) => {
}
}
/** 从回款计划创建回款 */
/** 从回款计划创建回款 */
const
crateReceivable
=
(
planData
:
any
)
=>
{
const
cr
e
ateReceivable
=
(
planData
:
any
)
=>
{
const
data
=
planData
as
unknown
as
ReceivablePlanApi
.
ReceivablePlanVO
const
data
=
planData
as
unknown
as
ReceivablePlanApi
.
ReceivablePlanVO
formRef
.
value
.
open
(
'create'
,
undefined
,
data
)
formRef
.
value
.
open
(
'create'
,
undefined
,
data
)
}
}
defineExpose
({
crateReceivable
})
defineExpose
({
createReceivable
})
/** 监听打开的 customerId + contractId,从而加载最新的列表 */
/** 监听打开的 customerId + contractId,从而加载最新的列表 */
watch
(
watch
(
()
=>
[
props
.
customerId
,
props
.
contractId
],
()
=>
[
props
.
customerId
,
props
.
contractId
],
...
...
src/views/crm/receivable/detail/index.vue
View file @
25665f54
...
@@ -87,12 +87,13 @@ const close = () => {
...
@@ -87,12 +87,13 @@ const close = () => {
/** 初始化 */
/** 初始化 */
const
{
params
}
=
useRoute
()
const
{
params
}
=
useRoute
()
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
if
(
!
params
.
id
)
{
const
id
=
props
.
id
||
route
.
params
.
id
if
(
!
id
)
{
message
.
warning
(
'参数错误,回款不能为空!'
)
message
.
warning
(
'参数错误,回款不能为空!'
)
close
()
close
()
return
return
}
}
receivableId
.
value
=
params
.
id
as
unknown
as
number
receivableId
.
value
=
id
await
getReceivable
(
receivableId
.
value
)
await
getReceivable
(
receivableId
.
value
)
})
})
</
script
>
</
script
>
src/views/crm/receivable/plan/ReceivablePlanForm.vue
View file @
25665f54
...
@@ -136,6 +136,7 @@ import * as CustomerApi from '@/api/crm/customer'
...
@@ -136,6 +136,7 @@ import * as CustomerApi from '@/api/crm/customer'
import
*
as
ContractApi
from
'@/api/crm/contract'
import
*
as
ContractApi
from
'@/api/crm/contract'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
aw
}
from
'../../../../../dist-prod/assets/index-9eac537b'
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
...
@@ -157,7 +158,7 @@ const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
...
@@ -157,7 +158,7 @@ const customerList = ref<CustomerApi.CustomerVO[]>([]) // 客户列表
const
contractList
=
ref
<
ContractApi
.
ContractVO
[]
>
([])
// 合同列表
const
contractList
=
ref
<
ContractApi
.
ContractVO
[]
>
([])
// 合同列表
/** 打开弹窗 */
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
const
open
=
async
(
type
:
string
,
id
?:
number
,
customerId
?:
number
,
contractId
?:
number
)
=>
{
dialogVisible
.
value
=
true
dialogVisible
.
value
=
true
dialogTitle
.
value
=
t
(
'action.'
+
type
)
dialogTitle
.
value
=
t
(
'action.'
+
type
)
formType
.
value
=
type
formType
.
value
=
type
...
@@ -179,6 +180,14 @@ const open = async (type: string, id?: number) => {
...
@@ -179,6 +180,14 @@ const open = async (type: string, id?: number) => {
if
(
formType
.
value
===
'create'
)
{
if
(
formType
.
value
===
'create'
)
{
formData
.
value
.
ownerUserId
=
useUserStore
().
getUser
.
id
formData
.
value
.
ownerUserId
=
useUserStore
().
getUser
.
id
}
}
// 设置 customerId 和 contractId 默认值
if
(
customerId
)
{
formData
.
value
.
customerId
=
customerId
await
handleCustomerChange
(
customerId
)
}
if
(
contractId
)
{
formData
.
value
.
contractId
=
contractId
}
}
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
...
...
src/views/crm/receivable/plan/components/ReceivablePlanList.vue
View file @
25665f54
<
template
>
<
template
>
<!-- 操作栏 -->
<!-- 操作栏 -->
<el-row
justify=
"end"
>
<el-row
justify=
"end"
>
<el-button
@
click=
"openForm"
>
<el-button
@
click=
"openForm
('create', undefined)
"
>
<Icon
class=
"mr-5px"
icon=
"icon-park:income"
/>
<Icon
class=
"mr-5px"
icon=
"icon-park:income"
/>
创建回款计划
创建回款计划
</el-button>
</el-button>
...
@@ -13,7 +13,13 @@
...
@@ -13,7 +13,13 @@
<el-table-column
align=
"center"
label=
"客户名称"
prop=
"customerName"
width=
"150px"
/>
<el-table-column
align=
"center"
label=
"客户名称"
prop=
"customerName"
width=
"150px"
/>
<el-table-column
align=
"center"
label=
"合同编号"
prop=
"contractNo"
width=
"200px"
/>
<el-table-column
align=
"center"
label=
"合同编号"
prop=
"contractNo"
width=
"200px"
/>
<el-table-column
align=
"center"
label=
"期数"
prop=
"period"
/>
<el-table-column
align=
"center"
label=
"期数"
prop=
"period"
/>
<el-table-column
align=
"center"
label=
"计划回款(元)"
prop=
"price"
width=
"120"
/>
<el-table-column
align=
"center"
label=
"计划回款(元)"
prop=
"price"
width=
"120"
:formatter=
"erpPriceTableColumnFormatter"
/>
<el-table-column
<el-table-column
:formatter=
"dateFormatter2"
:formatter=
"dateFormatter2"
align=
"center"
align=
"center"
...
@@ -37,7 +43,8 @@
...
@@ -37,7 +43,8 @@
v-hasPermi=
"['crm:receivable:create']"
v-hasPermi=
"['crm:receivable:create']"
link
link
type=
"primary"
type=
"primary"
@
click=
"crateReceivable(scope.row)"
@
click=
"createReceivable(scope.row)"
:disabled=
"scope.row.receivableId"
>
>
创建回款
创建回款
</el-button>
</el-button>
...
@@ -75,8 +82,8 @@
...
@@ -75,8 +82,8 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
*
as
ReceivablePlanApi
from
'@/api/crm/receivable/plan'
import
*
as
ReceivablePlanApi
from
'@/api/crm/receivable/plan'
import
ReceivableForm
from
'./../ReceivablePlanForm.vue'
import
ReceivableForm
from
'./../ReceivablePlanForm.vue'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
dateFormatter2
}
from
'@/utils/formatTime'
import
{
dateFormatter2
}
from
'@/utils/formatTime'
import
{
erpPriceTableColumnFormatter
}
from
'@/utils'
defineOptions
({
name
:
'CrmReceivablePlanList'
})
defineOptions
({
name
:
'CrmReceivablePlanList'
})
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
...
@@ -127,16 +134,15 @@ const handleQuery = () => {
...
@@ -127,16 +134,15 @@ const handleQuery = () => {
/** 添加/修改操作 */
/** 添加/修改操作 */
const
formRef
=
ref
()
const
formRef
=
ref
()
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
formRef
.
value
.
open
(
type
,
id
)
formRef
.
value
.
open
(
type
,
id
,
props
.
customerId
,
props
.
contractId
)
}
}
/
/ todo @puhui999:拼写错误
/
** 创建回款 */
const
emits
=
defineEmits
<
{
const
emits
=
defineEmits
<
{
(
e
:
'crateReceivable'
,
v
:
ReceivablePlanApi
.
ReceivablePlanVO
)
(
e
:
'cr
e
ateReceivable'
,
v
:
ReceivablePlanApi
.
ReceivablePlanVO
)
}
>
()
}
>
()
/** 创建回款 */
const
createReceivable
=
(
row
:
ReceivablePlanApi
.
ReceivablePlanVO
)
=>
{
const
crateReceivable
=
(
row
:
ReceivablePlanApi
.
ReceivablePlanVO
)
=>
{
emits
(
'createReceivable'
,
row
)
emits
(
'crateReceivable'
,
row
)
}
}
/** 删除按钮操作 */
/** 删除按钮操作 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment