ch
2022-03-10 1278472a0c96eaeb4a8bbe04df2c23b0eb52e2ff
WebTM/views/Éú²ú¹¤Ðò¹ÜÀí/Ôö¼Ó²»Á¼ÆÀÉóµ¥/QC_NoPassProdCheckBillList.html
@@ -171,10 +171,16 @@
                        });
                        break;
                    case '':
                        layer.msg('');
                    //删除
                    case 'btn-Delete':
                        set_DeleteBill();
                        break;
                    //审核
                    case 'btn-Audit': set_AuditBill();
                        break;
                    //反审核
                    case 'btn-DeAudit': set_DeAuditBill();
                        break;
                };
            });
@@ -213,9 +219,11 @@
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        //{ type: 'checkbox' }
                        { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                        { type: 'checkbox' }
                        , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                        , { field: '日期', title: '日期', sort: true, width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', sort: true, width: 170 }
                        , { field: '表头备注', title: '表头备注' }
@@ -256,7 +264,7 @@
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL() + '/Sc_ProcessMangement/MES_QC_NoPassProdCheckBill_Json',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
@@ -336,6 +344,131 @@
                sWhere = "";
            }
            //删除
            function set_DeleteBill() {
                var checkStatus = table.checkStatus("mainTable");
                //判断是否选中数据
                if (checkStatus.data.length != 1) {
                    return layer.msg("请选择一条数据");
                }
                layer.confirm('您确定要删除吗?', {
                    btn: ['确定', '取消'] //按钮
                    , btn1: function () {
                        var HInterID = checkStatus.data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + '/Sc_ProcessMangement/ProcessMangementDeleteBill'
                            , type: "GET"
                            , data: { "HInterID": HInterID, "user": 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();
                                        ////重载tree
                                        //tree.reload('treeDepartment', {});
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }
                        })
                    }
                })
            }
            //审核
            function set_AuditBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var HBillStatus = data[0].HBillStatus.toString();
                    if (HBillStatus == 1) {
                        layer.mes("单据已审核,不能再次审核!");
                        return false;
                    }
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_ProcessMangement/AuditProcessMangement", //方法所在页面和方法名
                        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 set_DeAuditBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var HBillStatus = data[0].HBillStatus.toString();
                    if (HBillStatus == 0) {
                        layer.msg("单据未审核,不能反审核!");
                        return false;
                    }
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_ProcessMangement/AuditProcessMangement", //方法所在页面和方法名
                        data: { "HInterID": InterID, "IsAudit": 2, "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('请选择一行数据反审核!');
                }
            }
              //#endregion
            //以上是layui模块