yangle
2024-01-10 450c5ef57e10dfa81c623186952899eedeb789f5
WebTM/views/ϵͳ¹ÜÀí/Óû§¹ÜÀí/Gy_UserMater.html
@@ -56,7 +56,7 @@
                                                <div class="layui-input-inline">
                                                    <input type="text" name="UserName" id="UserName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="UserID" id="UserID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="UserList" style="width:40px;">
                                                    <button type="button" lay-submit="" id="button_Edit" class="layui-btn" lay-filter="UserList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
@@ -131,6 +131,7 @@
            }
            else if (OperationType == 3) {//编辑
                set_EditFromGrid(linterid);
                $('#button_Edit').addClass("layui-btn-disabled").attr("disabled", true);
            }
            else {
                layer.alert("未知操作类型!", { icon: 5 });
@@ -318,19 +319,62 @@
                    });
            });
            //编辑
            function set_EditFromGrid(linterid) {
                set_EditForm(linterid);  //编辑获取表头
            }
            //编辑加载表头
            function set_EditForm(linterid) {
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "GetGy_UserMaterDetail",
                    type: "GET",
                    data: {
                        "HID": linterid
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Gy_UserMater[0];
                            $("#HItemID").val(data.HItemID);//代码ID
                            $("#UserID").val(data.用户代码);//用户代码
                            $("#UserName ").val(data.用户名称);//用户名称
                            layui.form.render();//实时渲染选中和不选中的样式,最好添加这句话
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                        var arr = [];
                        for (var i = 0; i < result.data.h_v_Gy_UserMater.length; i++) {
                            arr.push({
                                "HMaterID": result.data.h_v_Gy_UserMater[i].HMaterID,
                                "HMaterNumber": result.data.h_v_Gy_UserMater[i].物料代码,
                                "HMaterName": result.data.h_v_Gy_UserMater[i].物料名称,
                            });
                        }
                        option.data = arr;
                        table.render(option);
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
            }
            //退出
            form.on('submit(Exit)', function (data) {
                if (OperationType == 1) {
                    Pub_Close(closeType);//直接新增closeType值为2,列表调新增closeType值从列表传递
                    Pub_Close(1);//直接新增closeType值为2,列表调新增closeType值从列表传递
                }
                else if (OperationType == 3) {
                    Pub_Close(closeType);
                    Pub_Close(1);
                }
                else {
                    Pub_Close(2);
                }
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰æ–¹æ³•