Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_tuananh_nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
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
TTS Tran Viet Anh
kiaisoft_tuananh_nuxt
Commits
c8125a6f
Commit
c8125a6f
authored
Feb 15, 2023
by
vietanh-0511
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update product ui
parent
c8b36af7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
index.vue
pages/products/index.vue
+37
-1
No files found.
pages/products/index.vue
View file @
c8125a6f
...
@@ -499,6 +499,15 @@
...
@@ -499,6 +499,15 @@
<
template
#
[`
item
.
index
`
]=
"{ index }"
>
<
template
#
[`
item
.
index
`
]=
"{ index }"
>
{{
index
+
1
}}
{{
index
+
1
}}
</
template
>
</
template
>
<
template
#
[`
item
.
variants
`
]=
"{ item }"
>
{{
item
.
variants_count
}}
</
template
>
<
template
#
[`
item
.
status
`
]=
"{ item }"
>
<v-switch
v-model=
"item.status"
@
click=
"switchStatus(item)"
/>
</
template
>
<
template
#
[`
item
.
actions
`
]=
"{ item }"
>
<
template
#
[`
item
.
actions
`
]=
"{ item }"
>
<v-icon
:id=
"item.id"
small
@
click=
"editProduct(item)"
>
<v-icon
:id=
"item.id"
small
@
click=
"editProduct(item)"
>
mdi-pencil
mdi-pencil
...
@@ -534,6 +543,7 @@ export default {
...
@@ -534,6 +543,7 @@ export default {
stock
:
''
,
stock
:
''
,
description
:
''
,
description
:
''
,
images
:
[],
images
:
[],
status
:
''
,
variants
:
[
variants
:
[
{
{
color
:
''
,
color
:
''
,
...
@@ -562,6 +572,8 @@ export default {
...
@@ -562,6 +572,8 @@ export default {
{
text
:
'
Category
'
,
value
:
'
category.name
'
},
{
text
:
'
Category
'
,
value
:
'
category.name
'
},
{
text
:
'
Price
'
,
value
:
'
price
'
},
{
text
:
'
Price
'
,
value
:
'
price
'
},
{
text
:
'
Stock
'
,
value
:
'
stock
'
},
{
text
:
'
Stock
'
,
value
:
'
stock
'
},
{
text
:
'
Variants
'
,
value
:
'
variants
'
},
{
text
:
'
Status
'
,
value
:
'
status
'
},
{
text
:
'
Actions
'
,
value
:
'
actions
'
,
sortable
:
false
}
{
text
:
'
Actions
'
,
value
:
'
actions
'
,
sortable
:
false
}
],
],
items
:
[
items
:
[
...
@@ -870,7 +882,7 @@ export default {
...
@@ -870,7 +882,7 @@ export default {
}
}
)
)
.then((response) => {
.then((response) => {
self.$toast.success('
User
updated successfully!', {
self.$toast.success('
Product
updated successfully!', {
duration: 3000
duration: 3000
})
})
console.log(response)
console.log(response)
...
@@ -951,6 +963,30 @@ export default {
...
@@ -951,6 +963,30 @@ export default {
},
},
clearImage () {
clearImage () {
this.files.length = 0
this.files.length = 0
},
switchStatus (item) {
const status = item.status ? 1 : 0
const self = this
const fd = new FormData()
fd.append('status', status)
try {
this.$axios
.post(`
/
products
/
update
-
status
/
$
{
item
.
id
}
`,
fd, {
headers: {
Authorization: `
Bearer
$
{
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)}
`
}
}
)
.then((response) => {
console.log(response)
self.$toast.success('Updated status successfully!', {
duration: 3000
})
})
} catch (error) {
console.log(error)
}
}
}
}
}
}
}
...
...
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