Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quasar-web-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Nguyễn Hải Sơn
quasar-web-base
Commits
a7d22a86
Commit
a7d22a86
authored
May 04, 2022
by
Nguyễn Đức Thắng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update AddArtist.ts
parent
a7ebee48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
88 deletions
+88
-88
AddArtist.ts
src/pages/them-nghe-sy/AddArtist.ts
+88
-88
No files found.
src/pages/them-nghe-sy/AddArtist.ts
View file @
a7d22a86
...
...
@@ -656,95 +656,95 @@ export default defineComponent({
}
catch
(
error
)
{}
};
const
checkValidate
=
()
=>
{
//
let hasError = false;
//
if (!avatarFile.value) {
//
hasError = true;
//
hidden_img.value = true;
//
}
//
if (!artistCode.value || !artistCode.value?.trim().length) {
//
hasError = true;
//
artistCodeRules.value = true;
//
}
//
if (!fullName.value || !fullName.value?.trim().length) {
//
hasError = true;
//
fullNameRules.value = true;
//
}
//
if (!artistName.value || !artistName.value?.trim().length) {
//
hasError = true;
//
artistNameRules.value = true;
//
}
//
if (address.value) {
//
hasError = true;
//
addressRules.value = true;
//
}
//
if (!birthday.value || !birthday.value?.trim().length) {
//
hasError = true;
//
birthdayRules.value = true;
//
}
//
if (sex.value === null) {
//
hasError = true;
//
sexRules.value = true;
//
}
//
if (!phoneNumber.value || !phoneNumber.value?.trim().length) {
//
hasError = true;
//
phoneNumberRules.value = true;
//
errorMessPhoneNumber.value = i18n.global.t(
//
'artist.artistInformation.validateMessages.requirePhoneNumber'
//
);
//
}
//
if (!email.value || !email.value?.trim().length) {
//
hasError = true;
//
emailRules.value = true;
//
errorMessEmail.value = i18n.global.t(
//
'artist.artistInformation.validateMessages.requireEmail'
//
);
//
}
//
if (
//
(!mnBookingPhone.value || !mnBookingPhone.value?.trim().length) &&
//
check_infoBooking.value
//
) {
//
hasError = true;
//
mnBookingPhoneRules.value = true;
//
errorMessmnBookingPhone.value = i18n.global.t(
//
'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
//
);
//
}
//
if (
//
(!mnBookingEmail.value || !mnBookingEmail.value?.trim().length) &&
//
check_infoBooking.value
//
) {
//
hasError = true;
//
mnBookingEmailRules.value = true;
//
errorMessmnBookingEmail.value = i18n.global.t(
//
'artist.artistInformation.validateMessages.requireEmailAdminister'
//
);
//
}
//
if (artistLevel.value === null) {
//
hasError = true;
//
artistLevelRules.value = true;
//
}
//
if (!fields.value) {
//
hasError = true;
//
fieldRules.value = true;
//
}
//
if (nationality.value === null) {
//
hasError = true;
//
nationalityRules.value = true;
//
}
//
if (qualification.value === null) {
//
hasError = true;
//
qualificationRules.value = true;
//
}
//
if (!works.value.length) {
//
hasError = true;
//
workRules.value = true;
//
}
//
if (hasError === false) {
let
hasError
=
false
;
if
(
!
avatarFile
.
value
)
{
hasError
=
true
;
hidden_img
.
value
=
true
;
}
if
(
!
artistCode
.
value
||
!
artistCode
.
value
?.
trim
().
length
)
{
hasError
=
true
;
artistCodeRules
.
value
=
true
;
}
if
(
!
fullName
.
value
||
!
fullName
.
value
?.
trim
().
length
)
{
hasError
=
true
;
fullNameRules
.
value
=
true
;
}
if
(
!
artistName
.
value
||
!
artistName
.
value
?.
trim
().
length
)
{
hasError
=
true
;
artistNameRules
.
value
=
true
;
}
if
(
address
.
value
)
{
hasError
=
true
;
addressRules
.
value
=
true
;
}
if
(
!
birthday
.
value
||
!
birthday
.
value
?.
trim
().
length
)
{
hasError
=
true
;
birthdayRules
.
value
=
true
;
}
if
(
sex
.
value
===
null
)
{
hasError
=
true
;
sexRules
.
value
=
true
;
}
if
(
!
phoneNumber
.
value
||
!
phoneNumber
.
value
?.
trim
().
length
)
{
hasError
=
true
;
phoneNumberRules
.
value
=
true
;
errorMessPhoneNumber
.
value
=
i18n
.
global
.
t
(
'artist.artistInformation.validateMessages.requirePhoneNumber'
);
}
if
(
!
email
.
value
||
!
email
.
value
?.
trim
().
length
)
{
hasError
=
true
;
emailRules
.
value
=
true
;
errorMessEmail
.
value
=
i18n
.
global
.
t
(
'artist.artistInformation.validateMessages.requireEmail'
);
}
if
(
(
!
mnBookingPhone
.
value
||
!
mnBookingPhone
.
value
?.
trim
().
length
)
&&
check_infoBooking
.
value
)
{
hasError
=
true
;
mnBookingPhoneRules
.
value
=
true
;
errorMessmnBookingPhone
.
value
=
i18n
.
global
.
t
(
'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
);
}
if
(
(
!
mnBookingEmail
.
value
||
!
mnBookingEmail
.
value
?.
trim
().
length
)
&&
check_infoBooking
.
value
)
{
hasError
=
true
;
mnBookingEmailRules
.
value
=
true
;
errorMessmnBookingEmail
.
value
=
i18n
.
global
.
t
(
'artist.artistInformation.validateMessages.requireEmailAdminister'
);
}
if
(
artistLevel
.
value
===
null
)
{
hasError
=
true
;
artistLevelRules
.
value
=
true
;
}
if
(
!
fields
.
value
)
{
hasError
=
true
;
fieldRules
.
value
=
true
;
}
if
(
nationality
.
value
===
null
)
{
hasError
=
true
;
nationalityRules
.
value
=
true
;
}
if
(
qualification
.
value
===
null
)
{
hasError
=
true
;
qualificationRules
.
value
=
true
;
}
if
(
!
works
.
value
.
length
)
{
hasError
=
true
;
workRules
.
value
=
true
;
}
if
(
hasError
===
false
)
{
void
addArtist
();
//
}
}
};
const
addArtist
=
async
()
=>
{
try
{
...
...
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