<!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('【请填写功能名称】列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>客户编号：</label>
                                <input type="text" name="customerId"/>
                            </li>
                            <li>
                                <label>客户名称：</label>
                                <input type="text" name="customerName"/>
                            </li>
                            <li>
                                <label>客户简称：</label>
                                <input type="text" name="customerShortName"/>
                            </li>
                            <li>
                                <label>拼音简称：</label>
                                <input type="text" name="pyName"/>
                            </li>
                            <li>
                                <label>客户分类编号：</label>
                                <input type="text" name="cusTypeId"/>
                            </li>
                            <li>
                                <label>联系人：</label>
                                <input type="text" name="linkman"/>
                            </li>
                            <li>
                                <label>手机号：</label>
                                <input type="text" name="telephone"/>
                            </li>
                            <li>
                                <label>联系电话：</label>
                                <input type="text" name="phone"/>
                            </li>
                            <li>
                                <label>联系传真：</label>
                                <input type="text" name="fax"/>
                            </li>
                            <li>
                                <label>联系地址：</label>
                                <input type="text" name="email"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" class="time-input" placeholder="请选择${comment}" name="birthday"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" name="province"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" name="city"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" name="distirct"/>
                            </li>
                            <li>
                                <label>邮编：</label>
                                <input type="text" name="postcode"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" name="address"/>
                            </li>
                            <li>
                                <label>版本号：</label>
                                <input type="text" name="version"/>
                            </li>
                            <li>
                                <label>操作人：</label>
                                <input type="text" name="operatorid"/>
                            </li>
                            <li>
                                <label>操作日期：</label>
                                <input type="text" class="time-input" placeholder="请选择操作日期" name="operatedate"/>
                            </li>
                            <li>
                                <label>省编号：</label>
                                <input type="text" name="provinceId"/>
                            </li>
                            <li>
                                <label>市编号：</label>
                                <input type="text" name="cityId"/>
                            </li>
                            <li>
                                <label>县/区编号：</label>
                                <input type="text" name="townId"/>
                            </li>
                            <li>
                                <label>GUID：</label>
                                <input type="text" name="guid"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" class="time-input" placeholder="请选择${comment}" name="updateDate"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" name="updateBy"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" name="port"/>
                            </li>
                            <li>
                                <label>${comment}：</label>
                                <input type="text" name="sts"/>
                            </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="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:customer:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:customer:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:customer:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:customer: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>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('business:customer:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:customer:remove')}]];
        var prefix = ctx + "business/customer";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "【请填写功能名称】",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'customerId',
                    title: '客户编号'
                },
                {
                    field: 'customerName',
                    title: '客户名称'
                },
                {
                    field: 'customerShortName',
                    title: '客户简称'
                },
                {
                    field: 'pyName',
                    title: '拼音简称'
                },
                {
                    field: 'cusTypeId',
                    title: '客户分类编号'
                },
                {
                    field: 'linkman',
                    title: '联系人'
                },
                {
                    field: 'telephone',
                    title: '手机号'
                },
                {
                    field: 'phone',
                    title: '联系电话'
                },
                {
                    field: 'fax',
                    title: '联系传真'
                },
                {
                    field: 'sex',
                    title: '${comment}'
                },
                {
                    field: 'email',
                    title: '联系地址'
                },
                {
                    field: 'birthday',
                    title: '${comment}'
                },
                {
                    field: 'province',
                    title: '${comment}'
                },
                {
                    field: 'city',
                    title: '${comment}'
                },
                {
                    field: 'distirct',
                    title: '${comment}'
                },
                {
                    field: 'postcode',
                    title: '邮编'
                },
                {
                    field: 'address',
                    title: '${comment}'
                },
                {
                    field: 'status',
                    title: '状态 0：正常 1：停用'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    field: 'version',
                    title: '版本号'
                },
                {
                    field: 'operatorid',
                    title: '操作人'
                },
                {
                    field: 'operatedate',
                    title: '操作日期'
                },
                {
                    field: 'provinceId',
                    title: '省编号'
                },
                {
                    field: 'cityId',
                    title: '市编号'
                },
                {
                    field: 'townId',
                    title: '县/区编号'
                },
                {
                    field: 'guid',
                    title: 'GUID'
                },
                {
                    field: 'updateDate',
                    title: '${comment}'
                },
                {
                    field: 'updateBy',
                    title: '${comment}'
                },
                {
                    field: 'port',
                    title: '${comment}'
                },
                {
                    field: 'sts',
                    title: '${comment}'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.customerId + '\')"><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.customerId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>