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
d6048a1a
Commit
d6048a1a
authored
Oct 12, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料分类顶级新增加固有属性
parent
daabb5f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
17 deletions
+97
-17
add.vue
pages/materiel/classification/add.vue
+97
-17
No files found.
pages/materiel/classification/add.vue
View file @
d6048a1a
...
...
@@ -25,7 +25,11 @@
</Col>
<Col
:span=
"24"
>
<FormItem
label=
"描述"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
placeholder=
"请输入..."
></Input>
<Input
v-model=
"entity.description"
type=
"textarea"
placeholder=
"请输入..."
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
...
...
@@ -33,30 +37,37 @@
<!--
<h4>
扩展属性
</h4>
-->
<Table
:columns=
"columns"
:data=
"checkList"
border
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div
v-if=
"row.fieldType==1||row.fieldType==2"
>
{{
row
.
title
}}
</div>
<div
v-if=
"row.fieldType == 1 || row.fieldType == 2"
>
{{
row
.
title
}}
</div>
<Input
v-if=
"row.fieldType
==
3"
v-if=
"row.fieldType
==
3"
v-model=
"row.title"
placeholder=
"请输入名称"
@
on-blur=
"setRow(row,index)"
@
on-blur=
"setRow(row,
index)"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"note"
>
<!--
<Input
v-if=
"row.dataType==3"
v-model=
"row.note"
placeholder=
"请输入字典编码"
@
on-blur=
"setRow(row,index)"
/>
-->
<Select
v-if=
"row.dataType
==
3"
v-if=
"row.dataType
==
3"
v-model=
"row.note"
clearable
transfer
@
on-change=
"setRow(row,index)"
@
on-change=
"setRow(row,
index)"
>
<Option
v-for=
"item in codeList"
:value=
"item.code"
:key=
"item.code"
>
{{
item
.
name
}}
</Option>
<Option
v-for=
"item in codeList"
:value=
"item.code"
:key=
"item.code"
>
{{
item
.
name
}}
</Option
>
</Select>
<span
v-else
>
{{
row
.
note
}}
</span>
<span
v-else
>
{{
row
.
note
}}
</span>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"dataType"
>
<Dictionary
@
on-change=
"setRow(row,index)"
@
on-change=
"setRow(row,
index)"
v-model=
"row.dataType"
code=
"materail.category.dataType"
type=
"select"
...
...
@@ -66,8 +77,8 @@
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"unitName"
>
<Dictionary
v-if=
"row.dataType
==1||row.dataType==
2"
@
on-change=
"setRow(row,index)"
v-if=
"row.dataType
== 1 || row.dataType ==
2"
@
on-change=
"setRow(row,
index)"
v-model=
"row.unitName"
code=
"material.main.unitName"
type=
"select"
...
...
@@ -77,17 +88,30 @@
></Dictionary>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"required"
>
<Checkbox
v-model=
"row.required"
@
on-change=
"setRow(row,index)"
></Checkbox>
<Checkbox
v-model=
"row.required"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isUnique"
>
<Checkbox
v-model=
"row.isUnique"
@
on-change=
"setRow(row,index)"
></Checkbox>
<Checkbox
v-model=
"row.isUnique"
@
on-change=
"setRow(row, index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
>
<a
@
click=
"remove(index,row)"
style=
"color:#FF7A8B"
v-if=
"row.fieldType>1"
>
删除
</a>
<a
@
click=
"remove(index, row)"
style=
"color: #ff7a8b"
v-if=
"row.fieldType > 1"
>
删除
</a
>
</
template
>
</Table>
<Button
type=
"dashed"
long
@
click=
"addNew"
class=
"mt10"
>
新增属性
</Button>
<Button
type=
"dashed"
long
@
click=
"addNew"
class=
"mt10"
>
新增属性
</Button
>
</Col>
<Col
:span=
"24"
class=
"tr mt10"
>
<FormItem>
...
...
@@ -168,7 +192,61 @@ export default {
align
:
"center"
,
},
],
checkList
:
[],
checkList
:
[
{
field
:
"drawing"
,
title
:
"图号"
,
note
:
""
,
dataType
:
0
,
unitName
:
""
,
required
:
false
,
isunique
:
false
,
fieldType
:
1
,
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
{
field
:
"version"
,
title
:
"版本"
,
note
:
""
,
dataType
:
0
,
unitName
:
""
,
required
:
true
,
isunique
:
false
,
fieldType
:
1
,
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
{
field
:
"name"
,
title
:
"名称"
,
note
:
""
,
dataType
:
0
,
unitName
:
""
,
required
:
true
,
isunique
:
false
,
fieldType
:
1
,
//共有属性(不能删除)
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
{
field
:
"description"
,
title
:
"描述"
,
note
:
""
,
dataType
:
8
,
unitName
:
""
,
required
:
false
,
isunique
:
true
,
fieldType
:
1
,
//共有属性(不能删除)
categoryId
:
0
,
action
:
1
,
add
:
0
,
//新增标识
},
],
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
...
...
@@ -206,12 +284,14 @@ export default {
}).
then
((
r
)
=>
{
if
(
r
.
result
)
{
var
arr
=
r
.
result
;
this
.
checkList
=
arr
.
filter
(
function
(
item
)
{
let
dataList
=
[];
dataList
=
arr
.
filter
(
function
(
item
)
{
item
.
mid
=
item
.
id
;
delete
item
[
"id"
];
//删除属性id
// return item.fieldType > 1;
return
true
;
});
this
.
checkList
=
this
.
checkList
.
concat
(
dataList
);
}
});
Api
.
getChildren
({
id
:
582
}).
then
((
r
)
=>
{
...
...
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