Helius
2022-05-27 4351e71d782741143a98f86f6648acd16689165f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
 
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
    content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
        th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script>
 
</head>
<body class="gray-bg">
     
 
    <div class="ibox-content">
        <!-- 搜索框部分start -->
        <form class="form-inline" id="serchform">
            <div class="form-group mr-20">
                <label>日期范围</label>
                <input name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">-
                <input name="endTime"  type="text" class="form-control datetimepicker" id="endTime">
            </div>
 
            <div class="form-group mr-20">
                <label>门店</label>
                <select class="form-control autoFull" data-filed="shopName" name="shopId" id="shopId"
                        th:data-url="@{/admin/shopInfo/findShops}">
                    <option value=''>--请选择部所属门店--</option>
                </select>
            </div>
 
            <div class="row mb-10">
                <div class="col-sm-8">
                    <button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button>
                    <button  type="reset"   class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button>
<!--                    <button  matrix:btn="ygyjbb-exportExcel"  onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button>-->
                </div>
            </div>
        </form>
 
 
        <table id="mgrid">
            <thead>
                <tr>
                    <th data-formatter="MGrid.indexfn" data-align="center"
                        data-width="30px">序号</th>
                    <th data-field="dataTime">日期</th>
                    <th data-field="shopName">门店名称</th>
                    <th data-field="shouldPay" data-formatter="shouldPayFormat">应收金额</th>
                    <th data-field="totalPay">实收金额</th>
                    <th data-field="shouldPay" data-formatter="zkAmountFormat">折扣金额</th>
                    <th data-field="perCustomCnt">客单数</th>
                    <th data-field="customGoodsCnt">客品数</th>
                    <th data-field="cost">成本</th>
                    <th data-field="grossProfit">毛利</th>
                    <th data-field="grossProfitRate">毛利率</th>
                    <th data-field="wechat">微信</th>
                    <th data-field="alipay">支付宝</th>
                    <th data-field="cash">现金</th>
                    <th data-field="bankCard">银行卡</th>
                    <th data-field="tuan">团购</th>
                    <th data-field="cardBj">本金收款</th>
                    <th data-field="cardFree">赠金收款</th>
                    <th data-field="arrears">欠款</th>
                </tr>
            </thead>
        </table>
    </div>
 
    <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
    <script type="text/javascript" th:src="@{/js/function/public.js}"></script>
    <script type="text/javascript">
        var myGrid;
        var initParam = {
                format : "yyyy-mm-dd", //默认显示年与日,如果想显示十分秒:"yyyy-mm-dd hh:ii:ss"
                minView: "month",     //"month",只显示年月日的选择,不会再跳转去选择时分秒;如果想要选择时分秒的:"hour"
            }
         MTools.ininDatetimepicker(initParam);
        //限制结束时间不小于开始时间
         MTools.limitStartEndTime({});
 
        $(function() {
            MTools.autoFullSelect();
            $(".select2").select2();
            myGrid = MGrid.initGrid({
                url : basePath+"/admin/sysBusinessData/findDailySaleData",
                showExport : true,
                showFooter : false,
                exportDataType : "basic", //basic', 'all', 'selected'.
                exportTypes : [ 'excel', 'xlsx' ], //导出类型
                exportOptions : {
                    ignoreColumn : [ 0 ],
                    fileName : "客户消费统计" + MTools.getTime(), //文件名称设置
                    worksheetName : 'Sheet1', //表格工作区名称  
                    tableName : '客户消费统计',
                    excelstyles : [ 'background-color', 'color', 'font-size',
                            'font-weight' ],
                }
            });
 
            $('[data-toggle="tooltip"]').tooltip()
 
        });
 
        function shouldPayFormat(value, row, index) {
            return row.shouldPay + row.refund;
        }
 
        function zkAmountFormat(value, row, index) {
            var result = row.shouldPay + row.refund - row.arrears - row.totalPay;
            return result.toFixed(2);
        }
 
        function footCountTitle(data) {
            return "<b>合计</b>";
        };
        function countColumn(data) {
            if (data) {
                var resultsumQuantity = parseFloat(data).toFixed(2);//保留有效数字
                return resultsumQuantity;
            } else {
                return "-";
            }
        };
 
        function buildVipNameJump(value, row, index) {
            return '<a  onClick="vipDetail(\'' + row.t9 +'\')"   class="text-primary " >'+value+'</a>';
        }
 
        function vipDetail(value) {
            layer.full(layer.open({
                type : 2,
                title : "订单详情",
                maxmin : true,
                area : MUI.SIZE_M,
                content : [basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ]
            }));
        }
 
        function exportExcel(){
 
            var param=MForm.toUrlParam("#serchform");
 
            window.location.href=basePath+"/admin/achieve/exportDailyInfoNew?"+param;
        }
        
    </script>
</body>
</html>