Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
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
胡宝山
template_vue
Commits
204223cb
Commit
204223cb
authored
Mar 21, 2024
by
孙浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签管理新增及修改回显
parent
c6cc0d64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
incomeWmsLabel.vue
src/views/template/incomeWmsLabel.vue
+21
-12
No files found.
src/views/template/incomeWmsLabel.vue
View file @
204223cb
...
...
@@ -175,7 +175,7 @@
</el-col>
<el-col
:span=
"5"
class=
"btn-container"
>
<el-button
type=
"primary"
class=
"el-icon-plus"
@
click=
"addFormItem(index)"
circle
></el-button>
<el-button
type=
"primary"
class=
"el-icon-minus"
@
click=
"removeFormItem(index)"
circle
></el-button>
<el-button
v-if=
"paramsItems.length > 1"
type=
"primary"
class=
"el-icon-minus"
@
click=
"removeFormItem(index)"
circle
></el-button>
</el-col>
</el-row>
</el-form-item>
...
...
@@ -269,7 +269,6 @@ export default {
},
methods
:
{
getKeyRules
(
item
)
{
console
.
log
(
item
)
return
[
{
required
:
!!
item
.
value
&&
!
item
.
key
,
message
:
'请输入key的值'
,
trigger
:
'blur'
}
]
...
...
@@ -359,12 +358,15 @@ export default {
const
id
=
row
.
businessId
getIncomeWmsLabel
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
const
obj
=
JSON
.
parse
(
this
.
form
.
params
)
this
.
paramsItems
=
[]
for
(
const
key
in
obj
)
{
if
(
Object
.
hasOwnProperty
.
call
(
obj
,
key
))
{
const
value
=
obj
[
key
]
this
.
paramsItems
.
push
({
key
:
key
,
value
:
value
})
console
.
log
(
this
.
form
)
if
(
this
.
form
.
params
!==
null
&&
this
.
form
.
params
!==
undefined
)
{
this
.
paramsItems
=
[]
const
obj
=
JSON
.
parse
(
this
.
form
.
params
)
for
(
const
key
in
obj
)
{
if
(
Object
.
hasOwnProperty
.
call
(
obj
,
key
))
{
const
value
=
obj
[
key
]
this
.
paramsItems
.
push
({
key
:
key
,
value
:
value
})
}
}
}
this
.
open
=
true
...
...
@@ -393,10 +395,14 @@ export default {
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
form
.
params
=
JSON
.
stringify
(
this
.
paramsItems
.
reduce
((
obj
,
item
)
=>
{
obj
[
item
.
key
]
=
item
.
value
return
obj
},
{}))
if
(
this
.
paramsItems
.
length
===
1
&&
this
.
paramsItems
[
0
].
key
===
''
)
{
this
.
form
.
params
=
undefined
}
else
{
this
.
form
.
params
=
JSON
.
stringify
(
this
.
paramsItems
.
reduce
((
obj
,
item
)
=>
{
obj
[
item
.
key
]
=
item
.
value
return
obj
},
{}))
}
if
(
this
.
form
.
businessId
!==
undefined
)
{
updateIncomeWmsLabel
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
...
...
@@ -473,6 +479,9 @@ export default {
width
:
115%
;
.el-input
{
width
:
60%
;
.el-input__inner
{
padding-right
:
0%
;
}
}
}
}
...
...
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