wtt
2024-10-28 07cf94734c36d4eae6ddbc4dd338bf5af81a2193
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>
@@ -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,14 +327,29 @@
            }
            //判断操作类型
            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 {
                layer.alert("未知操作类型!", { icon: 5 });
@@ -344,7 +370,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) {
@@ -382,7 +409,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/GroupInformation.html', 'yes'],
                    content: ['../../基础资料/工资基础资料/Gy_Group.html?type=HGroup', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -392,7 +419,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内部动态递增计算的
                    }
@@ -431,7 +458,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);
                        //按钮【按钮一】的回调
@@ -461,7 +489,8 @@
                                    //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": ""
                                        "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
                                    });
                                    option.data = table.cache["mainTable"];
                                    table.render(option);
@@ -509,7 +538,7 @@
            //#region æäº¤ä¿å­˜
            form.on('submit(Saver)', function (data) {//保存
                var refSav = "";
                if (OperationType == 1 || OperationType == 2) {
                if (OperationType == 1 || OperationType == 2 || OperationType == 4) {
                    refSav = "Add";
                }
                if (OperationType == 3) {
@@ -539,9 +568,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 +612,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 +710,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 +726,7 @@
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                });
            }
            //#endregion
@@ -694,7 +745,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/PartInformation.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
@@ -706,17 +757,26 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HMaterID: checkStatus.data[0].HItemID,
                                        HMaterCode: checkStatus.data[0].HNumber,
                                        HMaterName: checkStatus.data[0].HName,
                                        HMaterSpec: checkStatus.data[0].HModel,
                                        HMaterCode: checkStatus.data[0].物料代码,
                                        HMaterName: checkStatus.data[0].物料名称,
                                        HMaterSpec: checkStatus.data[0].规格型号,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }, end: function () {
                                    if (OptionData.length > 0) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            HMaterID: OptionData[0].HItemID,
                                            HMaterCode: OptionData[0].物料代码,
                                            HMaterName: OptionData[0].物料名称,
                                            HMaterSpec: OptionData[0].规格型号,
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -732,7 +792,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/UnitInformation.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_Unit.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -746,8 +806,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 +815,16 @@
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }, end: function () {
                                    if (OptionData.length > 0) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            HUnitID: OptionData[0].HItemID,
                                            HUnitCode: OptionData[0].计量单位代码,
                                            HUnitName: OptionData[0].计量单位名称
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -773,7 +840,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/SourceInformation.html', 'yes'],
                                content: ['../../基础资料/生产基础资料/Gy_Source.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -787,8 +854,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 +863,16 @@
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }, end: function () {
                                    if (OptionData.length > 0) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            HSourceID: OptionData[0].HItemID,
                                            HSourceCode: OptionData[0].生产资源代码,
                                            HSourceName: OptionData[0].生产资源名称
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -814,7 +888,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 +902,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 +911,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 = [];
                                    }
                                }
                            });
                        }
@@ -869,11 +950,17 @@
                    , { 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: 'HICMOInterID', title: '生产订单内码', edit: 'text', width: 100, hide: true}
                    , { field: 'HICMOEntryID', title: '生产订单子内码', edit: 'text', width: 100, hide: true}
                    , { field: 'HICMOInterID', title: '生产订单内码', edit: 'text', width: 100, hide: true }
                    , { field: 'HICMOEntryID', title: '生产订单子内码', edit: 'text', width: 100, hide: true }
                    , { 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 +971,7 @@
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , totalRow: true
                    , height: 500
                    , cols: [columns]
                    , done: function (res, curr, count) {
@@ -904,8 +992,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 }
@@ -914,8 +1002,9 @@
                    id: 'mainTable_prodReport'
                    , elem: '#mainTable_prodReport'
                    , page: true
                    , totalRow: true
                    , limit: 1000
                    , limits: [500,1000,1500,2000,3000]
                    , limits: [500, 1000, 1500, 2000, 3000]
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns_prodReport]
@@ -965,7 +1054,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);
            }
@@ -994,10 +1084,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].不良数量 == '' ? 0 : data[i].不良数量, "HICMOBillNo": data[i].生产订单号,
                                        "HICMOInterID": data[i].HICMOInterID, "HICMOEntryID": data[i].HICMOEntryID, "HRemark": ""
                                        "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
                                    });
                                }
@@ -1019,7 +1110,7 @@
                    });
                    option.data = arr;
                    console.log(option.data );
                    console.log(option.data);
                    table.render(option);
                    option_prodReport.data = arr_detail;
@@ -1027,8 +1118,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);
                }
@@ -1042,8 +1134,9 @@
                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": ""
                    "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);
            }
@@ -1067,6 +1160,7 @@
                            $("#HInnerBillNo").val(data.内部单据号);
                            $("#HDeptID").val(data.HDeptID);
                            $("#HDeptName").val(data.部门);
                            $("#HDeptNumber").val(data.部门代码);
                            $("#HGroupID").val(data.HGroupID);
                            $("#HGroupName").val(data.班组);
                            $("#HEmpID").val(data.HEmpID);
@@ -1168,15 +1262,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;
                }
@@ -1235,7 +1329,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]  //获取弹框页面
@@ -1243,7 +1337,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内部动态递增计算的
                    }
@@ -1260,7 +1354,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../PublicPage/DeptInformation.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1268,9 +1362,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) { }
@@ -1380,7 +1474,125 @@
                }
            }
            //#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': ""
                            }
                        );
                    }
                    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
@@ -1430,7 +1642,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 GetMaterValue(obj) {
            OptionData = obj;
        }
        //单位
        function GetUnitValue(obj) {
            OptionData = obj;
        }
        //生产资源
        function GetGySource(obj) {
            OptionData[0] = obj;
        }
        //操作员
        function GetHManagerValue(obj) {
            OptionData = obj;
        }
    </script>
</body>
</html>