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
82429c15
Commit
82429c15
authored
Apr 29, 2021
by
Võ Quang Thành Đạt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search and updateCustomer in customer feature
parent
c056aab7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
37 deletions
+40
-37
customer.ts
src/pages/khach-hang/customer.ts
+37
-34
index.vue
src/pages/khach-hang/index.vue
+3
-3
No files found.
src/pages/khach-hang/customer.ts
View file @
82429c15
...
...
@@ -3,6 +3,7 @@ import { defineComponent, onMounted, ref, Ref } from 'vue';
import
Pagination
from
'components/pagination/index.vue'
;
import
AddNewCustomerDialogComponent
from
'../../components/customer/add-new-customer-dialog/index.vue'
;
import
UpdateNewCustomerDialogComponent
from
'../../components/customer/update-new-customer-dialog/index.vue'
;
// import { API_PATHS } from 'src/assets/configurations.example';
export
type
ArtistInfoType
=
{
id
:
number
;
userName
:
string
|
null
;
...
...
@@ -183,15 +184,16 @@ export default defineComponent({
userTableRowsCustomer
.
value
=
fakeData
;
};
const
filterListCustomer
=
()
=>
{
// const response = (await api({
// url: API_PATHS.filterListArtist,
// method: 'GET',
// params: {
// unitName: fullNameKeyword.value,
// fieldName: fieldSelected.value,
// },
// })) as AxiosResponse<BaseResponseBody<unknown>>;
// userTableRowsArtist.value = userTableRowsArtist.value.filter((item: unknown) => item.fullName = fullNameKeyword)
// const response = (await api({
// url: API_PATHS.filterListArtist,
// method: 'GET',
// params: {
// businessName: businessName.value
// taxCode: taxCode.value
// ratings: ratings.value
// },
// })) as AxiosResponse<BaseResponseBody<Artist[]>>;
// userTableRowsArtist.value = response.data.data
};
const
changePageSize
=
()
=>
{
pageIndex
.
value
=
1
;
...
...
@@ -214,42 +216,42 @@ export default defineComponent({
};
const
addNewCustomer
=
()
=>
{
//gọi api thêm mới
try
{
}
catch
(
error
)
{
}
}
catch
(
error
)
{}
};
const
openUpdateCustomerDialog
=
()
=>
{
showDialogUpdate
.
value
=
true
;
userName
.
value
=
''
;
customerName
.
value
=
''
;
businessName
.
value
=
''
;
taxCode
.
value
=
undefined
;
email
.
value
=
''
;
ratings
.
value
=
undefined
;
address
.
value
=
''
;
businessType
.
value
=
undefined
;
representative
.
value
=
''
;
position
.
value
=
''
;
phone
.
value
=
''
;
const
getDetailCustomer
=
(
id
:
number
)
=>
{
// gọi api chi tiết cần có id để lấy value cho từng customer
// const response = (await api({
// url: ...,
// method: 'GET',
// params: {
// id: id
// }
// }))
// gọi api lấy chi tiết sau đấy gán giá trị api trả về gán cho các biến userName customerName businessName taxCode...
// userName.value = response.data.data.userName
// Tương tự các biến còn lại
};
const
openUpdateCustomerDialog
=
(
id
:
number
)
=>
{
showDialogUpdate
.
value
=
false
;
console
.
log
(
id
,
'iddd'
);
void
getDetailCustomer
(
id
);
};
const
updateNewCustomer
=
()
=>
{
//Bấm nút lưu ở dialog update thì gọi api cập nhật trong hàm updateCustomer
const
updateCustomer
=
()
=>
{
//gọi api update
try
{
}
catch
(
error
)
{
}
}
catch
(
error
)
{}
};
onMounted
(()
=>
{
void
getListCustomer
();
});
return
{
openUpdateCustomerDialog
,
update
New
Customer
,
updateCustomer
,
openAddCustomerDialog
,
addNewCustomer
,
showDialogUpdate
,
...
...
@@ -275,6 +277,7 @@ export default defineComponent({
pageIndex
,
pageSize
,
filterListCustomer
,
// getDetailCustomer,
dataTest
,
totalPage
,
changePageSize
,
...
...
src/pages/khach-hang/index.vue
View file @
82429c15
...
...
@@ -63,7 +63,7 @@
separator=
"cell"
hide-pagination
>
<template
v-slot:body-cell-action=
""
>
<template
v-slot:body-cell-action=
"
rowData
"
>
<q-td
style=
"padding: 0"
class=
"flex flex-center"
>
<q-btn
flat
round
color=
"primary"
icon=
"mdi-information-outline"
>
<q-tooltip
:offset=
"[20, 10]"
>
{{
...
...
@@ -75,7 +75,7 @@
round
color=
"primary"
icon=
"mdi-account-edit-outline"
@
click=
"openUpdateCustomerDialog()"
@
click=
"openUpdateCustomerDialog(
rowData.row.id
)"
>
<q-tooltip
:offset=
"[20, 10]"
>
{{
$t
(
'customer.toolTipMessage.updateCustomerInfo'
)
...
...
@@ -147,7 +147,7 @@
:ratings-options=
"ratingsOptions"
:business-type-options=
"businessTypeOptions"
@
click:CloseBtn=
"showDialogUpdate = false"
@
updateNewCustomer=
"update
New
Customer"
@
updateNewCustomer=
"updateCustomer"
></UpdateNewCustomerDialogComponent>
</div>
</div>
...
...
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