duhe
2025-09-01 e57b2edbffff5a653ba9eda65eae100ceb2e7822
WebTM/views/Éú²ú¹ÜÀí/Éú²ú»ã±¨µ¥/Sc_Add_ICMOReportBillList.html
@@ -13,6 +13,8 @@
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/PageTitle.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        /*begin æ­¤æ ·å¼ç”¨äºŽæ¶ˆé™¤è¡Œå…ƒç´ ä¸­å¸ƒå±€å®½åº¦ä¸å¤Ÿçš„问题*/
        .layui-form-item .layui-inline {
@@ -36,12 +38,12 @@
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">审核</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">反审核</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_DeleteBill" id="set_DeleteBill">删除</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="get_PrintReport" id="get_PrintReport">预览</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="get_PrintReport" id="get_PrintReport">打印</button>
                            <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                        </div>
                    </div>
                    <h1 style="text-align:center;"><b>生产汇报单</b></h1>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">基本信息</li>
@@ -83,7 +85,7 @@
                                            <label class="layui-form-label">班组</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HGroupName" id="HGroupName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HGroupList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
@@ -93,7 +95,7 @@
                                            <label class="layui-form-label">统计员</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
@@ -123,8 +125,8 @@
                                        </div>
                                        <div class="layui-col-xs8 layui-inline">
                                            <label class="layui-form-label" style="width: 6.5%;">备注</label>
                                            <div class="layui-input-block">
                                                <input class="layui-input" name="HRemark" id="HRemark" autocomplete="off" style=" width: 75%;">
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HRemark" id="HRemark" autocomplete="off" style=" width: 75%;">
                                            </div>
                                        </div>
                                    </div>
@@ -242,7 +244,7 @@
                                <table class="layui-hide" id="mainTable_prodReport" lay-filter="mainTable_prodReport"></table>
                            </div>
                        </div>
                    </div>
                    </div>
                    <script type="text/html" id="toolbarDemo">
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine" id="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
@@ -262,6 +264,7 @@
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        var OptionData = [];
        //#region æŠ˜å æ³¨é‡Š
        //#endregion
        layui.config({
@@ -288,10 +291,18 @@
            //};
            var Sctag = "0";
            var columns = "";
            var HIsCheck = false;
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "3711";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            $("h1").html('<b>' + HPageTitle + '</b>');
            //#endregion
            //判断是否登录 æœªç™»å½•则跳到登录页
            get_LoginIs();
@@ -316,13 +327,45 @@
            }
            //判断操作类型
            if (OperationType == 1) {//无源单新增
                $("#HDeptID").val(sessionStorage["HDeptID"]); //根据登录用户带出部门ID
                $("#HDeptName").val(sessionStorage["HDept"]); //根据登录用户带出部门
                $("#HGroupID").val(sessionStorage["HGroupID"]); //根据登录用户带出班组ID
                $("#HGroupName").val(sessionStorage["HGroup"]); //根据登录用户带出班组
                $("#HEmpID").val(sessionStorage["HEmpID"]); //根据登录用户带出操作员ID
                $("#HEmpName").val(sessionStorage["HEmpName"]); //根据登录用户带出操作员
                set_AddFNew();
            }
            else if (OperationType == 2) {//有源单新增
                $("#HDeptID").val(sessionStorage["HDeptID"]); //根据登录用户带出部门ID
                $("#HDeptName").val(sessionStorage["HDept"]); //根据登录用户带出部门
                $("#HGroupID").val(sessionStorage["HGroupID"]); //根据登录用户带出班组ID
                $("#HGroupName").val(sessionStorage["HGroup"]); //根据登录用户带出班组
                $("#HEmpID").val(sessionStorage["HEmpID"]); //根据登录用户带出操作员ID
                $("#HEmpName").val(sessionStorage["HEmpName"]); //根据登录用户带出操作员
                set_AddNew();
            }
            else if (OperationType == 3) {//编辑
                set_EditFromGrid();
                //get_file();
            }
            else if (OperationType == 4) {//下推
                setInit_PushBill();
            }
            else if (OperationType == 5) {//复制
                set_EditFromGrid();
                //获取最大单据号
                get_MAXNum();
                //初始化制单人和制单时间
                $("#HMaker").val(sessionStorage["HUserName"]);
                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HUpDater").val();
                $("#HUpDateDate").val();
                $("#HChecker").val();
                $("#HCheckDate").val();
                $("#HCloseMan").val();
                $("#HCloseDate").val();
                $("#HDeleteMan").val();
                $("#HDeleteDate").val();
                //get_file();
            }
            else {
@@ -344,7 +387,8 @@
                var NewRow = {
                    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                    "HICMOBillNo": "", "HICMOInterID": "0","HICMOEntryID":"0","HRemark": ""
                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
                    "HSourceBillType": 0
                };
                switch (obj.event) {
@@ -362,6 +406,26 @@
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
                //#region ä¿®æ”¹è¡Œ æ—¶é—´
                var data = obj.data;
                //生产日期
                if (obj.event == 'HProduceDate') {
                    var field = $(this).data('field');
                    laydate.render({
                        elem: this.firstChild
                        , show: true //直接显示
                        , closeStop: this
                        , done: function (nowDate) {
                            //时间选择完成,行数据更新
                            data[field] = nowDate;
                            obj.update(data);
                            //刷新复选框
                            //checkRefresh();
                        }
                    });
                }
                //#endregion
            });
            //#endregion
@@ -382,7 +446,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/GroupInformation.html', 'yes'],
                    content: ['../../基础资料/工资基础资料/Gy_Group.html?type=HGroup&openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -392,7 +456,7 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HGroupName").val(checkStatus.data[0].HName);
                        $("#HGroupName").val(checkStatus.data[0].班组名称);
                        $("#HGroupID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -428,12 +492,6 @@
                    content: ['../../PublicPage/ProductionOrder.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        option.data = [{
                            "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                            "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                            "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": ""
                        }];
                        table.render(option);
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
@@ -455,29 +513,22 @@
                        if (isAllEqual(list))  //相同单号
                        {
                            //console.log(checkStatus.data);
                            if (checkStatus.data.length > 1) {
                                for (var i = 0; i < checkStatus.data.length - 1; i++) //补行
                                {
                                    //var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HRemark": "" };
                                    table.cache["mainTable"].push({
                                        "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                                        "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0, "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": ""
                                    });
                                    option.data = table.cache["mainTable"];
                                    table.render(option);
                                }
                            var optionData = [];
                            for (var i = 0; i < checkStatus.data.length; i++) //补行
                            {
                                var NewRow = {
                                    "HMaterID": checkStatus.data[0].HMaterID, "HMaterCode": checkStatus.data[0].HMaterCode, "HMaterName": checkStatus.data[0].HMaterName, "HMaterSpec": checkStatus.data[0].HMaterSpec, "HUnitID": checkStatus.data[0].HUnitID, "HUnitCode": checkStatus.data[0].HUnitCode, "HUnitName": checkStatus.data[0].HUnitName,
                                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                                    "HICMOBillNo": checkStatus.data[0].单据号, "HICMOInterID": checkStatus.data[0].hmainid, "HICMOEntryID": checkStatus.data[0].HEntryID, "HRemark": "", "HSourceInterID": checkStatus.data[0].hmainid, "HSourceEntryID": checkStatus.data[0].HEntryID, "HSourceBillNo": checkStatus.data[0].单据号,
                                    "HSourceBillType": 3710
                                };
                                optionData.push(NewRow);
                            }
                            option.data = checkStatus.data;
                            table.render(option);
                            //for (var i = 0; i < checkStatus.data.length; i++) {
                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterID"] .layui-table-cell').text(checkStatus.data[i].HMaterID);
                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterCode"] .layui-table-cell').text(checkStatus.data[i].HMaterCode);
                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterName"] .layui-table-cell').text(checkStatus.data[i].HMaterName);
                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterSpec"] .layui-table-cell').text(checkStatus.data[i].HMaterSpec);
                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HUnitID"] .layui-table-cell').text(checkStatus.data[i].HUnitID);
                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HUnitCode"] .layui-table-cell').text(checkStatus.data[i].HUnitCode);
                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HUnitName"] .layui-table-cell').text(checkStatus.data[i].HUnitName);
                            //}
                            table.reload("mainTable", {
                                data: optionData    //将数据重新载入表格
                            })
                            layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        }
                        else {
@@ -509,10 +560,10 @@
            //#region æäº¤ä¿å­˜
            form.on('submit(Saver)', function (data) {//保存
                var refSav = "";
                if (OperationType == 1 || OperationType == 2) {
                if (OperationType == 1 || OperationType == 2 || OperationType == 4 || OperationType == 5) {
                    refSav = "Add";
                }
                if (linterid == 3) {
                if (OperationType == 3) {
                    refSav = "Update";
                }
                data.field.HMaker = sessionStorage["HUserName"];//制单人
@@ -520,6 +571,13 @@
                var row = [];
                for (var i = 0; i < table.cache['mainTable'].length; i++) {
                    if (table.cache['mainTable'][i] != "") {
                        if (table.cache["mainTable"][i].HMaterName.indexOf("\"") != -1 || table.cache["mainTable"][i].HMaterName.indexOf(";") != -1) {
                            table.cache["mainTable"][i].HMaterName = table.cache["mainTable"][i].HMaterName.replaceAll("\"", "”").replaceAll(";", ";")
                        }
                        if (table.cache["mainTable"][i].HMaterSpec.indexOf("\"") != -1 || table.cache["mainTable"][i].HMaterSpec.indexOf(";") != -1) {
                            table.cache["mainTable"][i].HMaterSpec = table.cache["mainTable"][i].HMaterSpec.replaceAll("\"", "”").replaceAll(";", ";")
                        }
                        row.push(table.cache['mainTable'][i])
                    }
                }
@@ -539,9 +597,10 @@
                    success: function (data) {
                        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); //再执行关闭 Â  Â  Â  Â  Â Â  Â Â Â  Â 
                                $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
                                $('#set_CheckBill').removeClass("layui-btn-disabled").attr("disabled", false);//审核按钮启用
                                //var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                //parent.layer.close(index); //再执行关闭 Â  Â  Â  Â  Â Â  Â Â Â  Â 
                            });
                        }
                        else {
@@ -582,6 +641,26 @@
            //#region åˆ é™¤
            form.on('submit(set_DeleteBill)', function (data) {
            });
            //#endregion
            //#region æ‰“印
            form.on('submit(get_PrintReport)', function (data) {
                if (HIsCheck == true) {
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + $("#HInterID").val().toString() + '&MyMsg=' + $("#HInterID").val().toString() + '&Type=HICMOReport2', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('请审核单据成功后打印!');
                }
            });
            //#endregion
@@ -660,6 +739,7 @@
                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            HIsCheck = true;
                            layer.msg(result.Message, { time: 1 * 10000, icon: 1 }, function () {
                                // å¾—到frame索引
                                var index = layer.getFrameIndex(window.name);
@@ -675,7 +755,7 @@
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                });
            }
            //#endregion
@@ -694,7 +774,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/PartInformation.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_Material.html?openType=2', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
@@ -703,20 +783,68 @@
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HMaterID: checkStatus.data[0].HItemID,
                                        HMaterCode: checkStatus.data[0].HNumber,
                                        HMaterName: checkStatus.data[0].HName,
                                        HMaterSpec: checkStatus.data[0].HModel,
                                    });
                                    //选中多行时
                                    if (checkStatus.data.length > 1) {
                                        var rowIndex = $(obj.tr).attr("data-index") * 1;  //attr("data-index")用于获取该tr元素上data-index属性的值*1转换类型然后赋值给rowIndex
                                        for (var i = 0; i < checkStatus.data.length; i++) {  //判断选中的数据的长度  ç”¨äºŽéåކcheckStatus.data数组中的每个元素
                                            if (rowIndex + i >= option.data.length) {           //判断rowIndex + i的索引超出了option.data数组的长度,说明option.data数组需要扩展以包含更多行
                                                var NewRow = {
                                                    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                                                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                                                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
                                                    "HSourceBillType": 0
                                                };
                                                table.cache["mainTable"].push(NewRow);    //创建新的包含数组  ä¼ å…¥table.cache["mainTable"]数组
                                                option.data = table.cache["mainTable"];  //把传入 table.cache["mainTable"]数组的值赋值给option.data çš„属性
                                                table.render(option);//渲染界面
                                            }
                                            option.data[rowIndex + i].HMaterID = checkStatus.data[i].HItemID;  //将option.data数组中对应行的HMaterID属性更新为从resultData对象中获取的物料ID
                                            option.data[rowIndex + i].HMaterCode = checkStatus.data[i].物料代码; //将option.data数组中对应行的 ç‰©æ–™ä»£ç  å±žæ€§æ›´æ–°ä¸ºä»ŽresultData对象中获取的物料ID
                                            option.data[rowIndex + i].HMaterName = checkStatus.data[i].物料名称; //将option.data数组中对应行的  ç‰©æ–™åç§°  å±žæ€§æ›´æ–°ä¸ºä»ŽresultData对象中获取的物料ID
                                            option.data[rowIndex + i].HMaterSpec = checkStatus.data[i].规格型号; //将option.data数组中对应行的  è§„格型号  å±žæ€§æ›´æ–°ä¸ºä»ŽresultData对象中获取的物料ID
                                            option.data[rowIndex + i].HUnitID = checkStatus.data[i].HUnitID; //将option.data数组中对应行的 HUnitID å±žæ€§æ›´æ–°ä¸ºä»ŽresultData对象中获取的物料ID
                                            option.data[rowIndex + i].HUnitCode = checkStatus.data[i].计量单位代码;
                                            option.data[rowIndex + i].HUnitName = checkStatus.data[i].计量单位名称; //将option.data数组中对应行的 è®¡é‡å•位 å±žæ€§æ›´æ–°ä¸ºä»ŽresultData对象中获取的物料ID   æ›´æ–°è®¡é‡å•位属性
                                        }
                                        table.render(option); //重新渲染表格以显示更新后的数据
                                    } else {
                                        //同步更新表格和缓存对应的值
                                        obj.update({
                                            HMaterID: checkStatus.data[0].HItemID,
                                            HMaterCode: checkStatus.data[0].物料代码,
                                            HMaterName: checkStatus.data[0].物料名称,
                                            HMaterSpec: checkStatus.data[0].规格型号,
                                            HUnitID: checkStatus.data[0].HUnitID,
                                            HUnitCode: checkStatus.data[0].计量单位代码,
                                            HUnitName: checkStatus.data[0].计量单位名称,
                                        });
                                    }
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }, end: function () {
                                    if (OptionData != "" && OptionData != []) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            HMaterID: OptionData.HItemID,
                                            HMaterCode: OptionData.物料代码,
                                            HMaterName: OptionData.物料名称,
                                            HMaterSpec: OptionData.规格型号,
                                            HUnitID: OptionData.HUnitID,
                                            HUnitCode: OptionData.计量单位代码,
                                            HUnitName: OptionData.计量单位名称,
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -732,7 +860,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/UnitInformation.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_Unit.html?Type=HUnitList', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -746,8 +874,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HUnitID: checkStatus.data[0].HItemID,
                                        HUnitCode: checkStatus.data[0].HNumber,
                                        HUnitName: checkStatus.data[0].HName
                                        HUnitCode: checkStatus.data[0].计量单位代码,
                                        HUnitName: checkStatus.data[0].计量单位名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
@@ -755,9 +883,16 @@
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }, end: function () {
                                    if (OptionData != "" && OptionData != []) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            HUnitID: OptionData.HItemID,
                                            HUnitCode: OptionData.计量单位代码,
                                            HUnitName: OptionData.计量单位名称
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -773,7 +908,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/SourceInformation.html', 'yes'],
                                content: ['../../基础资料/生产基础资料/Gy_Source.html?Htype=&openType=2', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -787,8 +922,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HSourceID: checkStatus.data[0].HItemID,
                                        HSourceCode: checkStatus.data[0].HNumber,
                                        HSourceName: checkStatus.data[0].HName
                                        HSourceCode: checkStatus.data[0].生产资源代码,
                                        HSourceName: checkStatus.data[0].生产资源名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
@@ -796,9 +931,16 @@
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }, end: function () {
                                    if (OptionData.length > 0) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            HSourceID: OptionData[0][0].HItemID,
                                            HSourceCode: OptionData[0][0].生产资源代码,
                                            HSourceName: OptionData[0][0].生产资源名称
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -814,7 +956,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/UserInformation.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?type=HManager', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -828,8 +970,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HWorkerid: checkStatus.data[0].HItemID,
                                        HWorkerCode: checkStatus.data[0].HNumber,
                                        HWorkerName: checkStatus.data[0].HName
                                        HWorkerCode: checkStatus.data[0].职员代码,
                                        HWorkerName: checkStatus.data[0].职员名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
@@ -837,9 +979,16 @@
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }, end: function () {
                                    if (OptionData.length > 0) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            HWorkerid: OptionData[0].HItemID,
                                            HWorkerCode: OptionData[0].职员代码,
                                            HWorkerName: OptionData[0].职员名称
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -858,22 +1007,29 @@
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterCode', title: '物料代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', edit: 'text', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', style: 'background-color:#efefef4d;', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', style: 'background-color:#efefef4d;', width: 100 }
                    , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true }
                    , { field: 'HUnitCode', title: '单位代码', edit: 'text', event: 'HUnitCode', width: 100 }
                    , { field: 'HUnitName', title: '单位名称', edit: 'text', width: 100 }
                    , { field: 'HUnitName', title: '单位名称', style: 'background-color:#efefef4d;', width: 100 }
                    , { field: 'HSourceID', title: 'HSourceID', edit: 'text', width: 100, hide: true }
                    , { field: 'HSourceCode', title: '资源代码', edit: 'text', event: 'HSourceCode', width: 100 }
                    , { field: 'HSourceName', title: '资源名称', edit: 'text', width: 100 }
                    , { field: 'HSourceName', title: '资源名称', style: 'background-color:#efefef4d;', width: 100 }
                    , { field: 'HWorkerid', title: 'HWorkerid', edit: 'text', width: 100, hide: true }
                    , { field: 'HWorkerCode', title: '操作员代码', edit: 'text', event: 'HWorkerCode', width: 100 }
                    , { field: 'HWorkerName', title: '操作员名称', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '生产数量', edit: 'text', width: 100 }
                    , { field: 'HBadQty', title: '不良数量', edit: 'text', width: 100 }
                    , { field: 'HICMOBillNo', title: '生产订单', edit: 'text', width: 100 }
                    , { field: 'HICMOInterID', title: '生产订单内码', edit: 'text', width: 100, hide: true}
                    , { field: 'HICMOEntryID', title: '生产订单子内码', edit: 'text', width: 100, hide: true}
                    , { field: 'HWorkerName', title: '操作员名称', style: 'background-color:#efefef4d;', width: 100 }
                    , { field: 'HQty', title: '生产数量', edit: 'text', width: 100, totalRow: true }
                    , { field: 'HBadQty', title: '不良数量', edit: 'text', width: 100, totalRow: true }
                    , { field: 'HICMOBillNo', title: '生产订单', style: 'background-color:#efefef4d;', width: 100 }
                    , { field: 'HICMOInterID', title: '生产订单内码', style: 'background-color:#efefef4d;', width: 100, hide: true }
                    , { field: 'HICMOEntryID', title: '生产订单子内码', style: 'background-color:#efefef4d;', width: 100, hide: true }
                    , { field: 'HPRODUCEDATE', title: '生产日期', event: 'HProduceDate', width: 100 }
                    , { field: 'HSourceInterID', title: '源单内码', edit: 'text', width: 100, hide: true }
                    , { field: 'HSourceEntryID', title: '源单子内码', edit: 'text', width: 100, hide: true }
                    , { field: 'HSourceBillNo', title: '源单单号', edit: 'text', width: 100, hide: true }
                    , { field: 'HSourceBillType', title: '源单类型', edit: 'text', width: 100, hide: true }
                    , { field: 'HICMOTempID', title: 'HICMOTempID', edit: 'text', width: 100, hide: true }
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150 }
@@ -884,6 +1040,7 @@
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , totalRow: true
                    , height: 500
                    , cols: [columns]
                    , done: function (res, curr, count) {
@@ -904,8 +1061,8 @@
                    , { field: 'HWorkerid', title: 'HWorkerid', edit: 'text', width: 100, hide: true }
                    , { field: 'HWorkerCode', title: '操作员代码', edit: 'text', event: 'HWorkerCode', width: 100 }
                    , { field: 'HWorkerName', title: '操作员名称', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '生产数量', edit: 'text', width: 100 }
                    , { field: 'HBadQty', title: '不良数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '生产数量', edit: 'text', width: 100, totalRow: true }
                    , { field: 'HBadQty', title: '不良数量', edit: 'text', width: 100, totalRow: true }
                    , { field: 'HICMOBillNo', title: '生产订单', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '表体备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150 }
@@ -913,7 +1070,10 @@
                option_prodReport = {
                    id: 'mainTable_prodReport'
                    , elem: '#mainTable_prodReport'
                    , page: false
                    , page: true
                    , totalRow: true
                    , limit: 1000
                    , limits: [500, 1000, 1500, 2000, 3000]
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns_prodReport]
@@ -963,7 +1123,8 @@
                option.data = [{
                    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": ""
                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
                    "HSourceBillType": 0, "HICMOTempID": 0
                }];
                table.render(option);
            }
@@ -992,10 +1153,11 @@
                                for (let i = 0; i < data.length; i++) {
                                    arr.push({
                                        "HMaterID": data[i].物料ID, "HMaterCode": data[i].物料代码, "HMaterName": data[i].物料名称, "HMaterSpec": data[i].规格型号,
                                        "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HSourceID": data[i].生产资源ID, "HSourceCode": data[i].生产资源代码,
                                        "HUnitID": data[i].单位ID, "HUnitCode": data[i].计量单位代码, "HUnitName": data[i].计量单位, "HSourceID": data[i].生产资源ID, "HSourceCode": data[i].生产资源代码,
                                        "HSourceName": data[i].生产资源名称, "HWorkerid": data[i].操作员ID, "HWorkerCode": data[i].操作员代码,
                                        "HWorkerName": data[i].操作员名称, "HQty": data[i].产量, "HBadQty": data[i].不良数量, "HICMOBillNo": data[i].生产订单号,
                                        "HICMOInterID": data[i].HICMOInterID, "HICMOEntryID": data[i].HICMOEntryID, "HRemark": ""
                                        "HWorkerName": data[i].操作员名称, "HQty": data[i].产量, "HBadQty": data[i].不良数量 == '' ? 0 : data[i].不良数量, "HICMOBillNo": data[i].生产订单号,
                                        "HICMOInterID": data[i].HICMOInterID, "HICMOEntryID": data[i].HICMOEntryID, "HRemark": "", "HSourceInterID": data[i].HICMOInterID, "HSourceEntryID": data[i].HICMOEntryID, "HSourceBillNo": data[i].生产订单号,
                                        "HSourceBillType": 3710, "HICMOTempID": data[i].HICMOTempID,"HPRODUCEDATE": data[i].生产日期
                                    });
                                }
@@ -1017,7 +1179,7 @@
                    });
                    option.data = arr;
                    console.log(option.data );
                    console.log(option.data);
                    table.render(option);
                    option_prodReport.data = arr_detail;
@@ -1025,8 +1187,9 @@
                } else {
                    option.data = [{
                        "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                        "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                        "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": ""
                        "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                        "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
                        "HSourceBillType": 0, "HICMOTempID": 0
                    }];
                    table.render(option);
                }
@@ -1038,11 +1201,12 @@
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{
                    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": ""
                }];
                //option.data = [{
                //    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
                //    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
                //    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
                //    "HSourceBillType": 0, "HICMOTempID": 0
                //}];
                table.render(option);
            }
            //#endregion
@@ -1053,6 +1217,7 @@
                $.ajax({
                    url: GetWEBURL() + "Sc_ICMOReportBill/Sc_GetICMOReportBillListCheckDetai",
                    type: "GET",
                    async: false,
                    data: {
                        "HID": linterid
                    },
@@ -1065,13 +1230,14 @@
                            $("#HInnerBillNo").val(data.内部单据号);
                            $("#HDeptID").val(data.HDeptID);
                            $("#HDeptName").val(data.部门);
                            $("#HDeptNumber").val(data.部门代码);
                            $("#HGroupID").val(data.HGroupID);
                            $("#HGroupName").val(data.班组);
                            $("#HEmpID").val(data.HEmpID);
                            $("#HEmpName").val(data.统计员);
                            $("#HMainSourceBillNo").val(data.HMainSourceBillNo);
                            $("#HMainSourceInterID").val(data.HMainSourceInterID);
                            $("#HMainSourceEntryID").val(data.HMainSourceEntryID);
                            $("#HMainSourceInterID").val(data.HMainSourceInterID == null ? 0 : data.HMainSourceInterID);
                            $("#HMainSourceEntryID").val(data.HMainSourceEntryID == null ? 0 : data.HMainSourceEntryID);
                            $("#HExplanation").val("");
                            $("#HRemark").val(data.表头备注);
                            PicUpload();
@@ -1093,6 +1259,7 @@
                $.ajax({
                    url: GetWEBURL() + 'Sc_ICMOReportBill/Sc_ICMOReportBillListProjectDetai',
                    type: "GET",
                    async: false,
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        if (result.count == 1) {
@@ -1166,15 +1333,15 @@
            //#region éžç©ºéªŒè¯
            function AllowLoadData(sSubStr) {  //非空验证
                var Result = true;
                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null) {
                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null || $("#HDeptID").val() == "undefined" || $("#HDeptID").val() == 0) {
                    layer.msg("车间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null) {
                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null || $("#HGroupID").val() == "undefined" | $("#HGroupID").val() == 0) {
                    layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null) {
                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null || $("#HGroupID").val() == "undefined" || $("#HEmpID").val() == 0) {
                    layer.msg("统计员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
@@ -1206,6 +1373,10 @@
                            layer.msg("明细记录第" + (i + 1) + "行,生产数量不能为空或0或者小于0!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }
                        //if (sSubStr[i].HPRODUCEDATE == "" || sSubStr[i].HPRODUCEDATE == null || sSubStr[i].HPRODUCEDATE == "undefined") {
                        //    layer.msg("明细记录第" + (i + 1) + "行,生产日期不允许为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        //    return Result = false;
                        //}
                    }
                }
                else {
@@ -1233,7 +1404,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '职员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../PublicPage/UserInformation.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?type=HEmp', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1241,7 +1412,7 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HEmpName").val(checkStatus.data[0].HName);
                        $("#HEmpName").val(checkStatus.data[0].职员名称);
                        $("#HEmpID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -1258,7 +1429,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../PublicPage/DeptInformation.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html?openType=2&HOrgName=' + sessionStorage["Organization"], 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1266,9 +1437,9 @@
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        $("#HDeptName").val(checkStatus.data[0].部门名称);
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        $("#HDeptNumber").val(checkStatus.data[0].HNumber);
                        $("#HDeptNumber").val(checkStatus.data[0].部门代码);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
@@ -1378,7 +1549,126 @@
                }
            }
            //#region ä¸‹æŽ¨é¡µé¢åˆå§‹åŒ–
            function setInit_PushBill() {
                //生成单据号和内码
                get_MAXNum();
                //初始化日期、制单人、制单日期
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HMaker").val(sessionStorage["HUserName"]);
                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));
                $("#HGroupID").val(sessionStorage["HGroupID"]); //根据登录用户带出班组ID
                $("#HGroupName").val(sessionStorage["HGroup"]); //根据登录用户带出班组
                $("#HEmpID").val(sessionStorage["HEmpID"]); //根据登录用户带出操作员ID
                $("#HEmpName").val(sessionStorage["HEmpName"]); //根据登录用户带出操作员
                var temp = HSouceBillType;
                if (temp == "3710") {
                    //获取
                    var data = getUrlVars_JSON().data;
                    var dataArray = [];
                    for (var i = 0; i < data.length; i++) {
                        var temp = getPushSource_ICMOBillInit(data[i].hmainid, data[i].hsubid);
                        if (temp != "none") {
                            dataArray.push(temp);
                        } else {
                            return;
                        }
                    }
                    form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                        "HMainSourceInterID": "0"
                        , "HMainSourceEntryID": "0"
                        , "HMainSourceBillNo": ""
                        , "HMainSourceBillType": temp
                        , "HDeptID": dataArray[0].HDeptID
                        , "HDeptName": dataArray[0].生产车间
                        , "HMainSourceBillType": 2
                    });
                    $('#XDHList').addClass("layui-btn-disabled").attr("disabled", true);
                    $('#HMainSourceBillNo').addClass("layui-btn-disabled").attr("disabled", true);
                    document.getElementById('HMainSourceBillNo').style.backgroundColor = '#efefef4d'
                    //子表  èµ‹å€¼
                    var rowdata = [];
                    for (var i = 0; i < dataArray.length; i++) {
                        rowdata.push(
                            {
                                "HMaterID": dataArray[i].HMaterID
                                , "HMaterCode": dataArray[i].产品代码
                                , "HMaterName": dataArray[i].产品名称
                                , "HMaterSpec": dataArray[i].规格型号
                                , "HUnitID": dataArray[i].HUnitID
                                , "HUnitCode": dataArray[i].计量单位代码
                                , "HUnitName": dataArray[i].计量单位
                                , "HSourceID": sessionStorage["HSourceID"] == "" ? 0 : sessionStorage["HSourceID"]
                                , "HSourceCode": ""
                                , "HSourceName": sessionStorage["HSource"]
                                , "HWorkerid": sessionStorage["HEmpID"] == "" ? 0 : sessionStorage["HEmpID"]
                                , "HWorkerCode": sessionStorage["HEmpNumber"]
                                , "HWorkerName": sessionStorage["HEmpName"]
                                , "HQty": dataArray[i].未关联数量
                                , "HBadQty": 0
                                , "HICMOBillNo": dataArray[i].单据号
                                , "HICMOInterID": dataArray[i].hmainid
                                , "HICMOEntryID": dataArray[i].HEntryID
                                , "HSourceInterID": dataArray[i].hmainid
                                , "HSourceEntryID": dataArray[i].HEntryID
                                , "HSourceBillNo": dataArray[i].单据号
                                , "HSourceBillType": dataArray[i].单据类型
                                , 'HICMOTempID': "0"
                                , 'HRemark': ""
                                , 'HPRODUCEDATE': dataArray[i].生产日期
                            }
                        );
                    }
                    option.data = rowdata;
                    table.render(option);
                }
                else {
                    return layer.msg('当前不支持该源单下推!!');
                }
            }
            //#endregion
            //#region æ ¹æ®ä¸»å†…码与子内码获取源单生产订单数据
            function getPushSource_ICMOBillInit(HSourceInterID, HSourceEntryID) {
                var res = "none";
                $.ajax({
                    url: GetWEBURL() + "/Sc_ICMOBill/loadSc_ICMOBill_Push",
                    async: false,
                    type: "GET",
                    data: {
                        "HInterID": HSourceInterID
                        , "HSubID": HSourceEntryID
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            res = result.data[0];
                        } else {
                            res = result.data;
                            //layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                        res = "none";
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
                return res;
            }
            //#endregion
            //#region èŽ·å–å‚æ•°_传递的JSON格式参数
            function getUrlVars_JSON() {
                var datajson;
                var str = window.location.search; //获取链接中传递的参数
                var arr = str.substring(str.lastIndexOf("=") + 1);
                datajson = $.parseJSON(decodeURI(arr));
                return datajson;
            }
            //#endregion
            //#endregion
@@ -1428,7 +1718,38 @@
            /*window.location.href = url;*/
            window.open(url)
        }
        //生产车间
        function GetHDeptNameValue(obj) {
            $("#HDeptName").val(obj[0].部门名称);
            $("#HDeptID").val(obj[0].HItemID);
            $("#HDeptNumber").val(obj[0].部门代码);
        }
        //生产班组
        function GetHGroupValue(obj) {
            $("#HGroupName").val(obj[0].班组名称);
            $("#HGroupID").val(obj[0].HItemID);
        }
        //统计员
        function GetHEmpValue(obj) {
            $("#HEmpName").val(obj[0].职员名称);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //物料
        function GetGyMaterial(obj) {
            OptionData = obj;
        }
        //单位
        function GetHUnitListValue(obj) {
            OptionData = obj;
        }
        //生产资源
        function GetGySource(obj) {
            OptionData[0] = obj;
        }
        //操作员
        function GetHManagerValue(obj) {
            OptionData = obj;
        }
    </script>
</body>
</html>