<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('订单操作记录')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="order-behavior-form">
                <div class="select-list">
                    <ul>
                        <li>
                            师傅名称：<input type="text" name="workerName"/>
                        </li>
                        <li>
                            订单编号：<input type="text" name="orderMasterCode"/>
                        </li>
                        <li>
                            子订单编号：<input type="text" name="orderDetailCode"/>
                        </li>
                        <li>
                            操作类型：<select name="status" th:with="type=${@dict.getType('sys_order_behavior')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"/>
                        </select>
                        </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()"><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>

<th:block th:include="include :: footer"/>

<script th:inline="javascript">
    var datas = [[${@dict.getType('sys_order_behavior')}]];
    var prefix = ctx + "order/behavior"

    $(function () {
        var options = {
            url: prefix + "/list",
            method: 'get',
            modalName: "订单操作记录",
            columns: [
                {
                    field: 'orderMasterCode',
                    title: '订单编号',
                    align: "left"
                },
                {
                    field: 'orderDetailCode',
                    title: '子订单编号',
                    align: "left"
                },
                {
                    field: 'workerName',
                    title: '师傅名称',
                    align: "left"
                },
                {
                    field: 'behavior',
                    title: '操作',
                    align: "left",
                    formatter: function (value, item, index) {
                        return $.table.selectDictLabel(datas, item.status);
                    }
                },
                {
                    field: 'behaviorTime',
                    title: '操作时间',
                    align: "left"
                }
            ]
        };
        $.table.init(options);
    });

</script>
</body>
</html>