yusijie
2024-01-16 c050cb7ec19a6f65ecaecb5ee18b8ca3108a0ba8
WebTM/views/ϵͳ¹ÜÀí/Óû§¹ÜÀí/Gy_UserByWorkStation.html
@@ -127,7 +127,10 @@
            set_AddFNew();
        }
        else if (OperationType == 3) {//编辑
            //set_EditFromGrid(linterid);
            //子表初始化
            set_InitGrid();
            //加载表体和表体数据
            RoadBillMain(linterid);
        }
        else {
            layer.alert("未知操作类型!", { icon: 5 });
@@ -305,15 +308,21 @@
        //退出
        form.on('submit(Exit)', function (data) {
            if (OperationType == 1) {
                Pub_Close(closeType);//直接新增closeType值为2,列表调新增closeType值从列表传递
            }
            else if (OperationType == 3) {
                Pub_Close(closeType);
            }
            else {
            if (params[1] != null) {
                Pub_Close(1);
            } else if (params[1] == null) {
                Pub_Close(2);
            }
            //if (OperationType == 1) {
            //    Pub_Close(closeType);//直接新增closeType值为2,列表调新增closeType值从列表传递
            //}
            //else if (OperationType == 3) {
            //    Pub_Close(closeType);
            //}
            //else {
            //    Pub_Close(2);
            //}
        });
        //#endregion
@@ -348,6 +357,54 @@
            table.render(option);
        }
        //#region ç¼–辑页面初始化
        function RoadBillMain(linterid) {
            //查询用户关联客户是否存在
            var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + "/Xt_User/UserByWorkStationRelationList_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.用户代码);
                        //子表  èµ‹å€¼
                        var rowdata = [];
                        for (var i = 0; i < result.data.length; i++) {
                            rowdata.push(
                                {
                                    "HItemID": result.data[i]["HItemID"],
                                    //"HUserID": result.data[i]["用户代码"],
                                    //"HUserName": result.data[i]["用户名称"],
                                    "HCusID": result.data[i]["HCusID"],
                                    "HNumber": result.data[i]["工位代码"],
                                    "HName": result.data[i]["工位名称"]
                                }
                            );
                        }
                        option.data = rowdata;
                        table.render(option);
                        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) {
            var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据