<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=no">
    <th:block th:include="include :: header('门店订单表')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>
<style>
    /* 设置 ul 的基本样式 */
    ul {
        list-style-type: none; /* 去掉项目符号 */
        padding: 0; /* 去掉默认的内边距 */
        display: grid; /* 使用网格布局 */
        grid-template-columns: repeat(5, 1fr); /* 设置三列 */
    }
    ul-list ul{
        list-style-type: none; /* 去掉项目符号 */
        padding: 0; /* 去掉默认的内边距 */
        display: grid; /* 使用网格布局 */
        grid-template-columns: repeat(4, 1fr); /* 设置三列 */
    }
    ul-list ul li{
        /*padding: 10px;*/ /* 内边距 */
        text-align: left; /* 文本居中 */
    }

    /* 设置 li 的基本样式 */
    li {
        /*background-color: lightblue; *//* 背景颜色 */
        /*padding: 1px; !* 内边距 *!*/
        text-align: right; /* 文本居中 */
    }
</style>

<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse" >
                <form id="SDdglOrderStore-form">
                    <input type="hidden" id="deptId" name="deptId">
                    <input type="hidden" id="parentId" name="parentId">
                    <div class="select-list" >
                        <ul>
                            <li>
                                订单号:<input type="text" class="styled-input" name="orderId" autocomplete="off"/>
                            </li>
                            <li>
                                配送类型:<input type="text" class="styled-input" name="deliveryType" autocomplete="off"/>
                            </li>
                            <li>
                                手机号:<input type="text" class="styled-input" name="mobileNumber" autocomplete="off"/>
                            </li>
                            <li>
                                渠道名称:<input type="text" class="styled-input" name="channelName" autocomplete="off"/>
                            </li>
                            <li>
                                渠道单号:<input type="text" class="styled-input" name="channelOrderNo" autocomplete="off"/>
                            </li>
                            <li>
                                PSO销售单号:<input type="text" class="styled-input" name="psoSaleOrderNo" autocomplete="off"/>
                            </li>
                            <li>
                                订单状态:<input type="text" class="styled-input" name="orderStatus" autocomplete="off"/>
                            </li>
                            <li>
                                配送状态:<input type="text" class="styled-input" name="deliveryStatus" autocomplete="off"/>
                            </li>
                            <li>
                                订单日期:<input type="text" class="styled-input" name="orderDate" autocomplete="off"/>
                            </li>
                            <li>
                                门店名称:<input type="text" class="styled-input" name="storeName" autocomplete="off"/>
                            </li>
                            <li>
                                消费时间:<input type="text" class="styled-input" name="consumptionTime" autocomplete="off"/>
                            </li>
                            <li>
                                会员ID:<input type="text" class="styled-input" name="memberId" autocomplete="off"/>
                            </li>
                            <li>
                                会员名称:<input type="text" class="styled-input" name="memberName" autocomplete="off"/>
                            </li>
                            <li>
                                系统登录人Id:<input type="text" class="styled-input" name="systemLoginUserId" autocomplete="off"/>
                            </li>
                            <li>
                                下单人:<input type="text" class="styled-input" name="orderPlacer" autocomplete="off"/>
                            </li>
                            <li>
                                下单时间:<input type="text" class="styled-input" name="orderTime" autocomplete="off"/>
                            </li>
                            <li>
                                结账单id:<input type="text" class="styled-input" name="settlementId" autocomplete="off"/>
                            </li>
                            <li>
                                结账单code:<input type="text" class="styled-input" name="settlementCode" autocomplete="off"/>
                            </li>
                            <li>
                                最后完成支付的支付时间:<input type="text" class="styled-input" name="finalPaymentTime" autocomplete="off"/>
                            </li>
                            <li>
                                药品总数量:<input type="text" class="styled-input" name="totalDrugQuantity" autocomplete="off"/>
                            </li>
                            <li>
                                卡号:<input type="text" class="styled-input" name="cardNumber" autocomplete="off"/>
                            </li>
                            <li>
                                发货地址:<input type="text" class="styled-input" name="shippingAddress" autocomplete="off"/>
                            </li>
                            <li>
                                下单地址:<input type="text" class="styled-input" name="orderAddress" autocomplete="off"/>
                            </li>
                            <li>
                                订单类型:<input type="text" class="styled-input" name="orderType" autocomplete="off"/>
                            </li>
                            <li>
                                订单来源:<input type="text" class="styled-input" name="orderSource" autocomplete="off"/>
                            </li>
                            <li>
                                订单总金额:<input type="text" class="styled-input" name="totalAmount" autocomplete="off"/>
                            </li>
                            <li>
                                订单费用外送费:<input type="text" class="styled-input" name="deliveryFee" autocomplete="off"/>
                            </li>
                            <li>
                                退款金额:<input type="text" class="styled-input" name="refundAmount" autocomplete="off"/>
                            </li>
                            <li>
                                外送提货方式:<input type="text" class="styled-input" name="deliveryPickupMethod" autocomplete="off"/>
                            </li>
                            <li>
                                外送提货时间:<input type="text" class="styled-input" name="deliveryPickupTime" autocomplete="off"/>
                            </li>
                            <li>
                                备注:<input type="text" class="styled-input" name="remarks" autocomplete="off"/>
                            </li>
                            <li style="text-align: center">
                                <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="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>

                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
                    <i class="fa fa-plus"></i> 新增
                </a>
                 <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:user:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:user:import">
                    <i class="fa fa-upload"></i> 导入
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('dtp:pmService:edit')}]];
    var removeFlag = [[${@permission.hasPermi('dtp:pmService:remove')}]];
    var prefix = ctx + "ddgl/sddglorderstore";
    $(function() {
        var panehHidden = false;
        if ($(this).width() < 1590) {
            panehHidden = true;
        }
        $('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
        // 回到顶部绑定
        if ($.fn.toTop !== undefined) {
            var opt = {
                win:$('.ui-layout-center'),
                doc:$('.ui-layout-center')
            };
            $('#scroll-up').toTop(opt);
        }
        queryArchivesList();
    });

    function queryArchivesList() {
        var options = {
            url: prefix + "/sDdglOrderStoreList",
            viewUrl: prefix + "/sDdglOrderStoreView/{id}",
            createUrl: prefix + "/sDdglOrderStoreAdd",
            updateUrl: prefix + "/sDdglOrderStoreEdit/{id}",
            removeUrl: prefix + "/sDdglOrderStoreRemove",
            /*exportUrl: prefix + "/export",
            importUrl: prefix + "/importData",
            importTemplateUrl: prefix + "/importTemplate",*/
            sortName: "id",
            sortOrder: "asc",
            modalName: "门店订单表",
            fitColumns: true,
            striped: true,
            autoRowHeight: true,
            rowNumbers: true,
            showFooter:true,  //是否显示表格底部区域。
            clickToSelect: true, //是否启用点击行时选中整行的功能。
            singleSelect: true, //是否仅允许选择一行
            columns: [{
                checkbox: true
            },
                { field: 'id', title: '主键', align: 'center' ,visible:false},
                    { field: 'orderId', title: '订单号', align: 'center' },
                    { field: 'deliveryType', title: '配送类型', align: 'center' },
                    { field: 'mobileNumber', title: '手机号', align: 'center' },
                    { field: 'channelName', title: '渠道名称', align: 'center' },
                    { field: 'channelOrderNo', title: '渠道单号', align: 'center' },
                    { field: 'psoSaleOrderNo', title: 'PSO销售单号', align: 'center' },
                    { field: 'orderStatus', title: '订单状态', align: 'center' },
                    { field: 'deliveryStatus', title: '配送状态', align: 'center' },
                    { field: 'orderDate', title: '订单日期', align: 'center' },
                    { field: 'storeName', title: '门店名称', align: 'center' },
                    { field: 'consumptionTime', title: '消费时间', align: 'center' },
                    { field: 'memberId', title: '会员ID', align: 'center' },
                    { field: 'memberName', title: '会员名称', align: 'center' },
                    { field: 'systemLoginUserId', title: '系统登录人Id', align: 'center' },
                    { field: 'orderPlacer', title: '下单人', align: 'center' },
                    { field: 'orderTime', title: '下单时间', align: 'center' },
                    { field: 'settlementId', title: '结账单id', align: 'center' },
                    { field: 'settlementCode', title: '结账单code', align: 'center' },
                    { field: 'finalPaymentTime', title: '最后完成支付的支付时间', align: 'center' },
                    { field: 'totalDrugQuantity', title: '药品总数量', align: 'center' },
                    { field: 'cardNumber', title: '卡号', align: 'center' },
                    { field: 'shippingAddress', title: '发货地址', align: 'center' },
                    { field: 'orderAddress', title: '下单地址', align: 'center' },
                    { field: 'orderType', title: '订单类型', align: 'center' },
                    { field: 'orderSource', title: '订单来源', align: 'center' },
                    { field: 'totalAmount', title: '订单总金额', align: 'center' },
                    { field: 'deliveryFee', title: '订单费用外送费', align: 'center' },
                    { field: 'refundAmount', title: '退款金额', align: 'center' },
                    { field: 'deliveryPickupMethod', title: '外送提货方式', align: 'center' },
                    { field: 'deliveryPickupTime', title: '外送提货时间', align: 'center' },
                    { field: 'remarks', title: '备注', align: 'center' },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        if (row.serviceId != 1) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit_page(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                            var more = [];
                            /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
                            more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
                            actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');*/
                            return actions.join('');
                        } else {
                            return "";
                        }
                    }
                }]
        };
        $.table.init(options);
    }

    /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
    function resetPre() {
        resetDate();
        $("#SDdglOrderStore-form")[0].reset();
        $("#deptId").val("");
        $("#parentId").val("");
        $(".curSelectedNode").removeClass("curSelectedNode");
        $.table.search();
        var resetButton = document.getElementById('SDdglOrderStore-form');
        resetButton.addEventListener('click', function() {
            _refresh();
        });
    }
    function edit_page(id){
        table.set();
        var url = "/404.html";
        if ($.common.isNotEmpty(id)) {
            url = table.options.updateUrl.replace("{id}", id);
        } else {
            var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
            if (id.length == 0) {
                $.modal.alertWarning("请至少选择一条记录");
                return;
            }
            url = table.options.updateUrl.replace("{id}", id);
        }
        $.modal.openTab("修改" + table.options.modalName, url + "?status=1" );
    }

    /* 用户状态显示 */
    function statusTools(row) {
        if (row.status == 1) {
            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
        } else {
            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
        }
    }
</script>
</body>

</html>
