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
562a4487
Commit
562a4487
authored
May 11, 2021
by
Võ Quang Thành Đạt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b0abc23e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
21 deletions
+89
-21
type.ts
src/assets/type.ts
+1
-1
AddNewCustomerDialog.ts
.../customer/add-new-customer-dialog/AddNewCustomerDialog.ts
+80
-19
index.ts
src/i18n/vi/index.ts
+5
-0
customer.ts
src/pages/khach-hang/customer.ts
+1
-1
index.vue
src/pages/khach-hang/index.vue
+1
-0
artist.ts
src/pages/nghe-sy/artist.ts
+1
-0
No files found.
src/assets/type.ts
View file @
562a4487
...
@@ -229,7 +229,7 @@ export type DetailUnit = {
...
@@ -229,7 +229,7 @@ export type DetailUnit = {
export
type
CustomerType
=
{
export
type
CustomerType
=
{
id
:
number
;
id
:
number
;
code
:
string
;
code
:
string
|
null
;
userName
:
string
;
userName
:
string
;
fullName
:
string
;
fullName
:
string
;
companyName
:
string
;
companyName
:
string
;
...
...
src/components/customer/add-new-customer-dialog/AddNewCustomerDialog.ts
View file @
562a4487
...
@@ -2,7 +2,8 @@ import { defineComponent, PropType, Ref, ref, watch } from 'vue';
...
@@ -2,7 +2,8 @@ import { defineComponent, PropType, Ref, ref, watch } from 'vue';
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
isEmail
}
from
'../../../boot/functions'
;
import
{
isEmail
}
from
'../../../boot/functions'
;
import
{
isMobilePhone
}
from
'../../../boot/functions'
;
import
{
isMobilePhone
}
from
'../../../boot/functions'
;
import
{
CustomerLevelType
}
from
'src/assets/type'
;
import
{
CustomerLevelType
,
CustomerType
}
from
'src/assets/type'
;
import
{
Notify
}
from
'quasar'
;
export
default
defineComponent
({
export
default
defineComponent
({
props
:
{
props
:
{
...
@@ -14,6 +15,10 @@ export default defineComponent({
...
@@ -14,6 +15,10 @@ export default defineComponent({
type
:
Array
as
PropType
<
CustomerLevelType
[]
>
,
type
:
Array
as
PropType
<
CustomerLevelType
[]
>
,
required
:
true
,
required
:
true
,
},
},
listCustomers
:
{
type
:
Array
as
PropType
<
CustomerType
[]
>
,
required
:
true
,
},
},
},
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
watch
(
watch
(
...
@@ -30,7 +35,7 @@ export default defineComponent({
...
@@ -30,7 +35,7 @@ export default defineComponent({
const
companyName
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
companyName
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
taxCode
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
taxCode
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
email
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
email
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
status
:
Ref
<
number
|
null
>
=
ref
(
2
);
const
status
:
Ref
<
number
|
null
>
=
ref
(
1
);
const
phone
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
phone
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
password
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
password
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
address
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
address
:
Ref
<
string
|
null
>
=
ref
(
null
);
...
@@ -40,22 +45,78 @@ export default defineComponent({
...
@@ -40,22 +45,78 @@ export default defineComponent({
const
level
:
Ref
<
CustomerLevelType
|
null
>
=
ref
(
null
);
const
level
:
Ref
<
CustomerLevelType
|
null
>
=
ref
(
null
);
const
confirmAddCustomer
=
()
=>
{
const
confirmAddCustomer
=
()
=>
{
context
.
emit
(
'addNewCustomer'
,
{
let
hasError
=
false
;
code
:
code
.
value
,
userName
:
userName
.
value
,
if
(
fullName
:
fullName
.
value
,
props
.
listCustomers
.
filter
((
customer
)
=>
customer
.
code
===
code
.
value
)
companyName
:
companyName
.
value
,
.
length
taxCode
:
taxCode
.
value
,
)
{
email
:
email
.
value
,
hasError
=
true
;
status
:
status
.
value
,
Notify
.
create
({
phone
:
phone
.
value
,
type
:
'negative'
,
password
:
password
.
value
,
message
:
i18n
.
global
.
t
(
'customer.validateMessages.codeExists'
),
address
:
address
.
value
,
});
type
:
type
.
value
,
}
representative
:
representative
.
value
,
if
(
position
:
position
.
value
,
props
.
listCustomers
.
filter
(
level
:
level
.
value
,
(
customer
)
=>
customer
.
userName
===
userName
.
value
});
).
length
)
{
hasError
=
true
;
Notify
.
create
({
type
:
'negative'
,
message
:
i18n
.
global
.
t
(
'customer.validateMessages.userNameExists'
),
});
}
if
(
props
.
listCustomers
.
filter
(
(
customer
)
=>
customer
.
taxCode
===
taxCode
.
value
).
length
)
{
hasError
=
true
;
Notify
.
create
({
type
:
'negative'
,
message
:
i18n
.
global
.
t
(
'customer.validateMessages.taxCodeExists'
),
});
}
if
(
props
.
listCustomers
.
filter
((
customer
)
=>
customer
.
email
===
email
.
value
)
.
length
)
{
hasError
=
true
;
Notify
.
create
({
type
:
'negative'
,
message
:
i18n
.
global
.
t
(
'customer.validateMessages.emailExists'
),
});
}
if
(
props
.
listCustomers
.
filter
((
customer
)
=>
customer
.
phone
===
phone
.
value
)
.
length
)
{
hasError
=
true
;
Notify
.
create
({
type
:
'negative'
,
message
:
i18n
.
global
.
t
(
'customer.validateMessages.phoneExists'
),
});
}
if
(
!
hasError
)
{
context
.
emit
(
'addNewCustomer'
,
{
code
:
code
.
value
,
userName
:
userName
.
value
,
fullName
:
fullName
.
value
,
companyName
:
companyName
.
value
,
taxCode
:
taxCode
.
value
,
email
:
email
.
value
,
status
:
status
.
value
,
phone
:
phone
.
value
,
password
:
password
.
value
,
address
:
address
.
value
,
type
:
type
.
value
,
representative
:
representative
.
value
,
position
:
position
.
value
,
level
:
level
.
value
,
});
}
};
};
const
resetData
=
()
=>
{
const
resetData
=
()
=>
{
code
.
value
=
null
;
code
.
value
=
null
;
...
@@ -64,7 +125,7 @@ export default defineComponent({
...
@@ -64,7 +125,7 @@ export default defineComponent({
companyName
.
value
=
null
;
companyName
.
value
=
null
;
taxCode
.
value
=
null
;
taxCode
.
value
=
null
;
email
.
value
=
null
;
email
.
value
=
null
;
status
.
value
=
2
;
status
.
value
=
1
;
phone
.
value
=
null
;
phone
.
value
=
null
;
password
.
value
=
null
;
password
.
value
=
null
;
address
.
value
=
null
;
address
.
value
=
null
;
...
...
src/i18n/vi/index.ts
View file @
562a4487
...
@@ -344,6 +344,11 @@ export default {
...
@@ -344,6 +344,11 @@ export default {
cancel
:
'Đóng'
,
cancel
:
'Đóng'
,
},
},
validateMessages
:
{
validateMessages
:
{
codeExists
:
'Mã khách hàng đã tồn tại'
,
userNameExists
:
'Tên đăng nhập đã tồn tại'
,
taxCodeExists
:
'Mã số thuế đã tồn tại'
,
emailExists
:
'Email đã tồn tại'
,
phoneExists
:
'Số điện thoại đã tồn tại'
,
requireUserName
:
'Vui lòng nhập Tên đăng nhập'
,
requireUserName
:
'Vui lòng nhập Tên đăng nhập'
,
requirePassword
:
'Vui lòng nhập Mật khẩu'
,
requirePassword
:
'Vui lòng nhập Mật khẩu'
,
requireCode
:
'Vui lòng nhập Mã khách hàng'
,
requireCode
:
'Vui lòng nhập Mã khách hàng'
,
...
...
src/pages/khach-hang/customer.ts
View file @
562a4487
...
@@ -109,7 +109,7 @@ export default defineComponent({
...
@@ -109,7 +109,7 @@ export default defineComponent({
sortable
:
false
,
sortable
:
false
,
},
},
];
];
const
userTableRowsCustomer
:
Ref
<
unknown
[]
>
=
ref
([]);
const
userTableRowsCustomer
:
Ref
<
CustomerType
[]
>
=
ref
([]);
const
showDialog
=
ref
(
false
);
const
showDialog
=
ref
(
false
);
const
showDialogUpdate
=
ref
(
false
);
const
showDialogUpdate
=
ref
(
false
);
const
pageIndex
=
ref
(
1
);
const
pageIndex
=
ref
(
1
);
...
...
src/pages/khach-hang/index.vue
View file @
562a4487
...
@@ -129,6 +129,7 @@
...
@@ -129,6 +129,7 @@
<AddNewCustomerDialogComponent
<AddNewCustomerDialogComponent
v-model:show-dialog=
"showDialog"
v-model:show-dialog=
"showDialog"
:level-options=
"levelOptions"
:level-options=
"levelOptions"
:list-customers=
"userTableRowsCustomer"
@
click:CloseBtn=
"showDialog = false"
@
click:CloseBtn=
"showDialog = false"
@
addNewCustomer=
"addCustomer"
@
addNewCustomer=
"addCustomer"
></AddNewCustomerDialogComponent>
></AddNewCustomerDialogComponent>
...
...
src/pages/nghe-sy/artist.ts
View file @
562a4487
...
@@ -158,6 +158,7 @@ export default defineComponent({
...
@@ -158,6 +158,7 @@ export default defineComponent({
params
:
{
params
:
{
pageIndex
:
pageIndex
.
value
,
pageIndex
:
pageIndex
.
value
,
pageSize
:
pageSize
.
value
,
pageSize
:
pageSize
.
value
,
name
:
fullNameKeyword
.
value
,
qualification
:
fieldSelected
.
value
?.
id
,
qualification
:
fieldSelected
.
value
?.
id
,
artistLevel
:
professionSelected
.
value
?.
id
,
artistLevel
:
professionSelected
.
value
?.
id
,
field
:
artistLevelSelected
.
value
?.
id
,
field
:
artistLevelSelected
.
value
?.
id
,
...
...
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