1
duhe
2024-03-15 be7d738131c8cf9c8e00c6abfde469f2d82cbfb0
WebTM/views/Éú²ú¹ÜÀí/Éú²ú½ÐÁÏÆ½Ì¨/JIT_ComplementGoodBillMain.html
@@ -26,50 +26,62 @@
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 10px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Bzjjl" id="Bzjjl">标准件叫料</button>
                        <!--<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Bzjjl" id="Bzjjl">标准件叫料</button>-->
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Ptjl" id="Ptjl">配套叫料</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Zxbzjl" id="Zxbzjl">最小包装叫料</button>
                        <!--<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Zxbzjl" id="Zxbzjl">最小包装叫料</button>-->
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Yce" id="Yce">引出Excel</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Xc" id="Xc">下查</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Cx" id="Cx">查询</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Jl" id="Jl">叫料</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Scjld" id="Scjld">生成拣料单</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Blptl" id="Blptl">不良品退料申请单</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Yltl" id="Yltl">余量退料申请单</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Bftl" id="Bftl">报废退料申请单</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Sctld" id="Sctld">生成退料单</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cx" id="Cx">查询</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Jl" id="Jl">叫料</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Scjld" id="Scjld">生成拣料单</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Blptl" id="Blptl">不良品退料申请单</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Yltl" id="Yltl">余量退料申请单</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Bftl" id="Bftl">报废退料申请单</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Sctld" id="Sctld">生成退料单</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">隐藏列设置</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" style="margin-left: 0px;" lay-filter="btnReSearch" id="btnReSearch">重置</button>
                    </div>
                    <div class="layui-collapse">
                        <div class="layui-colla-item">
                                <div class="layui-colla-title layui-inline">
                                    <div class="layui-inline">
                                        <span>更多</span>
                                    </div>
                                </div>
                            <div class="layui-colla-title layui-inline">
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">销售订单号</label>
                                    <div class="layui-input-block" style="margin-left: 120px;">
                                        <input type="text" class="layui-input" name="HSeOrderBillNo" lay-verify="HSeOrderBillNo" id="HSeOrderBillNo">
                                    </div>
                                    <span>更多</span>
                                </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="DepartmentID" name="DepartmentID" id="DepartmentID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <input type="text" class="layui-input" lay-verify="DepartmentName" name="DepartmentName" id="DepartmentName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnDepartment" id="btnDepartment" 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;padding: 9px 18px;">生产订单</label>
                                <div class="layui-input-block" style="margin-left: 77px;">
                                    <input type="text" class="layui-input" name="HICMOBillNo" lay-verify="HICMOBillNo" id="HICMOBillNo" style="width: 60%;display: inline-block;" >
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnICMOBill" id="btnICMOBill" style="padding: 0 10px;float: right;margin-right: 3px;">
                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                    </button>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 85px;">组织</label>
                                    <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                        <select name="Organization" id="Organization" lay-verify="Organization">
                                            <!--动态渲染组织-->
                                        </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="DepartmentID" name="DepartmentID" id="DepartmentID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                    <input type="text" class="layui-input" lay-verify="DepartmentName" name="DepartmentName" id="DepartmentName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnDepartment" id="btnDepartment" 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>
                                <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                    <select name="Organization" id="Organization" lay-verify="Organization">
                                        <!--动态渲染组织-->
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width: 85px; font-size: 20px;">消息:</label>
                                <div style=" height:50px;">
                                    <p id="wjlCount" style="width: 350px; color: red;"></p>
                                    <p id="wtlCount" style="width: 350px; color: red;"></p>
                                </div>
                            </div>
                            <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
                                <div class="layui-row" style="margin-top:10px;">
                                    <div class="layui-inline">
@@ -91,7 +103,7 @@
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">物料规格型号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="MaterialModel" id="MaterialModel" onmouseover="this.title=this.value" readonly>
                                            <input type="text" class="layui-input" name="MaterialModel" id="MaterialModel" readonly>
                                        </div>
                                    </div>
                                </div>
@@ -100,7 +112,6 @@
                                        <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">产品代码</label>
                                        <div class="layui-input-block" style="margin-left: 77px;">
                                            <input type="text" class="layui-input" name="CPNumber" lay-verify="CPNumber" id="CPNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <input type="hidden" name="CPID" id="CPID" lay-verify="CPID" value="0">
                                            <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnCP" id="btnCP" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                            </button>
@@ -115,34 +126,20 @@
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">产品规格型号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="CPModel" lay-verify="CPModel" id="CPModel" value="" readonly onmouseover="this.title=this.value">
                                            <input type="text" class="layui-input" name="CPModel" lay-verify="CPModel" id="CPModel" value="" readonly>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-row" style="margin-top:10px;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">生产订单号</label>
                                        <label class="layui-form-label" style="width: 85px;">销售订单号</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HICMOBillNo" lay-verify="HICMOBillNo" id="HICMOBillNo" value="" onmouseover="this.title=this.value">
                                            <input type="text" class="layui-input" name="HSeOrderBillNo" lay-verify="HSeOrderBillNo" id="HSeOrderBillNo">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">开始日期</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 48px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;text-align:center;">—</label>
                                        <div class="layui-input-block" style="margin-left: 118px;">
                                            <input type="date" class="layui-input" lay-verify="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 48px;">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-row" style="margin-top:10px;">
                                    <div class="layui-inline">
                                        <div class="layui-input-block" style="margin-left: 90px;">
                                            <input type="checkbox" name="ps" id="ps" lay-skin="primary" lay-filter="ps" title="仅显示未完全配送">
                                        <div style="padding-left: 50px;">
                                            <input type="checkbox" name="checkZXBZ" id="checkZXBZ" lay-skin="primary" lay-filter="checkZXBZ" title="最小包装">
                                        </div>
                                    </div>
                                </div>
@@ -179,13 +176,15 @@
        //查询条件
        var sWhere = "";
        var option = [];
        var HModName = "JIT_ComplementGoodBill";
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
        //初始化界面
        set_ClearBill();
        //定时查询 åˆ·æ–° æœªæ‹£æ–™ æœªé€€æ–™ æ˜¾ç¤ºçš„æ¡æ•°
        setInterval(NotGeneratedMaterial, 30000);
        //#endregion
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
@@ -193,6 +192,27 @@
        //过滤查询
        form.on('submit(Cx)', function () {
            get_FastQuery();
            //隐藏按钮
            var HICMOBillNo = $("#HICMOBillNo").val();
            if (HICMOBillNo == "") {
                $("#Ptjl").hide();
                //$("#Zxbzjl").hide();
                $("#Jl").hide();
                $("#Scjld").hide();
                $("#Yltl").hide();
                $("#Bftl").hide();
                $("#Blptl").hide();
                $("#Sctld").hide();
            } else {
                $("#Ptjl").show();
                //$("#Zxbzjl").show();
                $("#Jl").show();
                $("#Scjld").show();
                $("#Yltl").show();
                $("#Bftl").show();
                $("#Blptl").show();
                $("#Sctld").show();
            }
        })
        //选择生产车间
@@ -218,6 +238,11 @@
        //新增叫料单
        form.on('submit(Jl)', function () {
            set_AddNew_Jl();
        })
        //配套叫料
        form.on('submit(Ptjl)', function () {
            set_Ptjl();
        })
        //新增不良品退料申请单
@@ -250,6 +275,61 @@
            getXc();
        })
        //重置按钮
        form.on('submit(btnReSearch)', function (data) {
            set_ClearQuery();
        });
        //生产订单
        form.on('submit(btnICMOBill)', function (data) {
            get_btnICMOBill();
        })
        //隐藏列设置
        form.on('submit(HideColumn)', function () {
            get_HideColumn();
        })
        //最小包装
        form.on('checkbox(checkZXBZ)', function (data) {
            var checkZXBZ = $("input[name='checkZXBZ']").prop("checked");//复选框
            if (checkZXBZ) {
                for (var i = 0; i < option.cols[0].length; i++) {
                    if (option.cols[0][i]["field"] == "包数") {
                        option.cols[0][i]["edit"] = "text";
                    }
                    if (option.cols[0][i]["field"] == "叫料数量") {
                        option.cols[0][i]["edit"] = "";
                    }
                }
            } else {
                for (var i = 0; i < option.cols[0].length; i++) {
                    if (option.cols[0][i]["field"] == "包数") {
                        option.cols[0][i]["edit"] = "";
                    }
                    if (option.cols[0][i]["field"] == "叫料数量") {
                        option.cols[0][i]["edit"] = "text";
                    }
                }
            }
            table.render(option);
        })
        //行内鼠标离开事件
        table.on('edit(mainTable)', function (obj) {
            var HQty = 0.0;
            if (obj.field == "包数") {
                HQty = parseFloat(obj.data["包数"]) * parseFloat(obj.data["最小包装"])
                //修改数据
                obj.update({
                    "叫料数量": HQty
                });
            }
        })
        //#endregion
        //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
@@ -257,13 +337,15 @@
        //初始化界面
        function set_ClearBill()
        {
            NotGeneratedMaterial();
            Organ();
            //读取过滤条件
            get_ReadConfigFile();
            set_InitGrid();
            get_Display(sWhere);
            Organ();
            //时间初始化
            $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
            DisPlay_HideColumn();
        }
        //获取组织
        function Organ() {
            //获取登录页组织列
@@ -271,14 +353,26 @@
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Web/GetOrganizations",
                async: false,
                success: function (result) {
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data;
                        for (var i = 0; i < data.length; i++) {
                            Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                        }
                        $("#Organization").append(Organization);
                        //获取存储数据
                        var dataG = localStorage.getItem("dataJL");
                        if (dataG != null) {
                            var data2 = JSON.parse(dataG);
                            $("#Organization").val(data2["Organization"]);
                        } else {
                            $("#Organization").val(sessionStorage["OrganizationID"]);
                        }
                        form.render('select');
                    }
                    layer.closeAll("loading");
                }
@@ -291,6 +385,7 @@
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , height: 'full-150'
                , totalRow: true
                , cellMinWidth: 90
                , limit: 500
                , cols: [[
@@ -306,20 +401,24 @@
                    , { field: '物料名称', title: '物料名称', width: 160 }
                    , { field: '规格型号', title: '规格型号', width: 160 }
                    , { field: '子项单位', title: '子项单位', width: 160 }
                    , { field: '单位用量', title: '单位用量', width: 160}
                    , { field: '计划发料数量', title: '计划发料数量', width: 160 }
                    , { field: '叫料数量', title: '叫料数量', width: 160, edit: 'text'}
                    , { field: '退料数量', title: '退料数量', width: 160, edit: 'text'}
                    , { field: '单位用量', title: '单位用量', totalRow: true, width: 160}
                    , { field: '计划发料数量', title: '计划发料数量', totalRow: true, width: 160 }
                    , { field: '最小包装', title: '最小包装', width: 160}
                    , { field: '包数', title: '包数', totalRow: true,width: 160}
                    , { field: '叫料数量', title: '叫料数量', totalRow: true, width: 160, edit: 'text'}
                    , { field: '退料数量', title: '退料数量', totalRow: true,width: 160, edit: 'text'}
                    , { field: '退料原因', title: '退料原因', width: 160, edit: 'text'}
                    , { field: '已叫料数量', title: '已叫料数量', width: 160}
                    , { field: '已配送数量', title: '已配送数量', width: 160 }
                    , { field: '调出仓库', title: '调出仓库', width: 160, edit: 'text', event: 'Warehouse' }
                    , { field: '已叫料数量', title: '已叫料数量', totalRow: true, width: 160}
                    , { field: '已配送数量', title: '已配送数量', totalRow: true,width: 160 }
                    , { field: '调出仓库', title: '调出仓库', width: 160, edit: 'text', event: 'OutWarehouse' }
                    , { field: '调出仓库id', title: '调出仓库id', width: 160, hide: true }
                    , { field: '库存数量', title: '库存数量', width: 160 }
                    , { field: '调出仓库库存数量', title: '调出仓库库存数量', width: 160 }
                    , { field: '调出仓库可用库存数量', title: '调出仓库可用库存数量', width: 160 }
                    , { field: '调入仓库', title: '调入仓库', width: 160, edit: 'text', event: 'InWarehouse' }
                    , { field: '调入仓库id', title: '调入仓库id', width: 160, hide: true }
                    , { field: '库存数量', title: '库存数量', totalRow: true, width: 160 }
                    , { field: '调出仓库库存数量', title: '调出仓库库存数量', totalRow: true, width: 160 }
                    , { field: '调出仓库可用库存数量', title: '调出仓库可用库存数量', totalRow: true, width: 160 }
                    , { field: '可用库存', title: '可用库存', width: 160 }
                    , { field: '库存组织', title: '库存组织', width: 160}
                    , { field: '调出组织', title: '调出组织', width: 160}
                    , { field: 'HICMOBillNo', title: 'HICMOBillNo', width: 160 }
                    , { field: '源单主内码', title: '源单主内码', width: 160 }
                    , { field: '源单子内码', title: '源单子内码', width: 160 }
@@ -344,12 +443,15 @@
            $.ajax({
                url: GetWEBURL() + '/Sc_ComplementGoodBill/ComplementGoodBillList',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(ajaxLoad);
                        //存储过滤条件
                        get_WriteConfigFile();
                        //layer.alert("查询成功", { icon: 1 });
                    } else {
                        layer.close(ajaxLoad);
@@ -453,9 +555,11 @@
            var CPName = $("#CPName").val(); //产品名称
            var CPModel = $("#CPModel").val(); //产品规格型号
            var HICMOBillNo = $("#HICMOBillNo").val(); //生产订单号
            var HBeginDate = $("#HBeginDate").val(); //开始日期
            var HEndDate = $("#HEndDate").val(); //结束日期
            var ps = $("#ps").prop("checked"); //仅显示未完全配送
            if (DepartmentName=="") {
                return layer.msg("请选择生产车间!");
            }
            if (ps) {
                ps = 1; //仅显示未完全配送
            }
@@ -474,10 +578,8 @@
                CPName: CPName,
                CPModel: CPModel,
                HICMOBillNo: HICMOBillNo,
                HBeginDate: HBeginDate,
                HEndDate: HEndDate,
                ps: ps,
                user: user
                user: user,
            };
            get_Display(JSON.stringify(sWhere));
            sWhere = "";
@@ -487,7 +589,44 @@
        function set_GridCellCheck(obj) {
            $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                if (event.key == "F7") {
                    if (obj.event == "Warehouse") {
                    if (obj.event == "OutWarehouse") {
                        var MaterNum = obj.data["物料代码"];
                        var HOrgID = $("#Organization").val();
                        //打开维修项目小窗体
                        layer.open({
                            type: 2
                            , skin: "layui-layer-rim" //加上边框
                            , title: "仓库列表"  //标题
                            , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                            , shift: 2 //弹出动画
                            , area: ["90%", "90%"] //窗体大小
                            , maxmin: true //设置最大最小按钮是否显示
                            , content: ["../../Baseset/基础资料/Gy_WarehouseList_JIT.html?MaterNum=" + MaterNum + "&HOrgID=" + HOrgID, "yes"]
                            , btn: ["确定", "取消"]
                            , btn1: function (index, laero) {
                                //按钮一  çš„回调
                                var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                if (checkStatus.data.length != 1) {
                                    return layer.msg("请选择一条数据");
                                }
                                //更新表格缓存的数据
                                obj.update({
                                    "调出仓库": checkStatus.data[0].仓库名称
                                    , "调出仓库id": checkStatus.data[0].仓库ID
                                    , "调出仓库库存数量": checkStatus.data[0].调出仓库库存数量
                                    , "调出仓库可用库存数量": checkStatus.data[0].调出仓库可用库存数量
                                    , "HOutOrgID": checkStatus.data[0].库存组织
                                    , "调出组织": checkStatus.data[0].组织名称
                                })
                                layer.close(index);//关闭弹窗
                            }
                        })
                    }
                    if (obj.event == "InWarehouse") {
                        //打开维修项目小窗体
                        layer.open({
                            type: 2
@@ -509,10 +648,9 @@
                                }
                                //更新表格缓存的数据
                                obj.update({
                                    "调出仓库": checkStatus.data[0].HName
                                    , "调出仓库id": checkStatus.data[0].HItemID
                                    "调入仓库": checkStatus.data[0].HName
                                    , "调入仓库id": checkStatus.data[0].HItemID
                                })
                                console.log(checkStatus.data[0].HItemID)
                                layer.close(index);//关闭弹窗
                            }
                        })
@@ -523,17 +661,18 @@
        //新增叫料单
        function set_AddNew_Jl() {
            if (table.cache['mainTable'].length == 0) {
            var data = table.cache['mainTable'];
            if (data.length == 0) {
                return layer.msg("无数据,无法叫料!");
            }
            else {
                var sMainStr = JSON.stringify(table.cache['mainTable']) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];//sessionStorage["HUserName"]
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "Sc_ComplementGoodBill/InsertCallGoodsBill", //方法所在页面和方法名
                        url: GetWEBURL() + "/Sc_ComplementGoodBill/InsertCallGoodsBill", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainStr },
                        dataType: "json",
@@ -545,15 +684,48 @@
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                                console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            layer.alert("错误:" + err, { icon: 5 });
                            console.log("Reason" + sMainStr);
                        }
                    });
            }
        }
        //配套叫料
        function set_Ptjl() {
            var CheckStatus = table.checkStatus("mainTable");
            if (CheckStatus.data.length !=1) {
                return layer.msg("请选择一条数据!");
            }
            else {
                var HICMOInterID = CheckStatus.data[0].HICMOInterID;
                var HICMOEntryID = CheckStatus.data[0].HICMOEntryID;
                var HDeptID = $("#DepartmentID").val();
                var HOrgID = $("#Organization").val();
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "配套叫料"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["90%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ['../../生产管理/生产叫料平台/JIT_ComplementGoodPT.html?OperationType=1&HICMOInterID=' + HICMOInterID + '&HICMOEntryID=' + HICMOEntryID + '&HDeptID=' + HDeptID + '&HOrgID=' + HOrgID, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                    , end: function () {
                        //刷新页面,
                        get_FastQuery();
                    }
                })
            }
        }
@@ -672,13 +844,15 @@
            else {
                layer.confirm('确定要生成拣料单?', {
                    btn: ['确定', '取消'] //按钮
                    , btn1: function () {
                    , btn1: function (index) {
                        layer.close(index);
                        var sMainStr = JSON.stringify(table.cache['mainTable']) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];//sessionStorage["HUserName"]
                        $.ajax(
                            {
                                type: "POST",
                                url: GetWEBURL() + "Sc_ComplementGoodBill/Insert_JL_ICStockTuiBill", //方法所在页面和方法名
                                url: GetWEBURL() + "/Sc_ComplementGoodBill/Insert_JL_ICStockTuiBill", //方法所在页面和方法名
                                async: true,
                                data: { "msg": sMainStr },
                                dataType: "json",
@@ -713,7 +887,9 @@
            else {
                layer.confirm('确定要生成退料单?', {
                    btn: ['确定', '取消'] //按钮
                    , btn1: function () {
                    , btn1: function (index) {
                        layer.close(index);
                        var sMainStr = JSON.stringify(table.cache['mainTable']) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];//sessionStorage["HUserName"]
                        $.ajax(
@@ -764,6 +940,212 @@
                })
            }
        }
        //隐藏列设置
        function get_HideColumn() {
            var colName = "";
            for (var i = 1; i < option.cols[0].length - 1; i++) {
                colName += option.cols[0][i]["title"] + ",";
            }
            colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
            layer.open({
                type: 2
                , skin: "layui-layer-rim" //加上边框
                , title: "隐藏列设置"  //标题
                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                , shift: 2 //弹出动画
                , area: ["50%", "90%"] //窗体大小
                , maxmin: true //设置最大最小按钮是否显示
                , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
                , btn: ["确定", "取消"]
                , btn1: function (index, laero) {
                    //刷新表格数据
                    DisPlay_HideColumn();
                    //更新表格缓存的数据
                    layer.close(index);//关闭弹窗
                }
            })
        }
        //显示列数据
        function DisPlay_HideColumn() {
            $.ajax({
                url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                type: "GET",
                data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.data.length != 0) {
                        var dataCol = [];//数据库查询出的列数据
                        var titleData = ["调出仓库id", "调入仓库id", "HDeptID", "HDeptNumber", "HMaterialID", "HWHID", "HOutOrgID", "HSouceInterID", "HSourceEntryID", "HSourceBillNo", "HICMOInterID", "HICMOEntryID","HSTOCKID"];//不需要显示的字段 å¯æ‰©å±•
                        dataCol = data1.data[0].HGridString.split(',');
                        for (var i = 0; i < option.cols[0].length - 2; i++) {
                            var dataCols = dataCol[i].split('|');
                            //隐藏列
                            if (dataCols[1] == 1) {
                                option.cols[0][i + 1]["hide"] = true;
                            }
                            //设置内容字体大小
                            if (data1.data[0].HFontSize != 0) {
                                option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                            } else {
                                option.cols[0][i + 1]["style"] = "font-size:100%";
                            }
                            //设置列宽
                            if (dataCols[3] > 0) {
                                option.cols[0][i + 1]["width"] = dataCols[3];
                            }
                            //显示列
                            if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["field"], titleData) == -1) {
                                option.cols[0][i + 1]["hide"] = false;
                            }
                            //字体所在位置(å·¦ å±…中 å³)
                            switch (dataCols[2]) {
                                case "L":
                                    option.cols[0][i + 1]["align"] = "left";
                                    break;
                                case "M":
                                    option.cols[0][i + 1]["align"] = "center";
                                    break;
                                case "R":
                                    option.cols[0][i + 1]["align"] = "right";
                                    break;
                            }
                        }
                        //取消冻结列
                        for (var i = 1; i < option.cols[0].length - 1; i++) {
                            if (option.cols[0][i]["fixed"] != null) {
                                option.cols[0][i]["fixed"] = null;
                            }
                            else {
                                break;
                            }
                        }
                        //冻结列
                        if (data1.data[0].HFixCols != 0) {
                            for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                    data1.data[0].HFixCols += 1;
                                }
                                option.cols[0][i + 1]["fixed"] = "left";
                            }
                        }
                        table.render(option);
                    } else {
                        table.render(option);
                    }
                }, error: function () {
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            })
        }
        //未生成拣料申请单  æœªç”Ÿæˆé€€æ–™å•çš„  æ•°æ®
        function NotGeneratedMaterial() {
            //var ajaxLoad = layer.load();
            $.ajax({
                url: GetWEBURL() + '/Sc_ComplementGoodBill/NotGeneratedMaterialList',
                type: "GET",
                async: false,
                data: { "sWhere": sessionStorage["OrganizationID"], "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        $("#wjlCount").text("已叫料,未拣料申请 " + data1.data[1]["未生成"]+" æ¡å•据");
                        $("#wtlCount").text("已退料申请,未退料 " + data1.data[0]["未生成"]+" æ¡å•据");
                        //console.log(data1)
                        //layer.close(ajaxLoad);
                    } else {
                        //layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    //layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //生产订单选单
        function get_btnICMOBill() {
            layer.open({
                type: 2 //类型
                , skin: 'layui-layer-rim'//加上边框
                , area: ['90%', '90%']//大小
                , title: '生产订单列表'//标题
                , shift: 2//弹出动画
                , content: ['../../生产管理/生产任务单/Sc_ICMOBillList.html?HDeptID='+ $("#DepartmentID").val(), 'yes']
                , btn: ['确定', '取消']
                , btn1: function (index, layero) {//按钮【按钮一】的回调
                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                    if (checkStatus.data.length === 0) {
                        return layer.msg('请选择数据');
                    }
                    $("#HICMOBillNo").val(checkStatus.data[0].单据号);//生产订单号
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
                , btn2: function (index, layero) { }
            })
        }
        //重置过滤条件
        function set_ClearQuery() {
            $("#HSeOrderBillNo").val("");
            $("#MaterialNumber").val("");
            $("#MaterialName").val("");
            $("#MaterialModel").val("");
            $("#CPNumber").val("");
            $("#CPName").val("");
            $("#CPModel").val("");
            $("#HICMOBillNo").val("");
            sWhere = "";
        }
        //读取配置文件
        function get_ReadConfigFile() {
            //获取本地存储的数据
            var data = localStorage.getItem("dataJL");
            if (data != null) {
                var data2 = JSON.parse(data);
                $("#HSeOrderBillNo").val(data2["HSeOrderBillNo"]);
                $("#DepartmentID").val(data2["DepartmentID"]);
                $("#DepartmentName").val(data2["DepartmentName"]);
                $("#MaterialNumber").val(data2["MaterialNumber"]);
                $("#MaterialName").val(data2["MaterialName"]);
                $("#MaterialModel").val(data2["MaterialModel"]);
                $("#CPNumber").val(data2["CPNumber"]);
                $("#CPName").val(data2["CPName"]);
                $("#CPModel").val(data2["CPModel"]);
                $("#HICMOBillNo").val(data2["HICMOBillNo"]);
            }
        }
        //存储配置文件
        function get_WriteConfigFile() {
            //清空本地存储的数据
            localStorage.removeItem("dataJL");
            var data = {
                HSeOrderBillNo: $("#HSeOrderBillNo").val()
                , DepartmentID: $("#DepartmentID").val()
                , DepartmentName: $("#DepartmentName").val()
                , Organization: $("#Organization").val()
                , MaterialNumber: $("#MaterialNumber").val()
                , MaterialName: $("#MaterialName").val()
                , MaterialModel: $("#MaterialModel").val()
                , CPNumber: $("#CPNumber").val()
                , CPName: $("#CPName").val()
                , CPModel: $("#CPModel").val()
                , HICMOBillNo: $("#HICMOBillNo").val()
            }
            //本地存储
            localStorage.setItem("dataJL", JSON.stringify(data));
        }
        //#endregion
    });