Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuzhen@situdata.com
/
yunxiao-admin-fe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bffca5a2
authored
2020-11-05 15:20:27 +0800
by
zhen
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
区分新增和修改产品路由
1 parent
48f77bd1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
src/router/index.js
src/views/editProduct.vue
src/views/productInforManagement.vue
src/router/index.js
View file @
bffca5a
...
...
@@ -82,13 +82,23 @@ export const constantRoutes = [
}
},
{
path
:
'add-product'
,
name
:
'add-product'
,
hidden
:
true
,
component
:
()
=>
import
(
'@/views/editProduct'
),
meta
:
{
title
:
'新增产品'
,
icon
:
'report'
}
},
{
path
:
'edit-product'
,
name
:
'edit-product'
,
hidden
:
true
,
component
:
()
=>
import
(
'@/views/editProduct'
),
props
:
route
=>
({
idAndCode
:
route
.
query
}),
meta
:
{
title
:
'
新增
产品'
,
title
:
'
编辑
产品'
,
icon
:
'report'
}
}
...
...
src/views/editProduct.vue
View file @
bffca5a
...
...
@@ -33,7 +33,7 @@
v-model
.
trim=
"form.code"
placeholder=
"请输入产品编号"
:maxlength=
"inputMaxLength"
:disabled=
"!!idAndCode
.code
"
:disabled=
"!!idAndCode"
>
</el-input>
</el-form-item>
...
...
@@ -208,7 +208,7 @@ export default {
}
},
mounted
()
{
if
(
this
.
idAndCode
.
code
)
{
if
(
this
.
idAndCode
)
{
this
.
handleProductDetail
()
this
.
rules
.
code
=
[]
...
...
@@ -320,7 +320,7 @@ export default {
},
async
editOrAdd
()
{
const
formData
=
this
.
constructorFormData
()
if
(
this
.
idAndCode
.
code
)
{
if
(
this
.
idAndCode
)
{
const
formData
=
this
.
constructorFormData
()
const
{
code
}
=
await
productEdit
(
formData
)
if
(
code
===
0
)
{
...
...
src/views/productInforManagement.vue
View file @
bffca5a
...
...
@@ -197,11 +197,12 @@ export default {
methods
:
{
editOrAdd
(
row
)
{
const
url
=
{
path
:
'
edit
-product'
path
:
'
add
-product'
}
if
(
row
.
id
&&
row
.
code
)
{
const
{
id
,
code
}
=
row
url
.
query
=
{
id
,
code
}
url
.
path
=
'edit-product'
}
this
.
$router
.
push
(
url
)
},
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment