1
wangbin
2024-07-08 3dfe7dfe993869c8a44e9ccf177849abe98ca8d0
WebTM/views/ϵͳ¹ÜÀí/Óû§¹ÜÀí/Gy_UserDept.html
@@ -95,7 +95,7 @@
        var HSouceBillType = params[params[2]];//源单类型
        var closeType = params[params[3]];  //关闭类型
    }
    var OptionData;
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
@@ -126,7 +126,8 @@
            set_AddFNew();
        }
        else if (OperationType == 3) {//编辑
            //set_EditFromGrid(linterid);
            RoadBillMain(linterid);
            /*set_EditFromGrid(linterid);*/
        }
        else {
            layer.alert("未知操作类型!", { icon: 5 });
@@ -160,7 +161,7 @@
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '验收员列表',
                title: '用户列表',
                closeBtn: 1,
                shift: 2,
                area: ['80%', '80%'],
@@ -238,7 +239,11 @@
                                //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                            },
                            end: function () {
                                obj.update({
                                    HItemID: OptionData.HItemID,
                                    HNumber: OptionData.部门代码,
                                    HName: OptionData.部门名称
                                });
                            }
                        });
                    }
@@ -302,18 +307,15 @@
                });
        });
        //退出
        form.on('submit(Exit)', function (data) {
            if (OperationType == 1) {
                Pub_Close(closeType);//直接新增closeType值为2,列表调新增closeType值从列表传递
            }
            else if (OperationType == 3) {
                Pub_Close(closeType);
            }
            else {
        //#region é€€å‡ºæŒ‰é’®
        form.on('submit(Exit)', function () {
            if (params[1] != null) {
                Pub_Close(1);
            } else if (params[1] == null) {
                Pub_Close(2);
            }
        });
        })
            //#endregion
        //#endregion
@@ -346,6 +348,52 @@
            option.data = [TabRow];
            table.render(option);
        }
        //#region ç¼–辑页面初始化
        function RoadBillMain(linterid) {
            //查询用户关联客户是否存在
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + "/Xt_User/UserRelationDeptlist_EditInit",
                async: false,
                type: "GET",
                data: {
                    "HItemID": linterid
                    , "user": sessionStorage["HUserName"]
                },
                success: function (result) {
                    if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data[0];
                        //主用户赋值
                        $("#UserName").val(data.用户名称);
                        $("#UserID").val(data.用户代码);
                        //子表赋值
                        $.ajax({
                            url: GetWEBURL() + "/Xt_User/UserDeptlistPlaylist",
                            type: "GET",
                            data: { "HUserID": $("#UserID").val() },
                            success: function (data) {
                                if (data.data != null && data.data != "") {
                                    option.data = data.data;
                                    table.render(option);
                                }
                                else {
                                    table.reload("mainTable", {});
                                    table.reload('mainTable', { data: [] });
                                }
                            }
                        });
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("发生错误!", { icon: 5 });
                }
            });
        }
            //#endregion
        //增加一行
        function btnAddLine(NewRow) {
@@ -420,6 +468,9 @@
            }
            return Result;
        }
    });
    function GetHDeptNameValue(obj) {
        OptionData = obj[0];
    }
</script>