Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
0e670986
Commit
0e670986
authored
Jun 08, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料分类
parent
7566c7da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
add.vue
pages/materiel/classification/add.vue
+3
-2
edit.vue
pages/materiel/classification/edit.vue
+17
-12
No files found.
pages/materiel/classification/add.vue
View file @
0e670986
...
...
@@ -203,7 +203,7 @@ export default {
var
arr
=
r
.
result
;
this
.
checkList
=
arr
.
filter
(
function
(
item
)
{
delete
item
[
"id"
];
return
item
return
item
;
});
}
});
...
...
@@ -222,7 +222,8 @@ export default {
required
:
false
,
isunique
:
false
,
fieldType
:
3
,
categoryId
:
0
categoryId
:
0
,
action
:
1
};
this
.
checkList
.
push
(
obj
);
},
...
...
pages/materiel/classification/edit.vue
View file @
0e670986
...
...
@@ -35,12 +35,7 @@
<Table
border
:columns=
"columns"
:data=
"checkList"
class=
"tableCommon"
height=
"300"
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div
v-if=
"row.fieldType==1||row.fieldType==2"
>
{{
row
.
title
}}
</div>
<Input
v-if=
"row.fieldType==3"
v-model=
"row.title"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
<Input
v-else
v-model=
"row.title"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"note"
>
<div
v-if=
"row.fieldType==1"
>
{{
row
.
note
}}
</div>
...
...
@@ -131,7 +126,8 @@ export default {
{
title
:
"属性名称"
,
key
:
"title"
,
align
:
"center"
align
:
"center"
,
slot
:
"title"
},
{
title
:
"备注"
,
...
...
@@ -181,7 +177,6 @@ export default {
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
mounted
()
{
this
.
tableData
();
this
.
get
();
},
methods
:
{
...
...
@@ -189,11 +184,18 @@ export default {
Api
.
get
({
id
:
this
.
nodeInfo
.
id
}).
then
(
r
=>
{
if
(
r
.
result
)
{
this
.
entity
=
r
.
result
;
this
.
tableData
();
}
});
},
tableData
()
{
let
conditions
=
[];
let
conditions
=
[
{
conditionalType
:
"Equal"
,
fieldName
:
"categoryId"
,
fieldValue
:
this
.
nodeInfo
.
id
}
];
Api
.
listTable
({
conditions
:
conditions
}).
then
(
r
=>
{
if
(
r
.
result
)
{
console
.
log
(
r
);
...
...
@@ -208,6 +210,7 @@ export default {
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{
let
arr
=
this
.
$u
.
clone
(
this
.
checkList
);
let
obj
=
{
title
:
""
,
note
:
""
,
...
...
@@ -215,16 +218,18 @@ export default {
required
:
false
,
isunique
:
false
,
fieldType
:
3
,
categoryId
:
0
categoryId
:
0
,
action
:
1
};
this
.
checkList
.
push
(
obj
);
arr
.
push
(
obj
);
this
.
checkList
=
arr
;
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
let
categoryDto
=
this
.
entity
;
let
pro
=
this
.
checkList
;
Api
.
cre
ate
({
categoryDto
:
categoryDto
,
pro
:
pro
})
Api
.
upd
ate
({
categoryDto
:
categoryDto
,
pro
:
pro
})
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
...
...
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