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
bd367f50
Commit
bd367f50
authored
Apr 17, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员
parent
c79dc093
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
55 deletions
+66
-55
zh-CN.js
i18n/locale/zh-CN.js
+2
-1
add.vue
pages/basicData/user/add.vue
+64
-54
No files found.
i18n/locale/zh-CN.js
View file @
bd367f50
...
@@ -65,7 +65,8 @@ export default {
...
@@ -65,7 +65,8 @@ export default {
jobNo
:
'工号'
,
jobNo
:
'工号'
,
departmentTitle
:
'所属部门'
,
departmentTitle
:
'所属部门'
,
roleTitles
:
'角色名称'
,
roleTitles
:
'角色名称'
,
enableEquip
:
'可操控设备'
enableEquip
:
'可操控设备'
,
property
:
'属性'
},
},
resource
:
{
resource
:
{
id
:
'编号'
,
id
:
'编号'
,
...
...
pages/basicData/user/add.vue
View file @
bd367f50
...
@@ -68,6 +68,11 @@
...
@@ -68,6 +68,11 @@
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
<Dictionary
code=
"User.base.workLicense"
v-model=
"entity.licensedToWork"
></Dictionary>
</FormItem>
</FormItem>
</Col>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('property')"
>
<Checkbox
v-model=
"entity.property"
>
排产资源
</Checkbox>
</FormItem>
</Col>
<Col
:span=
"24"
>
<Col
:span=
"24"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<FormItem
:label=
"l('remark')"
prop=
"remark"
>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
<Input
v-model=
"entity.remark"
type=
"textarea"
:rows=
"3"
></Input>
...
@@ -82,138 +87,143 @@
...
@@ -82,138 +87,143 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Api
from
'./api'
import
Api
from
"./api"
;
const
valideTel
=
(
rule
,
value
,
callback
)
=>
{
const
valideTel
=
(
rule
,
value
,
callback
)
=>
{
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
var
re
=
/^1
[
3-9
]{1}[
0-9
]{9}
/
;
if
(
value
===
''
||
value
===
null
)
{
if
(
value
===
""
||
value
===
null
)
{
callback
(
new
Error
(
'请输入手机号'
))
callback
(
new
Error
(
"请输入手机号"
));
}
else
if
(
!
re
.
test
(
value
))
{
}
else
if
(
!
re
.
test
(
value
))
{
callback
(
new
Error
(
'请输入正确手机号'
))
callback
(
new
Error
(
"请输入正确手机号"
));
}
else
{
}
else
{
callback
()
callback
()
;
}
}
}
}
;
export
default
{
export
default
{
name
:
'Add'
,
name
:
"Add"
,
components
:
{},
components
:
{},
data
()
{
data
()
{
const
validateCarNo
=
(
rule
,
value
,
callback
)
=>
{
const
validateCarNo
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
if
(
!
value
)
{
return
callback
(
new
Error
(
'员工编号不能为空'
))
return
callback
(
new
Error
(
"员工编号不能为空"
));
}
}
Api
.
list
(
value
).
then
(
(
r
)
=>
{
Api
.
list
(
value
).
then
(
r
=>
{
if
(
r
.
result
.
length
>
0
)
{
if
(
r
.
result
.
length
>
0
)
{
return
callback
(
new
Error
(
'员工编号已经存在'
))
return
callback
(
new
Error
(
"员工编号已经存在"
));
}
else
{
}
else
{
callback
()
callback
();
}
})
}
}
});
};
return
{
return
{
disabled
:
false
,
disabled
:
false
,
showDeptTree
:
false
,
showDeptTree
:
false
,
entity
:
{
entity
:
{
gender
:
1
,
gender
:
1
,
status
:
1
status
:
1
,
property
:
false
},
},
rules
:
{
rules
:
{
userName
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
userName
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
cardNo
:
[
cardNo
:
[
{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
},
{
validator
:
validateCarNo
,
trigger
:
'blur'
}
{
validator
:
validateCarNo
,
trigger
:
"blur"
}
],
],
departmentTitle
:
[
departmentTitle
:
[
{
required
:
true
,
message
:
'必选'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
"必选"
,
trigger
:
"change"
}
],
],
// email: [
// email: [
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// { required: true, message: '必填', trigger: 'blur', type: 'email' }
// ],
// ],
phone
:
[{
validator
:
valideTel
,
required
:
true
,
trigger
:
'blur'
}]
phone
:
[{
validator
:
valideTel
,
required
:
true
,
trigger
:
"blur"
}]
// degreeId: [
// degreeId: [
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// { required: true, message: '必填', trigger: 'blur', type: 'number' }
// ],
// ],
// phone: [{ required: true, message: '必填', trigger: 'blur' }]
// phone: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
}
}
;
},
},
props
:
{
props
:
{
v
:
Object
v
:
Object
},
},
methods
:
{
methods
:
{
handleSubmit
()
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
(
v
)
=>
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
if
(
v
)
{
this
.
disabled
=
true
if
(
this
.
entity
.
property
)
{
this
.
entity
.
property
=
2
;
}
else
{
this
.
entity
.
property
=
""
;
}
this
.
disabled
=
true
;
Api
.
create
(
this
.
entity
)
Api
.
create
(
this
.
entity
)
.
then
(
(
r
)
=>
{
.
then
(
r
=>
{
this
.
disabled
=
false
this
.
disabled
=
false
;
if
(
r
.
success
)
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
this
.
$Message
.
success
(
"保存成功"
);
//账户同步操作start
//账户同步操作start
let
parms
=
{
let
parms
=
{
userId
:
r
.
result
.
id
,
userId
:
r
.
result
.
id
,
loginName
:
this
.
entity
.
phone
,
//用户电话
loginName
:
this
.
entity
.
phone
,
//用户电话
status
:
this
.
entity
.
status
,
//状态
status
:
this
.
entity
.
status
,
//状态
tanantCode
:
this
.
$store
.
state
.
userInfo
.
tanantCode
//商户号
tanantCode
:
this
.
$store
.
state
.
userInfo
.
tanantCode
//商户号
}
}
;
Api
.
authAccount
(
parms
).
then
(
(
res
)
=>
{
Api
.
authAccount
(
parms
).
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
'账户同步成功'
)
this
.
$Message
.
success
(
"账户同步成功"
);
//修改用户表的accountId start
//修改用户表的accountId start
let
parms1
=
{
let
parms1
=
{
userId
:
parms
.
userId
,
userId
:
parms
.
userId
,
accountId
:
res
.
result
accountId
:
res
.
result
}
}
;
Api
.
updateAccount
(
parms1
).
then
(
(
res1
)
=>
{
Api
.
updateAccount
(
parms1
).
then
(
res1
=>
{
if
(
res1
.
success
)
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
'操作成功'
)
this
.
$Message
.
success
(
"操作成功"
);
this
.
$emit
(
'on-ok'
)
this
.
$emit
(
"on-ok"
);
}
}
else
{
else
{
this
.
$Message
.
error
(
"同步失败"
);
this
.
$Message
.
error
(
'同步失败'
)
}
}
})
})
;
//修改用户表的accountId end
//修改用户表的accountId end
}
}
})
})
;
//账户同步操作end
//账户同步操作end
}
else
{
}
else
{
this
.
$Message
.
error
(
r
.
error
.
message
)
this
.
$Message
.
error
(
r
.
error
.
message
)
;
}
}
})
})
.
catch
(
(
err
)
=>
{
.
catch
(
err
=>
{
// alert(JSON.stringify(err))
// alert(JSON.stringify(err))
console
.
warn
(
err
)
console
.
warn
(
err
)
;
this
.
disabled
=
false
this
.
disabled
=
false
;
this
.
$Message
.
error
(
err
.
error
.
message
)
this
.
$Message
.
error
(
err
.
error
.
message
)
;
})
})
;
}
}
})
})
;
},
},
handleClose
()
{
handleClose
()
{
this
.
$emit
(
'on-close'
)
this
.
$emit
(
"on-close"
);
},
},
l
(
key
)
{
l
(
key
)
{
key
=
'user'
+
'.'
+
key
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
)
return
this
.
$t
(
key
)
;
},
},
setDepartmentTitle
(
v
,
item
)
{
setDepartmentTitle
(
v
,
item
)
{
this
.
entity
.
departmentTitle
=
item
.
name
this
.
entity
.
departmentTitle
=
item
.
name
;
},
},
selectDepart
()
{
selectDepart
()
{
this
.
showDeptTree
=
true
this
.
showDeptTree
=
true
;
},
},
getBirthday
(
value
)
{
getBirthday
(
value
)
{
this
.
entity
.
birthday
=
value
this
.
entity
.
birthday
=
value
;
}
}
},
},
watch
:
{
watch
:
{
v
()
{
v
()
{
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
this
.
entity
=
this
.
$u
.
clone
(
this
.
v
)
;
}
}
}
}
}
}
;
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.addUser {
.addUser {
...
...
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