|
@@ -7,38 +7,66 @@
|
|
|
</head>
|
|
|
<body class="content">
|
|
|
<div class="order-body">
|
|
|
+ <div class="order-tiaojian back-gray">
|
|
|
+ <div class="tiaojian-part1" id = "conditions">
|
|
|
+ <div class="fl f12-gray4-op mt4">所选条件:</div>
|
|
|
+ </div>
|
|
|
+ <div class="tiaojian-part2 fr demoTable">
|
|
|
+ <button class="layui-btn order-bnt1" data-type="reload" >搜索</button>
|
|
|
+ <button class="layui-btn order-bnt2" data-type="reset">重置</button>
|
|
|
+ <button class="layui-btn order-bnt2" id = "addUser">添加</button>
|
|
|
+ <a href="#" id="toggle" class="top">收起</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<form class="layui-form" action="javascript:void(0)" id = "formName">
|
|
|
<div class="order-select back-border" id="content">
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">查询日期:</label>
|
|
|
+ <input class="search-select" type="text" id="dates" placeholder="日期(区间)" readonly />
|
|
|
+ </div>
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">设备编号:</label>
|
|
|
+ <input onchange = "changeSelectCon(1,this,'inp')" class="search-select"
|
|
|
+ type="tel" name="equNum" id ="equNum" value="" placeholder="设备编号" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</form>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
<div class="shadow-content" style="margin:1.5rem;">
|
|
|
<table id="incomeManage" lay-filter="tableFilter"></table>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
-<!--操作功能-->
|
|
|
-<script type="text/html" id="barDemo">
|
|
|
-</script>
|
|
|
<script>
|
|
|
-
|
|
|
+ $("#toggle").click(function() {
|
|
|
+ $(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
|
|
|
+ "<i class='iconfont up iconSelect_drop-down'/></i>");
|
|
|
+ $("#content").slideToggle();
|
|
|
+ });
|
|
|
layui.use(['table','laydate','form'], function(){
|
|
|
var laydate = layui.laydate;
|
|
|
- $.request({
|
|
|
- action : '../../invCardManageAction/selectAllIncome',
|
|
|
- data : { },
|
|
|
- success : function(data) {
|
|
|
- var orderNum = data.orderNum;
|
|
|
- var countIncome = data.countIncome;
|
|
|
- var countDevice = data.countDevice;
|
|
|
-<!-- $("#orderNum").html(orderNum);-->
|
|
|
-<!-- $("#countIncome").html(countIncome);-->
|
|
|
-<!-- $("#countDevice").html(countDevice);-->
|
|
|
- form.render();
|
|
|
- }
|
|
|
- });
|
|
|
+ //日期范围
|
|
|
+ laydate.render({
|
|
|
+ elem: '#dates'
|
|
|
+ ,range: true
|
|
|
+ ,format:'yyyyMMdd'
|
|
|
+ ,done: function(value, date, endDate){
|
|
|
+ changeSelectCon(0,"dates",'date',value)
|
|
|
+ }
|
|
|
+ });
|
|
|
+// $.request({
|
|
|
+// action : '../../invCardManageAction/selectAllIncome',
|
|
|
+// data : { },
|
|
|
+// success : function(data) {
|
|
|
+// var orderNum = data.orderNum;
|
|
|
+// var countIncome = data.countIncome;
|
|
|
+// var countDevice = data.countDevice;
|
|
|
+// <!-- $("#orderNum").html(orderNum);-->
|
|
|
+// <!-- $("#countIncome").html(countIncome);-->
|
|
|
+// <!-- $("#countDevice").html(countDevice);-->
|
|
|
+// form.render();
|
|
|
+// }
|
|
|
+// });
|
|
|
form.render();
|
|
|
})
|
|
|
|
|
@@ -54,7 +82,8 @@
|
|
|
,where:{MINView:"JSON", token: 'sasasas'}
|
|
|
,page: true //开启分页
|
|
|
,cols: [[ //表头
|
|
|
- {field: 'newTime',title: '日期',width:'15%'}
|
|
|
+ {field: 'sellTime',title: '日期',width:'15%'}
|
|
|
+ ,{field: 'vciId',title: '设备编号',width:'15%'}
|
|
|
,{field: 'newCount', title: '支付次数', width:'10%', sort: true}
|
|
|
,{field: 'sellWxSum', title: '微信支付金额', width:'18%'}
|
|
|
,{field: 'sellZfSum', title: '支付宝支付金额', width:'18%'}
|
|
@@ -70,8 +99,103 @@
|
|
|
console.log(count);
|
|
|
}
|
|
|
,even: true //开启隔行背景
|
|
|
- });
|
|
|
+ });
|
|
|
+
|
|
|
+ var $ = layui.$, active = {
|
|
|
+ reload: function(){
|
|
|
+ reLoadFun();
|
|
|
+ }
|
|
|
+ ,reset: function(){
|
|
|
+ $('#formName')[0].reset();
|
|
|
+ $("#conditions").html('<div class="fl f12-gray4-op mt4">所选条件:</div>');
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $('.layui-btn').on('click', function(){
|
|
|
+ var type = $(this).data('type');
|
|
|
+ active[type] ? active[type].call(this) : '';
|
|
|
+ });
|
|
|
});
|
|
|
+
|
|
|
+ function reLoadFun() {
|
|
|
+ var equNum = $('#equNum').val();
|
|
|
+ var dates = $("#dates").val();
|
|
|
+ //执行重载
|
|
|
+ table.reload('incomeManage', {
|
|
|
+ page: {
|
|
|
+ curr: 1 //重新从第 1 页开始
|
|
|
+ }
|
|
|
+ ,where: {
|
|
|
+ equNum : equNum,
|
|
|
+ datesTime :dates
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function changeSelectCon(index, t, type, dateValue){
|
|
|
+ if (type == "date") {
|
|
|
+ if (isEmpty(dateValue)) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type,dateValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (type == 'inp') {
|
|
|
+ if (isEmpty($(t).val())) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isEmpty($(t).val())) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $(t).attr("id",dateValue);
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type,dateValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var array = new Array('日期','设备编号');
|
|
|
+ function getSelectConHtml(index, t, type,dateValue){
|
|
|
+ var name;
|
|
|
+ var value;
|
|
|
+ if(type == "inp"){
|
|
|
+ value = t.value.substr(0,5)+"..";
|
|
|
+ }
|
|
|
+ if (type == "date") {
|
|
|
+ value = dateValue;
|
|
|
+ }
|
|
|
+ if (type == "date") {
|
|
|
+ name = $("#"+t).attr("id");
|
|
|
+ } else {
|
|
|
+ name = $(t).attr("id");
|
|
|
+ }
|
|
|
+ var html = '<div class="fl xuanzhong-active" id = "search' + index + '" name = "' + name + '" onclick = "removeSearch(this)">' +
|
|
|
+ '<div class="fl">' + array[index] + '</div>' +
|
|
|
+ ':<i class="iconfont">'+value+'</i>' +
|
|
|
+ '<svg class="icon" aria-hidden="true">' +
|
|
|
+ '<use xlink:href="#iconicon_close1"></use>' +
|
|
|
+ '</svg>' +
|
|
|
+ '</div>';
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+ function removeSearch(t) {
|
|
|
+ if ($(t).attr("name") == 'state') {
|
|
|
+ initSelect('state', "IM_USER_STATE", "state", ' ', true);
|
|
|
+ form.render();
|
|
|
+ $(t).remove();
|
|
|
+ } else {
|
|
|
+ $("#"+$(t).attr("name")).val('');
|
|
|
+ $(t).remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|