yusijie
2024-03-29 ae5cfe81fd2b9f38c2e9ccfcdeaa7be2b28ad5dc
WebTM/views/¹¤×ʹÜÀí/¿¼Çڻ㱨µ¥/Pay_WorkTimesBillEdit.html
@@ -15,6 +15,7 @@
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/PageTitle.js"></script>
    <style type="text/css">
        .layui-form-item .layui-inline {
            margin-right: 0;
@@ -191,26 +192,11 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">制单日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">审核日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
@@ -224,7 +210,20 @@
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改日期</label>
@@ -283,6 +282,14 @@
                    , laydate = layui.laydate
                    , element = layui.element;
                //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
                var HModuleType = "2203";
                //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
                var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
                $("h1").html('<b>' + HPageTitle + '</b>');
                //#endregion
                var params = get_UrlVars();
                if (typeof (params[params[0]]) == "undefined") {
                    var OperationType = 1;//操作类型
@@ -300,40 +307,46 @@
                });
                var tableReload = table.reload;
                var option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 500
                    , totalRow: true
                    //,url: '/demo/table/user/' //数据接口
                    , page: true //开启分页
                    , cols: [[ //表头
                        { type: 'checkbox', fixed: 'left' }
                        { type: 'checkbox', totalRowText: '合计' }
                        , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                        , { field: 'HEmpID', title: 'HEmpID', edit: 'text', width: 100, hide: true }
                        , { field: 'HEmpNumber', title: '职员代码', edit: 'text', event: 'HEmpCheck', width: 150 }
                        , { field: 'HEmpName', title: '职员名称', edit: 'text', width: 100 }
                        , { field: 'HEmpRate', title: '职员系数', edit: 'text', width: 100 }
                        , { field: 'HPMTimes', title: '下午工时', edit: 'text', width: 100 }
                        , { field: 'HAMTimes', title: '上午工时', edit: 'text', width: 100 }
                        , { field: 'HBaseTimes', title: '基本工时', edit: 'text', width: 100 }
                        , { field: 'HBaseDays', title: '基本天数', edit: 'text', width: 100 }
                        , { field: 'HOverTimes', title: '加班工时', edit: 'text', width: 100 }
                        , { field: 'HOverDays', title: '加班天数', edit: 'text', width: 100 }
                        , { field: 'HLeaveTimes', title: '请假工时', edit: 'text', width: 100 }
                        , { field: 'HLeaveDays', title: '请假天数', edit: 'text', width: 100 }
                        , { field: 'HLateQty', title: '迟到次数', edit: 'text', width: 100 }
                        , { field: 'HLateTimes', title: '迟到时间', edit: 'text', width: 100 }
                        , { field: 'HEarlyQty', title: '早退次数', edit: 'text', width: 100 }
                        , { field: 'HEarlyTimes', title: '早退时间', edit: 'text', width: 100 }
                        , { field: 'HOutForEmpQty', title: '私出次数', edit: 'text', width: 100 }
                        , { field: 'HOutForEmpTimes', title: '私出时间', edit: 'text', width: 100 }
                        , { field: 'HOutForComQty', title: '公出次数', edit: 'text', width: 100 }
                        , { field: 'HOutForComTimes', title: '公出时间', edit: 'text', width: 100 }
                        , { field: 'HAbsentDays', title: '旷工天数', edit: 'text', width: 100 }
                        , { field: 'HPMTimes', title: '下午工时', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HAMTimes', title: '上午工时', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HBaseTimes', title: '基本工时', width: 100, totalRow: true }
                        , { field: 'HBaseDays', title: '基本天数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HOverTimes', title: '加班工时', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HOverDays', title: '加班天数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HLeaveTimes', title: '请假工时', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HLeaveDays', title: '请假天数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HLateQty', title: '迟到次数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HLateTimes', title: '迟到时间', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HEarlyQty', title: '早退次数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HEarlyTimes', title: '早退时间', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HOutForEmpQty', title: '私出次数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HOutForEmpTimes', title: '私出时间', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HOutForComQty', title: '公出次数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HOutForComTimes', title: '公出时间', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HAbsentDays', title: '旷工天数', edit: 'text', width: 100, totalRow: true }
                        , { field: 'HRestFlag', title: '厂休', edit: 'text', value: "true", width: 100, hide: true }
                        , { field: 'HSchClassID', title: '班次', edit: 'text', width: 100 }
                        , { field: 'HCTPrjID', title: '核算方案代码', edit: 'text', width: 100, hide: true}
                        , { field: 'HCTPrjName', title: '核算方案名称', edit: 'text', event: 'HCTPrjName', width: 100 }
                        , { field: 'HWorkTypeID', title: '工种代码', edit: 'text', width: 100, hide: true}
                        , { field: 'HWorkTypeName', title: '工种名称', edit: 'text', event: 'HWorkTypeName', width: 100 }
                        , { field: 'HPayMoney', title: '小时工资', edit: 'text', width: 100 }
                        , { field: 'HMoney', title: '工资', width: 100, totalRow: true }
                        //, { field: 'HNeedTimes   ', title: '应上班工时', edit: 'text', width: 100 }
                        , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                        , { field: 'HMainSourceInterID ', title: '源单主内码', edit: 'text', width: 100, hide: true }
@@ -348,21 +361,14 @@
                if (OperationType == 1) {
                    $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
                    $("#HMaker").val(sessionStorage["HUserName"]);
                    $("#HCheckDate").val(Format(new Date(), "yyyy-MM-dd"));
                    $("#HChecker").val(sessionStorage["HUserName"]);
                    $("#HUpDateDate").val(Format(new Date(), "yyyy-MM-dd"));
                    $("#HUpDater").val(sessionStorage["HUserName"]);
                    $("#HCloseDate").val(Format(new Date(), "yyyy-MM-dd"));
                    $("#HDeleteDate").val(Format(new Date(), "yyyy-MM-dd"));
                    $("#HDeleteMan").val(sessionStorage["HUserName"]);
                    $("#HCloseMan").val(sessionStorage["HUserName"]);
                    //初始加载表格{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": "  ", "HSQProcName": "   ","HProcID":0, "HZRProcName": "  ", "HMRBChecker": "  ", "HRemark": "  ", "HPSProcName": "  ", "HCloseMan": "   " }
                    option.data = [{
                        "HEmpID": "", "HEmpNumber": "", "HEmpName": "", "HEmpID": "", "HEmpRate": 0
                        , "HPMTimes": 0, "HAMTimes": 0, "HBaseTimes": 0, "HBaseDays": 0, "HOverTimes": 0
                        , "HOverDays": 0, "HLeaveTimes": 0, "HLeaveDays": 0, "HLateQty": 0, "HLateTimes": 0, "HEarlyQty": 0
                        , "HEarlyTimes": 0, "HOutForEmpQty": 0, "HOutForEmpTimes": 0, "HOutForComQty": 0, "HOutForComTimes": 0, "HAbsentDays": 0
                        , "HRestFlag": "true", "HSchClassID": 0, "HNeedTimes": 0, "HMainSourceInterID": 0, "HMainSourceEntryID": 0, "HMainSourceBillNo": 0
                        , "HRestFlag": "true", "HSchClassID": 0, "HCTPrjID": 0, "HCTPrjName": "", "HWorkTypeID": 0, "HWorkTypeName": "", "HPayMoney": 0,"HMoney":0
                        , "HNeedTimes": 0, "HMainSourceInterID": 0, "HMainSourceEntryID": 0, "HMainSourceBillNo": 0
                        , "HSourceBillType": "", "HRemark": ""
                    }];
                    table.render(option);
@@ -373,7 +379,7 @@
                    $.ajax({
                        url: GetWEBURL() + 'Pay_WorkTimesBill/Pay_WorkTimesBillListProjectDetai',
                        type: "GET",
                        data: { "sqlWhere": "and hmainid=" + hID },
                        data: { "HInterID": hID },
                        success: function (result) {
                            if (result.count == 1) {
@@ -404,7 +410,8 @@
                        , "HPMTimes": 0, "HAMTimes": 0, "HBaseTimes": 0, "HBaseDays": 0, "HOverTimes": 0
                        , "HOverDays": 0, "HLeaveTimes": 0, "HLeaveDays": 0, "HLateQty": 0, "HLateTimes": 0, "HEarlyQty": 0
                        , "HEarlyTimes": 0, "HOutForEmpQty": 0, "HOutForEmpTimes": 0, "HOutForComQty": 0, "HOutForComTimes": 0, "HAbsentDays": 0
                        , "HRestFlag": "true", "HSchClassID": 0, "HNeedTimes": 0, "HMainSourceInterID": 0, "HMainSourceEntryID": 0, "HMainSourceBillNo": 0
                        , "HRestFlag": "true", "HSchClassID": 0, "HCTPrjID": 0, "HCTPrjName": "", "HWorkTypeID": 0, "HWorkTypeName": "", "HPayMoney": 0, "HMoney": 0
                        , "HNeedTimes": 0, "HMainSourceInterID": 0, "HMainSourceEntryID": 0, "HMainSourceBillNo": 0
                        , "HSourceBillType": "", "HRemark": ""
                    };
                    switch (obj.event) {
@@ -469,7 +476,7 @@
                                    , btn1: function (index, layero) {
                                        //按钮【按钮一】的回调
                                        var iframeWindow = window['layui-layer-iframe' + index];
                                        var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');
                                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');
                                        if (checkStatus.data.length === 0) {
                                            return layer.msg('请选择数据');
                                        }
@@ -486,6 +493,54 @@
                                    }
                                });
                            }
                            if (obj.event === 'HCTPrjName') {//核算方案
                                layer.open({
                                    type: 2//弹窗类型
                                    , skin: 'layui-layer-rim' //加上边框
                                    , area: ['90%', '90%']//大小
                                    , title: '核算方式列表'//标题
                                    , shift: 2//弹出动画
                                    , content: ['../../../views/Baseset/基础资料/Gy_ClassTimePrjList.html', 'yes']
                                    , btn: ['确定', '取消']
                                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                        if (checkStatus.data.length === 0) {
                                            return layer.msg('请选择数据');
                                        }
                                        obj.update({
                                            HCTPrjName: checkStatus.data[0].HName
                                            , HCTPrjID: checkStatus.data[0].HItemID
                                        });
                                        layer.close(layer.index);
                                    }
                                    , btn2: function (index, layero) { }
                                })
                            }
                            if (obj.event === 'HWorkTypeName') {//工种
                                layer.open({
                                    type: 2//弹窗类型
                                    , skin: 'layui-layer-rim' //加上边框
                                    , area: ['90%', '90%']//大小
                                    , title: '工种列表'//标题
                                    , shift: 2//弹出动画
                                    , content: ['../../../views/Baseset/基础资料/Gy_WorkTypeList.html', 'yes']
                                    , btn: ['确定', '取消']
                                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                        if (checkStatus.data.length === 0) {
                                            return layer.msg('请选择数据');
                                        }
                                        obj.update({
                                            HWorkTypeName: checkStatus.data[0].HName
                                            , HWorkTypeID: checkStatus.data[0].HItemID
                                        });
                                        layer.close(layer.index);
                                    }
                                    , btn2: function (index, layero) { }
                                })
                            }
                            //if (obj.event === 'HMaterCheck')  //模具信息
                            //{
@@ -504,7 +559,7 @@
                            //            //按钮【按钮一】的回调
                            //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                            //            var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                            //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                            //            if (checkStatus.data.length === 0) {
                            //                return layer.msg('请选择数据');
                            //            }
@@ -547,7 +602,7 @@
                            //        , btn1: function (index, layero) {
                            //            //按钮【按钮一】的回调
                            //            var iframeWindow = window['layui-layer-iframe' + index];
                            //            var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');
                            //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');
                            //            if (checkStatus.data.length === 0) {
                            //                return layer.msg('请选择数据');
                            //            }
@@ -582,7 +637,7 @@
                            //            //按钮【按钮一】的回调
                            //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                            //            var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                            //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                            //            if (checkStatus.data.length === 0) {
                            //                return layer.msg('请选择数据');
                            //            }
@@ -623,55 +678,56 @@
                    //layer.msg('[ID: ' + data.id + '] ' + field + ' å­—段更改为:' + value);
                    switch (field) {
                        case "HDesignLife":  //设计寿命
                        case "HPMTimes":  //下午工时
                            value = isNaN(value) ? 0 : value;
                            var HUseLife = isNaN(data.HUseLife) ? 0 : data.HUseLife;
                            //基本工时=上午工时+下午工时
                            var HBaseTimes = Number(isNaN(data.HAMTimes) ? 0 : data.HAMTimes) + Number(value);
                            //工资=小时工资*基本工时
                            var HMoney = Number(isNaN(data.HPayMoney) ? 0 : data.HPayMoney) * HBaseTimes;
                            //同步更新表格和缓存对应的值
                            obj.update({
                                HDesignLife: value,                          //设计寿命
                                HLeaveLife: value - HUseLife,           //剩余寿命=设计寿命-使用寿命
                                HPMTimes: value,                  //下午工时
                                HBaseTimes: HBaseTimes,           //基本工时
                                HMoney: HMoney, //工资
                            });
                            break;
                        case "HLeaveLife":  //剩余寿命
                            var HDesignLife = isNaN(data.HDesignLife) ? 0 : data.HDesignLife;
                            var HUseLife = isNaN(data.HUseLife) ? 0 : data.HUseLife;
                            //同步更新表格和缓存对应的值
                            obj.tr.find('td[data-field=HLeaveLife] input').val(HDesignLife - HUseLife);
                            obj.update({
                                HLeaveLife: HDesignLife - HUseLife,   //剩余寿命=设计寿命-使用寿命
                            });
                            break;
                        case "HUseLife":    //使用寿命
                            var HDesignLife = isNaN(data.HDesignLife) ? 0 : data.HDesignLife;
                        case "HAMTimes":  //上午工时
                            value = isNaN(value) ? 0 : value;
                            //基本工时=上午工时+下午工时
                            var HBaseTimes = Number(value) + Number(isNaN(data.HPMTimes) ? 0 : data.HPMTimes);
                            //工资=小时工资*基本工时
                            var HMoney = Number(isNaN(data.HPayMoney) ? 0 : data.HPayMoney) * HBaseTimes;
                            //同步更新表格和缓存对应的值
                            obj.update({
                                HLeaveLife: HDesignLife - value, //剩余寿命=设计寿命-使用寿命
                                HAMTimes: value,                  //上午工时
                                HBaseTimes: HBaseTimes,           //基本工时
                                HMoney: HMoney, //工资
                            });
                            break;
                        case "HQty":        //实发数量
                        case "HPayMoney":        //小时工资
                            value = isNaN(value) ? 0 : value;
                            var HPrice = isNaN(data.HPrice) ? 0 : data.HPrice;
                            //工资=小时工资*基本工时
                            var HMoney = Number(value) * Number(isNaN(data.HBaseTimes) ? 0 : data.HBaseTimes);
                            //console.log(HMoney);
                            //同步更新表格和缓存对应的值
                            obj.update({
                                HMoney: value * HPrice, //金额=实收数量*单价
                                HMoney: HMoney, //工资
                            });
                            break;
                        case "HPrice":      //单价
                        case "HMoney":         //工资
                            value = isNaN(value) ? 0 : value;
                            var HQty = isNaN(data.HQty) ? 0 : data.HQty;
                            if (data.HPayMoney == 0 || data.HPayMoney == null)
                            {
                                value = 0;
                            }
                            //工资=小时工资*基本工时
                            var HMoney = Number(isNaN(data.HPayMoney) ? 0 : data.HPayMoney) * Number(isNaN(data.HBaseTimes) ? 0 : data.HBaseTimes);
                            console.log(HMoney);
                            //同步更新表格和缓存对应的值
                            obj.update({
                                HMoney: value * HQty, //金额=实收数量*单价
                                HMoney: HMoney, //工资
                            });
                            break;
                        case "HMoney":     //金额
                            var HPrice = isNaN(data.HPrice) ? 0 : data.HPrice;
                            var HQty = isNaN(data.HQty) ? 0 : data.HQty;
                            //同步更新表格和缓存对应的值
                            obj.update({
                                HMoney: HPrice * HQty, //金额=实收数量*单价
                            });
                            break;
                        default:
                    }
@@ -708,11 +764,13 @@
                                    , "HMaker": data.制单人
                                    , "HChecker": data.审核人
                                    , "HCloseMan": data.关闭人
                                    , "HMakeDate": data.制单日期
                                    , "HCheckDate": data.审核日期
                                    , "HCloseDate": data.关闭日期
                                    , "HUpDateDate": data.修改日期
                                    , "HDeleteDate": data.作废日期
                                    , "HUpDater": data.修改人
                                    , "HDeleteMan": data.作废人
                                    , "HMakeDate": data.制单日期 == null ? "" : Format(data.制单日期, "yyyy-MM-dd hh:mm:ss")
                                    , "HCheckDate": data.审核日期 == null ? "" : Format(data.审核日期, "yyyy-MM-dd hh:mm:ss")
                                    , "HCloseDate": data.关闭日期 == null ? "" : Format(data.关闭日期, "yyyy-MM-dd hh:mm:ss")
                                    , "HUpDateDate": data.修改日期 == null ? "" : Format(data.修改日期, "yyyy-MM-dd hh:mm:ss")
                                    , "HDeleteDate": data.作废日期 == null ? "" : Format(data.作废日期, "yyyy-MM-dd hh:mm:ss")
                                });
                            } else {
@@ -770,12 +828,13 @@
                            //按钮【按钮一】的回调
                            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                            var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                            if (checkStatus.data.length === 0) {
                                return layer.msg('请选择数据');
                            }
                            $("#HGroupName").val(checkStatus.data[0].班组);
                            $("#HGroupID").val(checkStatus.data[0].HItemID);
                            GetEmployee();
                            layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        }
                        , btn2: function (index, layero) {
@@ -790,45 +849,53 @@
                        }
                    });
                });
                function GetEmployee() {
                    $.ajax({
                        url: GetWEBURL() + "/Pay_WorkTimesBill/GetEmployeeByHGroup",
                        type: "GET",
                        data: { "HGroupID": $("#HGroupID").val() },
                        success: function (result) {
                            if (result != null) {
                                if (result.count == 1) {
                                    var BYData = result.list[0];
                                    var rowdate1 = layui.table.cache["mainTable"];
                                    option.data = [{
                                        "HEmpID": "", "HEmpNumber": "", "HEmpName": "", "HEmpID": "", "HEmpRate": 0
                                        , "HPMTimes": 0, "HAMTimes": 0, "HBaseTimes": 0, "HBaseDays": 0, "HOverTimes": 0
                                        , "HOverDays": 0, "HLeaveTimes": 0, "HLeaveDays": 0, "HLateQty": 0, "HLateTimes": 0, "HEarlyQty": 0
                                        , "HEarlyTimes": 0, "HOutForEmpQty": 0, "HOutForEmpTimes": 0, "HOutForComQty": 0, "HOutForComTimes": 0, "HAbsentDays": 0
                                        , "HRestFlag": "true", "HSchClassID": 0, "HCTPrjID": 0, "HCTPrjName": "", "HWorkTypeID": 0, "HWorkTypeName": "", "HPayMoney": 0, "HMoney": 0
                                        , "HNeedTimes": 0, "HMainSourceInterID": 0, "HMainSourceEntryID": 0, "HMainSourceBillNo": 0
                                        , "HSourceBillType": "", "HRemark": ""
                                    }];
                                    table.render(option);
                                    if (BYData.length != 0)  //表体数据为空时
                                    {
                                        buttonArr = [];//清空数组
                                        for (var i = 0; i < BYData.length; i++) {
                                            var checkrow = {
                                                "HEmpID": BYData[i].HEmpID, "HEmpNumber": BYData[i].HEmpNumber, "HEmpName": BYData[i].HEmpName, "HEmpRate": BYData[i].HEmpRate
                                                , "HPMTimes": rowdate1[i].HPMTimes, "HAMTimes": rowdate1[i].HAMTimes, "HBaseTimes": rowdate1[i].HBaseTimes, "HBaseDays": rowdate1[i].HBaseDays, "HOverTimes": rowdate1[i].HOverTimes
                                                , "HOverDays": rowdate1[i].HOverDays, "HLeaveTimes": rowdate1[i].HLeaveTimes, "HLeaveDays": rowdate1[i].HLeaveDays, "HLateQty": rowdate1[i].HLateQty, "HLateTimes": rowdate1[i].HLateTimes, "HEarlyQty": rowdate1[i].HEarlyQty
                                                , "HEarlyTimes": rowdate1[i].HEarlyTimes, "HOutForEmpQty": rowdate1[i].HOutForEmpQty, "HOutForEmpTimes": rowdate1[i].HOutForEmpTimes, "HOutForComQty": rowdate1[i].HOutForComQty, "HOutForComTimes": rowdate1[i].HOutForComTimes, "HAbsentDays": rowdate1[i].HAbsentDays
                                                , "HRestFlag": "true", "HSchClassID": rowdate1[i].HSchClassID, "HCTPrjID": BYData[i].HCTPrjID, "HCTPrjName": BYData[i].HCTPrjName, "HWorkTypeID": rowdate1[i].HWorkTypeID, "HWorkTypeName": rowdate1[i].HWorkTypeName, "HPayMoney": rowdate1[i].HPayMoney, "HMoney": rowdate1[i].HMoney
                                                , "HNeedTimes": rowdate1[i].HNeedTimes, "HMainSourceInterID": rowdate1[i].HMainSourceInterID, "HMainSourceEntryID": rowdate1[i].HMainSourceEntryID, "HMainSourceBillNo": rowdate1[i].HMainSourceBillNo
                                                , "HSourceBillType": rowdate1[i].HSourceBillType, "HRemark": rowdate1[i].HRemark
                                            };
                                            buttonArr.push(checkrow);  //将之前的数据存储
                                        }
                                        table.reload("mainTable", {
                                            data: buttonArr    //将数据重新载入表格
                                        })
                                    }
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }
                        }
                    })
                }
                ////表头信息主管弹窗
                //form.on('submit(Employee)', function () {
                //    //页面层-自定义
                //    layer.open({
                //        type: 2,
                //        skin: 'layui-layer-rim', //加上边框
                //        title: '职员列表',
                //        closeBtn: 1,
                //        shift: 2,
                //        area: ['80%', '80%'],
                //        maxmin: true,
                //        content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HEmpID', 'yes'],
                //        btn: ['确定', '取消']
                //        , btn1: function (index, layero) {
                //            //按钮【按钮一】的回调
                //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                //            var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                //            if (checkStatus.data.length === 0) {
                //                return layer.msg('请选择数据');
                //            }
                //            $("#HEmpName").val(checkStatus.data[0].HName);
                //            $("#HEmpID").val(checkStatus.data[0].HItemID);
                //            layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                //        }
                //        , btn2: function (index, layero) {
                //            //按钮【按钮二】的回调
                //            //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                //        },
                //        end: function () {
                //        },
                //        success: function (layero, index) {
                //        }
                //    });
                //});
                //表头信息部门弹窗
                form.on('submit(Department)', function () {
                    //页面层-自定义
@@ -846,7 +913,7 @@
                            //按钮【按钮一】的回调
                            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                            var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//获取table的elem:"#test"
                            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                            if (checkStatus.data.length === 0) {
                                return layer.msg('请选择数据');
                            }
@@ -866,43 +933,7 @@
                        }
                    });
                });
                ////表头信息工资类型弹窗
                //form.on('submit(PayType)', function () {
                //    //页面层-自定义
                //    layer.open({
                //        type: 2,
                //        skin: 'layui-layer-rim', //加上边框
                //        title: '工资类型列表',
                //        closeBtn: 1,
                //        shift: 2,
                //        area: ['80%', '80%'],
                //        maxmin: true,
                //        content: ['../../../views/工资管理/Gy_WorkPayTypeBillList.html?Type=HPayTypeID', 'yes'],
                //        btn: ['确定', '取消']
                //        , btn1: function (index, layero) {
                //            //按钮【按钮一】的回调
                //            var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                //            var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                //            if (checkStatus.data.length === 0) {
                //                return layer.msg('请选择数据');
                //            }
                //            $("#HPayTypeName").val(checkStatus.data[0].工资类型名称);
                //            $("#HPayID").val(checkStatus.data[0].HItemID);
                //            layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                //        }
                //        , btn2: function (index, layero) {
                //            //按钮【按钮二】的回调
                //            //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                //        },
                //        end: function () {
                //        },
                //        success: function (layero, index) {
                //        }
                //    });
                //});
                //退出
                form.on('submit(Exit)', function (data) {
                    if (OperationType == 1) {
@@ -955,8 +986,8 @@
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    parent.layer.close(index); //再执行关闭
                                    //var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    //parent.layer.close(index); //再执行关闭
                                });
                            }
                            else {