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
b2cf7a09
Commit
b2cf7a09
authored
Sep 30, 2020
by
zhanglongtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门编号限制
parent
8055e5a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
37 deletions
+75
-37
Addrow.vue
pages/basicData/department/Addrow.vue
+38
-20
add.vue
pages/basicData/department/add.vue
+32
-15
api.js
pages/basicData/department/api.js
+4
-1
edit.vue
pages/basicData/department/edit.vue
+1
-1
No files found.
pages/basicData/department/Addrow.vue
View file @
b2cf7a09
...
...
@@ -7,7 +7,7 @@
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departcode')"
>
<FormItem
:label=
"l('departcode')"
prop=
"departcode"
>
<Input
v-model=
"entity.departcode"
placeholder=
"请输入..."
></Input>
</FormItem>
</Col>
...
...
@@ -20,7 +20,7 @@
</Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('upMent')"
>
<b>
{{
entity
.
name
}}
</b>
<b>
{{
entity
.
name
}}
</b>
</FormItem>
</Col>
...
...
@@ -44,7 +44,9 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<!-- 组织类型 -->
...
...
@@ -63,6 +65,18 @@ export default {
name
:
"Add"
,
// components: { OrganizType },
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
{
// showTree: false, //组织类型
disabled
:
false
,
...
...
@@ -73,33 +87,37 @@ export default {
organization_Id
:
0
,
organization_Type
:
""
,
departcode
:
""
,
name
:
''
,
name
:
""
,
},
property
:
[],
location
:
[],
rules
:
{
title02
:
[
{
required
:
true
,
message
:
"库位名不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"库位名不能为空"
,
trigger
:
"blur"
}
,
],
organizationType
:
[
{
required
:
true
,
message
:
"组织类型不能为空"
,
trigger
:
"blur"
}
]
}
trigger
:
"blur"
,
},
],
departcode
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
},
{
validator
:
validateCode
,
trigger
:
"blur"
},
],
},
};
},
props
:
{
val
:
Object
val
:
Object
,
},
created
()
{
// this.entity = {};
},
methods
:
{
handleSubmit
()
{
this
.
$refs
[
"form"
].
validate
(
value
=>
{
this
.
$refs
[
"form"
].
validate
(
(
value
)
=>
{
if
(
value
)
{
let
isProduction
=
0
;
let
property
=
[];
...
...
@@ -120,18 +138,18 @@ export default {
}
let
location
=
this
.
location
;
let
paramsdata
=
{
parentTitle
:
this
.
entity
.
name
,
parentTitle
:
this
.
entity
.
name
,
name
:
this
.
entity
.
title02
,
//部门名称
parent_Id
:
this
.
entity
.
id
,
//上级部门 [id]
code
:
this
.
entity
.
departcode
,
//部门编号
// organization_Id: this.entity.organization_Id, //组织类型 [id]
location
:
location
.
join
(
","
),
//省市县
isProduction
:
isProduction
,
//是否生产班组:1是,0否
property
:
property
.
join
(
","
)
//属性
isProduction
:
isProduction
,
//是否生产班组:1是,0否
property
:
property
.
join
(
","
)
,
//属性
};
Api
.
create
(
paramsdata
)
.
then
(
r
=>
{
.
then
(
(
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功!"
);
...
...
@@ -140,7 +158,7 @@ export default {
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
}
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
});
...
...
@@ -156,7 +174,7 @@ export default {
l
(
key
)
{
key
=
"DipartLocation"
+
"."
+
key
;
return
this
.
$t
(
key
);
}
}
,
},
watch
:
{
val
(
v
)
{
...
...
@@ -164,7 +182,7 @@ export default {
this
.
entity
=
{};
this
.
entity
.
name
=
v
.
name
;
this
.
entity
.
id
=
v
.
id
;
}
}
}
,
}
,
};
</
script
>
\ No newline at end of file
pages/basicData/department/add.vue
View file @
b2cf7a09
...
...
@@ -7,7 +7,7 @@
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departcode')"
>
<FormItem
:label=
"l('departcode')"
prop=
"departcode"
>
<Input
v-model=
"entity.departcode"
placeholder=
"请输入..."
></Input>
</FormItem>
</Col>
...
...
@@ -39,7 +39,9 @@
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button
>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
<!-- 组织类型 -->
...
...
@@ -58,6 +60,18 @@ export default {
name
:
"Add"
,
// components: { OrganizType },
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
{
// showTree: false, //组织类型
disabled
:
false
,
...
...
@@ -67,28 +81,31 @@ export default {
// organizationType: ""
departcode
:
""
,
title02
:
""
,
},
property
:
[],
location
:
[],
rules
:
{
title02
:
[
{
required
:
true
,
message
:
"库位名不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"库位名不能为空"
,
trigger
:
"blur"
}
,
],
organizationType
:
[
{
// type: 'array',
required
:
true
,
message
:
"组织类型不能为空"
,
trigger
:
"blur"
}
]
}
trigger
:
"blur"
,
},
],
departcode
:
[
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
},
{
validator
:
validateCode
,
trigger
:
"blur"
},
],
},
};
},
methods
:
{
handleSubmit
()
{
this
.
$refs
[
"form"
].
validate
(
value
=>
{
this
.
$refs
[
"form"
].
validate
(
(
value
)
=>
{
if
(
value
)
{
let
isProduction
=
0
;
let
property
=
[];
...
...
@@ -109,17 +126,17 @@ export default {
}
let
location
=
this
.
location
;
let
paramsdata
=
{
parentTitle
:
''
,
parentTitle
:
""
,
name
:
this
.
entity
.
title02
,
//部门名称
parent_Id
:
0
,
//上级部门 [id]
code
:
this
.
entity
.
departcode
,
//部门编号
organization_Id
:
this
.
entity
.
organization_Id
,
//组织类型 [id]
location
:
location
.
join
(
","
),
//省市县
isProduction
:
isProduction
,
//是否生产班组:1是,0否
property
:
property
.
join
(
","
)
//属性
property
:
property
.
join
(
","
)
,
//属性
};
Api
.
create
(
paramsdata
)
.
then
(
r
=>
{
.
then
(
(
r
)
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功!"
);
...
...
@@ -128,7 +145,7 @@ export default {
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
}
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败,请联系管理员"
);
});
...
...
@@ -144,7 +161,7 @@ export default {
l
(
key
)
{
key
=
"DipartLocation"
+
"."
+
key
;
return
this
.
$t
(
key
);
}
}
}
,
}
,
};
</
script
>
\ No newline at end of file
pages/basicData/department/api.js
View file @
b2cf7a09
...
...
@@ -20,5 +20,8 @@ export default {
departImport
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/departmentimport/import`
,
params
);
},
// 编号是否存在
isExist
(
value
)
{
return
Api
.
post
(
`
${
systemUrl
}
/Department/IsExist`
,
value
);
},
}
\ No newline at end of file
pages/basicData/department/edit.vue
View file @
b2cf7a09
...
...
@@ -8,7 +8,7 @@
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('departcode')"
>
<Input
v-model=
"entity.code"
placeholder=
"请输入..."
></Input>
<Input
v-model=
"entity.code"
placeholder=
"请输入..."
disabled
></Input>
</FormItem>
</Col>
<!--
<Col
:span=
"12"
>
...
...
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