bug修复
This commit is contained in:
parent
a18ec54d1d
commit
0dcd14e887
|
|
@ -2,15 +2,28 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.gs.sub.evaluate.evaluate.dao.PersonDao">
|
||||
<insert id="addPersonInfo" keyProperty="userId" useGeneratedKeys="true">
|
||||
insert into sys_user(username, password, nickname, id_card, phone, sex, status, org_id)
|
||||
values (#{name},
|
||||
#{password},
|
||||
#{name},
|
||||
#{idCard},
|
||||
#{phone},
|
||||
#{sex},
|
||||
'1',
|
||||
#{deptId})
|
||||
INSERT INTO sys_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">username,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="name != null and name != ''">nickname,</if>
|
||||
<if test="idCard != null and idCard != ''">id_card,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="deptId != null and deptId != ''">org_id,</if>
|
||||
status
|
||||
</trim>
|
||||
VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
'1'
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="addPersonRole">
|
||||
insert into sys_role_user(userId, roleId) values
|
||||
|
|
@ -22,14 +35,30 @@
|
|||
insert into sys_role_user(userId, roleId) values (#{id}, #{roleId})
|
||||
</insert>
|
||||
<update id="updatePerson">
|
||||
update sys_user
|
||||
set username = #{name},
|
||||
id_card = #{idCard},
|
||||
phone = #{phone},
|
||||
nickname = #{name},
|
||||
sex =#{sex},
|
||||
org_id = #{deptId}
|
||||
where id = #{id}
|
||||
UPDATE sys_user
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
username = #{name},
|
||||
nickname = #{name},
|
||||
</if>
|
||||
|
||||
<if test="idCard != null and idCard != ''">
|
||||
id_card = #{idCard},
|
||||
</if>
|
||||
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
|
||||
<if test="sex != null">
|
||||
sex = #{sex},
|
||||
</if>
|
||||
|
||||
<if test="deptId != null and deptId != ''">
|
||||
org_id = #{deptId}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateOldUser">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
|
|
|
|||
|
|
@ -47,14 +47,14 @@
|
|||
autocomplete="off" class="layui-input" lay-verify="required" maxlength="20">
|
||||
</div>
|
||||
</div>-->
|
||||
<!-- <div class="layui-form-item" style="width: 90%">
|
||||
<label class="layui-form-label" style="width: 150px"><span
|
||||
style="color: red">*</span>身份证号码:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
<input class="layui-input" id="idCard" name="idCard" lay-verify="required\|idCard"
|
||||
lay-affix="clear" autocomplete="off" maxlength="18">
|
||||
</div>
|
||||
</div>-->
|
||||
<!-- <div class="layui-form-item" style="width: 90%">
|
||||
<label class="layui-form-label" style="width: 150px"><span
|
||||
style="color: red">*</span>身份证号码:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
<input class="layui-input" id="idCard" name="idCard" lay-verify="required\|idCard"
|
||||
lay-affix="clear" autocomplete="off" maxlength="18">
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="layui-form-item" style="width: 90%">
|
||||
<label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>姓名:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
|
|
@ -64,15 +64,15 @@
|
|||
autocomplete="off" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="layui-form-item" style="width: 90%">
|
||||
<label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>性别:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
<select id="sex" name="sex" class="layui-select" lay-search>
|
||||
<option value="1">男</option>
|
||||
<option value="2">女</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>-->
|
||||
<!-- <div class="layui-form-item" style="width: 90%">
|
||||
<label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>性别:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
<select id="sex" name="sex" class="layui-select" lay-search>
|
||||
<option value="1">男</option>
|
||||
<option value="2">女</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="layui-form-item" style="width: 90%">
|
||||
<label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>联系电话:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item" id="dept">
|
||||
<label class="layui-form-label" style="width: 150px"><span
|
||||
style="color: red">*</span>所属项目/部门:</label>
|
||||
<div class="layui-input-inline" style="width: 60%">
|
||||
|
|
@ -148,6 +148,7 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getDeptSelect() {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
|
|
@ -158,15 +159,16 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
layui.use(['form', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
form.verify({
|
||||
/* idCard: function (value, item) {
|
||||
if (!checkPsidno(value)) {
|
||||
return '请输入正确的身份证号';
|
||||
}
|
||||
},*/
|
||||
/* idCard: function (value, item) {
|
||||
if (!checkPsidno(value)) {
|
||||
return '请输入正确的身份证号';
|
||||
}
|
||||
},*/
|
||||
phone: function (value, item) {
|
||||
if (!phone_reg(value)) {
|
||||
return '请输入正确的手机号';
|
||||
|
|
@ -178,32 +180,38 @@
|
|||
if (obj.value == 5) {
|
||||
$('#deptId').val(7); // 设置为发展运营中心
|
||||
$('#deptId').attr('disabled', 'disabled');
|
||||
} else if (obj.value == 7) {
|
||||
$('#deptId').val("");
|
||||
$('#deptId').removeAttr('lay-verify');
|
||||
$('#dept').hide();
|
||||
} else {
|
||||
$('#deptId').val("");
|
||||
$('#deptId').removeAttr('disabled');
|
||||
$('#deptId').attr('lay-verify','required');
|
||||
$('#dept').show();
|
||||
}
|
||||
layui.form.render('select'); // 刷新下拉框
|
||||
});
|
||||
// 提交事件
|
||||
form.on('submit(formSubmit)', function (data) {
|
||||
//对身份证和手机号验证
|
||||
/* if ($('#idCard').val() == null || $('#idCard').val() == "") {
|
||||
layer.msg("请输入身份证号", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}*/
|
||||
/* if (!checkPsidno($("#idCard").val())) {
|
||||
layer.msg("身份证号码格式不正确", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}*/
|
||||
/* if ($('#idCard').val() == null || $('#idCard').val() == "") {
|
||||
layer.msg("请输入身份证号", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}*/
|
||||
/* if (!checkPsidno($("#idCard").val())) {
|
||||
layer.msg("身份证号码格式不正确", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}*/
|
||||
|
||||
if ($('#name').val() == null || $('#name').val() == "") {
|
||||
layer.msg("请输入姓名", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}
|
||||
/* if ($('#sex').val() == null || $('#sex').val() == "") {
|
||||
layer.msg("请选择性别", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}*/
|
||||
/* if ($('#sex').val() == null || $('#sex').val() == "") {
|
||||
layer.msg("请选择性别", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}*/
|
||||
if ($('#phone').val() == null || $('#phone').val() == "") {
|
||||
layer.msg("请输入手机号", {icon: 2, time: 2000});
|
||||
return false;
|
||||
|
|
@ -216,10 +224,10 @@
|
|||
layer.msg("请选择角色", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}
|
||||
if ($('#deptId').val() == null || $('#deptId').val() == "") {
|
||||
layer.msg("请选择所属部门", {icon: 2, time: 2000});
|
||||
return false;
|
||||
}
|
||||
// if ($('#deptId').val() == null || $('#deptId').val() == "") {
|
||||
// layer.msg("请选择所属部门", {icon: 2, time: 2000});
|
||||
// return false;
|
||||
// }
|
||||
|
||||
$.ajax({
|
||||
url: ctxPath + '/evaluatePerson/addPersonInfo',
|
||||
|
|
|
|||
Loading…
Reference in New Issue