1
wtt
2024-05-24 1d46d1f94851c843813961c0fc0ac61d60596e9c
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldLifeChangeBillList.html
@@ -117,6 +117,8 @@
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Edit" id="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Delete" id="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-Audit" id="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-DeAudit" id="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideColumn" id="set_HideColumn"><i class="layui-icon layui-icon-form"></i>隐藏列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
                            </div>
@@ -152,71 +154,7 @@
            //查询条件
            var sWhere = "";
            var option = [];
            //var option = {
            //    elem: '#mainTable'
            //    , toolbar: '#toolbarDemo'
            //    , height: 550
            //    , page: true
            //    , cellMinWidth: 90
            //    , limits: [50, 500, 5000, 20000]
            //    , limit: 50
            //    , cols: [[
            //        { type: 'checkbox', fixed: 'left' }
            //        ,{ field: 'hmainid', title: '单据ID', hide: true }
            //        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>"}
            //        , { field: '单据号', title: '单据号', width: 160 }
            //        , { field: '单据类型', title: '单据类型', width: 160 }
            //        , { field: 'HEmID', title: 'HEmID', width: 200, hide: true }
            //        , { field: '调整人代码', title: '调整人代码', width: 200 }
            //        , { field: '调整人', title: '调整人', width: 200 }
            //        , { field: 'HMangerID', title: 'HEmID', width: 200, hide: true }
            //        , { field: '负责人代码', title: '负责人代码', width: 200 }
            //        , { field: '负责人', title: '负责人', width: 200 }
            //        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
            //        , { field: '部门代码', title: '部门代码', width: 115 }
            //        , { field: '部门', title: '部门', width: 200 }
            //        , { field: '调整原因', title: '调整原因', width: 115 }
            //        , { field: '摘要', title: '摘要', width: 200 }
            //        , { field: '内部单据号', title: '内部单据号', width: 115 }
            //        , { field: '备注', title: '备注', width: 200 }
            //        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
            //        , { field: '关联数量', title: '关联数量', width: 200 }
            //        , { field: '行关闭人', title: '行关闭人', width: 200 }
            //        , { field: '关闭类型', title: '关闭类型', width: 200 }
            //        , { field: '表体备注', title: '表体备注', width: 200 }
            //        , { field: 'HMaterID', title: 'HMaterID', width: 200, hide: true }
            //        , { field: '模具代码', title: '器具代码', width: 200 }
            //        , { field: '模具', title: '器具', width: 200 }
            //        , { field: 'HPropertyID', title: 'HPropertyID', width: 200, hide: true }
            //        , { field: '辅助属性代码', title: '辅助属性代码', width: 200 }
            //        , { field: '辅助属性', title: '辅助属性', width: 200 }
            //        , { field: 'HSecUnitID', title: 'HSecUnitID', width: 200, hide: true }
            //        , { field: '辅助计量单位代码', title: '辅助计量单位代码', width: 200 }
            //        , { field: '辅助计量单位', title: '辅助计量单位', width: 200 }
            //        , { field: '换算率', title: '换算率', width: 200 }
            //        , { field: 'Hunitid', title: 'Hunitid', width: 200, hide: true }
            //        , { field: '计量单位代码', title: '计量单位代码', width: 200 }
            //        , { field: '计量单位', title: '计量单位', width: 200 }
            //        , { field: '设计寿命', title: '设计寿命', width: 200 }
            //        , { field: '原剩余寿命', title: '原剩余寿命', width: 200 }
            //        , { field: '新剩余寿命', title: '新剩余寿命', width: 200 }
            //        , { field: '制单人', title: '制单人', width: 200 }
            //        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
            //        , { field: '审核人', title: '审核人', width: 200 }
            //        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
            //        , { field: '修改人', title: '修改人', width: 200 }
            //        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
            //        , { field: '关闭人', title: '关闭人', width: 200 }
            //        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
            //        , { field: '作废人', title: '作废人', width: 200 }
            //        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
            //        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
            //        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
            //        , { field: '源单单号', title: '源单单号', width: 200 }
            //        , { field: '源单类型', title: '源单类型', width: 200 }
            //    ]]
            //};
            var HModName = "Sc_MouldLifeChangeBillList";
            var HBillType = "3824";
            var col = [];
@@ -330,6 +268,12 @@
                    case 'set_HideButton':
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        break;
                    //审核
                    case 'btn-Audit': set_AuditBill();
                        break;
                    //反审核
                    case 'btn-DeAudit': set_DeAuditBill();
                        break;
                };
            });
@@ -510,6 +454,78 @@
                layer.alert("双击事件", { icon: 1 });
            });
            //审核
            function set_AuditBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MouldLifeChangeBill/AuditSc_MouldLifeChangeBillList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //反审核
            function set_DeAuditBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MouldLifeChangeBill/AuditSc_MouldLifeChangeBillList", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据反审核!');
                }
            }
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";