forked from kidgrow-microservices-platform

luliqiang
2020-12-28 f41b3b53dad6a8468fc1ae9babb85a0270124d01
kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/doctor_form.html
@@ -56,8 +56,8 @@
            <div class="layui-inline">
                <label class="layui-form-label">Email</label>
                <div class="layui-input-block" style="width: 150px;">
                    <input name="doctorEmail" type="text" class="layui-input" maxlength="20" lay-verify="required|email"
                        required />
                    <input name="doctorEmail" type="text" class="layui-input" maxlength="50" lay-verify="v_email"
                    autocomplete="off"  />
                </div>
            </div>
        </div>
@@ -211,7 +211,16 @@
        var formSelects = layui.formSelects;
        var $ = layui.jquery;
        //验证邮箱
        admin.v_email = function(value, item){
            var exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
            if(value && !exp.test(value) ){
                return '邮箱格式不正确';
            }
        }
        form.verify({
            v_email:admin.v_email,
        })
        //医生管理员
        var guanliyuan_role = undefined;
        //获取角色
@@ -340,11 +349,12 @@
                        }
                    }
                }
            }
            data.field.roleId = null;
            data.field.roles.forEach(element => {
                data.field.roles.forEach(element => {
                element = "" + element
            });
            }
            data.field.roleId = null;
            layer.load(2);
            admin.req('api-user/sysdoctor', JSON.stringify(data.field), function (data) {
                layer.closeAll('loading');
@@ -431,7 +441,7 @@
            }, 'Post');
        }
        //获取销售代表
        var getXiaoShouDaiBiao = function () {
        var getXiaoShouDaiBiao = function (selectVal) {
            admin.req('api-user/users/getAppointUser', { type: 0 }, function (data) {
                layer.closeAll('loading');
                if (0 === data.code) {
@@ -439,7 +449,7 @@
                    $.each(data.data, function (index, item) {
                        //往下拉菜单里添加元素
                        $('#serverUserId-add').append(new Option(item.nickname, item.id,
                            false, false));
                            false, (!strUtil.isEmpty(selectVal) && selectVal == item.id)));
                    })
                } else {
                    layer.msg(data.msg, {
@@ -456,10 +466,16 @@
            $('.layui-layer-content').css('overflow', 'auto');
            //将医院的数据保存到下拉表
            let selected = false;
            var selectVal="";
            //先拿到当前登录用户的信息
            var nowUser = config.getUser();
            if (!strUtil.isEmpty(nowUser)) {
                selectVal = nowUser.id;
            }
            //获取职称的
            getZhiCheng();
            //获取销售代表
            getXiaoShouDaiBiao();
            getXiaoShouDaiBiao(selectVal);
            //获取角色
            get_role();
            var upload = layui.upload;
@@ -591,11 +607,11 @@
            getXiaoShouDaiBiao();
            //获取角色
            get_role(doctor.isAdminUser);
            form.val('app-form-add', doctor);
            $("#hospitalId").val(doctor.hospitalId);
            $("#password_div").hide();
            $("#passwordSure_div").hide();
            $("#doctorTel-add").prop("disabled",true)
            //将密码项取消
            if (doctor.doctorType == 2) {
@@ -611,7 +627,8 @@
            $("#password").removeAttr("lay-verify")
            $("#password").removeAttr("required")
            $("#passwordSure").removeAttr("lay-verify")
            form.render();
        } else {
            loadEditData();