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
d9f6bfde
Commit
d9f6bfde
authored
May 07, 2021
by
Tình Trương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update index.vue
parent
0f5d4a9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
17 deletions
+73
-17
index.vue
src/pages/don-vi-chu-quan/index.vue
+73
-17
No files found.
src/pages/don-vi-chu-quan/index.vue
View file @
d9f6bfde
...
...
@@ -57,7 +57,13 @@
>
<template
v-slot:body-cell-action=
"item"
>
<q-td
style=
"padding: 0"
class=
"flex flex-center"
>
<q-btn
flat
round
color=
"primary"
icon=
"mdi-account-edit-outline"
>
<q-btn
flat
round
color=
"primary"
icon=
"mdi-account-edit-outline"
@
click=
"openUpdateUnitDialog()"
>
<q-tooltip
:offset=
"[20, 10]"
>
{{
$t
(
'managingUnit.toolTipMessage.updateInfo'
)
}}
</q-tooltip>
...
...
@@ -118,6 +124,21 @@
v-model:artistList=
"unitArtistList"
@
addNewUnit=
"addNewUnit"
/>
<AddUpdateUnitDialog
v-model:isOpened=
"updateUnitDialogIsOpened"
v-model:address=
"unitAddress"
v-model:code=
"unitCode"
v-model:email=
"unitEmail"
v-model:fields=
"unitField"
v-model:fieldsOptions=
"fieldsOptions"
v-model:name=
"unitName"
v-model:phoneNumber=
"unitPhoneNumber"
v-model:representative=
"unitRepresentative"
v-model:status=
"unitStatus"
v-model:artistList=
"unitArtistList"
@
updateNewUnit=
"updateNewUnit"
/>
</div>
</template>
...
...
@@ -129,7 +150,12 @@ import { Dialog, Notify } from 'quasar';
import
{
API_PATHS
}
from
'src/assets/configurations.example'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
PaginationResponse
,
ArtistOwner
,
FieldType
}
from
'src/assets/type'
;
import
{
PaginationResponse
,
ArtistOwner
,
FieldType
,
ArtistOwnerAdd
,
}
from
'src/assets/type'
;
import
{
config
}
from
'src/assets/configurations'
;
import
AddUpdateUnitDialog
from
'components/units-manager/add-update-unit-dialog/index.vue'
;
...
...
@@ -232,6 +258,7 @@ export default defineComponent({
const
totalPage
=
ref
(
1
);
const
fieldSelected
:
Ref
<
number
|
undefined
>
=
ref
();
const
addUnitDialogIsOpened
=
ref
(
false
);
const
updateUnitDialogIsOpened
=
ref
(
false
);
const
unitField
=
ref
(
undefined
);
const
unitCode
=
ref
(
''
);
const
unitName
=
ref
(
''
);
...
...
@@ -239,7 +266,7 @@ export default defineComponent({
const
unitEmail
=
ref
(
''
);
const
unitAddress
=
ref
(
''
);
const
unitPhoneNumber
=
ref
(
''
);
const
unitStatus
=
ref
(
''
);
const
unitStatus
:
Ref
<
boolean
|
number
>
=
ref
(
true
);
const
unitArtistList
:
Ref
<
unknown
[]
>
=
ref
([]);
const
getListUnits
=
async
()
=>
{
...
...
@@ -267,10 +294,22 @@ export default defineComponent({
unitEmail
.
value
=
''
;
unitAddress
.
value
=
''
;
unitPhoneNumber
.
value
=
''
;
unitStatus
.
value
=
''
;
unitStatus
.
value
=
true
;
addUnitDialogIsOpened
.
value
=
true
;
};
const
openUpdateUnitDialog
=
()
=>
{
// unitField.value = undefined;
// unitCode.value = '';
// unitName.value = '';
// unitRepresentative.value = '';
// unitEmail.value = '';
// unitAddress.value = '';
// unitPhoneNumber.value = '';
// unitStatus.value = true;
updateUnitDialogIsOpened
.
value
=
true
;
};
const
changePageSize
=
()
=>
{
pageIndex
.
value
=
1
;
void
getListUnits
();
...
...
@@ -328,25 +367,40 @@ export default defineComponent({
}
};
const
updateNew
ManagingUnits
=
()
=>
{
const
updateNew
Unit
=
()
=>
{
//gọi api update
try
{
}
catch
(
error
)
{}
};
const
addNewUnit
=
()
=>
{
//add
const
addNewUnit
=
async
()
=>
{
const
data
=
{
//
name: unitName.value,
//
code: unitCode.value,
//
representative: unitRepresentative.value,
//
address: unitAddress.value,
//
email: unitEmail.value,
//
phoneNumber: unitPhoneNumber.value,
// status: unitStatus.value
,
// fields: fieldSelecte
d.value,
//
artistList: unitArtistList.value,
name
:
unitName
.
value
,
code
:
unitCode
.
value
,
representative
:
unitRepresentative
.
value
,
address
:
unitAddress
.
value
,
email
:
unitEmail
.
value
,
phoneNumber
:
unitPhoneNumber
.
value
,
status
:
unitStatus
.
value
?
1
:
2
,
fields
:
unitFiel
d
.
value
,
artistList
:
unitArtistList
.
value
,
};
// // call API use Data
const
response
=
(
await
api
({
url
:
API_PATHS
.
artistOwnerAdd
,
method
:
'POST'
,
data
,
}))
as
AxiosResponse
<
BaseResponseBody
<
ArtistOwnerAdd
[]
>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
Notify
.
create
({
type
:
'positive'
,
message
:
i18n
.
global
.
t
(
'managingUnit.actionMessages.addNewManagingUnitsAccess'
),
actions
:
[{
icon
:
'close'
,
color
:
'white'
}],
});
void
getListUnits
();
}
};
onMounted
(()
=>
{
...
...
@@ -355,8 +409,9 @@ export default defineComponent({
});
return
{
addUnitDialogIsOpened
,
updateUnitDialogIsOpened
,
getFieldOptions
,
updateNew
ManagingUnits
,
updateNew
Unit
,
confirmDeleteManagingUnits
,
deleteManagingUnits
,
fieldsOptions
,
...
...
@@ -381,6 +436,7 @@ export default defineComponent({
openAddUnitDialog
,
unitArtistList
,
addNewUnit
,
openUpdateUnitDialog
,
};
},
});
...
...
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