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
77374798
Commit
77374798
authored
Apr 10, 2023
by
Nguyễn Đức Thắng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
218c6c4b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
17 deletions
+46
-17
functions.ts
src/boot/functions.ts
+13
-1
addFinedAmount.vue
src/components/booking/addFinedAmount.vue
+11
-4
listFinedAmount.vue
src/components/booking/listFinedAmount.vue
+1
-1
updateBooking.vue
src/components/booking/updateBooking.vue
+9
-4
updateFinedAmount.vue
src/components/booking/updateFinedAmount.vue
+11
-6
MenuItem.ts
src/components/menu-list/menu-item/MenuItem.ts
+1
-1
No files found.
src/boot/functions.ts
View file @
77374798
...
@@ -69,6 +69,17 @@ const formatMoney = (str: { amount: string }) => {
...
@@ -69,6 +69,17 @@ const formatMoney = (str: { amount: string }) => {
}
}
};
};
const
formatMoneyv2
=
(
str
:
{
amount
:
string
})
=>
{
try
{
return
str
==
null
||
str
.
amount
==
null
?
''
:
str
.
amount
.
toString
()
.
replace
(
/
\D
/g
,
''
)
.
replace
(
/
\B(?=(\d{3})
+
(?!\d))
/g
,
','
);
}
catch
(
e
)
{}
};
const
isNullOrEmpty
=
(
str
:
any
)
=>
{
const
isNullOrEmpty
=
(
str
:
any
)
=>
{
return
(
return
(
str
===
null
||
str
===
null
||
...
@@ -86,4 +97,5 @@ export {
...
@@ -86,4 +97,5 @@ export {
isHasVietnamese
,
isHasVietnamese
,
formatMoney
,
formatMoney
,
isNullOrEmpty
,
isNullOrEmpty
,
formatMoneyv2
,
};
};
src/components/booking/addFinedAmount.vue
View file @
77374798
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
hide-bottom-space
hide-bottom-space
dense
dense
:rules=
"errorMoney"
:rules=
"errorMoney"
@
update:model-value=
"(value) => checkValuePrice(value)"
label=
"Số tiền *"
label=
"Số tiền *"
/>
/>
</div>
</div>
...
@@ -61,6 +62,7 @@ import { Dialog, Notify } from 'quasar';
...
@@ -61,6 +62,7 @@ import { Dialog, Notify } from 'quasar';
import
{
API_PATHS
,
config
}
from
'src/assets/configurations.example'
;
import
{
API_PATHS
,
config
}
from
'src/assets/configurations.example'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
formatMoneyv2
,
formatMoney
}
from
'src/boot/functions'
;
import
{
ListBooking
}
from
'src/assets/type'
;
import
{
ListBooking
}
from
'src/assets/type'
;
export
default
defineComponent
({
export
default
defineComponent
({
...
@@ -77,7 +79,7 @@ export default defineComponent({
...
@@ -77,7 +79,7 @@ export default defineComponent({
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
const
content
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
content
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
money
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
money
:
Ref
<
string
|
undefined
>
=
ref
(
undefined
);
const
errorMoney
=
[
const
errorMoney
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
'Vui lòng nhập số tiền'
,
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
'Vui lòng nhập số tiền'
,
...
@@ -91,8 +93,7 @@ export default defineComponent({
...
@@ -91,8 +93,7 @@ export default defineComponent({
(
value
)
=>
{
(
value
)
=>
{
if
(
value
)
{
if
(
value
)
{
content
.
value
=
null
;
content
.
value
=
null
;
money
.
value
=
null
;
money
.
value
=
undefined
;
}
}
}
}
);
);
...
@@ -106,7 +107,7 @@ export default defineComponent({
...
@@ -106,7 +107,7 @@ export default defineComponent({
artistBooking
:
{
artistBooking
:
{
id
:
props
.
data
.
id
,
id
:
props
.
data
.
id
,
},
},
fee
:
money
.
value
,
fee
:
money
.
value
?.
replace
(
/,/g
,
''
)
,
reason
:
content
.
value
,
reason
:
content
.
value
,
},
},
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
...
@@ -126,10 +127,16 @@ export default defineComponent({
...
@@ -126,10 +127,16 @@ export default defineComponent({
context
.
emit
(
'toggle'
);
context
.
emit
(
'toggle'
);
};
};
const
checkValuePrice
=
(
value
:
string
)
=>
{
money
.
value
=
formatMoneyv2
({
amount
:
value
});
};
return
{
return
{
//
//
closeDialog
,
closeDialog
,
confirmAdd
,
confirmAdd
,
checkValuePrice
,
// formatNumber,
//
//
money
,
money
,
errorMoney
,
errorMoney
,
...
...
src/components/booking/listFinedAmount.vue
View file @
77374798
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<template
v-slot:body-cell-artistName=
"item"
>
<template
v-slot:body-cell-artistName=
"item"
>
<td
style=
"text-align: center"
>
<td
style=
"text-align: center"
>
<div>
{{
item
.
row
.
artistBooking
.
artistName
}}
</div>
<div>
{{
item
.
row
.
artistBooking
.
artistName
}}
</div>
<div>
SĐT:
{{
item
.
row
.
artistBooking
.
artistName
}}
</div>
<div>
SĐT:
{{
item
.
row
.
artistBooking
.
phoneArtist
}}
</div>
</td>
</td>
</
template
>
</
template
>
<
template
v-slot:body-cell-bookingRandomCode=
"item"
>
<
template
v-slot:body-cell-bookingRandomCode=
"item"
>
...
...
src/components/booking/updateBooking.vue
View file @
77374798
...
@@ -159,6 +159,7 @@
...
@@ -159,6 +159,7 @@
dense
dense
type=
"text"
type=
"text"
label=
"Số tiền"
label=
"Số tiền"
@
update:model-value=
"(value) => checkValuePrice(value)"
/>
/>
</div>
</div>
...
@@ -211,7 +212,7 @@ import { Dialog, Notify } from 'quasar';
...
@@ -211,7 +212,7 @@ import { Dialog, Notify } from 'quasar';
import
{
API_PATHS
,
config
}
from
'src/assets/configurations.example'
;
import
{
API_PATHS
,
config
}
from
'src/assets/configurations.example'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
formatMoneyv2
}
from
'src/boot/functions'
;
import
{
ListBooking
}
from
'src/assets/type'
;
import
{
ListBooking
}
from
'src/assets/type'
;
export
default
defineComponent
({
export
default
defineComponent
({
props
:
{
props
:
{
...
@@ -231,7 +232,7 @@ export default defineComponent({
...
@@ -231,7 +232,7 @@ export default defineComponent({
const
contractTimeFrom
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
contractTimeFrom
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
contractTimeTo
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
contractTimeTo
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
email
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
email
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
money
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
money
:
Ref
<
string
|
undefined
>
=
ref
(
undefined
);
const
location
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
location
:
Ref
<
string
|
null
>
=
ref
(
null
);
watch
(
watch
(
...
@@ -249,7 +250,7 @@ export default defineComponent({
...
@@ -249,7 +250,7 @@ export default defineComponent({
contractTimeFrom
.
value
=
props
.
data
.
fromTime
;
contractTimeFrom
.
value
=
props
.
data
.
fromTime
;
contractTimeTo
.
value
=
props
.
data
.
toTime
;
contractTimeTo
.
value
=
props
.
data
.
toTime
;
email
.
value
=
props
.
data
.
customerDto
.
email
;
email
.
value
=
props
.
data
.
customerDto
.
email
;
money
.
value
=
props
.
data
.
expectFee
;
money
.
value
=
formatMoneyv2
({
amount
:
props
.
data
.
expectFee
})
;
location
.
value
=
props
.
data
.
address
;
location
.
value
=
props
.
data
.
address
;
};
};
...
@@ -263,7 +264,7 @@ export default defineComponent({
...
@@ -263,7 +264,7 @@ export default defineComponent({
status
:
1
,
status
:
1
,
address
:
location
.
value
,
address
:
location
.
value
,
content
:
content
.
value
,
content
:
content
.
value
,
expectFee
:
money
.
value
,
expectFee
:
money
.
value
?.
replace
(
/,/g
,
''
)
,
fromTime
:
contractTimeFrom
.
value
,
fromTime
:
contractTimeFrom
.
value
,
toTime
:
contractTimeTo
.
value
,
toTime
:
contractTimeTo
.
value
,
email
:
email
.
value
,
email
:
email
.
value
,
...
@@ -294,10 +295,14 @@ export default defineComponent({
...
@@ -294,10 +295,14 @@ export default defineComponent({
// (val?: string) => (val && val.trim().length) || 'Vui lòng nhập nội dung',
// (val?: string) => (val && val.trim().length) || 'Vui lòng nhập nội dung',
// ];
// ];
const
checkValuePrice
=
(
value
:
string
)
=>
{
money
.
value
=
formatMoneyv2
({
amount
:
value
});
};
return
{
return
{
//
//
closeDialog
,
closeDialog
,
confirmAdd
,
confirmAdd
,
checkValuePrice
,
//
//
money
,
money
,
content
,
content
,
...
...
src/components/booking/updateFinedAmount.vue
View file @
77374798
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
dense
dense
type=
"text"
type=
"text"
:rules=
"errorMoney"
:rules=
"errorMoney"
@
update:model-value=
"(value) => checkValuePrice(value)"
label=
"Số tiền *"
label=
"Số tiền *"
/>
/>
</div>
</div>
...
@@ -62,7 +63,7 @@ import { Dialog, Notify } from 'quasar';
...
@@ -62,7 +63,7 @@ import { Dialog, Notify } from 'quasar';
import
{
API_PATHS
,
config
}
from
'src/assets/configurations.example'
;
import
{
API_PATHS
,
config
}
from
'src/assets/configurations.example'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
formatMoneyv2
}
from
'src/boot/functions'
;
import
{
ListBooking
,
ListFinedAmount
}
from
'src/assets/type'
;
import
{
ListBooking
,
ListFinedAmount
}
from
'src/assets/type'
;
export
default
defineComponent
({
export
default
defineComponent
({
props
:
{
props
:
{
...
@@ -82,14 +83,14 @@ export default defineComponent({
...
@@ -82,14 +83,14 @@ export default defineComponent({
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
const
content
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
content
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
money
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
money
:
Ref
<
string
|
undefined
>
=
ref
(
undefined
);
watch
(
watch
(
()
=>
props
.
open
,
()
=>
props
.
open
,
(
value
)
=>
{
(
value
)
=>
{
if
(
value
)
{
if
(
value
)
{
content
.
value
=
props
.
dataItem
.
reason
;
content
.
value
=
props
.
dataItem
.
reason
;
money
.
value
=
props
.
dataItem
.
fee
;
money
.
value
=
formatMoneyv2
({
amount
:
props
.
dataItem
.
fee
})
;
}
}
}
}
);
);
...
@@ -104,7 +105,7 @@ export default defineComponent({
...
@@ -104,7 +105,7 @@ export default defineComponent({
artistBooking
:
{
artistBooking
:
{
id
:
props
.
data
.
id
,
id
:
props
.
data
.
id
,
},
},
fee
:
money
.
value
,
fee
:
money
.
value
?.
replace
(
/,/g
,
''
)
,
reason
:
content
.
value
,
reason
:
content
.
value
,
},
},
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
...
@@ -123,6 +124,9 @@ export default defineComponent({
...
@@ -123,6 +124,9 @@ export default defineComponent({
const
closeDialog
=
()
=>
{
const
closeDialog
=
()
=>
{
context
.
emit
(
'toggle'
);
context
.
emit
(
'toggle'
);
};
};
const
checkValuePrice
=
(
value
:
string
)
=>
{
money
.
value
=
formatMoneyv2
({
amount
:
value
});
};
// const errorMoney = [
// const errorMoney = [
// (val?: string) => (val && val.trim().length) || 'Vui lòng nhập số tiền',
// (val?: string) => (val && val.trim().length) || 'Vui lòng nhập số tiền',
...
@@ -136,6 +140,7 @@ export default defineComponent({
...
@@ -136,6 +140,7 @@ export default defineComponent({
//
//
closeDialog
,
closeDialog
,
confirmAdd
,
confirmAdd
,
checkValuePrice
,
//
//
money
,
money
,
content
,
content
,
...
...
src/components/menu-list/menu-item/MenuItem.ts
View file @
77374798
...
@@ -10,7 +10,7 @@ export const MenuItemScript = defineComponent({
...
@@ -10,7 +10,7 @@ export const MenuItemScript = defineComponent({
},
},
},
},
setup
(
props
)
{
setup
(
props
)
{
console
.
log
(
props
.
item
,
'props'
);
const
$route
=
useRoute
();
const
$route
=
useRoute
();
const
isActive
=
computed
(()
=>
{
const
isActive
=
computed
(()
=>
{
return
(
return
(
...
...
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