WebTM/views/Éú²ú¹ÜÀí/Éú²úÍ깤µ¥/Sc_Add_MESEndWorkBillList.html
@@ -110,7 +110,6 @@
                                                        <div class="layui-input-inline">
                                                            <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" disabled autocomplete="off">
                                                            <input id="HInterID" name="HInterID" type="hidden" />
                                                            <input id="HMaker" name="HMaker" type="hidden" /><!--制单人-->
                                                        </div>
                                                    </div>
                                                    <div class="layui-inline">
@@ -224,6 +223,16 @@
                                                            <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;">
                                                            <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="" style="float:left;width:150px;">
                                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" id="HDeptList" style="width:40px;">
                                                                <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                            </button>
                                                        </div>
                                                    </div>
                                                    <div class="layui-inline">
                                                        <label class="layui-form-label">生产班次:</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="HWorkShiftName" id="HWorkShiftName" class="layui-input" value="" style="float:left;width:150px;">
                                                            <input type="hidden" name="HWorkShiftID" id="HWorkShiftID" class="layui-input" value="" style="float:left;width:150px;">
                                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HWorkShiftList" id="HWorkShiftLists" style="width:40px;">
                                                                <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                            </button>
                                                        </div>
@@ -351,6 +360,7 @@
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            var HCenterID = "0";
            //#endregion
            // #region é¡µé¢åˆå§‹åŒ–
@@ -363,14 +373,20 @@
                $("#HEmpName").val(sessionStorage["HEmpName"]); //根据登录用户带出操作员
                $("#HGroupID").val(sessionStorage["HGroupID"]); //根据登录用户带出班组ID
                $("#HGroupName").val(sessionStorage["HGroup"]); //根据登录用户带出班组
                HCenterID = sessionStorage["HWorkCenterID"]; //根据登录用户带出工作中心ID
                set_AddFNew();
                //获取当前班次
                get_HWorkShift();
            }
            else if (OperationType == 2) {//有源单
                $("#HEmpID").val(sessionStorage["HEmpID"]); //根据登录用户带出操作员ID
                $("#HEmpName").val(sessionStorage["HEmpName"]); //根据登录用户带出操作员
                $("#HGroupID").val(sessionStorage["HGroupID"]); //根据登录用户带出班组ID
                $("#HGroupName").val(sessionStorage["HGroup"]); //根据登录用户带出班组
                HCenterID = sessionStorage["HWorkCenterID"]; //根据登录用户带出工作中心ID
                set_AddNew();
                //获取当前班次
                get_HWorkShift();
            }
            else if (OperationType == 3) {//编辑
@@ -419,7 +435,6 @@
            //无源单新增
            function set_AddFNew() {
                //加源单类型区分(可以写不同的方法)
            }
            //有源单新增
@@ -451,7 +466,7 @@
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: true,
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
@@ -480,6 +495,7 @@
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
@@ -675,7 +691,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?type=HEmp', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -715,7 +731,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/工资基础资料/Gy_Group.html', 'yes'],
                    content: ['../../基础资料/工资基础资料/Gy_Group.html?type=HGroup', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -780,12 +796,50 @@
                });
            });
            //表头信息班次弹窗
            form.on('submit(HWorkShiftList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '班次列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/生产基础资料/Gy_WorkShiftList.html?type=HWorkShifts&OperationType=2', '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('请选择数据');
                        }
                        $("#HWorkShiftName").val(checkStatus.data[0].班次名称);
                        $("#HWorkShiftID").val(checkStatus.data[0].HInterID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //保存提交
            form.on('submit(Saver)', function (data) {
                var index = layer.load();
                var sMainStr = JSON.stringify(data.field);
                var sMainSub = sMainStr + ';' + sessionStorage["HUserName"] + ';' + refSav;
                if (!AllowLoadData())//数据验证
@@ -828,10 +882,12 @@
                            //});
                        }
                        else {
                            layer.close(index);
                            layer.alert(data.Message, { icon: 5 })
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.alert(err, { icon: 5 })
                    }
                })
@@ -877,6 +933,33 @@
                Pub_Close(1);
                window.parent.location.reload();
            });
            //获取班次
            function get_HWorkShift() {
                var HDeptID = $("#HDeptID").val();
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Gy_ShiftsController/Get_HWorkShift", //方法所在页面和方法名
                    data: {
                        "HDeptID": HDeptID,
                        "HCenterID": HCenterID
                    },
                    success: function (data) {
                        if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        {
                            var LoadData = data.data;
                            $("#HWorkShiftID").val(LoadData[0].HInterID); //当前工序ID
                            $("#HWorkShiftName").val(LoadData[0].班次); //当前工序
                        }
                        else {
                            layer.alert(data.Message, { icon: 5 });
                        }
                    },
                    error: function (err) {
                        layer.alert(err, { icon: 5 });
                    }
                });
            }
            //#endregion
@@ -927,6 +1010,23 @@
            }
            return Result;
        }
        //生产班次
        function GetHWorkShiftsValue(obj) {
            $("#HWorkShiftID").val(obj[0].HInterID); //当前工序ID
            $("#HWorkShiftName").val(obj[0].班次名称); //当前工序
        }
        //操作员
        function GetHEmpValue(obj) {
            $("#HEmpName").val(obj[0].职员名称);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //生产班组
        function GetHGroupValue(obj) {
            $("#HGroupName").val(obj[0].班组名称);
            $("#HGroupID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>