<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('EBS接口调用记录')"/>
    <link th:href="@{/ruoyi/css/ry-ui-custom.css?v=4.7.3}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row" style="height: auto !important;">
        <div class="col-sm-12 pr0 pl0 shadow">
            <div class="ibox float-e-margins ">
                <div class="ibox-title">
                    <div class="col-sm-11  pl0 pr0">
                        <h8>EBS接口调用记录</h8>
                    </div>
                    <div class="col-sm-1 pl20">
                        <a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.table.refresh()">刷新</a>
                        <a class="btn btn-ctr-color-blue btn-xs" href="javascript:void(0)" onclick="$.table.exportExcel()">导出</a>
                    </div>
                </div>
                <div class="ibox-content ibox-content-1" style="margin: 0;height: 150px">
                    <div class="btn-group-sm" id="toolbar" role="group">
                        <form id="formId">
                            <div class="select-list">
                                <ul>
                                    <li>
                                        物料编码：
                                        <input type="text" name="goodsId"/>
                                    </li>
                                    <li>
                                        <a class="btn btn-primary btn-rounded btn-sm"
                                           onclick="$.table.search('formId')"><i
                                                class="fa fa-search"></i>&nbsp;搜索</a>
                                        <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('formId')"><i
                                                class="fa fa-refresh"></i>&nbsp;重置</a>
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "business/ebsReport";

    /**
     * 表格初始化
     */
    $(function () {
        var options = {
            url: prefix + "/list",
            exportUrl: prefix + "/export",
            modalName: "EBS接口调用记录",
            showSearch: false,
            showToggle: false,
            showRefresh: false,
            showColumns: true,
            columns: [
                {
                    field: 'description',
                    title: '接口描述',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value, 8);
                    },
                    align: 'center'
                },
                {
                    field: 'methodName',
                    title: '方法名'
                },
                {
                    field: 'goodsId',
                    title: '物料编码',
                    sortable: true
                },
                {
                    field: 'goodsName',
                    title: '物料描述',
                },
                {
                    field: 'lotId',
                    title: '批次号'
                },
                {
                    field: 'quantity',
                    title: '数量'
                },
                {
                    field: 'apiUrl',
                    title: '地址',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value, 8);
                    }
                },
                {
                    field: 'apiParam',
                    title: '参数',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value, 8);
                    },
                    align: 'center'
                },
                {
                    field: 'result',
                    title: '返回结果',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value, 8);
                    },
                    align: 'center'
                },
                {
                    field: 'status',
                    title: '状态',
                    align: 'center',
                    sortable: true,
                    formatter: function (value, row, index) {
                        var actions = [];
                        if (value == "1") {
                            actions.push('<a class="btn btn-success btn-xs">成功</a>');
                        } else if(value == "-1") {
                            actions.push('<a class="btn btn-danger btn-xs">失败</a>');
                        } else {
                            actions.push('<a class="btn btn-warning btn-xs">待执行下一步查询操作</a>');
                        }
                        return actions.join('');
                    }
                },
                {
                    field: 'operateTime',
                    title: '调用时间',
                    sortable: true,
                    align: 'center'
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>