duhe
2024-04-03 1a40b7a8d4e6e24db362715b030ca9dfc1e2035e
WebTM/views/¹¤×ʹÜÀí/¹¤×ʵ¥/Pay_PayMentBill.html
@@ -14,7 +14,8 @@
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <style>
    <script src="../../../layuiadmin/PageTitle.js"></script>
    <!--<style>
        .main-btn { /*头部主按钮*/
            padding: 0 2px; /*调整按钮左右空隙大小*/
            height: 30px;
@@ -44,7 +45,7 @@
        .layui-form-label {
            width: 25%;
        }
    </style>
    </style>-->
</head>
<body>
@@ -65,6 +66,7 @@
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">反关闭</button>-->
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <h1 style="text-align: center; padding: 10px 0;"><b>工资单</b></h1>
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">基本信息</li>
                            <li lay-id="2" style="padding:1px;">其他信息</li>
@@ -115,23 +117,17 @@
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="width:200px;">
                                            <div class="layui-input-block">
                                                <select name="Year" id="Year" lay-filter="Year" style="width:140px;">
                                                </select>
                                        <div class="layui-inline" style="width:300px;">
                                            <label class="layui-form-label" style="width: 85px;">å¹´  ä»½</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 180px;">
                                                <select name="Year" id="Year" lay-filter="Year" style="width: 180px;"></select>
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="width:60px;">
                                            <label class="layui-form-label">å¹´</label>
                                        </div>
                                        <div class="layui-inline" style="width:200px;">
                                            <div class="layui-input-block">
                                                <select name="Month" id="Month" lay-filter="Month" style="width:140px;">
                                                </select>
                                        <div class="layui-inline" style="width:300px;">
                                            <label class="layui-form-label" style="width: 85px;">月  ä»½</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 180px;">
                                                <select name="Month" id="Month" lay-filter="Month" style="width: 180px;"></select>
                                            </div>
                                        </div>
                                        <div class="layui-inline"  style="width:60px;">
                                            <label class="layui-form-label">月</label>
                                        </div>
                                    </div>
                                    <div class="layui-row">
@@ -284,6 +280,14 @@
            //模块名
            var HModName = "Pay_PayMentBill";
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "2202";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            $("h1").html('<b>' + HPageTitle + '</b>');
            //#endregion
            //表格渲染参数
            var option = {};            //子表渲染参数
            //获取参数
@@ -351,7 +355,7 @@
            //#endregion
            //#region åˆå§‹åŒ–表格
            //DisPlay_HideColumn();
            DisPlay_HideColumn();
            //#endregion
            //#endregion
@@ -418,8 +422,6 @@
                    , 'HPayTotal': "0"
                    , 'HSubsidyTotal': "0"
                    , 'HDeuctTotal': "0"
                    , 'HDeuctTotal': "0"
                    , 'HDeuctTotal': "0"
                    , 'HShoudPay': "0"
                    , 'HInsurance': "0"
                    , 'HTaxBefore': "0"
@@ -470,6 +472,7 @@
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
                openDetailTouchedByDblclick(obj);
            });
            //#endregion
@@ -546,31 +549,29 @@
                    , cellMinWidth: 120
                    , height: 400
                    , cols: [[
                        { type: 'checkbox', totalRowText: '合计行' }
                        { type: 'checkbox', totalRowText: '合计' }
                        , { type: 'numbers', title: '序号' }
                        , { field: 'RowID', title: '行号' }                                                   //行标识,用于下一行、上一行识别所在行
                        , { field: 'HEmpID', title: '职员ID' }
                        , { field: 'HEmpNumber', title: '职员代码', edit: 'text', event: "HEmpNumber" }     //f7
                        , { field: 'RowID', title: '行号', hide: true }                                                   //行标识,用于下一行、上一行识别所在行
                        , { field: 'HEmpID', title: '职员ID', hide: true }
                        , { field: 'HEmpNumber', title: '职员代码', event: "HEmpNumber" }     //f7
                        , { field: 'HEmpName', title: '职员名称' }
                        , { field: 'HEmpType', title: '工资类型' }
                        , { field: 'HPostID', title: '岗位ID' }
                        , { field: 'HPostID', title: '岗位ID', hide: true }
                        , { field: 'HPostNumber', title: '岗位代码' }
                        , { field: 'HPostName', title: '岗位名称' }
                        , { field: 'HPiecePay', title: '计件工资' }
                        , { field: 'HTimesPay', title: '计时工资' }
                        , { field: 'HFixPay', title: '固定工资' }
                        , { field: 'HBasePay', title: '基础工资' }
                        , { field: 'HPiecePay', title: '计件工资', totalRow: true }
                        , { field: 'HTimesPay', title: '计时工资', event: "HTimesPay", totalRow: true }
                        , { field: 'HFixPay', title: '固定工资', totalRow: true }
                        , { field: 'HBasePay', title: '基础工资', totalRow: true }
                        , { field: 'HWorkTimes', title: '上班时间' }
                        , { field: 'HPayTotal', title: '工资小计' }
                        , { field: 'HSubsidyTotal', title: '补贴合计' }
                        , { field: 'HDeuctTotal', title: '扣款小计' }
                        , { field: 'HDeuctTotal', title: '扣款小计' }
                        , { field: 'HDeuctTotal', title: '扣款小计' }
                        , { field: 'HShoudPay', title: '应发工资' }
                        , { field: 'HInsurance', title: '扣社保' }
                        , { field: 'HTaxBefore', title: '税前' }
                        , { field: 'HPayTotal', title: '工资小计', totalRow: true }
                        , { field: 'HSubsidyTotal', title: '补贴合计', totalRow: true }
                        , { field: 'HDeuctTotal', title: '扣款小计', totalRow: true }
                        , { field: 'HShoudPay', title: '应发工资', totalRow: true }
                        , { field: 'HInsurance', title: '扣社保', totalRow: true }
                        , { field: 'HTaxBefore', title: '税前', totalRow: true }
                        , { field: 'HTax', title: '税' }
                        , { field: 'HRelPay', title: '实发合计' }
                        , { field: 'HRelPay', title: '实发合计', totalRow: true }
                        , { field: 'HRemark', title: '备注', edit: 'text' }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                    ]]
@@ -593,8 +594,6 @@
                        , 'HWorkTimes': "0"
                        , 'HPayTotal': "0"
                        , 'HSubsidyTotal': "0"
                        , 'HDeuctTotal': "0"
                        , 'HDeuctTotal': "0"
                        , 'HDeuctTotal': "0"
                        , 'HShoudPay': "0"
                        , 'HInsurance': "0"
@@ -636,6 +635,18 @@
                        $("#HDeptID").val(checkStatus.data[0].HDeptID);//部门代码
                        $("#HDeptName").val(checkStatus.data[0].部门名称);//部门名称
                        //根据班组内码获取子表数据
                        layer.confirm(
                            '是否确定覆盖子表原数据?'
                            , {
                                btn: ['确定', '取消'] //可以无限个按钮
                            }, function (index, layero) {                           //按钮1回调函数
                                var HGroupID = $("#HGroupID").val();
                                getSubData_BasedGroup(HGroupID);
                            }, function (index) {                                   //按钮2回调函数
                            });
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
@@ -989,6 +1000,47 @@
            }
            //#endregion
            //#region å­è¡¨ï¼šåŒå‡»æ‰“开明细
            function openDetailTouchedByDblclick(obj) {
                $(document).off('dblclick', ".layui-table").on('dblclick', '.layui-table', function (e) {
                    //职员
                    if (obj.event == "HTimesPay") {
                        //打开职员小窗体
                        layer.open({
                            type: 2
                            , skin: "layui-layer-rim"                           //加上边框
                            , title: "职员列表"                             //标题
                            , closeBtn: 1                                       //窗体右上角关闭 çš„ æ ·å¼
                            , shift: 2                                          //弹出动画
                            , area: ["90%", "90%"]                              //窗体大小
                            , maxmin: true                                      //设置最大最小按钮是否显示
                            , content: ["../../Baseset/基础资料/Gy_EmployeeList.html", "yes"]
                            , btn: ["确定", "取消"]
                            , btn1: function (index, laero) {
                                //按钮一  çš„回调
                                var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                if (checkStatus.data.length != 1) {
                                    return layer.msg("请选择一条数据");
                                }
                                //更新表格缓存的数据
                                obj.update({
                                    "HEmpID": checkStatus.data[0].HItemID
                                    , "HEmpNumber": checkStatus.data[0].HNumber
                                    , "HEmpName": checkStatus.data[0].HName
                                })
                                layer.close(index);//关闭弹窗
                            }
                        })
                    }
                    obj.event = "";
                    return false;
                })
                //#endregion
            }
            //#endregion
            //#region éšè—åˆ—设置
            function get_HideColumn() {
                var colName = "";
@@ -1151,6 +1203,78 @@
            }
            //#endregion
            //#region æ ¹æ®ç­ç»„获取子表数据
            function getSubData_BasedGroup(HGroupID) {
                var HYear = $("#Year").val();
                var HMonth = $("#Month").val();
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Pay_PayMentBill/getPayMentBillSub",
                    type: "GET",
                    async: false,
                    data: { "HGroupID": HGroupID, "HYear": HYear, "HMonth": HMonth, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            var subData = [];
                            var subDataSource = result.data;
                            for (var i = 0; i < subDataSource.length; i++) {
                                var NewRow =
                                {
                                    "RowID": (subData.length + 1) * 10
                                    , "HEmpID": "0"
                                    , "HEmpNumber": ""
                                    , "HEmpName": ""
                                    , "HEmpType": ""
                                    , "HPostID": "0"
                                    , "HPostNumber": ""
                                    , "HPostName": ""
                                    , 'HPiecePay': "0"
                                    , 'HTimesPay': "0"
                                    , 'HFixPay': "0"
                                    , 'HBasePay': "0"
                                    , 'HWorkTimes': "0"
                                    , 'HPayTotal': "0"
                                    , 'HSubsidyTotal': "0"
                                    , 'HDeuctTotal': "0"
                                    , 'HShoudPay': "0"
                                    , 'HInsurance': "0"
                                    , 'HTaxBefore': "0"
                                    , 'HTax': "0"
                                    , 'HRelPay': "0"
                                    , "HRemark": ""
                                };
                                NewRow.HEmpID = subDataSource[i]["HEmpID"];
                                NewRow.HEmpNumber = subDataSource[i]["HEmpNumber"];
                                NewRow.HEmpName = subDataSource[i]["HEmpName"];
                                NewRow.HEmpType = subDataSource[i]["HEmpType"];
                                NewRow.HPostID = subDataSource[i]["HPostID"];
                                NewRow.HPostNumber = subDataSource[i]["HPostNumber"];
                                NewRow.HPostName = subDataSource[i]["HPostName"];
                                NewRow.HPiecePay = subDataSource[i]["HPiecePay"];
                                NewRow.HTimesPay = subDataSource[i]["HTimesPay"];
                                NewRow.HSubsidyTotal = subDataSource[i]["HSubsidyTotal"];
                                NewRow.HDeuctTotal = subDataSource[i]["HDeuctTotal"];
                                NewRow.HShoudPay = NewRow.HPiecePay + NewRow.HTimesPay + NewRow.HSubsidyTotal - NewRow.HDeuctTotal;
                                subData.push(NewRow);
                            }
                            option.data = subData;
                            table.render(option);
                            layer.msg("加载成功");
                            layer.close(index);
                        } else {
                            layer.close(index);
                            layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                })
            }
            //#endregion
        });