specifiedBatchSearch.jsp 12.0 KB

<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>



<link href="${ctx}/assets/global/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/assets/global/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>

<style>
    td{
        padding:6px;
    }
    .btn-sm{
        padding: 1px 10px 1px 10px;
    }

    .ui-autocomplete{

        z-index: 111111;

    }
</style>
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
    <fmt:message key="menu.inRule"/>
</h3>

<!-- BEGIN PAGE CONTENT-->
<div class="row">
    <div class="col-md-12">

        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="portlet box blue">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-list-alt"></i><fmt:message key="menu.batch.specifiedBatch"/>
                </div>

                <%-- 站位列表上传权限--%>
                <security:authorize ifAnyGranted="ROLE_MANAGE_SPECIFIEDBATCH">
                    <div class="actions">
                        <a href="#" class="btn btn-default btn-sm" id="AddNewBtn">
                            <i class="fa fa-plus"></i> <fmt:message key="button.add"/> </a>
                    </div>
                </security:authorize>
            </div>
            <div class="portlet-body">
                <div class="table-toolbar">

                    <div class="tiles">
                        <div class="form-group">
                            <label class="control-label col-md-2"><fmt:message key="specifiedBatch.name"/></label>

                            <div class="col-md-3">
                                <div style="text-align:left" class="input-group">
                                    <input type="text" id="name" class="form-control" value="${name}"/>
                                </div>
                            </div>

                            <div class="col-md-2">
                                <button class="btn purple" id="search"><i class="fa fa-search"></i><fmt:message key="button.search"/> </button>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="table-scrollable">
                <display:table name="searchCriteria.pageList" cellspacing="0" cellpadding="0" requestURI=""
                               sort="external"
                               defaultsort="1" class="table table-striped table-bordered table-hover" export="false" id="specifiedBatch">
                    <display:column titleKey="specifiedBatch.name" sortProperty="name" sortable="true">
                        <a href="${ctx}/component/storagePosFind.html?lockId=${specifiedBatch.id}">${specifiedBatch.name}</a>
                    </display:column>
                    <display:column titleKey="specifiedBatch.bottom" sortProperty="bottom" sortable="true" property="bottom"/>
                    <display:column titleKey="specifiedBatch.top" sortProperty="side" sortable="true" property="side"/>
                    <display:column titleKey="specifiedBatch.task">
                        <a href="${ctx}/dataLog/search.html?bid=${specifiedBatch.id}">${specifiedBatch.finishOpNum}/${specifiedBatch.opNum}</a>
                    </display:column>
                    <display:column titleKey="specifiedBatch.status">
                        <span class='label label-sm label-${fn:toLowerCase(specifiedBatch.status)}' id="status${specifiedBatch.id}"><fmt:message key="op.status.${fn:toLowerCase(specifiedBatch.status)}"/></span>
                    </display:column>
                    <display:column titleKey="specifiedBatch.createDate" sortProperty="createDate" sortable="true">
                        <fmt:formatDate value="${specifiedBatch.createDate}" pattern="yyyy-MM-dd HH:mm"/>
                    </display:column>
                    <display:column>
                        <c:if test="${empty currentPutInBatchId}">
                            <button class="btn green" onclick="startPutIn('${specifiedBatch.id}');">
                                <i class="fa fa-database"></i><fmt:message key="specifiedBatch.startIn"/></button>
                        </c:if>
                        <c:if test="${not empty currentPutInBatchId && specifiedBatch.id == currentPutInBatchId}">
                            <button class="btn red" onclick="stopPutIn('${specifiedBatch.id}')">
                                <i class="fa fa-database"></i><fmt:message key="specifiedBatch.stopIn"/></button>
                        </c:if>
                        <c:if test="${!specifiedBatch.wait}">
                            <button class="btn yellow" onclick="addBatchToCheckOut('${specifiedBatch.id}');">
                                <i class="fa fa-sign-out"></i><fmt:message key="specifiedBatch.addOutTasks"/></button>
                        </c:if>

                        <c:if test="${specifiedBatch.canRemove}">
                            <button class="btn red" style="float:right" type="button" onclick="removeBatch('${specifiedBatch.id}')"><i
                                    class="fa fa-trash-o"></i><fmt:message
                                    key="button.delete"/></button>
                        </c:if>
                    </display:column>
                        <%--<display:column title="">--%>
                            <%--<security:authorize ifAnyGranted="ROLE_MANAGE_STACK_OUT">--%>
                                <%--<c:if test="${feeder.wait || feeder.executing}">--%>
                                    <%--[<a href="#" onclick="cancelFeeder('${feeder.areaId},${feeder.id}')">取消</a>]--%>
                                <%--</c:if>--%>
                            <%--</div>--%>
                        <%--</security:authorize>--%>
                            <%--<security:authorize ifAnyGranted="ROLE_MANAGE_FEEDER">--%>

                            <%--<c:if test="${!feeder.end && !feeder.wait && !feeder.executing}">--%>
                                <%--<button class="btn btn-sm default" type="button" id="end${feeder.id}" onclick="endFeeder('${feeder.id}')"><i--%>
                                        <%--class="fa fa-lock"></i><fmt:message--%>
                                        <%--key="button.end"/></button>--%>
                            <%--</c:if>--%>

                            <%--<c:if test="${feeder.canRemove}">--%>
                                <%--<button class="btn btn-sm red" style="float:right" type="button" onclick="removeFeeder('${feeder.id}')"><i--%>
                                        <%--class="fa fa-trash-o"></i><fmt:message--%>
                                        <%--key="button.delete"/></button>--%>
                            <%--</c:if>--%>
                            <%--</security:authorize>--%>
                        <%--</display:column>--%>

                </display:table>
                </div>
            </div>
        </div>
        <!-- END EXAMPLE TABLE PORTLET-->
    </div>
</div>
<!-- END PAGE CONTENT-->



<div id="stack1" class="modal fade" tabindex="-1" data-focus-on="input:first" aria-hidden="true"
     style="display: none; margin-top: 0px;">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h4 class="modal-title">添加指定批次</h4>
    </div>
    <div class="modal-body">
        <label id="err"></label>
        <div class="form-group">
            <label>区域:</label>
            <select id="areaId" class="form-control">
                <c:forEach items="${areaList}" var="area">
                    <option value="${area.id}">${area.name}</option>
                </c:forEach>
            </select>
        </div>
        <div class="form-group">
            <label>批次<i style="color: #737373;">(当站位表批次与次相同时才会自动匹配)</i></label>
            <input id="batchName" type="text" class="form-control"/>
        </div>
        <div class="form-group">
            <label>板型(如 MA/KE/IR/PW 等)<i style="color: #737373;">(当站位表版底以此开头时才会自动匹配)</i></label>
            <input id="bottom" type="text" class="form-control"/>
        </div>
        <div class="form-group">
            <label>T/B 面<i style="color: #737373;">(当站位表的面与次相同时才会自动匹配)</i></label>
            <input type="text" id="side" class="form-control" />

        </div>

    </div>
    <div class="modal-footer">
        <button type="button" class="btn default" data-dismiss="modal" ><i class="fa fa-history"></i><fmt:message key="button.cancel"/></button>
        <button class="btn green" type="button" id="saveBtn"><i class="fa fa-save"></i><fmt:message
                key="button.save"/></button>
    </div>
</div>

<c:set var="scripts" scope="request">

    <script src="${ctx}/assets/global/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript"></script>

    <script src="${ctx}/assets/global/plugins/bootstrap-modal/js/bootstrap-modal.js"></script>

    <script src="${ctx}/assets/admin/pages/scripts/ui-extended-modals.js"></script>


    <script src="${ctx}/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        jQuery(document).ready(function() {
            var sides = new Array();
            <c:forEach items="${sideList}" var="side">
            sides.push("${side}");
            </c:forEach>

            var sideSource = sides;
            $("#side").autocomplete({
                minLength: 0,
                source: sideSource
            }).focus(function() {
                $(this).autocomplete("search", "");
            }).click(function() {
                $(this).autocomplete("search", "");
            });
        });



        $("#search").click(function(){
            var name = $("#name").val();
            window.location.href="${ctx}/workOrder/specifiedBatchSearch.html?aid=${aid}&name="+name;
        })

        $("#AddNewBtn").click(function(){
            $('#stack1').modal("show");
        })
        $('#stack1').on('hidden.bs.modal', function (e) {
            window.location.href="";
        })


        function startPutIn(batchId){
            $.post("${ctx}/service/store/startPutInBatch", {bid: batchId}, function (data) {
                alert(data);
                window.location.href="";
            });
        }


        function stopPutIn(batchId){
            $.post("${ctx}/service/store/stopPutInBatch", {bid: batchId}, function (data) {
                alert(data);
                window.location.href="";
            });
        }

        function addBatchToCheckOut(batchId){
            $.post("${ctx}/service/store/addBatchToCheckOut", {bid: batchId}, function (data) {
                alert(data);
                window.location.href="";
            });
        }


        function removeBatch(batchId){
            $.post("${ctx}/service/store/removeBatch", {bid: batchId}, function (data) {
                alert(data);
                window.location.href="";
            });
        }

        $('#saveBtn').click(function(){
            $("#err").css("color","red")
            $("#msg").text("");
            var areaId = $("#areaId").val();
            if(!areaId){
                $("#err").text("请选择区域");
                return;
            }
            var name = $("#batchName").val();
            if(!name){
                $("#err").text("名称不能为空");
                return;
            }

            var bottom = $("#bottom").val();
            var side = $("#side").val();
            if(!side){
                $("#err").text("面不能为空");
                return;
            }
            $.post("${ctx}/service/store/saveSpecifiedBatch", {aid: areaId, name: name,bottom:bottom,side:side}, function (data) {
                if(data != ""){
                    alert(data);
                }else{
                    alert("保存成功");
                    window.location.href="";
                }
            });

        })
    </script>
</c:set>