bug修复
This commit is contained in:
parent
0dcd14e887
commit
d146a6f218
|
|
@ -8,6 +8,7 @@ import com.bonus.gs.sub.evaluate.manager.utils.AesCbcUtils;
|
|||
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
|
||||
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
|
@ -46,8 +47,8 @@ public class PersonServiceImpl implements PersonService {
|
|||
list.forEach(personBean -> {
|
||||
personBean.setSex("男".equals(personBean.getSex()) ? "1" : "0");
|
||||
personBean.setPassword(passwordEncoder.encode(password));
|
||||
// personBean.setEvaluatePassWord(AesCbcUtils.encrypt(password));
|
||||
personBean.setEvaluatePassWord(password);
|
||||
personBean.setDeptId(StringUtils.isBlank(personBean.getDeptId()) ? "0" : personBean.getDeptId());
|
||||
});
|
||||
for (PersonBean personBean : list) {
|
||||
dao.addPersonInfo(personBean);
|
||||
|
|
@ -68,6 +69,7 @@ public class PersonServiceImpl implements PersonService {
|
|||
public AjaxRes updatePerson(PersonBean o) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
try {
|
||||
o.setDeptId(StringUtils.isBlank(o.getDeptId()) ? "0" : o.getDeptId());
|
||||
dao.deletePersonRole(o.getId());
|
||||
dao.updatePerson(o);
|
||||
dao.addPersonRoleById(o);
|
||||
|
|
|
|||
|
|
@ -180,8 +180,9 @@
|
|||
if (obj.value == 5) {
|
||||
$('#deptId').val(7); // 设置为发展运营中心
|
||||
$('#deptId').attr('disabled', 'disabled');
|
||||
$('#dept').show();
|
||||
} else if (obj.value == 7) {
|
||||
$('#deptId').val("");
|
||||
$('#deptId').val('');
|
||||
$('#deptId').removeAttr('lay-verify');
|
||||
$('#dept').hide();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item" id="dept">
|
||||
<label class="layui-form-label"><span style="color: red">*</span>所属部门/项目</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="deptId" style="width: 100%;" name="deptId" class="layui-select" lay-search
|
||||
|
|
@ -117,6 +117,7 @@
|
|||
|
||||
form.render();
|
||||
})
|
||||
|
||||
function initData(data) {
|
||||
$("#name").val(data.name);
|
||||
$("#sex").val(data.sex === '男' ? 1 : 0);
|
||||
|
|
@ -128,25 +129,23 @@
|
|||
|
||||
function changeDept(value, name) {
|
||||
let elem = $("#deptId");
|
||||
if (value == '7' || name === '项目经理') {
|
||||
//清空部门
|
||||
elem.empty();
|
||||
//设置不可选并去除验证
|
||||
elem.attr("disabled", "disabled");
|
||||
elem.addClass('layui-disabled');
|
||||
elem.removeAttr("lay-verify");
|
||||
//删除所属部门/项目前面的*
|
||||
$(".layui-form-label:eq(5)").html("所属部门/项目");
|
||||
if (value == 7) {
|
||||
$('#deptId').val('');
|
||||
$('#deptId').removeAttr('lay-verify');
|
||||
$('#dept').hide();
|
||||
} else if (value == 5) {
|
||||
$('#deptId').val(7); // 设置为发展运营中心
|
||||
$('#deptId').attr('disabled', 'disabled');
|
||||
$('#dept').show();
|
||||
} else {
|
||||
$('#dept').show();
|
||||
elem.removeAttr("disabled");
|
||||
elem.attr("lay-verify", "required");
|
||||
elem.removeClass('layui-disabled');
|
||||
$(".layui-form-label:eq(5)").html("<span style='color: red'>*</span>所属部门/项目");
|
||||
getDeptSelect();
|
||||
}
|
||||
form.render();
|
||||
}
|
||||
|
||||
function getRoleSelect() {
|
||||
|
|
@ -189,6 +188,7 @@
|
|||
|
||||
function submit(data) {
|
||||
data.id = personInfo.id;
|
||||
console.log(JSON.stringify( data)+"data")
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ctxPath + '/evaluatePerson/updatePerson',
|
||||
|
|
|
|||
Loading…
Reference in New Issue