agvTask.html 14.8 KB
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-info">
            <!--<ul id="myTab" class="nav nav-tabs">-->
                <!--<li class="active"><a href="#tabHeader" data-toggle="tab">主表</a></li>-->
                <!--<li><a href="#tabDetail" data-toggle="tab">明细</a></li>-->
            <!--</ul>-->
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="tabHeader">
                    <div class="col-sm-12 select-info">
                        <form id="task-form">
                            <div class="select-list">
                                <ul>
                                    <!--<li>
                                        任务id:<input type="text" name="id"/>
                                    </li>-->
                                    <li>
                                        起点:<input type="text" name="fromPort"/>
                                    </li>
                                    <li>
                                        终点:<input type="text" name="toPort"/>
                                    </li>
                                    <li>
                                        容器编号:<input type="text" name="containerCode"/>
                                    </li>
                                    <!--<li>-->
                                        <!--&lt;!&ndash;入库类型:<input type="text" name="sourceCode"/>&ndash;&gt;-->
                                        <!--任务类型:<select name="type" th:with="type=${@dict.getType('taskType')}">-->
                                        <!--<option value="">所有</option>-->
                                        <!--<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>-->
                                    <!--</li>-->

                                    <!--<li class="time" style="height: 30px">-->
                                        <!--<label>创建时间: </label>-->
                                        <!--<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/>-->
                                        <!--<span>-</span>-->
                                        <!--<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/>-->
                                    <!--</li>-->

                                    <!--<li>-->
                                        <!--&lt;!&ndash;头 状 态:<input type="text" name="firstStatus"/>&ndash;&gt;-->
                                        <!--头 状 态:<select name="firstStatus" th:with="firstStatus=${@dict.getType('taskStatus')}">-->
                                        <!--<option value="">所有</option>-->
                                        <!--<option th:each="e : ${firstStatus}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>-->
                                    <!--</li>-->
                                    <!--<li>-->
                                        <!--&lt;!&ndash;尾 状 态:<input type="text" name="lastStatus"/>&ndash;&gt;-->
                                        <!--尾 状 态:<select name="lastStatus" th:with="lastStatus=${@dict.getType('taskStatus')}">-->
                                        <!--<option value="">所有</option>-->
                                        <!--<option th:each="e : ${lastStatus}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>-->
                                    <!--</li>-->
                                    <!--<li>
                                        出入库站台:<select name="station" th:with="stations = ${@dict.getType('station')}">
                                        <option value="">所有</option>
                                        <option th:each="e : ${stations}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>
                                    </li>-->
                                    <!--<li>-->
                                        <!--巷道:<input type="text" name="roadway"/>-->
                                    <!--</li>-->
                                    <!--<li>-->
                                        <!--来源库位:<input type="text" name="sourceLocation"/>-->
                                    <!--</li>-->
                                    <!--<li>-->
                                        <!--目的库位:<input type="text" name="destinationLocation"/>-->
                                    <!--</li>-->

                                    <li>
                                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                        <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('task-form')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                        <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="receipt:receiptHeader:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>

                    <!--<div class="btn-group hidden-xs" id="toolbar" role="group">-->
                        <!--<a class="btn btn-outline btn-info btn-rounded" onclick="emptyIn()" shiro:hasPermission="task:task:emptyIn">-->
                            <!--<i class="fa fa-level-down"></i> 空托入库-->
                        <!--</a>-->
                        <!--<a class="btn btn-outline btn-info btn-rounded" onclick="emptyOut()" shiro:hasPermission="task:task:emptyOut">-->
                            <!--<i class="fa fa-level-up"></i> 空托出库-->
                        <!--</a>-->
                        <!--<a class="btn btn-outline btn-primary btn-rounded" onclick="batchExecute()" shiro:hasPermission="task:task:execute">-->
                            <!--<i class="fa fa-send"></i> 批量执行-->
                        <!--</a>-->
                        <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="batchRemove()" shiro:hasPermission="task:agvTask:remove">
                            <i class="fa fa-remove"></i>批量删除
                        </a>-->
                    <!--</div>-->
                    <!--<input type="hidden" id="taskId" name="taskId" th:value="${taskId}"/>-->
                    <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
                </div>
                <!--<div class="tab-pane fade" id="tabDetail">-->
                    <!--<div class="btn-group hidden-xs" id="toolbar1" role="group">-->
                        <!--<a class="btn btn-outline btn-success btn-rounded" onclick="add()" >-->
                           <!--<i class="fa fa-plus"></i> 新增-->
                        <!--</a>-->
                        <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()">-->
                           <!--<i class="fa fa-trash-o"></i> 删除-->
                        <!--</a>-->
                    <!--</div>-->
                    <!--<table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover"></table>-->
                <!--</div>-->
            </div>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "task/agvTask";
    var stations = [[${@dict.getType('station')}]];
    var taskTypes=[[${@dict.getType('taskType')}]];
    var taskStatus=[[${@dict.getType('taskStatus')}]];
    var taskDetailStatus=[[${@dict.getType('taskDetailStatus')}]];

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            modalName: "任务管理",
            sortName: "id",
            sortOrder: "desc",
            search: false,
            clickToSelect:true,
            columns: [
                {
                    field : 'id',
                    title : '任务ID' ,
                    sortable: true
                },

                {
                    field : 'warehouseCode',
                    title : '仓库编码' ,
                    visible:true
                },
                {
                    field : 'companyCode',
                    title : '货主编码' ,
                    visible:false
                },
                {
                    field : 'interactionId',
                    title : '交互标识' ,
                    visible:false
                },
                {
                    field : 'taskHeaderId',
                    title : '任务头标识' ,
                    visible:false
                },
                {
                    field : 'taskDetailId',
                    title : '任务子标识' ,
                    visible:false
                },
                {
                    field : 'taskType',
                    title : '任务类型' ,
                    visible:true,
                    formatter: function(value, row, index) {
                        if (value == undefined) {
                            return '';
                        }
                        if (value == 300) {
                            return '入库';
                        }
                        if (value == 400) {
                            return '出库';
                        }
                    }
                },
                {
                    field : 'containerCode',
                    title : '容器号' ,
                    visible:true
                },
                {
                    field : 'station',
                    title : '站台编码' ,
                    visible:false
                },
                {
                    field : 'fromPort',
                    title : '开始点位' ,
                    visible:true
                },
                {
                    field : 'toPort',
                    title : '结束点位' ,
                    visible:true
                },
                {
                    field : 'orientation',
                    title : '方向' ,
                    visible:false
                },
                {
                    field : 'platform',
                    title : '平台' ,
                    visible:false
                },
                {
                    field : 'carNo',
                    title : '小车编号' ,
                    visible:false
                },
                {
                    field : 'status',
                    title : '状态' ,
                    visible:true,
                    formatter: function(value, row, index) {
                        if(value==undefined){
                            return '';
                        }
                        var html='';
                        switch(value){
                            case 0:
                                html= '<span style="color:red">异常</span>';
                                break;
                            case 1:
                                html= '创建';
                                break;
                            case 10:
                                html= '<span style="color:blue">下发</span>';
                                break;
                            case 20:
                                html= '执行';
                                break;
                            case 100:
                                html= '<span style="color:#54a70d">完成</>';
                                break;
                            default:
                                html=value;
                                break;

                        }
                        return html;

                    }
                },
                {
                    field : 'msg',
                    title : '异常' ,
                    visible:true
                },
                {
                    field : 'created',
                    title : '日期' ,
                    visible:true
                },


                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-info btn-xs " href="#" onclick="detail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>明细</a> ');
                //         if (row.lastStatus < 10)  {
                //             actions.push('<a class="btn btn-success btn-xs ' + executeFlag + '" href="#" onclick="execute(\'' + row.id + '\')"><i class="fa fa-send" style="padding-right: 1px;"></i>执行</a> ');
                //             actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> ');
                //             actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>');
                //         }
                //         return actions.join('');
                //     }
                // }
                ]
        };
        $.table.init(options);
    });
    /*任务列表-批量删除任务*/
    function batchRemove() {
        //var rows = $.common.isEmpty($.table._option.taskId) ? $.table.selectFirstColumns() : $.table.selectColumns($.table._option.taskId);
        var rows=$("#bootstrap-table").bootstrapTable('getSelections');
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
        $.modal.confirm("确认要删除选中的" + rows.length + "条数据吗?", function() {
            var url = ctx + 'task/agvTask/remove';
            var ids = "";
            for(var i=0; i<rows.length; i++) {
                ids = ids + rows[i].id + ","
            }
            var data = { "ids": ids.substring(0, ids.length-1) };
            $.operate.submit(url, "post", "json", data);
        })
    }
</script>
</body>
</html>