1
duhe
2025-04-08 60873cc299ff1acd06b51b9189abdcaec42995a7
WebTM/views/Éú²ú¹ÜÀí/Ç·ÁÏÔËËã/JIT_MaterialLevelShorAnalysisReport.html
@@ -52,16 +52,6 @@
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">产品编码</label>
                                    <div class="layui-input-block" style="margin-left: 77px;">
                                        <input type="hidden" class="layui-input" lay-verify="HMATERIALID" name="HMATERIALID" id="HMATERIALID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <input type="text" class="layui-input" lay-verify="HMATERIALNAME" name="HMATERIALNAME" id="HMATERIALNAME" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;">
                                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMATERIALID" id="btnHMATERIALID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                        </button>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">欠料日期</label>
@@ -76,6 +66,27 @@
                                    </div>
                                </div>
                                <div class="layui-row">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">产品编码</label>
                                        <div class="layui-input-block" style="margin-left: 77px;">
                                            <input type="hidden" class="layui-input" lay-verify="HMATERIALID" name="HMATERIALID" id="HMATERIALID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <input type="text" class="layui-input" lay-verify="HMATERIALNAME" name="HMATERIALNAME" id="HMATERIALNAME" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;">
                                            <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMATERIALID" id="btnHMATERIALID" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                            </button>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">物料属性</label>
                                        <div class="layui-input-block">
                                            <select name="HMaterClsID" id="HMaterClsID" lay-verify="HMaterClsID">
                                                <option value="0" selected>全部</option>
                                                <option value="1">外购</option>
                                                <option value="2">自制</option>
                                                <option value="3">委外</option>
                                            </select>
                                        </div>
                                    </div>
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">查询</button>
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">重置</button>
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnExport" id="btnExport">导出</button>
@@ -152,6 +163,14 @@
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
        //#endregion è¾“入框回车监听
        //$('input[type="text"]').on('keydown', function (event) {
        //    if (event.keyCode == 13) {
        //        $("#btnSearch").click();
        //    }
        //});
        //#endregion
        //#region äº§å“ç¼–码
        form.on('submit(btnHMATERIALID)', function (data) {
            btnHMATERIALID();
@@ -188,17 +207,18 @@
            var HWorkShopID = obj.data.需求车间ID;
            var HBEGINDATE = $("#HBEGINDATE").val();//欠料日期
            var HENDDATE = $("#HENDDATE").val();//至
            layer.open({
                type: 2
                , skin: 'layui-layer-rim'//加上边框
                , area: ['90%', '90%']
                , title: '上层缺料情况'
                , shift: 2//弹出动画
                , shade: 0.6 //遮罩透明度
                //, maxmin: true //允许全屏最小化
                , anim: 0 //0-6的动画形式,-1不开启
                , content: ['../../生产管理/欠料运算/JIT_MaterialLevelShorAnalysisDetailReport.html?type=2&HOrgID=' + HOrgID + "&HMaterID=" + HMaterID + "&HWorkShopID=" + HWorkShopID + "&HBEGINDATE=" + HBEGINDATE + "&HENDDATE=" + HENDDATE, 'yes']
            })
            window.open('../../生产管理/欠料运算/JIT_MaterialLevelShorAnalysisDetailReport.html?type=2&HOrgID=' + HOrgID + "&HMaterID=" + HMaterID + "&HWorkShopID=" + HWorkShopID + "&HBEGINDATE=" + HBEGINDATE + "&HENDDATE=" + HENDDATE);
            //layer.open({
            //    type: 2
            //    , skin: 'layui-layer-rim'//加上边框
            //    , area: ['90%', '90%']
            //    , title: '上层缺料情况'
            //    , shift: 2//弹出动画
            //    , shade: 0.6 //遮罩透明度
            //    //, maxmin: true //允许全屏最小化
            //    , anim: 0 //0-6的动画形式,-1不开启
            //    , content: ['../../生产管理/欠料运算/JIT_MaterialLevelShorAnalysisDetailReport.html?type=2&HOrgID=' + HOrgID + "&HMaterID=" + HMaterID + "&HWorkShopID=" + HWorkShopID + "&HBEGINDATE=" + HBEGINDATE + "&HENDDATE=" + HENDDATE, 'yes']
            //})
        })
            //#endregion
@@ -243,8 +263,8 @@
            })
            //初始化日期
            $("#HBEGINDATE").val(Format(new Date(new Date()), "yyyy-MM-dd"));//欠料日期
            $("#HENDDATE").val(Format(new Date($("#HBEGINDATE").val()).setDate(new Date($("#HBEGINDATE").val()).getDate() + 30), "yyyy-MM-dd"));//至
            $("#HBEGINDATE").val(Format(new Date().setDate(new Date().getDate() - 30), "yyyy-MM-dd"));//欠料日期
            $("#HENDDATE").val(Format(new Date().setDate(new Date().getDate() + 30), "yyyy-MM-dd"));//至
            //生产组织加载
            Organ();
            //车间
@@ -336,6 +356,14 @@
                , cols: [columns]
                , done: function (res, curr, count) {
                    soulTable.render(this);
                    for (var i in res.data) {
                        var item = res.data[i];
                        if (item["未匹配订单数量"] > 0) {
                            $("tr[data-index='" + i + "']").attr({ "style": "background:red;color:black;" });
                        }
                    }
                }
            };
        }
@@ -368,11 +396,12 @@
        function get_Dept() {
            //获取车间列
            var HDeptID = '<option value="0" style="color:red;" selected>全部车间</option>';
            var sql = "exec h_p_Gy_GetHDeptListISWorkShop " + sessionStorage["OrganizationID"]
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Sc_ICMOBill/GetHDeptList",
                url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList",
                async: false,
                data: { "HOrgID": sessionStorage["OrganizationID"] },
                data: { "sWhere": sql},
                success: function (result) {
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data;
@@ -428,11 +457,18 @@
                            }
                            else if ($.inArray(data[i].name, totalArray) > -1) { //计算列  
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120, filter: true });
                            } else if (data[i].name == '是否匹配到订单') {
                                col.push({ field: '是否匹配到订单', title: '是否匹配到订单', sort: true, filter: true, templet: function (d) { return d.是否匹配到订单 ? '否' : '是'; } });
                            } else if (data[i].name == '未匹配订单数量') {
                                col.push({
                                    field: '未匹配订单数量', title: '未匹配订单数量', sort: true, filter: true, templet: function (d) {
                                        return d.未匹配订单数量 > 0 ? '<span style="color: red;">' + d.未匹配订单数量 + '</span>' : d.未匹配订单数量;
                                    } });
                            }
                            else if (data[i].name == '是否匹配到要料计划信息') {
                                col.push({ field: '是否匹配到要料计划信息', title: '是否匹配到要料计划信息', sort: true, filter: true, templet: function (d) { return d.是否匹配到要料计划信息 ? '否' : '是'; } });
                            else if (data[i].name == '未匹配要料计划信息数量') {
                                col.push({
                                    field: '未匹配要料计划信息数量', title: '未匹配要料计划信息数量', sort: true, filter: true, templet: function (d) {
                                        return d.未匹配要料计划信息数量 > 0 ? '<span style="color: red;">' + d.未匹配要料计划信息数量 + '</span>' : d.未匹配要料计划信息数量;
                                    }
                                });
                            } else if (isValidDate(data[i].name)) {
                                col.push({ field: data[i].name, title: Format(data[i].name, 'MM.dd'), width: 70, totalRow: true, filter: true })
                            }
@@ -511,8 +547,10 @@
            var HBEGINDATE = $("#HBEGINDATE").val();//欠料日期
            var HENDDATE = $("#HENDDATE").val();//至
            var HMATERIALID = $("#HMATERIALID").val();//物料/产品
            var HMATERIALNAME = $("#HMATERIALNAME").val();//物料名称
            var HWorkShopID = $("#HWorkShopID").val();//物料/产品
            var HWorkShopID2 = $("#HWorkShopID2").val();//物料/产品需求车间
            var HMaterClsID = $("#HMaterClsID").val();//物料属性
            if (HBEGINDATE > HENDDATE) {
                return layer.msg("开始日期不能小于结束日期!");
            }
@@ -526,11 +564,18 @@
            if (HWorkShopID2 != 0) {
                sWhere += " and T1.HWorkShopID= " + HWorkShopID2 + " ";
            }
            if (HMaterClsID != 0) {
                sWhere += " and T1.HMaterClsID=" + HMaterClsID + " ";
            }
            //if (HBEGINDATE != null && HENDDATE != null) {
            //    sWhere += " and HDate between ''" + HBEGINDATE + "'' and ''" + HENDDATE + "'' ";
            //}
            if (HMATERIALID!=0) {
                sWhere += " and T1.HMaterID= " + HMATERIALID+" ";
            if (HMATERIALID != 0) {
                sWhere += " and T1.HMaterID= " + HMATERIALID + " ";
            } else {
                if (HMATERIALNAME != "") {
                    sWhere += " and (T2.HName like ''%" + HMATERIALNAME + "%'' or T2.HNumber like ''%" + HMATERIALNAME + "%'') ";
                }
            }
            get_Display(sWhere);
            sWhere = "";//调用接口后清空sWhere缓存
@@ -546,6 +591,7 @@
            $("#HMATERIALNAME").val("");
            $("#HWorkShopID").val("0");
            $("#HWorkShopID2").val("0");
            $("#HMaterClsID").val("0");
            form.render('select');
            sWhere = "";
        }