1
duhe
2024-04-09 ef197f035bc4c3b8b70783fabfa99593b86dcfc3
WebTM/views/Éú²ú¹ÜÀí/Éú²ú½ÐÁÏÆ½Ì¨/JIT_ComplementGoodBillMain.html
@@ -28,7 +28,7 @@
                    <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="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" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cx" id="Cx">查询</button>
@@ -49,9 +49,12 @@
                                </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="text" class="layui-input" name="HSeOrderBillNo" lay-verify="HSeOrderBillNo" id="HSeOrderBillNo">
                                <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>
                            <div class="layui-inline">
@@ -129,12 +132,14 @@
                                </div>
                                <div class="layui-row" style="margin-top:10px;">
                                    <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="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                            <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>
                                        <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>
                                    </div>
                                    <div class="layui-inline">
                                        <div style="padding-left: 50px;">
                                            <input type="checkbox" name="checkZXBZ" id="checkZXBZ" lay-skin="primary" lay-filter="checkZXBZ" title="最小包装">
                                        </div>
                                    </div>
                                </div>
@@ -191,7 +196,7 @@
            var HICMOBillNo = $("#HICMOBillNo").val();
            if (HICMOBillNo == "") {
                $("#Ptjl").hide();
                $("#Zxbzjl").hide();
                //$("#Zxbzjl").hide();
                $("#Jl").hide();
                $("#Scjld").hide();
                $("#Yltl").hide();
@@ -200,7 +205,7 @@
                $("#Sctld").hide();
            } else {
                $("#Ptjl").show();
                $("#Zxbzjl").show();
                //$("#Zxbzjl").show();
                $("#Jl").show();
                $("#Scjld").show();
                $("#Yltl").show();
@@ -286,6 +291,45 @@
            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 æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
@@ -294,13 +338,14 @@
        function set_ClearBill()
        {
            NotGeneratedMaterial();
            set_InitGrid();
            get_Display(sWhere);
            Organ();
            DisPlay_HideColumn();
            //读取过滤条件
            get_ReadConfigFile();
            set_InitGrid();
            get_Display(sWhere);
            DisPlay_HideColumn();
        }
        //获取组织
        function Organ() {
            //获取登录页组织列
@@ -308,6 +353,7 @@
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Web/GetOrganizations",
                async: false,
                success: function (result) {
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data;
@@ -322,7 +368,9 @@
                        if (dataG != null) {
                            var data2 = JSON.parse(dataG);
                            $("#Organization").val(data2["Organization"]);
                        }
                        } else {
                            $("#Organization").val(sessionStorage["OrganizationID"]);
                        }
                        form.render('select');
                      
                    }
@@ -337,6 +385,7 @@
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , height: 'full-150'
                , totalRow: true
                , cellMinWidth: 90
                , limit: 500
                , cols: [[
@@ -352,20 +401,22 @@
                    , { 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: '已叫料数量', 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, edit: 'text', event: 'InWarehouse' }
                    , { field: '调入仓库id', title: '调入仓库id', width: 160, hide: true }
                    , { field: '库存数量', title: '库存数量', width: 160 }
                    , { field: '调出仓库库存数量', title: '调出仓库库存数量', width: 160 }
                    , { field: '调出仓库可用库存数量', title: '调出仓库可用库存数量', width: 160 }
                    , { 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: 'HICMOBillNo', title: 'HICMOBillNo', width: 160 }
@@ -392,6 +443,7 @@
            $.ajax({
                url: GetWEBURL() + '/Sc_ComplementGoodBill/ComplementGoodBillList',
                type: "GET",
                async: false,
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
@@ -792,7 +844,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(
@@ -833,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(
@@ -994,6 +1050,7 @@
            $.ajax({
                url: GetWEBURL() + '/Sc_ComplementGoodBill/NotGeneratedMaterialList',
                type: "GET",
                async: false,
                data: { "sWhere": sessionStorage["OrganizationID"], "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
@@ -1021,7 +1078,7 @@
                , area: ['90%', '90%']//大小
                , title: '生产订单列表'//标题
                , shift: 2//弹出动画
                , content: ['../../生产管理/生产任务单/Sc_ICMOBillList.html', 'yes']
                , content: ['../../生产管理/生产任务单/Sc_ICMOBillList.html?HDeptID='+ $("#DepartmentID").val(), 'yes']
                , btn: ['确定', '取消']
                , btn1: function (index, layero) {//按钮【按钮一】的回调
                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面