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
35adbb58
Commit
35adbb58
authored
Jun 05, 2020
by
kangzhenfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product
parents
897f05a8
20adf7bb
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
531 additions
and
63 deletions
+531
-63
add.vue
pages/materiel/classification/add.vue
+4
-3
edit.vue
pages/materiel/classification/edit.vue
+200
-2
index.vue
pages/materiel/classification/index.vue
+23
-17
add.vue
pages/materiel/classification/masterData/add.vue
+0
-0
index.vue
pages/materiel/classification/masterData/index.vue
+111
-0
sonAdd.vue
pages/materiel/classification/sonAdd.vue
+92
-0
sonEdit.vue
pages/materiel/classification/sonEdit.vue
+101
-0
index.vue
pages/materiel/classification/spareParts/index.vue
+0
-41
No files found.
pages/materiel/classification/add.vue
View file @
35adbb58
...
...
@@ -2,11 +2,11 @@
<div>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
>
<
!--
<
Col
:span=
"12"
>
<FormItem
label=
"编码"
prop=
"code"
>
<Input
v-model=
"entity.code"
placeholder=
"请输入"
disabled
></Input>
</FormItem>
</Col>
</Col>
-->
<Col
:span=
"12"
>
<FormItem
label=
"名称"
prop=
"name"
>
<Input
v-model=
"entity.name"
placeholder=
"请输入"
></Input>
...
...
@@ -179,8 +179,9 @@ export default {
let
pro
=
this
.
checkList
;
Api
.
create
({
categoryDto
:
categoryDto
,
pro
:
pro
})
.
then
(
r
=>
{
if
(
r
.
result
)
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
...
...
pages/materiel/classification/edit.vue
View file @
35adbb58
<
template
>
<div>
55555555
</div>
</
template
>
\ No newline at end of file
<div>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<!--
<Col
:span=
"12"
>
<FormItem
label=
"编码"
prop=
"code"
>
<Input
v-model=
"entity.code"
placeholder=
"请输入"
disabled
></Input>
</FormItem>
</Col>
-->
<Col
:span=
"12"
>
<FormItem
label=
"名称"
prop=
"name"
>
<Input
v-model=
"entity.name"
placeholder=
"请输入"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"状态"
prop=
"status"
placeholder=
"请选择"
>
<Dictionary
code=
"materail.category.status"
v-model=
"entity.status"
type=
"select"
:value=
"entity.status"
:key=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
label=
"描述"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
placeholder=
"请输入..."
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
>
<h4>
属性配置
</h4>
</Col>
<Col
:span=
"24"
style=
"padding:20px 0 0px 10px;margin-bottom:10px;"
class=
"table-solt"
>
<Table
border
:columns=
"columns"
:data=
"checkList"
class=
"tableCommon"
height=
"300"
>
<template
slot-scope=
"
{ row, index }" slot="note">
<Input
v-model=
"row.note"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"datatype"
>
<!--
<Input
v-model=
"row.datatype"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
-->
<Select
v-model=
"row.datatype"
style=
"width:200px"
@
on-change=
"setRow(row,index)"
>
<Option
v-for=
"item in cityList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
</
template
>
<!-- <template slot-scope="{ row, index }" slot="result">
<Input v-model="row.result" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>-->
<
template
slot-scope=
"{ row, index }"
slot=
"required"
>
<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>
</
template
>
</Table>
</Col>
<Col
:span=
"24"
style=
"margin-bottom:20px;"
>
<Button
type=
"primary"
long
@
click=
"addNew"
class=
"mt10"
>
添加
</Button>
</Col>
<Col
:span=
"24"
style=
"text-align: right;"
>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
export
default
{
data
()
{
return
{
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
:
[
{
title
:
"序号"
,
type
:
"index"
,
width
:
80
,
align
:
"center"
},
{
title
:
"属性名称"
,
key
:
"title"
,
align
:
"center"
},
{
title
:
"备注"
,
key
:
"note"
,
align
:
"center"
,
slot
:
"note"
},
{
title
:
"属性类型"
,
key
:
"datatype"
,
align
:
"center"
,
slot
:
"datatype"
},
// {
// title: "是否显示",
// key: "result",
// align: "center",
// slot: "result"
// },
{
title
:
"是否必填"
,
key
:
"required"
,
align
:
"center"
,
slot
:
"required"
},
{
title
:
"是否唯一属性"
,
key
:
"isunique"
,
align
:
"center"
,
slot
:
"isunique"
}
],
checkList
:
[],
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
}
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
mounted
()
{
this
.
tableData
();
},
methods
:
{
tableData
()
{
let
conditions
=
[];
Api
.
listTable
({
conditions
:
conditions
}).
then
(
r
=>
{
if
(
r
.
result
)
{
console
.
log
(
r
);
this
.
checkList
=
r
.
result
;
}
});
},
setRow
()
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
let
categoryDto
=
this
.
entity
;
let
pro
=
this
.
checkList
;
Api
.
create
({
categoryDto
:
categoryDto
,
pro
:
pro
})
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
}
}
};
</
script
>
pages/materiel/classification/index.vue
View file @
35adbb58
...
...
@@ -85,8 +85,8 @@ export default {
}
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
'loadDictionary'
)
// 加载数据字典
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
this
.
loadTree
();
...
...
@@ -104,19 +104,26 @@ async fetch({ store, params }) {
addNew
()
{
// this.nodeInfo.id = 0;
// let conditions = [];
// debugger
this
.
add
();
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
add
()
{
//
this.curId = 0;
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./
a
dd"
);
this
.
detail
=
()
=>
import
(
"./
sonA
dd"
);
this
.
modal
=
true
;
},
edit
()
{
if
(
this
.
nodeInfo
.
upId
==
0
)
{
this
.
detail
=
()
=>
import
(
"./edit"
);
}
else
{
this
.
detail
=
()
=>
import
(
"./sonEdit"
);
}
this
.
curId
=
this
.
nodeInfo
.
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
()
{
...
...
@@ -172,17 +179,16 @@ async fetch({ store, params }) {
loadTree
()
{
let
conditions
=
[];
Api
.
list
({
conditions
:
conditions
}).
then
(
r
=>
{
setTree
(
r
.
result
);
function
setTree
(
data
)
{
data
.
map
(
u
=>
{
u
.
title
=
u
.
name
;
var
data
=
this
.
$u
.
toTree
(
r
.
result
,
0
,
u
=>
{
u
.
title
=
u
.
code
+
u
.
name
;
u
.
value
=
u
.
id
;
if
(
u
.
children
)
{
setTree
(
u
.
children
);
}
});
}
var
data
=
r
.
result
;
u
.
expand
=
true
;
},
"upId"
);
this
.
list
=
this
.
$u
.
clone
(
data
);
});
},
...
...
pages/materiel/classification/
spareParts
/add.vue
→
pages/materiel/classification/
masterData
/add.vue
View file @
35adbb58
File moved
pages/materiel/classification/masterData/index.vue
0 → 100644
View file @
35adbb58
<
template
>
<div
class=
"master-data"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入编码/名称"
v-width=
"200"
v-model=
"easySearch.keys.value"
clearable
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1120"
footer-hide
>
<component
:is=
"detail"
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
</template>
<
script
>
export
default
{
data
()
{
return
{
action
:
""
,
detail
:
null
,
modal
:
false
,
curId
:
0
,
easySearch
:
{
keys
:
{
op
:
"name,code"
,
value
:
null
}
},
title
:
""
,
columns
:
[
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
width
:
200
,
easy
:
true
,
high
:
true
},
{
key
:
"name"
,
title
:
"名称"
,
align
:
"left"
,
easy
:
true
,
high
:
true
,
tooltip
:
true
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
260
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
)
}
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
},
"删除"
)
]);
}
}
]
};
},
methods
:
{
edit
()
{
this
.
modal
=
true
;
this
.
detail
=
()
=>
import
(
"./add"
);
},
remove
()
{},
add
()
{
this
.
modal
=
true
;
this
.
detail
=
()
=>
import
(
"./add"
);
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
ok
()
{
// this.$refs.grid.load();
this
.
modal
=
false
;
this
.
curId
=
0
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
.spare-parts {
width: 100%;
height: 100%;
}
</
style
>
\ No newline at end of file
pages/materiel/classification/sonAdd.vue
0 → 100644
View file @
35adbb58
<
template
>
<div>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
>
<FormItem
label=
"上级名称"
prop=
"upName"
>
<Input
v-model=
"upName"
placeholder=
"请输入"
disabled
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"编码"
prop=
"code"
>
<Input
v-model=
"entity.code"
placeholder=
"请输入"
disabled
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"名称"
prop=
"name"
>
<Input
v-model=
"entity.name"
placeholder=
"请输入"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"状态"
prop=
"status"
placeholder=
"请选择"
>
<Dictionary
code=
"materail.category.status"
v-model=
"entity.status"
type=
"select"
:value=
"entity.status"
:key=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
label=
"描述"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
placeholder=
"请输入..."
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
style=
"text-align: right;"
>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
data
()
{
return
{
entity
:
{
upId
:
this
.
nodeInfo
.
id
,
code
:
0
},
upName
:
this
.
nodeInfo
.
title
,
disabled
:
false
,
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
}
};
},
props
:
[
"nodeInfo"
],
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
mounted
()
{},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
Api
.
create
({
categoryDto
:
this
.
entity
,
pro
:
[]
})
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
}
}
};
</
script
>
pages/materiel/classification/sonEdit.vue
0 → 100644
View file @
35adbb58
<
template
>
<div>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
:span=
"12"
>
<FormItem
label=
"上级名称"
prop=
"upName"
>
<Input
v-model=
"upName"
placeholder=
"请输入"
disabled
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"编码"
prop=
"code"
>
<Input
v-model=
"entity.code"
placeholder=
"请输入"
disabled
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"名称"
prop=
"name"
>
<Input
v-model=
"entity.name"
placeholder=
"请输入"
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"状态"
prop=
"status"
placeholder=
"请选择"
>
<Dictionary
code=
"materail.category.status"
v-model=
"entity.status"
type=
"select"
:value=
"entity.status"
:key=
"entity.status"
></Dictionary>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
label=
"描述"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
placeholder=
"请输入..."
></Input>
</FormItem>
</Col>
<Col
:span=
"24"
style=
"text-align: right;"
>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
data
()
{
return
{
entity
:
{
upId
:
0
,
code
:
0
},
upName
:
this
.
nodeInfo
.
title
,
disabled
:
false
,
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
}
};
},
props
:
[
"nodeInfo"
],
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
mounted
()
{
this
.
get
();
},
methods
:
{
get
()
{
Api
.
get
({
id
:
this
.
nodeInfo
.
id
}).
then
(
r
=>
{
if
(
r
.
result
)
{
this
.
entity
=
r
.
result
;
}
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
Api
.
update
({
categoryDto
:
this
.
entity
,
pro
:
[]
})
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
}
}
};
</
script
>
pages/materiel/classification/spareParts/index.vue
deleted
100644 → 0
View file @
897f05a8
<
template
>
<div
class=
"spare-parts"
>
<Button
type=
"dashed"
@
click=
"add"
>
新增
</Button>
<Modal
v-model=
"addModal"
title=
"新增"
footer-hide
width=
'1000'
>
<Add
@
on-close=
"cancel"
@
on-ok=
"addOk"
ref=
"add"
/>
</Modal>
</div>
</
template
>
<
script
>
import
Add
from
"./add"
;
export
default
{
components
:
{
Add
},
data
()
{
return
{
addModal
:
false
};
},
methods
:
{
add
()
{
this
.
addModal
=
true
;
},
remove
(){
},
addOk
()
{
this
.
addModal
=
false
;
},
cancel
()
{
this
.
addModal
=
false
;
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
.spare-parts {
width: 100%;
height: 100%;
}
</
style
>
\ No newline at end of file
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