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
8f8591fc
authored
Feb 24, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
CRM:增加合同配置表
parent
43bdb3cd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
0 deletions
+116
-0
src/api/crm/contract/config/index.ts
+16
-0
src/views/crm/contract/config/index.vue
+100
-0
No files found.
src/api/crm/contract/config/index.ts
0 → 100644
View file @
8f8591fc
import
request
from
'@/config/axios'
export
interface
ContractConfigVO
{
notifyEnabled
?:
boolean
notifyDays
?:
number
}
// 获取合同配置
export
const
getContractConfig
=
async
()
=>
{
return
await
request
.
get
({
url
:
`/crm/contract-config/get`
})
}
// 更新合同配置
export
const
saveContractConfig
=
async
(
data
:
ContractConfigVO
)
=>
{
return
await
request
.
put
({
url
:
`/crm/contract-config/save`
,
data
})
}
src/views/crm/contract/config/index.vue
0 → 100644
View file @
8f8591fc
<
template
>
<ContentWrap>
<el-form
ref=
"formRef"
:model=
"formData"
:rules=
"formRules"
label-width=
"160px"
v-loading=
"formLoading"
>
<el-card
shadow=
"never"
>
<!-- 操作 -->
<template
#
header
>
<div
class=
"flex items-center justify-between"
>
<CardTitle
title=
"合同配置设置"
/>
<el-button
type=
"primary"
@
click=
"onSubmit"
v-hasPermi=
"['crm:contract-config:update']"
>
保存
</el-button>
</div>
</
template
>
<!-- 表单 -->
<el-form-item
label=
"提前提醒设置"
prop=
"notifyEnabled"
>
<el-radio-group
v-model=
"formData.notifyEnabled"
@
change=
"changeNotifyEnable"
class=
"ml-4"
>
<el-radio
:label=
"false"
size=
"large"
>
不提醒
</el-radio>
<el-radio
:label=
"true"
size=
"large"
>
提醒
</el-radio>
</el-radio-group>
</el-form-item>
<div
v-if=
"formData.notifyEnabled"
>
<el-form-item>
提前
<el-input-number
class=
"mx-2"
v-model=
"formData.notifyDays"
/>
天提醒
</el-form-item>
</div>
</el-card>
</el-form>
</ContentWrap>
</template>
<
script
setup
lang=
"ts"
>
import
*
as
ContractConfigApi
from
'@/api/crm/contract/config'
import
{
CardTitle
}
from
'@/components/Card'
defineOptions
({
name
:
'CrmContractConfig'
})
const
message
=
useMessage
()
// 消息弹窗
const
{
t
}
=
useI18n
()
// 国际化
const
formLoading
=
ref
(
false
)
const
formData
=
ref
({
notifyEnabled
:
false
,
notifyDays
:
undefined
})
const
formRules
=
reactive
({})
const
formRef
=
ref
()
// 表单 Ref
/** 获取配置 */
const
getConfig
=
async
()
=>
{
try
{
formLoading
.
value
=
true
const
data
=
await
ContractConfigApi
.
getContractConfig
()
if
(
data
===
null
)
{
return
}
formData
.
value
=
data
}
finally
{
formLoading
.
value
=
false
}
}
/** 提交配置 */
const
onSubmit
=
async
()
=>
{
// 校验表单
if
(
!
formRef
)
return
const
valid
=
await
formRef
.
value
.
validate
()
if
(
!
valid
)
return
// 提交请求
formLoading
.
value
=
true
try
{
const
data
=
formData
.
value
as
ContractConfigApi
.
ContractConfigVO
await
ContractConfigApi
.
saveContractConfig
(
data
)
message
.
success
(
t
(
'common.updateSuccess'
))
await
getConfig
()
formLoading
.
value
=
false
}
finally
{
formLoading
.
value
=
false
}
}
/** 更改提前提醒设置 */
const
changeNotifyEnable
=
()
=>
{
if
(
!
formData
.
value
.
notifyEnabled
)
{
formData
.
value
.
notifyDays
=
undefined
}
}
onMounted
(()
=>
{
getConfig
()
})
</
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