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
41efa714
Commit
41efa714
authored
Sep 16, 2022
by
黄卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建客户,至少填写一个联系人信息
http://zentao.jdshangmen.com/bug-view-8.html
parent
6fc8b14b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
44 deletions
+29
-44
edit.vue
src/views/ecw/customer/edit.vue
+29
-44
No files found.
src/views/ecw/customer/edit.vue
View file @
41efa714
...
...
@@ -548,39 +548,35 @@ export default {
},
/** 提交按钮 */
submitForm
()
{
// this.$refs["contactForm"].validate(valid => {
// if (!valid) {
// return;
// }
// // todo
// console.log(1)
// })
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
!
valid
)
{
return
;
}
if
(
this
.
form
.
customerContacts
.
length
===
0
){
this
.
$modal
.
msgError
(
"
至少填写一个联系人信息
"
);
return
}
else
{
this
.
form
.
customerContacts
.
forEach
(
e
=>
{
if
(
!
e
.
name
)
{
this
.
$modal
.
msgWarning
(
'
请输入联系人
'
)
}
else
if
(
!
e
.
areaCode
)
{
this
.
$modal
.
msgWarning
(
'
请选择区号
'
)
}
else
if
(
!
e
.
phoneNew
)
{
this
.
$modal
.
msgWarning
(
'
请输入联系方式
'
)
}
})
}
// 修改的提交
if
(
this
.
form
.
id
!=
null
)
{
this
.
form
.
customerContacts
.
forEach
(
e
=>
{
e
.
customerId
=
this
.
customerId
})
this
.
$refs
[
"
contactForm
"
].
validate
(
valid1
=>
{
this
.
$refs
[
"
form
"
].
validate
(
valid2
=>
{
if
(
!
valid1
||
!
valid2
)
{
return
;
}
if
(
this
.
form
.
customerContacts
.
length
===
0
){
this
.
$modal
.
msgError
(
"
至少填写一个联系人信息
"
);
return
}
// 修改的提交
if
(
this
.
form
.
id
!=
null
)
{
this
.
form
.
customerContacts
.
forEach
(
e
=>
{
e
.
customerId
=
this
.
customerId
})
updateCustomer
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
updateCustomer
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
// this.getList();
const
obj
=
{
path
:
"
/customer/customer
"
};
this
.
$tab
.
closeOpenPage
(
obj
);
}).
catch
(
e
=>
{
this
.
$modal
.
msgError
(
e
.
msg
||
'
添加客户失败,请联系管理员
'
)
});
return
;
}
// 添加的提交
createCustomer
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
// this.getList();
const
obj
=
{
path
:
"
/customer/customer
"
};
...
...
@@ -588,19 +584,8 @@ export default {
}).
catch
(
e
=>
{
this
.
$modal
.
msgError
(
e
.
msg
||
'
添加客户失败,请联系管理员
'
)
});
return
;
}
// 添加的提交
createCustomer
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
// this.getList();
const
obj
=
{
path
:
"
/customer/customer
"
};
this
.
$tab
.
closeOpenPage
(
obj
);
}).
catch
(
e
=>
{
this
.
$modal
.
msgError
(
e
.
msg
||
'
添加客户失败,请联系管理员
'
)
});
})
;
})
},
/** 表单重置 */
reset
()
{
...
...
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