Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
2473756a
Commit
2473756a
authored
Sep 29, 2022
by
Marcus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建客户-联系人信息为必填,现在不填手机号也可以新增成功
http://zentao.jdshangmen.com/bug-view-400.html
parent
80860a7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
2 deletions
+43
-2
validate.js
src/api/ecw/validate.js
+10
-0
request.js
src/utils/request.js
+1
-1
edit.vue
src/views/ecw/customer/edit.vue
+32
-1
No files found.
src/api/ecw/validate.js
0 → 100644
View file @
2473756a
import
request
from
'
@/utils/request
'
// 校验手机号
export
function
validatorMobile
(
params
)
{
return
request
({
url
:
'
/param/validator/mobile
'
,
method
:
'
post
'
,
params
})
}
src/utils/request.js
View file @
2473756a
...
...
@@ -107,7 +107,7 @@ service.interceptors.response.use(res => {
Notification
.
error
({
title
:
msg
})
return
Promise
.
reject
(
'
error
'
)
return
Promise
.
reject
(
msg
||
'
error
'
)
}
else
{
return
res
.
data
}
...
...
src/views/ecw/customer/edit.vue
View file @
2473756a
...
...
@@ -417,6 +417,7 @@ import { getZhongPaoBest, getZhongPaoPage } from '@/api/ecw/zhongPao'
import
{
getCustomerContactsListByCustomer
}
from
'
@/api/ecw/customerContacts
'
import
{
getCountryListAll
}
from
'
@/api/ecw/country
'
import
Template
from
"
@/views/cms/template
"
;
import
{
validatorMobile
}
from
"
@/api/ecw/validate
"
export
default
{
name
:
"
edit
"
,
...
...
@@ -436,6 +437,10 @@ export default {
this
.
form
.
customerContacts
=
r
.
data
})
})
}
else
{
const
obj
=
Object
.
assign
({},
this
.
$route
,
{
title
:
"
自定义标题
"
})
this
.
$tab
.
updatePage
(
obj
);
this
.
$tab
.
updatePage
({...
this
.
$route
,
meta
:
{...
this
.
$route
.
meta
,
name
:
'
abc
'
}})
}
getNodeList
().
then
(
r
=>
{
...
...
@@ -492,7 +497,11 @@ export default {
contactRules
:
{
name
:
[{
required
:
true
,
message
:
"
请输入联系人
"
,
trigger
:
"
blur
"
}],
areaCode
:
[{
required
:
true
,
message
:
"
请选择区号
"
,
trigger
:
"
change
"
}],
phoneNew
:
[{
required
:
true
,
message
:
"
请输入联系方式
"
,
trigger
:
"
blur
"
}],
phoneNew
:
[{
required
:
true
,
trigger
:
"
blur
"
,
validator
:
this
.
phoneValidator
}],
},
// 网点
nodeList
:
[],
...
...
@@ -515,6 +524,24 @@ export default {
},
methods
:
{
phoneValidator
(
rule
,
value
,
callback
){
if
(
!
value
)
{
return
callback
(
new
Error
(
'
请输入联系方式
'
));
}
validatorMobile
({
code
:
this
.
form
.
customerContacts
.
find
(
e
=>
e
.
phoneNew
===
value
).
areaCode
,
mobile
:
value
}).
then
(
r
=>
{
if
(
r
.
data
){
callback
()
}
else
{
callback
(
new
Error
(
r
.
msg
||
'
手机号验证失败
'
))
}
}).
catch
(
e
=>
{
console
.
error
(
e
)
callback
(
new
Error
(
'
手机号验证失败
'
))
})
},
handleDefaultChange
(
$index
){
// 只有一个联系人,设置成非默认
if
(
this
.
form
.
customerContacts
.
length
===
1
&&
this
.
form
.
customerContacts
[
0
].
isDefault
===
0
){
...
...
@@ -549,6 +576,10 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
if
(
this
.
form
.
customerContacts
.
length
===
0
){
this
.
$modal
.
alert
(
'
至少添加一位联系人
'
)
return
}
this
.
$refs
[
"
contactForm
"
].
validate
(
valid1
=>
{
this
.
$refs
[
"
form
"
].
validate
(
valid2
=>
{
if
(
!
valid1
||
!
valid2
)
{
...
...
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