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
08c22d25
Commit
08c22d25
authored
Jun 08, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料主数据分类管理
parent
0fc2457c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
83 deletions
+75
-83
add.vue
pages/materiel/classification/add.vue
+32
-41
edit.vue
pages/materiel/classification/edit.vue
+32
-40
index.vue
pages/materiel/classification/index.vue
+11
-2
No files found.
pages/materiel/classification/add.vue
View file @
08c22d25
...
...
@@ -46,16 +46,20 @@
<div
v-if=
"row.fieldType==1"
>
{{
row
.
note
}}
</div>
<Input
v-model=
"row.note"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
v-else
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"datatype"
>
<div
v-if=
"row.fieldType==1"
>
{{
row
.
datatype
}}
</div>
<Select
v-model=
"row.datatype"
v-else
>
<Option
@
on-change=
"setRow(row,index)"
v-for=
"(item,index) in cityList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<state
v-if=
"row.fieldType==1"
code=
"materail.category.dataType"
:value=
"row.dataType"
type=
"text"
></state>
<Dictionary
v-else
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<!-- <template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" />
...
...
@@ -71,7 +75,7 @@
slot=
"action"
v-if=
"row.fieldType==2||row.fieldType==3"
>
<a
@
click=
"remove(index)"
style=
"color:#FF7A8B"
>
删除
</a>
<a
@
click=
"remove(index
,row
)"
style=
"color:#FF7A8B"
>
删除
</a>
</
template
>
</Table>
</Col>
...
...
@@ -93,33 +97,11 @@ import Api from "./api";
export
default
{
data
()
{
return
{
arr
:
[],
entity
:
{
upId
:
0
,
code
:
0
},
cityList
:
[
{
value
:
"0"
,
label
:
"Number"
},
{
value
:
"1"
,
label
:
"string"
},
{
value
:
"2"
,
label
:
"Null"
},
{
value
:
"3"
,
label
:
"Boolean"
},
{
value
:
"4"
,
label
:
"Undefined"
}
],
disabled
:
false
,
columns
:
[
{
...
...
@@ -142,9 +124,9 @@ export default {
},
{
title
:
"属性类型"
,
key
:
"data
t
ype"
,
key
:
"data
T
ype"
,
align
:
"center"
,
slot
:
"data
t
ype"
slot
:
"data
T
ype"
},
// {
// title: "是否显示",
...
...
@@ -208,8 +190,16 @@ export default {
}
});
},
remove
(
index
)
{
this
.
checkList
.
splice
(
index
,
1
);
remove
(
index
,
row
)
{
if
(
row
.
add
==
0
)
{
//新增的删除,直接删
this
.
checkList
.
splice
(
index
,
1
);
}
else
{
row
.
action
=
2
;
//返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this
.
$set
(
this
.
checkList
,
index
,
row
);
this
.
arr
.
push
(
row
);
this
.
checkList
.
splice
(
index
,
1
);
}
},
setRow
()
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
...
...
@@ -218,12 +208,13 @@ export default {
let
obj
=
{
title
:
""
,
note
:
""
,
data
t
ype
:
""
,
data
T
ype
:
""
,
required
:
false
,
isunique
:
false
,
fieldType
:
3
,
categoryId
:
0
,
action
:
1
action
:
1
,
add
:
0
//新增标识
};
this
.
checkList
.
push
(
obj
);
},
...
...
@@ -231,7 +222,7 @@ export default {
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
let
categoryDto
=
this
.
entity
;
let
pro
=
this
.
checkList
;
let
pro
=
this
.
checkList
.
concat
(
this
.
arr
)
;
Api
.
create
({
categoryDto
:
categoryDto
,
pro
:
pro
})
.
then
(
r
=>
{
if
(
r
.
success
)
{
...
...
pages/materiel/classification/edit.vue
View file @
08c22d25
...
...
@@ -32,6 +32,7 @@
<h4>
属性配置
</h4>
</Col>
<Col
:span=
"24"
style=
"padding:20px 0 0px 10px;margin-bottom:10px;"
class=
"table-solt"
>
<!--fieldType 1.固有,2.默认,3自定义; -->
<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>
...
...
@@ -41,16 +42,20 @@
<div
v-if=
"row.fieldType==1"
>
{{
row
.
note
}}
</div>
<Input
v-model=
"row.note"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
v-else
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"datatype"
>
<div
v-if=
"row.fieldType==1"
>
{{
row
.
datatype
}}
</div>
<Select
v-model=
"row.datatype"
v-else
>
<Option
@
on-change=
"setRow(row,index)"
v-for=
"(item,index) in cityList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<state
v-if=
"row.fieldType==1"
code=
"materail.category.dataType"
:value=
"row.dataType"
type=
"text"
></state>
<Dictionary
v-else
code=
"materail.category.dataType"
type=
"select"
:value=
"row.dataType"
:key=
"row.dataType"
></Dictionary>
</
template
>
<!-- <template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" />
...
...
@@ -66,7 +71,7 @@
slot=
"action"
v-if=
"row.fieldType==2||row.fieldType==3"
>
<a
@
click=
"remove(index)"
style=
"color:#FF7A8B"
>
删除
</a>
<a
@
click=
"remove(index
,row
)"
style=
"color:#FF7A8B"
>
删除
</a>
</
template
>
</Table>
</Col>
...
...
@@ -93,28 +98,7 @@ export default {
upId
:
0
,
code
:
0
},
cityList
:
[
{
value
:
"0"
,
label
:
"Number"
},
{
value
:
"1"
,
label
:
"string"
},
{
value
:
"2"
,
label
:
"Null"
},
{
value
:
"3"
,
label
:
"Boolean"
},
{
value
:
"4"
,
label
:
"Undefined"
}
],
arr
:
[],
disabled
:
false
,
columns
:
[
{
...
...
@@ -137,9 +121,9 @@ export default {
},
{
title
:
"属性类型"
,
key
:
"data
t
ype"
,
key
:
"data
T
ype"
,
align
:
"center"
,
slot
:
"data
t
ype"
slot
:
"data
T
ype"
},
// {
// title: "是否显示",
...
...
@@ -203,8 +187,15 @@ export default {
}
});
},
remove
(
index
)
{
this
.
checkList
.
splice
(
index
,
1
);
remove
(
index
,
row
)
{
if
(
row
.
add
==
0
)
{
this
.
checkList
.
splice
(
index
,
1
);
}
else
{
row
.
action
=
2
;
this
.
$set
(
this
.
checkList
,
index
,
row
);
this
.
arr
.
push
(
row
);
this
.
checkList
.
splice
(
index
,
1
);
}
},
setRow
()
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
...
...
@@ -214,12 +205,13 @@ export default {
let
obj
=
{
title
:
""
,
note
:
""
,
data
t
ype
:
""
,
data
T
ype
:
""
,
required
:
false
,
isunique
:
false
,
fieldType
:
3
,
categoryId
:
0
,
action
:
1
action
:
1
,
add
:
0
};
arr
.
push
(
obj
);
this
.
checkList
=
arr
;
...
...
@@ -228,7 +220,7 @@ export default {
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
let
categoryDto
=
this
.
entity
;
let
pro
=
this
.
checkList
;
let
pro
=
this
.
checkList
.
concat
(
this
.
arr
)
;
Api
.
update
({
categoryDto
:
categoryDto
,
pro
:
pro
})
.
then
(
r
=>
{
if
(
r
.
success
)
{
...
...
pages/materiel/classification/index.vue
View file @
08c22d25
...
...
@@ -56,8 +56,15 @@
<!--
<Product
:parent=
"parent"
/>
-->
</Content>
</Layout>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1000"
footer-hide
:mask-closable=
"false"
>
<component
:is=
"detail"
:eid=
"curId"
:nodeInfo=
"nodeInfo"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1000"
footer-hide
:mask-closable=
"false"
>
<component
:is=
"detail"
:eid=
"curId"
:nodeInfo=
"nodeInfo"
@
on-close=
"cancel"
@
on-ok=
"ok"
ref=
"chlidren"
/>
</Modal>
</div>
</
template
>
...
...
@@ -109,6 +116,7 @@ export default {
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
this
.
$refs
.
chlidren
.
arr
=
[];
},
add
()
{
this
.
curId
=
0
;
...
...
@@ -119,6 +127,7 @@ export default {
edit
()
{
if
(
this
.
nodeInfo
.
upId
==
0
)
{
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
$refs
.
chlidren
.
arr
=
[];
}
else
{
this
.
detail
=
()
=>
import
(
"./sonEdit"
);
}
...
...
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