duhe
2025-05-08 bf06a5de3e5f08502e9fdd2f7c4492d0c295752e
WebTM/views/Éú²ú¹ÜÀí/°à´Î¿ª°àµ¥/Sc_ShiftsBeginInfoBill_Add_Edit.html
@@ -118,14 +118,26 @@
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">应到岗人数<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" lay-verify="HStdEmpQty" name="HStdEmpQty" id="HStdEmpQty" value="">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs9 layui-inline">
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">实到岗人数<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" lay-verify="HRelEmpQty" name="HRelEmpQty" id="HRelEmpQty" value="">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label" style="width: 95px; margin-left: -15px;">计划停工时长<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" lay-verify="HPlanShutdownTimes" name="HPlanShutdownTimes" id="HPlanShutdownTimes" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3 layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">备注</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" lay-verify="HRemark" name="HRemark" id="HRemark">
@@ -542,7 +554,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '职员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HWorker&openType=2', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -569,7 +581,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html?openType=2&HOrgName=' + sessionStorage["Organization"], 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -597,7 +609,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '工作中心列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_WorkCenter.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_WorkCenter.html?openType=2', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -625,7 +637,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '班次列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/生产基础资料/Gy_WorkShiftList.html?type=HWorkShifts&OperationType=2', 'yes']
                    , content: ['../../基础资料/生产基础资料/Gy_WorkShiftList.html?type=HWorkShifts&openType=2', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -653,7 +665,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '班组列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/工资基础资料/Gy_Group.html?type=HGroup', 'yes']
                    , content: ['../../基础资料/工资基础资料/Gy_Group.html?type=HGroup&openType=2', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -681,7 +693,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '班组列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/生产基础资料/Gy_Source.html', 'yes']
                    , content: ['../../基础资料/生产基础资料/Gy_Source.html?Htype=&openType=2', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -737,15 +749,20 @@
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "Sc_ShiftsBeginInfoBill/SaveSc_ShiftsBeginInfoBillMain",
                    url: GetWEBURL() + "Sc_ShiftsBeginInfoBill/SaveSc_ShiftsBeginInfoBillMain ",
                    async: true,
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            layer.msg(data.Message, { icon: 1 });
                            $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
                            if (data.Verify == "Y") //自动审核
                            {
                                $("#HInterID").val(data.HInterID);//获取提交成功返回的单据主ID
                                set_CheckBill(1); //审核
                            }
                            layer.close(index);
                            layer.msg("提交成功");
                        }
                        else {
@@ -791,6 +808,8 @@
                            , "HGroupLeaderID": data[0]["HGroupLeaderID"]
                            , "HGroupLeaderName": data[0]["班组长"]                        
                            , "HStdEmpQty": data[0]["应到岗人数"]
                            , "HRelEmpQty": data[0]["实到岗人数"]
                            , "HPlanShutdownTimes": data[0]["计划停工时长"]
                            , "HRemark": data[0]["表头备注"]
                            , "HMaker": data[0]["制单人"]
@@ -853,6 +872,7 @@
                    return false;
                }
                //#region å­è¡¨æ•°æ®æ£€éªŒ
                //for (var i = 0; i < option.data.length; i++) {
                //    if (option.data[i] != "") {
@@ -907,7 +927,7 @@
                                , shift: 2                                          //弹出动画
                                , area: ["90%", "90%"]                              //窗体大小
                                , maxmin: true                                      //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=&openType=2', "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -957,92 +977,33 @@
                    }
                })
            }
            //#endregion
            //#endregion
            //#region æ˜¾ç¤ºåˆ—数据
            function DisPlay_HideColumn() {
            //审核
            function set_CheckBill(num) {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    async: false,
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                    url: GetWEBURL() + "/Sc_ShiftsBeginInfoBill/AuditSc_ShiftsBeginInfoBill", //方法所在页面和方法名
                    data: { "HInterID": $("#HInterID").val(),"Type": num, "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);
                            });
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                var dataCols = dataCol[i].split('|');
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] += "font-size:" + data1.data[0].HFontSize + "px;";
                                } else {
                                    option.cols[0][i + 1]["style"] += "font-size:100%";
                                }
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //字体所在位置(å·¦ å±…中 å³)
                                switch (dataCols[2]) {
                                    case "L":
                                        option.cols[0][i + 1]["align"] = "left";
                                        break;
                                    case "M":
                                        option.cols[0][i + 1]["align"] = "center";
                                        break;
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                            }
                            //取消冻结列
                            for (var i = 1; i < option.cols[0].length - 1; i++) {
                                if (option.cols[0][i]["fixed"] != null) {
                                    option.cols[0][i]["fixed"] = null;
                                }
                                else {
                                    break;
                                }
                            }
                            //冻结列
                            if (data1.data[0].HFixCols != 0) {
                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                        data1.data[0].HFixCols += 1;
                                    }
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            table.render(option);
                            for (var i = 0; i < option.data.length; i++) {
                                $('#HReceiveType' + (i + 1)).find("option[value='" + option.data[i].HReceiveType + "']").attr("selected", true);
                            }
                            form.render('select');
                        } else {
                            table.render(option);
                            for (var i = 0; i < option.data.length; i++) {
                                $('#HReceiveType' + (i + 1)).find("option[value='" + option.data[i].HReceiveType + "']").attr("selected", true);
                            }
                            form.render('select');
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
                });
            }
            //#endregion
            //#endregion