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
c26d050f
Commit
c26d050f
authored
Sep 30, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'portal' of
http://git.mes123.com/zhouyx/mes-ui
into portal
parents
4eaf4684
b2cf7a09
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
33 deletions
+71
-33
Addrow.vue
pages/basicData/department/Addrow.vue
+37
-19
add.vue
pages/basicData/department/add.vue
+30
-13
api.js
pages/basicData/department/api.js
+4
-1
No files found.
pages/basicData/department/Addrow.vue
View file @
c26d050f
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</Col>
-->
</Col>
-->
<Col
:span=
"12"
>
<Col
:span=
"12"
>
<FormItem
:label=
"l('upMent')"
>
<FormItem
:label=
"l('upMent')"
>
<b>
{{
entity
.
name
}}
</b>
<b>
{{
entity
.
name
}}
</b>
</FormItem>
</FormItem>
</Col>
</Col>
<Col
:span=
"24"
>
<Col
:span=
"24"
>
...
@@ -43,7 +43,9 @@
...
@@ -43,7 +43,9 @@
</Col>
</Col>
</Row>
</Row>
<FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</FormItem>
<!-- 组织类型 -->
<!-- 组织类型 -->
...
@@ -62,6 +64,18 @@ export default {
...
@@ -62,6 +64,18 @@ export default {
name
:
"Add"
,
name
:
"Add"
,
// components: { OrganizType },
// components: { OrganizType },
data
()
{
data
()
{
const
validateCode
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
"编号不能为空"
));
}
Api
.
isExist
(
value
).
then
((
r
)
=>
{
if
(
r
.
result
)
{
return
callback
(
new
Error
(
"编号已经存在"
));
}
else
{
callback
();
}
});
};
return
{
return
{
// showTree: false, //组织类型
// showTree: false, //组织类型
disabled
:
false
,
disabled
:
false
,
...
@@ -72,13 +86,13 @@ export default {
...
@@ -72,13 +86,13 @@ export default {
organization_Id
:
0
,
organization_Id
:
0
,
organization_Type
:
""
,
organization_Type
:
""
,
departcode
:
""
,
departcode
:
""
,
name
:
''
,
name
:
""
,
},
},
property
:
[],
property
:
[],
location
:
[],
location
:
[],
rules
:
{
rules
:
{
title02
:
[
title02
:
[
{
required
:
true
,
message
:
"库位名不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"库位名不能为空"
,
trigger
:
"blur"
}
,
],
],
departcode
:
[
departcode
:
[
{
required
:
true
,
message
:
"编码不能为空"
,
trigger
:
"blur"
},
{
required
:
true
,
message
:
"编码不能为空"
,
trigger
:
"blur"
},
...
@@ -87,21 +101,25 @@ export default {
...
@@ -87,21 +101,25 @@ export default {
{
{
required
:
true
,
required
:
true
,
message
:
"组织类型不能为空"
,
message
:
"组织类型不能为空"
,
trigger
:
"blur"
trigger
:
"blur"
,
}
},
]
],
}
departcode
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
},
{
validator
:
validateCode
,
trigger
:
"blur"
},
],
},
};
};
},
},
props
:
{
props
:
{
val
:
Object
val
:
Object
,
},
},
created
()
{
created
()
{
// this.entity = {};
// this.entity = {};
},
},
methods
:
{
methods
:
{
handleSubmit
()
{
handleSubmit
()
{
this
.
$refs
[
"form"
].
validate
(
value
=>
{
this
.
$refs
[
"form"
].
validate
(
(
value
)
=>
{
if
(
value
)
{
if
(
value
)
{
let
isProduction
=
0
;
let
isProduction
=
0
;
let
property
=
[];
let
property
=
[];
...
@@ -122,18 +140,18 @@ export default {
...
@@ -122,18 +140,18 @@ export default {
}
}
let
location
=
this
.
location
;
let
location
=
this
.
location
;
let
paramsdata
=
{
let
paramsdata
=
{
parentTitle
:
this
.
entity
.
name
,
parentTitle
:
this
.
entity
.
name
,
name
:
this
.
entity
.
title02
,
//部门名称
name
:
this
.
entity
.
title02
,
//部门名称
parent_Id
:
this
.
entity
.
id
,
//上级部门 [id]
parent_Id
:
this
.
entity
.
id
,
//上级部门 [id]
code
:
this
.
entity
.
departcode
,
//部门编号
code
:
this
.
entity
.
departcode
,
//部门编号
// organization_Id: this.entity.organization_Id, //组织类型 [id]
// organization_Id: this.entity.organization_Id, //组织类型 [id]
location
:
location
.
join
(
","
),
//省市县
location
:
location
.
join
(
","
),
//省市县
isProduction
:
isProduction
,
//是否生产班组:1是,0否
isProduction
:
isProduction
,
//是否生产班组:1是,0否
property
:
property
.
join
(
","
)
//属性
property
:
property
.
join
(
","
)
,
//属性
};
};
Api
.
create
(
paramsdata
)
Api
.
create
(
paramsdata
)
.
then
(
r
=>
{
.
then
(
(
r
)
=>
{
this
.
disabled
=
false
;
this
.
disabled
=
false
;
if
(
r
.
success
)
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功!"
);
this
.
$Message
.
success
(
"保存成功!"
);
...
@@ -142,7 +160,7 @@ export default {
...
@@ -142,7 +160,7 @@ export default {
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
disabled
=
false
;
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
});
});
...
@@ -158,7 +176,7 @@ export default {
...
@@ -158,7 +176,7 @@ export default {
l
(
key
)
{
l
(
key
)
{
key
=
"DipartLocation"
+
"."
+
key
;
key
=
"DipartLocation"
+
"."
+
key
;
return
this
.
$t
(
key
);
return
this
.
$t
(
key
);
}
}
,
},
},
watch
:
{
watch
:
{
val
(
v
)
{
val
(
v
)
{
...
@@ -166,7 +184,7 @@ export default {
...
@@ -166,7 +184,7 @@ export default {
this
.
entity
=
{};
this
.
entity
=
{};
this
.
entity
.
name
=
v
.
name
;
this
.
entity
.
name
=
v
.
name
;
this
.
entity
.
id
=
v
.
id
;
this
.
entity
.
id
=
v
.
id
;
}
}
,
}
}
,
};
};
</
script
>
</
script
>
\ No newline at end of file
pages/basicData/department/add.vue
View file @
c26d050f
...
@@ -39,7 +39,9 @@
...
@@ -39,7 +39,9 @@
</Col>
</Col>
</Row>
</Row>
<FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</FormItem>
<!-- 组织类型 -->
<!-- 组织类型 -->
...
@@ -58,6 +60,18 @@ export default {
...
@@ -58,6 +60,18 @@ export default {
name
:
"Add"
,
name
:
"Add"
,
// components: { OrganizType },
// components: { OrganizType },
data
()
{
data
()
{
const
validateCode
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
(
new
Error
(
"编号不能为空"
));
}
Api
.
isExist
(
value
).
then
((
r
)
=>
{
if
(
r
.
result
)
{
return
callback
(
new
Error
(
"编号已经存在"
));
}
else
{
callback
();
}
});
};
return
{
return
{
// showTree: false, //组织类型
// showTree: false, //组织类型
disabled
:
false
,
disabled
:
false
,
...
@@ -67,7 +81,6 @@ export default {
...
@@ -67,7 +81,6 @@ export default {
// organizationType: ""
// organizationType: ""
departcode
:
""
,
departcode
:
""
,
title02
:
""
,
title02
:
""
,
},
},
property
:
[],
property
:
[],
location
:
[],
location
:
[],
...
@@ -83,15 +96,19 @@ export default {
...
@@ -83,15 +96,19 @@ export default {
// type: 'array',
// type: 'array',
required
:
true
,
required
:
true
,
message
:
"组织类型不能为空"
,
message
:
"组织类型不能为空"
,
trigger
:
"blur"
trigger
:
"blur"
,
}
},
]
],
}
departcode
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
},
{
validator
:
validateCode
,
trigger
:
"blur"
},
],
},
};
};
},
},
methods
:
{
methods
:
{
handleSubmit
()
{
handleSubmit
()
{
this
.
$refs
[
"form"
].
validate
(
value
=>
{
this
.
$refs
[
"form"
].
validate
(
(
value
)
=>
{
if
(
value
)
{
if
(
value
)
{
let
isProduction
=
0
;
let
isProduction
=
0
;
let
property
=
[];
let
property
=
[];
...
@@ -112,17 +129,17 @@ export default {
...
@@ -112,17 +129,17 @@ export default {
}
}
let
location
=
this
.
location
;
let
location
=
this
.
location
;
let
paramsdata
=
{
let
paramsdata
=
{
parentTitle
:
''
,
parentTitle
:
""
,
name
:
this
.
entity
.
title02
,
//部门名称
name
:
this
.
entity
.
title02
,
//部门名称
parent_Id
:
0
,
//上级部门 [id]
parent_Id
:
0
,
//上级部门 [id]
code
:
this
.
entity
.
departcode
,
//部门编号
code
:
this
.
entity
.
departcode
,
//部门编号
organization_Id
:
this
.
entity
.
organization_Id
,
//组织类型 [id]
organization_Id
:
this
.
entity
.
organization_Id
,
//组织类型 [id]
location
:
location
.
join
(
","
),
//省市县
location
:
location
.
join
(
","
),
//省市县
isProduction
:
isProduction
,
//是否生产班组:1是,0否
isProduction
:
isProduction
,
//是否生产班组:1是,0否
property
:
property
.
join
(
","
)
//属性
property
:
property
.
join
(
","
)
,
//属性
};
};
Api
.
create
(
paramsdata
)
Api
.
create
(
paramsdata
)
.
then
(
r
=>
{
.
then
(
(
r
)
=>
{
this
.
disabled
=
false
;
this
.
disabled
=
false
;
if
(
r
.
success
)
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功!"
);
this
.
$Message
.
success
(
"保存成功!"
);
...
@@ -131,7 +148,7 @@ export default {
...
@@ -131,7 +148,7 @@ export default {
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
disabled
=
false
;
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
});
});
...
@@ -147,7 +164,7 @@ export default {
...
@@ -147,7 +164,7 @@ export default {
l
(
key
)
{
l
(
key
)
{
key
=
"DipartLocation"
+
"."
+
key
;
key
=
"DipartLocation"
+
"."
+
key
;
return
this
.
$t
(
key
);
return
this
.
$t
(
key
);
}
}
,
}
}
,
};
};
</
script
>
</
script
>
\ No newline at end of file
pages/basicData/department/api.js
View file @
c26d050f
...
@@ -20,5 +20,8 @@ export default {
...
@@ -20,5 +20,8 @@ export default {
departImport
(
params
)
{
departImport
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/departmentimport/import`
,
params
);
return
Api
.
post
(
`
${
systemUrl
}
/departmentimport/import`
,
params
);
},
},
// 编号是否存在
isExist
(
value
)
{
return
Api
.
post
(
`
${
systemUrl
}
/Department/IsExist`
,
value
);
},
}
}
\ 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