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
5647f358
Commit
5647f358
authored
Jun 10, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料主数据
parent
929a2081
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
74 deletions
+66
-74
dataGrid.vue
components/page/dataGrid.vue
+8
-0
add.vue
pages/materiel/classification/add.vue
+3
-3
edit.vue
pages/materiel/classification/edit.vue
+5
-4
sonAdd.vue
pages/materiel/classification/sonAdd.vue
+2
-2
sonEdit.vue
pages/materiel/classification/sonEdit.vue
+2
-2
add.vue
pages/materiel/masterData/add.vue
+4
-5
index.vue
pages/materiel/masterData/index.vue
+7
-33
masterData.vue
pages/materiel/masterData/masterData.vue
+35
-25
No files found.
components/page/dataGrid.vue
View file @
5647f358
...
...
@@ -150,6 +150,10 @@ export default {
type
:
Function
,
default
:
null
},
initsearch
:
{
type
:
Function
,
default
:
null
},
lazy
:
{
//懒加载设置,设置为真时候,默认不加载数据。
type
:
Boolean
,
...
...
@@ -291,6 +295,10 @@ export default {
this
.
tableHeight
=
window
.
innerHeight
-
this
.
firstY
-
60
;
}
if
(
this
.
action
)
{
//条件初始化处理。
if
(
this
.
initsearch
){
this
.
initsearch
(
this
.
search
)
}
this
.
$api
.
post
(
this
.
action
,
this
.
search
).
then
(
r
=>
{
if
(
this
.
format
)
{
this
.
list
=
this
.
format
(
r
.
result
.
items
);
...
...
pages/materiel/classification/add.vue
View file @
5647f358
...
...
@@ -201,7 +201,7 @@ export default {
this
.
checkList
.
splice
(
index
,
1
);
}
},
setRow
(
row
,
index
)
{
setRow
(
row
,
index
)
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{
...
...
@@ -229,12 +229,12 @@ export default {
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
});
}
});
...
...
pages/materiel/classification/edit.vue
View file @
5647f358
...
...
@@ -69,8 +69,9 @@
<
template
slot-scope=
"{ row, index }"
slot=
"action"
v-if=
"row.fieldType==2||row.fieldType==3"
v-if=
"row.fieldType==2||row.fieldType==3
||!row.notEditDelete
"
>
<!-- notEditDelete=true,删除不显示 -->
<a
@
click=
"remove(index,row)"
style=
"color:#FF7A8B"
>
删除
</a>
</
template
>
</Table>
...
...
@@ -197,7 +198,7 @@ export default {
this
.
checkList
.
splice
(
index
,
1
);
}
},
setRow
(
row
,
index
)
{
setRow
(
row
,
index
)
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{
...
...
@@ -227,12 +228,12 @@ export default {
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
});
}
});
...
...
pages/materiel/classification/sonAdd.vue
View file @
5647f358
...
...
@@ -74,12 +74,12 @@ export default {
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
});
}
});
...
...
pages/materiel/classification/sonEdit.vue
View file @
5647f358
...
...
@@ -83,12 +83,12 @@ export default {
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
,
this
.
entity
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
});
}
});
...
...
pages/materiel/masterData/add.vue
View file @
5647f358
<
template
>
<div>
{{
nodeInfo
}}
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
>
...
...
@@ -25,8 +24,8 @@
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"版本"
prop=
"
banbe
n"
>
<Input
v-model=
"entity.
banbe
n"
placeholder=
"请输入"
></Input>
<FormItem
label=
"版本"
prop=
"
versio
n"
>
<Input
v-model=
"entity.
versio
n"
placeholder=
"请输入"
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
...
...
@@ -121,12 +120,12 @@ export default {
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
this
.
$Message
.
error
(
r
.
error
.
message
);
});
}
});
...
...
pages/materiel/masterData/index.vue
View file @
5647f358
...
...
@@ -107,7 +107,7 @@ export default {
},
handleSelect
(
root
,
data
)
{
// console.log(root);
// console.log(data);
let
pid
=
null
;
//定义最顶级id
let
upId
=
data
.
upId
;
let
roots
=
root
;
...
...
@@ -124,11 +124,13 @@ export default {
});
}
addId
(
roots
,
upId
);
console
.
log
(
pid
);
this
.
nodeInfo
.
categoryId
=
data
.
id
;
if
(
pid
==
null
)
{
this
.
nodeInfo
.
rootCategoryId
=
data
.
id
;
}
else
{
this
.
nodeInfo
.
rootCategoryId
=
pid
;
// this.$refs.dataTable.$refs.grid.reload(this.nodeInfo);
}
},
loadTree
()
{
let
conditions
=
[];
...
...
@@ -149,35 +151,7 @@ export default {
toggle
()
{
this
.
expand
=
!
this
.
expand
;
},
change
(
v
,
b
)
{
// console.log(v);
// console.log(b);
// }
// var parentList = [];
// buildParentList(v);
// findParent(b.id);
// function buildParentList(arr) {
// arr.forEach(g => {
// console.log(g);
// if (g.upId != undefined) {
// let pid = g["upId"];
// let oid = g["id"];
// parentList[oid] = pid;
// }
// if (g.children != undefined) buildParentList(g["children"]);
// });
// }
// function findParent(idx) {
// alert(idx);
// alert(parentList[idx]);
// if (parentList[idx] != undefined) {
// let pid = parentList[idx];
// console.log(pid);
// findParent(pid);
// } else {
// }
// }
},
change
(
v
,
b
)
{},
hide
()
{
this
.
showMenu
=
false
;
}
...
...
pages/materiel/masterData/masterData.vue
View file @
5647f358
<
template
>
<div
class=
"master-data"
>
{{
nodeInfo
}}
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:initsearch=
"sets"
:high=
"false"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入
工艺名称/工艺编号
"
placeholder=
"请输入
编码/名称/状态
"
v-width=
"200"
v-model=
"easySearch.keys.value"
clearable
...
...
@@ -47,21 +47,25 @@ export default {
props
:
[
"nodeInfo"
],
data
()
{
return
{
action
:
""
,
action
:
Api
.
index
,
modal
:
false
,
title
:
"新增"
,
curId
:
0
,
detail
:
null
,
sets
:
v
=>
{
v
.
categoryId
=
this
.
nodeInfo
.
categoryId
;
v
.
rootCategoryId
=
this
.
nodeInfo
.
rootCategoryId
;
},
easySearch
:
{
keys
:
{
op
:
"
categoryId,rootCategoryId
"
,
value
:
null
},
categoryId
:
{
op
:
"In"
,
value
:
this
.
nodeInfo
.
categoryId
},
rootCategoryId
:
{
op
:
"In"
,
value
:
this
.
nodeInfo
.
rootCategoryId
}
keys
:
{
op
:
"
Code,Name
"
,
value
:
null
},
//
categoryId: {
//
op: "In",
//
value: this.nodeInfo.categoryId
//
},
//
rootCategoryId: {
//
op: "In",
//
value: this.nodeInfo.rootCategoryId
//
}
},
columns
:
[
// {
...
...
@@ -71,17 +75,17 @@ export default {
// width: 60
// },
{
key
:
"
c
ode"
,
key
:
"
C
ode"
,
title
:
"编码"
,
align
:
"left"
},
{
key
:
"
n
ame"
,
key
:
"
N
ame"
,
title
:
"名称"
,
align
:
"left"
},
{
key
:
"
s
tatus"
,
key
:
"
S
tatus"
,
title
:
"状态"
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
...
...
@@ -89,17 +93,21 @@ export default {
props
:
{
code
:
"materail.category.status"
,
type
:
"text"
,
value
:
params
.
row
.
s
tatus
+
""
value
:
params
.
row
.
S
tatus
+
""
}
});
}
},
{
key
:
"description"
,
key
:
"Version"
,
title
:
"版本"
,
align
:
"left"
},
{
key
:
"Description"
,
title
:
"描述"
,
align
:
"left"
},
{
title
:
"操作"
,
key
:
"action"
,
...
...
@@ -132,12 +140,7 @@ export default {
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
Api
.
paged
().
then
(
r
=>
{
if
(
r
.
success
)
{
}
});
},
created
()
{},
methods
:
{
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
...
...
@@ -167,7 +170,7 @@ export default {
});
},
ok
()
{
// this.loadTree(
);
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
modal
=
false
;
this
.
curId
=
0
;
},
...
...
@@ -175,6 +178,13 @@ export default {
this
.
curId
=
0
;
this
.
modal
=
false
;
}
},
watch
:
{
"nodeInfo.categoryId"
(
v
)
{
if
(
v
)
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
}
}
};
</
script
>
...
...
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