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
3bfdb2df
authored
Feb 23, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
CRM:完善合同的新增、修改需求
parent
9d44b9ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
6 deletions
+30
-6
src/views/crm/contract/ContractForm.vue
+30
-6
No files found.
src/views/crm/contract/ContractForm.vue
View file @
3bfdb2df
...
...
@@ -38,7 +38,12 @@
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"客户名称"
prop=
"customerId"
>
<el-select
v-model=
"formData.customerId"
placeholder=
"请选择客户"
class=
"w-1/1"
>
<el-select
v-model=
"formData.customerId"
placeholder=
"请选择客户"
class=
"w-1/1"
@
change=
"handleCustomerChange"
>
<el-option
v-for=
"item in customerList"
:key=
"item.id"
...
...
@@ -50,7 +55,12 @@
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"商机名称"
prop=
"businessId"
>
<el-select
:disabled=
"!formData.customerId"
v-model=
"formData.businessId"
class=
"w-1/1"
>
<el-select
@
change=
"handleBusinessChange"
:disabled=
"!formData.customerId"
v-model=
"formData.businessId"
class=
"w-1/1"
>
<el-option
v-for=
"item in getBusinessOptions"
:key=
"item.id"
...
...
@@ -192,6 +202,7 @@ import * as BusinessApi from '@/api/crm/business'
import
{
erpPriceInputFormatter
,
erpPriceMultiply
}
from
'@/utils'
import
{
useUserStore
}
from
'@/store/modules/user'
import
ContractProductForm
from
'@/views/crm/contract/components/ContractProductForm.vue'
import
{
bu
}
from
'../../../../dist-prod/assets/index-9eac537b'
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
...
...
@@ -333,15 +344,28 @@ const resetForm = () => {
formRef
.
value
?.
resetFields
()
}
// TODO 芋艿:切换客户时,需要 reset 关联的几个字段
// TODO 芋艿:选择商机时,需要自动设置
/** 处理切换客户 */
const
handleCustomerChange
=
()
=>
{
formData
.
value
.
businessId
=
undefined
formData
.
value
.
signContactId
=
undefined
formData
.
value
.
products
=
[]
}
/** 处理商机变化 */
const
handleBusinessChange
=
async
(
businessId
:
number
)
=>
{
const
business
=
await
BusinessApi
.
getBusiness
(
businessId
)
business
.
products
.
forEach
((
item
)
=>
{
item
.
contractPrice
=
item
.
businessPrice
})
formData
.
value
.
products
=
business
.
products
}
/** 动态获取客户联系人 */
const
getContactOptions
=
computed
(()
=>
contactList
.
value
.
filter
((
item
)
=>
item
.
customerId
==
=
formData
.
value
.
customerId
)
contactList
.
value
.
filter
((
item
)
=>
item
.
customerId
==
formData
.
value
.
customerId
)
)
/** 动态获取商机 */
const
getBusinessOptions
=
computed
(()
=>
businessList
.
value
.
filter
((
item
)
=>
item
.
customerId
==
=
formData
.
value
.
customerId
)
businessList
.
value
.
filter
((
item
)
=>
item
.
customerId
==
formData
.
value
.
customerId
)
)
</
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