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
93fdcad0
Commit
93fdcad0
authored
May 26, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品结构管理ok
parent
2da1dd21
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
143 additions
and
75 deletions
+143
-75
index.vue
pages/technology/productMix/index.vue
+1
-2
add.vue
pages/technology/productMix/product/add.vue
+49
-42
edit.vue
pages/technology/productMix/product/edit.vue
+85
-20
index.vue
pages/technology/productMix/product/index.vue
+0
-3
add.vue
pages/technology/productMix/productTree/add.vue
+3
-3
edit.vue
pages/technology/productMix/productTree/edit.vue
+3
-3
index.vue
pages/technology/productMix/productTree/index.vue
+2
-2
No files found.
pages/technology/productMix/index.vue
View file @
93fdcad0
...
...
@@ -49,6 +49,7 @@ export default {
<
style
lang=
"less"
>
.product-mix {
font-family: Microsoft YaHei;
height: 84vh;
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
margin-right: 10px;
...
...
@@ -62,7 +63,6 @@ export default {
}
.p-list {
padding: 10px;
height: 85vh;
overflow: auto;
}
}
...
...
@@ -70,7 +70,6 @@ export default {
margin-left: 5px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 88vh;
overflow: auto;
padding: 10px;
}
...
...
pages/technology/productMix/product/add.vue
View file @
93fdcad0
...
...
@@ -10,7 +10,6 @@
<Row>
<Col
:span=
"12"
>
<FormItem
label=
"上级所属"
prop=
"levelId"
>
33
{{
parents
.
parentName
}}
{{
parents
.
id
}}
55
<productSelect1
v-model=
"entity.levelId"
@
on-change=
"proChange"
/>
</FormItem>
</Col>
...
...
@@ -18,7 +17,7 @@
<FormItem
label=
"层级类型"
prop=
"levelTitle"
>
<Input
v-model=
"entity.levelTitle"
disabled
></Input>
</FormItem>
</Col>
-->
</Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('productCode')"
prop=
"productCode"
>
<Input
v-model=
"entity.productCode"
></Input>
...
...
@@ -42,27 +41,22 @@
<Col
:span=
"12"
>
<FormItem
:label=
"l('madeCompany')"
prop=
"madeCompany"
>
<Input
v-model=
"entity.madeCompany"
></Input>
<Select
v-model=
"entity.madeCompany"
placeholder=
"请选择"
>
<Option
v-for=
"(item,index) in componaylist"
:key=
"index"
:value=
"item.value"
style=
"display:none"
>
{{
item
.
label
}}
</Option>
<Tree
:data=
"data2"
:ref=
"`madetree`"
@
on-select-change=
"handleSelect1"
></Tree>
</Select>
</FormItem>
</Col>
<!--
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
></Input>
</FormItem>
</Col>
-->
<Col
:span=
"24"
>
<FormItem
:label=
"l('productUrlList')"
prop=
"productUrlList"
>
<!--
<InputFile
v-model=
"entity.productUrl"
></InputFile>
-->
<files
ref=
"refFile"
:parms=
"parms"
fileFormat
:Photos=
"true"
@
clickItem=
"clickData"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"24"
>
<FormItem
:label=
"l('productUrlList')"
prop=
"productUrlList"
>
-->
<!--
<Input
v-model=
"entity.productUrlList"
type=
"textarea"
:rows=
"5"
></Input>
-->
<!--
<filesList
v-model=
"entity.productUrlList"
></filesList>
</FormItem>
</Col>
-->
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
...
...
@@ -74,6 +68,7 @@
</
template
>
<
script
>
import
Api
from
"./api"
;
import
service
from
"@/plugins/request"
;
export
default
{
name
:
"Add"
,
data
()
{
...
...
@@ -91,11 +86,14 @@ export default {
// extend: "",
productUrl
:
""
,
productUrlList
:
""
,
levelId
:
60
,
// levelId: this.parents.parentId,
// parentName: this.parents.parentId,
// levelTitle: this.parents.parentName
levelId
:
null
,
levelTitle
:
""
},
componaylist
:
[],
componaylist
:
[],
data2
:
[],
selectdata1
:
[],
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
},
...
...
@@ -111,29 +109,38 @@ export default {
props
:
{
v
:
Object
,
eid
:
Number
,
parents
:
{
type
:
Object
,
default
:()
=>
{
return
{
id
:
-
1
,
parentName
:
""
}
}
},
parents
:
{
type
:
Object
,
default
:
()
=>
{
return
{
id
:
-
1
,
parentName
:
""
};
}
}
},
created
()
{
// alert(this.parents.parentId)
;
// if (this.eid > 0)
{
// this.load(this.eid)
;
// }
var
url
=
`
${
designUrl
}
/productlevel/getdepartmentstree`
;
service
.
get
(
`
${
url
}
`
).
then
(
response
=>
{
this
.
data2
=
response
.
result
;
});
this
.
parms
.
eid
=
this
.
$u
.
guid
();
this
.
entity
.
levelId
=
this
.
parents
.
id
this
.
entity
.
levelId
=
this
.
parents
.
id
;
// this.$refs.refFile.intFiles();
},
methods
:
{
clickData
(
data
)
{
this
.
img
=
data
;
},
handleSelect1
(
data
)
{
if
(
data
.
length
>
0
)
{
this
.
selectdata1
=
[];
this
.
selectdata1
=
data
;
this
.
componaylist
=
[];
this
.
componaylist
.
push
({
label
:
data
[
0
].
title
,
value
:
data
[
0
].
id
});
this
.
entity
.
madeCompany
=
data
[
0
].
id
;
}
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
...
...
@@ -166,13 +173,13 @@ export default {
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
entity
=
r
.
result
;
this
.
entity
.
id
=
0
;
});
},
proChange
(
id
,
data
,
listName
,
roots
)
{
//
load(v) {
//
Api.get({ id: v }).then(r => {
//
this.entity = r.result;
//
this.entity.id = 0;
//
});
//
},
proChange
(
id
,
data
,
listName
,
roots
)
{
this
.
entity
.
levelTitle
=
listName
.
join
(
" / "
);
},
l
(
key
)
{
...
...
@@ -185,7 +192,7 @@ export default {
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
);
// this.entity.parentId = this.parents.parentId;
// this.entity.parentName = this.parents.parentName;
}
,
}
// eid(v) {
// if (v > 0) {
...
...
pages/technology/productMix/product/edit.vue
View file @
93fdcad0
...
...
@@ -9,9 +9,9 @@
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"120"
>
<Row>
<Col
:span=
"12"
>
<FormItem
label=
"上级所属"
prop=
"
parentName
"
>
<FormItem
label=
"上级所属"
prop=
"
levelId
"
>
<!--
<Input
v-model=
"entity.parentName"
disabled
></Input>
-->
<productSelect1
v-model=
"entity.levelId"
@
on-change=
"proChange"
/>
<productSelect1
v-model=
"entity.levelId
+''
"
@
on-change=
"proChange"
/>
</FormItem>
</Col>
<Col
:span=
"12"
>
...
...
@@ -37,27 +37,17 @@
<Col
:span=
"12"
>
<FormItem
:label=
"l('madeCompany')"
prop=
"madeCompany"
>
<Input
v-model=
"entity.madeCompany"
></Input>
<Select
v-model=
"entity.madeCompany"
placeholder=
"请选择"
>
<Option
:value=
"value"
>
{{
label
}}
</Option>
<Tree
:data=
"data2"
:ref=
"`madetree`"
@
on-select-change=
"handleSelect1"
></Tree>
</Select>
</FormItem>
</Col>
<!--
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
></Input>
</FormItem>
</Col>
-->
<Col
:span=
"24"
>
<FormItem
:label=
"l('productUrlList')"
prop=
"productUrlList"
>
<!--
<InputFile
v-model=
"entity.productUrl"
></InputFile>
-->
<files
ref=
"refFile"
:parms=
"parms"
fileFormat
:Photos=
"true"
@
clickItem=
"clickData"
/>
</FormItem>
</Col>
<!--
<Col
:span=
"24"
>
<FormItem
:label=
"l('productUrlList')"
prop=
"productUrlList"
>
-->
<!--
<Input
v-model=
"entity.productUrlList"
type=
"textarea"
:rows=
"5"
></Input>
-->
<!--
<filesList
v-model=
"entity.productUrlList"
></filesList>
</FormItem>
</Col>
-->
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
...
...
@@ -69,19 +59,28 @@
</
template
>
<
script
>
import
Api
from
"./api"
;
import
service
from
"@/plugins/request"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
entity
:
{},
entity
:
{
levelTitle
:
""
},
componayId
:
null
,
componaylist
:
[],
label
:
""
,
value
:
""
,
data2
:
[],
selectdata1
:
[],
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
},
img
:
""
,
parms
:
{
app
:
"technology"
,
eid
:
''
,
eid
:
""
,
name
:
""
,
field
:
""
}
...
...
@@ -90,22 +89,64 @@ export default {
props
:
{
eid
:
Number
},
mounted
()
{
this
.
treeCompany
();
if
(
this
.
eid
>
0
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
clickData
(
data
)
{
this
.
img
=
data
;
},
proChange
(
items
,
data
,
roots
)
{},
handleSelect1
(
data
)
{
if
(
data
.
length
>
0
)
{
this
.
selectdata1
=
[];
this
.
selectdata1
=
data
;
// this.componaylist = [];
this
.
label
=
data
[
0
].
title
;
this
.
value
=
data
[
0
].
id
;
// this.componaylist.push({ label: data[0].title, value: data[0].id });
this
.
entity
.
madeCompany
=
data
[
0
].
id
;
}
},
proChange
(
id
,
data
,
listName
,
roots
)
{
this
.
entity
.
levelTitle
=
listName
.
join
(
" / "
);
},
treeCompany
()
{
var
url
=
`
${
designUrl
}
/productlevel/getdepartmentstree`
;
service
.
get
(
`
${
url
}
`
).
then
(
response
=>
{
this
.
data2
=
response
.
result
;
// var arr = this.data2;
// var id = this.componayId;
// var returnedItem = {};
// var finds = function(arr, id) {
// for (let i = 0; i
<
arr
.
length
;
i
++
)
{
// console.log(arr[i])
// if (arr[i].id == id) {
// console.log(arr[i].id)
// returnedItem = arr[i];
// break;
// } else if (arr[i].children.length > 0) {
// finds(arr[i].children, id); //递归调用
// }
// }
// return returnedItem;
// };
// console.log(returnedItem);
});
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
$refs
.
refFile
.
intFilesClone
();
//
this.$refs.refFile.intFilesClone();
this
.
parms
.
eid
=
r
.
result
.
productUrlList
;
this
.
entity
=
r
.
result
;
this
.
img
=
this
.
entity
.
productUrl
;
this
.
componayId
=
r
.
result
.
madeCompany
;
});
},
handleSubmit
()
{
...
...
@@ -143,6 +184,30 @@ export default {
if
(
v
!=
0
)
{
this
.
load
(
v
);
}
},
componayId
(
v
)
{
if
(
v
!=
null
)
{
var
url
=
`
${
designUrl
}
/productlevel/getdepartmentstree`
;
service
.
get
(
`
${
url
}
`
).
then
(
response
=>
{
var
arr
=
response
.
result
;
var
id
=
this
.
componayId
;
var
returnedItem
=
""
;
var
finds
=
function
(
arr
,
id
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
arr
[
i
].
id
==
id
)
{
returnedItem
=
arr
[
i
].
title
;
break
;
}
else
if
(
arr
[
i
].
children
.
length
>
0
)
{
finds
(
arr
[
i
].
children
,
id
);
//递归调用
}
}
return
returnedItem
;
};
finds
(
arr
,
id
);
this
.
label
=
returnedItem
;
this
.
value
=
id
;
});
}
}
}
};
...
...
pages/technology/productMix/product/index.vue
View file @
93fdcad0
<
template
>
<div
class=
"product-m"
>
t
{{
parent
.
id
}}
v
<DataGrid
:columns=
"columns"
ref=
"grid"
...
...
@@ -17,8 +16,6 @@
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
...
...
pages/technology/productMix/productTree/add.vue
View file @
93fdcad0
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"
12
"
>
<Col
:span=
"
24
"
>
<FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<
!--
<
Col
:span=
"12"
>
<FormItem
:label=
"l('upId')"
prop=
"upId"
>
<InputNumber
v-model=
"entity.upId"
></InputNumber>
</FormItem>
</Col>
</Col>
-->
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
...
...
pages/technology/productMix/productTree/edit.vue
View file @
93fdcad0
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"
12
"
>
<Col
:span=
"
24
"
>
<FormItem
:label=
"l('name')"
prop=
"name"
>
<Input
v-model=
"entity.name"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<
!--
<
Col
:span=
"12"
>
<FormItem
:label=
"l('upId')"
prop=
"upId"
>
<InputNumber
v-model=
"entity.upId"
></InputNumber>
</FormItem>
</Col>
</Col>
-->
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
...
...
pages/technology/productMix/productTree/index.vue
View file @
93fdcad0
...
...
@@ -4,7 +4,7 @@
产品列表
<div
class=
"fr mr10 mt10"
>
<ButtonGroup
class=
"fr"
size=
"small"
>
<Button
icon=
"md-add"
title=
"
刷新
"
@
click=
"addNew"
></Button>
<Button
icon=
"md-add"
title=
"
新增顶级
"
@
click=
"addNew"
></Button>
<Button
:icon=
"expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@
click=
"toggle"
...
...
@@ -42,7 +42,7 @@
</Dropdown>
</div>
</div>
<Modal
v-model=
"modal"
:title=
"title"
width=
"
8
00"
footer-hide
>
<Modal
v-model=
"modal"
:title=
"title"
width=
"
5
00"
footer-hide
>
<component
:is=
"detail"
:eid=
"curId"
:nodeInfo=
"nodeInfo"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
...
...
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