<!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="SXsglMdlsrbbYgSalesperformanceinfo-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="name" autocomplete="off"/>
                            </li>
                            <li>
                                销售额:<input type="text" class="styled-input" name="salesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                销售额占比:<input type="text" class="styled-input" name="salesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                销售额任务达成:<input type="text" class="styled-input" name="salesTargetAchievement" autocomplete="off"/>
                            </li>
                            <li>
                                毛利额:<input type="text" class="styled-input" name="grossProfitAmount" autocomplete="off"/>
                            </li>
                            <li>
                                毛利额占比:<input type="text" class="styled-input" name="grossProfitRatio" autocomplete="off"/>
                            </li>
                            <li>
                                毛利额任务达成:<input type="text" class="styled-input" name="grossProfitTargetAchievement" autocomplete="off"/>
                            </li>
                            <li>
                                毛利率:<input type="text" class="styled-input" name="grossProfitMargin" autocomplete="off"/>
                            </li>
                            <li>
                                来客数:<input type="text" class="styled-input" name="customerVisits" autocomplete="off"/>
                            </li>
                            <li>
                                来客数占比:<input type="text" class="styled-input" name="customerVisitsRatio" autocomplete="off"/>
                            </li>
                            <li>
                                客单价:<input type="text" class="styled-input" name="averageTransactionValue" autocomplete="off"/>
                            </li>
                            <li>
                                AA销售额:<input type="text" class="styled-input" name="aaSalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                AA销售额占比:<input type="text" class="styled-input" name="aaSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                AA达成:<input type="text" class="styled-input" name="aaTargetAchievement" autocomplete="off"/>
                            </li>
                            <li>
                                A1销售额:<input type="text" class="styled-input" name="a1SalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                A1销售额占比:<input type="text" class="styled-input" name="a1SalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                A1达成:<input type="text" class="styled-input" name="a1TargetAchievement" autocomplete="off"/>
                            </li>
                            <li>
                                A2销售额:<input type="text" class="styled-input" name="a2SalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                低毛利:<input type="text" class="styled-input" name="lowProfitSalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                微毛利:<input type="text" class="styled-input" name="marginalProfitSalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                负毛利:<input type="text" class="styled-input" name="negativeProfitSalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                淘汰:<input type="text" class="styled-input" name="eliminationSalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                A2销售额占比:<input type="text" class="styled-input" name="a2SalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                A3销售额:<input type="text" class="styled-input" name="a3SalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                A3销售额占比:<input type="text" class="styled-input" name="a3SalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                A4销售额:<input type="text" class="styled-input" name="a4SalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                A4销售额占比:<input type="text" class="styled-input" name="a4SalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                低毛销售额:<input type="text" class="styled-input" name="lowProfitSales" autocomplete="off"/>
                            </li>
                            <li>
                                低毛销售额占比:<input type="text" class="styled-input" name="lowProfitSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                微毛销售额:<input type="text" class="styled-input" name="marginalProfitSales" autocomplete="off"/>
                            </li>
                            <li>
                                微毛销售额占比:<input type="text" class="styled-input" name="marginalProfitSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                负毛销售额:<input type="text" class="styled-input" name="negativeProfitSales" autocomplete="off"/>
                            </li>
                            <li>
                                负毛销售额占比:<input type="text" class="styled-input" name="negativeProfitSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                其它销售额:<input type="text" class="styled-input" name="otherSalesAmount" autocomplete="off"/>
                            </li>
                            <li>
                                其它销售额占比:<input type="text" class="styled-input" name="otherSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                效期商品销量:<input type="text" class="styled-input" name="expiryProductSales" autocomplete="off"/>
                            </li>
                            <li>
                                效期商品销量占比:<input type="text" class="styled-input" name="expiryProductSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                效期商品任务达成:<input type="text" class="styled-input" name="expiryProductTargetAchievement" autocomplete="off"/>
                            </li>
                            <li>
                                淘汰商品销量:<input type="text" class="styled-input" name="eliminationProductSales" autocomplete="off"/>
                            </li>
                            <li>
                                淘汰商品销量占比:<input type="text" class="styled-input" name="eliminationProductSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                淘汰商品达成:<input type="text" class="styled-input" name="eliminationProductTargetAchievement" autocomplete="off"/>
                            </li>
                            <li>
                                不动销销量:<input type="text" class="styled-input" name="inactiveProductSales" autocomplete="off"/>
                            </li>
                            <li>
                                不动销销量占比:<input type="text" class="styled-input" name="inactiveProductSalesRatio" autocomplete="off"/>
                            </li>
                            <li>
                                不动销任务达成:<input type="text" class="styled-input" name="inactiveProductTargetAchievement" 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 + "xsgl/sxsglmdlsrbbygsalesperformanceinfo";
    $(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 + "/sXsglMdlsrbbYgSalesperformanceinfoList",
            viewUrl: prefix + "/sXsglMdlsrbbYgSalesperformanceinfoView/{id}",
            createUrl: prefix + "/sXsglMdlsrbbYgSalesperformanceinfoAdd",
            updateUrl: prefix + "/sXsglMdlsrbbYgSalesperformanceinfoEdit/{id}",
            removeUrl: prefix + "/sXsglMdlsrbbYgSalesperformanceinfoRemove",
            /*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: 'name', title: '姓名', align: 'center' },
                    { field: 'salesAmount', title: '销售额', align: 'center' },
                    { field: 'salesRatio', title: '销售额占比', align: 'center' },
                    { field: 'salesTargetAchievement', title: '销售额任务达成', align: 'center' },
                    { field: 'grossProfitAmount', title: '毛利额', align: 'center' },
                    { field: 'grossProfitRatio', title: '毛利额占比', align: 'center' },
                    { field: 'grossProfitTargetAchievement', title: '毛利额任务达成', align: 'center' },
                    { field: 'grossProfitMargin', title: '毛利率', align: 'center' },
                    { field: 'customerVisits', title: '来客数', align: 'center' },
                    { field: 'customerVisitsRatio', title: '来客数占比', align: 'center' },
                    { field: 'averageTransactionValue', title: '客单价', align: 'center' },
                    { field: 'aaSalesAmount', title: 'AA销售额', align: 'center' },
                    { field: 'aaSalesRatio', title: 'AA销售额占比', align: 'center' },
                    { field: 'aaTargetAchievement', title: 'AA达成', align: 'center' },
                    { field: 'a1SalesAmount', title: 'A1销售额', align: 'center' },
                    { field: 'a1SalesRatio', title: 'A1销售额占比', align: 'center' },
                    { field: 'a1TargetAchievement', title: 'A1达成', align: 'center' },
                    { field: 'a2SalesAmount', title: 'A2销售额', align: 'center' },
                    { field: 'lowProfitSalesAmount', title: '低毛利', align: 'center' },
                    { field: 'marginalProfitSalesAmount', title: '微毛利', align: 'center' },
                    { field: 'negativeProfitSalesAmount', title: '负毛利', align: 'center' },
                    { field: 'eliminationSalesAmount', title: '淘汰', align: 'center' },
                    { field: 'a2SalesRatio', title: 'A2销售额占比', align: 'center' },
                    { field: 'a3SalesAmount', title: 'A3销售额', align: 'center' },
                    { field: 'a3SalesRatio', title: 'A3销售额占比', align: 'center' },
                    { field: 'a4SalesAmount', title: 'A4销售额', align: 'center' },
                    { field: 'a4SalesRatio', title: 'A4销售额占比', align: 'center' },
                    { field: 'lowProfitSales', title: '低毛销售额', align: 'center' },
                    { field: 'lowProfitSalesRatio', title: '低毛销售额占比', align: 'center' },
                    { field: 'marginalProfitSales', title: '微毛销售额', align: 'center' },
                    { field: 'marginalProfitSalesRatio', title: '微毛销售额占比', align: 'center' },
                    { field: 'negativeProfitSales', title: '负毛销售额', align: 'center' },
                    { field: 'negativeProfitSalesRatio', title: '负毛销售额占比', align: 'center' },
                    { field: 'otherSalesAmount', title: '其它销售额', align: 'center' },
                    { field: 'otherSalesRatio', title: '其它销售额占比', align: 'center' },
                    { field: 'expiryProductSales', title: '效期商品销量', align: 'center' },
                    { field: 'expiryProductSalesRatio', title: '效期商品销量占比', align: 'center' },
                    { field: 'expiryProductTargetAchievement', title: '效期商品任务达成', align: 'center' },
                    { field: 'eliminationProductSales', title: '淘汰商品销量', align: 'center' },
                    { field: 'eliminationProductSalesRatio', title: '淘汰商品销量占比', align: 'center' },
                    { field: 'eliminationProductTargetAchievement', title: '淘汰商品达成', align: 'center' },
                    { field: 'inactiveProductSales', title: '不动销销量', align: 'center' },
                    { field: 'inactiveProductSalesRatio', title: '不动销销量占比', align: 'center' },
                    { field: 'inactiveProductTargetAchievement', 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();
        $("#SXsglMdlsrbbYgSalesperformanceinfo-form")[0].reset();
        $("#deptId").val("");
        $("#parentId").val("");
        $(".curSelectedNode").removeClass("curSelectedNode");
        $.table.search();
        var resetButton = document.getElementById('SXsglMdlsrbbYgSalesperformanceinfo-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>
