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
6725318f
authored
Feb 24, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRM:完善回款计划
parent
8f8591fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
72 deletions
+91
-72
src/api/crm/contract/index.ts
+7
-0
src/api/crm/customer/index.ts
+5
-0
src/api/crm/receivable/plan/index.ts
+1
-3
src/views/crm/customer/CustomerImportForm.vue
+8
-6
src/views/crm/receivable/plan/ReceivablePlanForm.vue
+0
-0
src/views/crm/receivable/plan/index.vue
+70
-63
No files found.
src/api/crm/contract/index.ts
View file @
6725318f
...
...
@@ -65,6 +65,13 @@ export const getContract = async (id: number) => {
return
await
request
.
get
({
url
:
`/crm/contract/get?id=`
+
id
})
}
// 查询 CRM 合同下拉列表
export
const
getCrmContractSimpleListByCustomerId
=
async
(
customerId
:
number
)
=>
{
return
await
request
.
get
({
url
:
`/crm/contract/list-all-simple-by-customer?customerId=
${
customerId
}
`
})
}
// 新增 CRM 合同
export
const
createContract
=
async
(
data
:
ContractVO
)
=>
{
return
await
request
.
post
({
url
:
`/crm/contract/create`
,
data
})
...
...
src/api/crm/customer/index.ts
View file @
6725318f
...
...
@@ -90,6 +90,11 @@ export const importCustomerTemplate = () => {
return
request
.
download
({
url
:
'/crm/customer/get-import-template'
})
}
// 导入客户
export
const
handleImport
=
async
(
formData
)
=>
{
return
await
request
.
upload
({
url
:
`/crm/customer/import`
,
data
:
formData
})
}
// 客户列表
export
const
getCustomerSimpleList
=
async
()
=>
{
return
await
request
.
get
({
url
:
`/crm/customer/simple-list`
})
...
...
src/api/crm/receivable/plan/index.ts
View file @
6725318f
...
...
@@ -4,8 +4,7 @@ export interface ReceivablePlanVO {
id
:
number
period
:
number
receivableId
:
number
status
:
number
checkStatus
:
string
finishStatus
:
number
processInstanceId
:
number
price
:
number
returnTime
:
Date
...
...
@@ -14,7 +13,6 @@ export interface ReceivablePlanVO {
customerId
:
number
contractId
:
number
ownerUserId
:
number
sort
:
number
remark
:
string
}
...
...
src/views/crm/customer/CustomerImportForm.vue
View file @
6725318f
...
...
@@ -4,7 +4,6 @@
<el-upload
ref=
"uploadRef"
v-model:file-list=
"fileList"
:action=
"importUrl + '?updateSupport=' + updateSupport"
:auto-upload=
"false"
:disabled=
"formLoading"
:headers=
"uploadHeaders"
...
...
@@ -13,6 +12,7 @@
:on-exceed=
"handleExceed"
:on-success=
"submitFormSuccess"
accept=
".xlsx, .xls"
action=
"none"
drag
>
<Icon
icon=
"ep:upload"
/>
...
...
@@ -45,6 +45,7 @@
import
*
as
CustomerApi
from
'@/api/crm/customer'
import
{
getAccessToken
,
getTenantId
}
from
'@/utils/auth'
import
download
from
'@/utils/download'
import
type
{
UploadUserFile
}
from
'element-plus'
defineOptions
({
name
:
'SystemUserImportForm'
})
...
...
@@ -53,11 +54,9 @@ const message = useMessage() // 消息弹窗
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
formLoading
=
ref
(
false
)
// 表单的加载中
const
uploadRef
=
ref
()
const
importUrl
=
import
.
meta
.
env
.
VITE_BASE_URL
+
import
.
meta
.
env
.
VITE_API_URL
+
'/crm/customer/import'
const
uploadHeaders
=
ref
()
// 上传 Header 头
const
fileList
=
ref
([])
// 文件列表
const
updateSupport
=
ref
(
0
)
// 是否更新已经存在的客户数据
const
fileList
=
ref
<
UploadUserFile
[]
>
([])
// 文件列表
const
updateSupport
=
ref
(
false
)
// 是否更新已经存在的客户数据
/** 打开弹窗 */
const
open
=
()
=>
{
...
...
@@ -79,7 +78,10 @@ const submitForm = async () => {
'tenant-id'
:
getTenantId
()
}
formLoading
.
value
=
true
uploadRef
.
value
!
.
submit
()
const
formData
=
new
FormData
()
formData
.
append
(
'updateSupport'
,
updateSupport
.
value
)
formData
.
append
(
'file'
,
fileList
.
value
[
0
].
raw
)
await
CustomerApi
.
handleImport
(
formData
)
}
/** 文件上传成功 */
...
...
src/views/crm/receivable/plan/ReceivablePlanForm.vue
View file @
6725318f
This diff is collapsed.
Click to expand it.
src/views/crm/receivable/plan/index.vue
View file @
6725318f
...
...
@@ -2,49 +2,63 @@
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class=
"-mb-15px"
:model=
"queryParams"
ref=
"queryFormRef"
:inline=
"true"
:model=
"queryParams"
class=
"-mb-15px"
label-width=
"68px"
>
<el-form-item
label=
"客户"
prop=
"customerId"
>
<el-
inpu
t
<el-
selec
t
v-model=
"queryParams.customerId"
placeholder=
"请输入客户"
clearable
@
keyup
.
enter=
"handleQuery"
class=
"!w-240px"
/>
placeholder=
"请选择客户"
@
keyup
.
enter=
"handleQuery"
>
<el-option
v-for=
"item in customerList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"合同
"
prop=
"contractId
"
>
<el-form-item
label=
"合同
编号"
prop=
"contractNo
"
>
<el-input
v-model=
"queryParams.contract
Id
"
placeholder=
"请输入合同
"
v-model=
"queryParams.contract
No
"
class=
"!w-240px
"
clearable
placeholder=
"请输入合同编号"
@
keyup
.
enter=
"handleQuery"
class=
"!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button
@
click=
"handleQuery"
><Icon
icon=
"ep:search"
class=
"mr-5px"
/>
搜索
</el-button>
<el-button
@
click=
"resetQuery"
><Icon
icon=
"ep:refresh"
class=
"mr-5px"
/>
重置
</el-button>
<el-button
@
click=
"handleQuery"
>
<Icon
class=
"mr-5px"
icon=
"ep:search"
/>
搜索
</el-button>
<el-button
@
click=
"resetQuery"
>
<Icon
class=
"mr-5px"
icon=
"ep:refresh"
/>
重置
</el-button>
<el-button
type=
"primary
"
v-hasPermi=
"['crm:receivable-plan:create']
"
plain
type=
"primary"
@
click=
"openForm('create')"
v-hasPermi=
"['crm:receivable-plan:create']"
>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
新增
<Icon
class=
"mr-5px"
icon=
"ep:plus"
/>
新增
</el-button>
<el-button
type=
"success"
v-hasPermi=
"['crm:receivable-plan:export']"
:loading=
"exportLoading"
plain
type=
"success"
@
click=
"handleExport"
:loading=
"exportLoading"
v-hasPermi=
"['crm:receivable-plan:export']"
>
<Icon
icon=
"ep:download"
class=
"mr-5px"
/>
导出
<Icon
class=
"mr-5px"
icon=
"ep:download"
/>
导出
</el-button>
</el-form-item>
</el-form>
...
...
@@ -52,68 +66,58 @@
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<!--
<el-table-column
label=
"ID"
align=
"center"
prop=
"id"
/>
-->
<el-table-column
label=
"客户名称"
align=
"center"
prop=
"customerId"
width=
"150px"
/>
<el-table-column
label=
"合同名称"
align=
"center"
prop=
"contractId"
width=
"150px"
/>
<el-table-column
label=
"期数"
align=
"center"
prop=
"period"
/>
<el-table-column
label=
"计划回款"
align=
"center"
prop=
"price"
/>
<el-table
v-loading=
"loading"
:data=
"list"
:show-overflow-tooltip=
"true"
:stripe=
"true"
>
<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=
"period"
/>
<el-table-column
align=
"center"
label=
"计划回款"
prop=
"price"
/>
<el-table-column
label=
"计划回款日期
"
:formatter=
"dateFormatter2
"
align=
"center"
label=
"计划回款日期"
prop=
"returnTime"
:formatter=
"dateFormatter2"
width=
"180px"
/>
<el-table-column
label=
"提前几天提醒"
align=
"center"
prop=
"remindDays
"
/>
<
!--
<
el-table-column
label=
"提醒日期
"
<el-table-column
align=
"center"
label=
"提前几天提醒"
prop=
"remindDays"
width=
"150
"
/>
<el-table-column
:formatter=
"dateFormatter2
"
align=
"center"
label=
"提醒日期"
prop=
"remindTime"
:formatter=
"dateFormatter"
width=
"180px"
/>
-->
<!--
<el-table-column
label=
"回款ID"
align=
"center"
prop=
"receivableId"
/>
-->
<el-table-column
label=
"完成状态"
align=
"center"
prop=
"status"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.COMMON_STATUS"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"审批状态"
align=
"center"
prop=
"checkStatus"
width=
"130px"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.CRM_AUDIT_STATUS"
:value=
"scope.row.checkStatus"
/>
</
template
>
</el-table-column>
<!--<el-table-column label="工作流编号" align="center" prop="processInstanceId" />-->
<el-table-column
prop=
"ownerUserId"
label=
"负责人"
width=
"120"
>
/>
<el-table-column
label=
"负责人"
prop=
"ownerUserId"
width=
"120"
>
<template
#
default=
"scope"
>
{{
userList
.
find
((
user
)
=>
user
.
id
===
scope
.
row
.
ownerUserId
)?.
nickname
}}
</
template
>
</el-table-column>
<el-table-column
label=
"显示顺序"
align=
"center"
prop=
"sort"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
/>
<el-table-column
align=
"center"
label=
"备注"
prop=
"remark"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
:formatter=
"dateFormatter"
width=
"180px"
/>
<el-table-column
label=
"操作"
align=
"center"
width=
"130px"
>
fixed=
"right"
label=
"完成状态"
prop=
"finishStatus"
width=
"130px"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.INFRA_BOOLEAN_STRING"
:value=
"scope.row.finishStatus"
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
fixed=
"right"
label=
"操作"
width=
"130px"
>
<
template
#
default=
"scope"
>
<el-button
v-hasPermi=
"['crm:receivable-plan:update']"
link
type=
"primary"
@
click=
"openForm('update', scope.row.id)"
v-hasPermi=
"['crm:receivable-plan:update']"
>
编辑
</el-button>
<el-button
v-hasPermi=
"['crm:receivable-plan:delete']"
link
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
v-hasPermi=
"['crm:receivable-plan:delete']"
>
删除
</el-button>
...
...
@@ -122,9 +126,9 @@
</el-table>
<!-- 分页 -->
<Pagination
:total=
"total"
v-model:page=
"queryParams.pageNo"
v-model:limit=
"queryParams.pageSize"
v-model:page=
"queryParams.pageNo"
:total=
"total"
@
pagination=
"getList"
/>
</ContentWrap>
...
...
@@ -133,13 +137,14 @@
<ReceivablePlanForm
ref=
"formRef"
@
success=
"getList"
/>
</template>
<
script
setup
lang=
"ts"
>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
dateFormatter
,
dateFormatter
2
}
from
'@/utils/formatTime'
import
{
dateFormatter2
}
from
'@/utils/formatTime'
import
download
from
'@/utils/download'
import
*
as
ReceivablePlanApi
from
'@/api/crm/receivable/plan'
import
ReceivablePlanForm
from
'./ReceivablePlanForm.vue'
import
*
as
UserApi
from
'@/api/system/user'
import
*
as
CustomerApi
from
'@/api/crm/customer'
defineOptions
({
name
:
'ReceivablePlan'
})
...
...
@@ -153,8 +158,8 @@ const userList = ref<UserApi.UserVO[]>([]) // 用户列表
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
customerId
:
null
,
contract
Id
:
null
customerId
:
undefined
,
contract
No
:
undefined
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
exportLoading
=
ref
(
false
)
// 导出的加载中
...
...
@@ -216,11 +221,13 @@ const handleExport = async () => {
exportLoading
.
value
=
false
}
}
const
customerList
=
ref
<
CustomerApi
.
CustomerVO
[]
>
([])
// 客户列表
/** 初始化 **/
onMounted
(
async
()
=>
{
await
getList
()
// 获取用户列表
userList
.
value
=
await
UserApi
.
getSimpleUserList
()
// 获得客户列表
customerList
.
value
=
await
CustomerApi
.
getCustomerSimpleList
()
})
</
script
>
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