WebTM/views/Ó¦ÊÕ¹ÜÀí/±¨±í·ÖÎö/YS_CusShouldIncomeEntryReport.html
@@ -295,9 +295,198 @@
            });
            //#endregion
            //#region åŒå‡»è¿›å…¥ç¼–辑
            table.on('rowDouble(mainTable)', function (obj) {
                //选中高亮 åŒå‡»è¡Œ
                obj.tr.find(':checkbox').prop('checked', true);
                obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');  //设置复选框选中样式
                $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色
                //mainTable ä¸ºè¡¨æ ¼ID   æ³¨æ„æ­¤å¤„如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色
                layui.each(table.cache.mainTable, function (i, l) {
                    if (obj.tr.index() == l.LAY_TABLE_INDEX) {
                        l.LAY_CHECKED = true;
                    }
                });
                var HBillNo = obj.data["单据号"];
                var sWhere = "";
                if (obj.data.单据类型 == "销售出库单") {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                    $.ajax({
                        url: GetWEBURL() + '/Kf_SellOutBill/GetSellOutBillList',
                        type: "GET",
                        data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                        success: function (data1) {
                            if (data1.count == 1) {
                                var linterid = data1.data[0].hmainid
                                layer.open({
                                    type: 2
                                    , area: ['100%', '100%']
                                    , title: '编辑销售订单'
                                    , closeBtn: 1
                                    , shade: 0.6 //遮罩透明度
                                    , maxmin: true //允许全屏最小化
                                    , anim: 0 //0-6的动画形式,-1不开启
                                    , content: '../../领料发货/销售出库/Kf_SellOutBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=10'
                                    , resize: false,
                                    end: function () {
                                        //刷新页面,
                                        $("#btnSearch").trigger('click');
                                    }
                                    , cancel: function () {
                                    }
                                })
                            }
                            else {
                                layer.close(ajaxLoad);
                                layer.alert(data1.code + data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else if (obj.data.单据类型 == "收款单") {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                    $.ajax({
                        url: GetWEBURL() + '/YS_ReceiveBill/list',
                        async: false,
                        type: "GET",
                        data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                        success: function (data1) {
                            if (data1.count == 1) {
                                var linterid = data1.data[0].hmainid
                                layer.open({
                                    type: 2
                                    , area: ['100%', '100%']
                                    , title: '编辑销售订单'
                                    , closeBtn: 1
                                    , shade: 0.6 //遮罩透明度
                                    , maxmin: true //允许全屏最小化
                                    , anim: 0 //0-6的动画形式,-1不开启
                                    , content: '../../销售管理/收款单/YS_ReceiveBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=10'
                                    , resize: false,
                                    end: function () {
                                        //刷新页面,
                                        $("#btnSearch").trigger('click');
                                    }
                                    , cancel: function () {
                                    }
                                })
                            }else {
                                layer.close(ajaxLoad);
                                layer.alert(data1.code + data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else if (obj.data.单据类型 == "其他应收单") {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                    $.ajax({
                        url: GetWEBURL() + '/YS_ReceiveOtherBill/YS_ReceiveOtherBillMainList',
                        async: false,
                        type: "GET",
                        data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                        success: function (data1) {
                            if (data1.count == 1) {
                                var linterid = data1.data[0].hmainid
                                layer.open({
                                    type: 2
                                    , area: ['100%', '100%']
                                    , title: '编辑其他应收单'
                                    , closeBtn: 1
                                    , shade: 0.6 //遮罩透明度
                                    , maxmin: true //允许全屏最小化
                                    , anim: 0 //0-6的动画形式,-1不开启
                                    , content: '../../销售管理/其他应收单/YS_ReceiveOtherBillMain.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=10'
                                    , resize: false,
                                    end: function () {
                                        //刷新页面,
                                        $("#btnSearch").trigger('click');
                                    }
                                    , cancel: function () {
                                    }
                                })
                            } else {
                                layer.close(ajaxLoad);
                                layer.alert(data1.code + data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else if (obj.data.单据类型 == "销售退货单") {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                    $.ajax({
                        url: GetWEBURL() + '/Kf_ICStockBackBill/GetKf_ICStockBackBillList',
                        async: false,
                        type: "GET",
                        data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                        success: function (data1) {
                            if (data1.count == 1) {
                                var linterid = data1.data[0].hmainid
                                layer.open({
                                    type: 2
                                    , area: ['100%', '100%']
                                    , title: '编辑销售退货单'
                                    , closeBtn: 1
                                    , shade: 0.6 //遮罩透明度
                                    , maxmin: true //允许全屏最小化
                                    , anim: 0 //0-6的动画形式,-1不开启
                                    , content: '../../销售管理/销售退货单/Kf_ICStockBackBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0&closeType=10'
                                    , resize: false,
                                    end: function () {
                                        //刷新页面,
                                        $("#btnSearch").trigger('click');
                                    }
                                    , cancel: function () {
                                    }
                                })
                            } else {
                                layer.close(ajaxLoad);
                                layer.alert(data1.code + data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
            });
            //#endregion
            //#region å¯¼å‡ºExecel
            function get_Export() {
                table.exportFile(ins.config.id, option.data, "xls");
                var ModRightNameCheck = "YS_CusShouldIncomeEntryReport_ExportExcel";
                //逻辑审核方法
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //方法所在页面和方法名
                    data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            table.exportFile(ins.config.id, option.data, "xls");
                        } else {
                            layer.alert("当前模块没有导出权限!", { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion