123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>收费记录查询</title>
- <!--<script src="../dist/controller/layui_exts/excel.js"></script>-->
- </head>
- <body>
- <div class="layui-card layadmin-header">
- <div class="layui-breadcrumb" lay-filter="breadcrumb">
- <a lay-href="">主页</a>
- <a><cite>车辆检测管理</cite></a>
- <a><cite>收费记录查询</cite></a>
- </div>
- </div>
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <!--<div class="layui-card-header">开启头部工具栏</div>-->
- <div class="layui-card-body">
- <div class="test-table-reload-btn" style="margin-bottom: 10px;">
- 车牌地区:
- <div class="layui-inline layui-form" lay-filter="licenseSelect">
- <select name="license_region" lay-verify="required" lay-search="" lay-filter="licenseSelect" id="licenseSelect">
- <option value=0>全部</option>
- <option value=1>沪</option>
- <option value=2>非沪</option>
- </select>
- </div>
- 环保类型:
- <div class="layui-inline layui-form" lay-filter="detectionSelect">
- <select name="EP_type" lay-verify="required" lay-search="" lay-filter="detectionChangeType" id="detectionSelect">
- <option value="">全部</option>
- </select>
- </div>
- 挂账客户:
- <div class="layui-inline layui-form" lay-filter="customerSelect">
- <select name="customer" lay-verify="required" lay-search="" lay-filter="customerSelect" id="customerSelect">
- <!--<option value="">全部</option>-->
- </select>
- </div>
- 签约客户:
- <div class="layui-inline layui-form" lay-filter="contractedSelect">
- <select name="contracted_customer" lay-verify="required" lay-search="" lay-filter="contractedSelect" id="contractedSelect">
- <!--<option value="">全部</option>-->
- </select>
- </div>
- <!--换行-->
- <div class="layui-inline">
- 安检类型:
- <div class="layui-inline layui-form" lay-filter="carTypeSelect">
- <select name="car_type" lay-verify="required" lay-search="" lay-filter="carChangeType" id="carTypeSelect">
- <option value="">全部</option>
- </select>
- </div>
- 检测年月:
- <div class="layui-input-inline">
- <input type="text" class="layui-input" id="test-laydate-range-date">
- </div>
- </div>
- <button class="layui-btn" data-type="reload">搜索</button>
- <button type="button" lay-submit="" class="layui-btn layui-btn-warm" data-type="uploadImg" lay-filter="uploadImg">
- <i class="layui-icon"></i>导出Excel</button>
- </div>
- <table class="layui-hide" id="test-table-totalRow" lay-filter="test-table-totalRow"></table>
- </div>
- <div class="layui-card-body">
- 支付宝总计:
- <div class="layui-input-inline" style="width: 80px">
- <input type="text" class="layui-input" id="ali_pay_sum" style="border:none;font-weight:bold">
- </div>
- 挂账总计:
- <div class="layui-input-inline" style="width: 80px">
- <input type="text" class="layui-input" id="on_account_sum" style="border:none;font-weight:bold">
- </div>
- 环检应收总计:
- <div class="layui-input-inline" style="width: 80px">
- <input type="text" class="layui-input" id="EP_sum" style="border:none;font-weight:bold">
- </div>
- 安检应收总计:
- <div class="layui-input-inline" style="width: 80px">
- <input type="text" class="layui-input" id="Safe_sum" style="border:none;font-weight:bold">
- </div>
- 应收总计:
- <div class="layui-input-inline" style="width: 80px">
- <input type="text" class="layui-input" id="rece_sum" style="border:none;font-weight:bold">
- </div>
- 实收总计:
- <div class="layui-input-inline" style="width: 80px" >
- <input type="text" class="layui-input" id="cost_sum" style="border:none;font-weight:bold">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <script>
- // LAY_EXCEL.exportExcel([[1, 2, 3]], '表格导出.xlsx', 'xlsx')
- layui.use(['admin', 'table','laydate','form','excel'], function(){
- var admin = layui.admin
- ,$ = layui.$
- ,laydate = layui.laydate
- ,table = layui.table
- ,excel = layui.excel
- ,form = layui.form;
- // form.render(null, 'form-group');
- table.render({
- elem: '#test-table-totalRow'
- ,url:'/charge/chargeMonth'
- ,method:'post'
- ,toolbar: '#'
- ,even: true//隔行背景
- ,title: '收费记录数据表'
- // ,parseData:function (res) {
- // console.log(res)
- // }
- ,cols: [[
- // {type:'numbers',fixed: 'left', totalRowText: '合计:'}
- {field:'license', title:'车牌',align: 'center'},
- {field:'EP_type', title:'环保类型',align: 'center'},
- {field:'car_type', title:'安检类型',align: 'center'},
- {field:'customer', title:'挂账客户',align: 'center'},
- {field:'contracted_customer', title:'签约客户',align: 'center'},
- {field:'ali_pay', title:'支付宝',align: 'center'},
- {field:'on_account', title:'挂账金额',align: 'center'},
- {field:'EP_receivable', title:'环检应收',align: 'center'},
- {field:'Safe_receivable', title:'安检应收',align: 'center'},
- {field:'receivable', title:'应收总和',align: 'center'},
- {field:'cost', title:'实收总和',align: 'center'},
- {field:'remarks', title:'备注',align: 'center'}
- // ,{fixed: 'right', title:'操作', toolbar: '#test-table-toolbar-barDemo', width:150}
- ]]
- ,page: true
- ,done:function (data) {
- $('#ali_pay_sum').val(data.sum.ali_pay_sum);
- $('#on_account_sum').val(data.sum.on_account_sum);
- $('#EP_sum').val(data.sum.EP_sum);
- $('#Safe_sum').val(data.sum.Safe_sum);
- $('#rece_sum').val(data.sum.rece_sum);
- $('#cost_sum').val(data.sum.cost_sum);
- }
- });
- //环检下拉
- $.ajax({
- url:"/chargingStandard/getSelect",
- type:'POST',
- data:{"project":"环检"},
- success:function (res) {
- var data = res;
- $.each(data,function (index,item) {
- $('#detectionSelect').append('<option value="'+item.carType+'">'+item.carType+'</option>');
- });
- form.render('select', 'detectionSelect');
- }
- });
- //安检下拉
- $.ajax({
- url:"/chargingStandard/getSelect",
- type:'POST',
- data:{"project":"安检"},
- success:function (res) {
- var data = res;
- $.each(data,function (index,item) {
- $('#carTypeSelect').append('<option value="'+item.carType+'">'+item.carType+'</option>');
- });
- form.render('select', 'carTypeSelect');
- }
- });
- //挂账客户下拉
- $.ajax({
- url:"/customer/getCustomer",
- type:'GET',
- // data:{"project":"安检"},
- success:function (res) {
- var data = res;
- $.each(data,function (index,item) {
- if (index===0){
- $('#customerSelect').append('<option value="">'+item.name+'</option>');
- }else {
- $('#customerSelect').append('<option value="'+item.name+'">'+item.name+'</option>');
- }
- });
- form.render('select', 'customerSelect');
- }
- });
- //签约客户下拉
- $.ajax({
- url:"/contracted/getContracted",
- type:'GET',
- success:function (res) {
- var data = res;
- $.each(data,function (index,item) {
- if (index===0){
- $('#contractedSelect').append('<option value="">'+item.name+'</option>');
- }else {
- $('#contractedSelect').append('<option value="'+item.name+'">'+item.name+'</option>');
- }
- });
- form.render('select', 'contractedSelect');
- }
- });
- var active = {
- //搜索重载
- reload: function(){
- var date = $('#test-laydate-range-date');
- var ep = $('#detectionSelect');
- var car = $('#carTypeSelect');
- var customer = $('#customerSelect');
- var contracted = $('#contractedSelect');
- var license = $('#licenseSelect');
- //执行重载
- table.reload('test-table-totalRow', {
- where: {
- 'EP_type': ep.val(),
- 'car_type': car.val(),
- 'customer': customer.val(),
- 'contracted': contracted.val(),
- 'date': date.val(),
- 'license': license.val()
- },page: {
- curr: 1 //重新从第 1 页开始
- }
- });
- },
- //导出excel
- uploadImg:function () {
- var date = $('#test-laydate-range-date');
- var ep = $('#detectionSelect');//环保
- var car = $('#carTypeSelect');//安检
- var customer = $('#customerSelect');//挂账客户
- var contracted = $('#contractedSelect');//签约客户
- var license = $('#licenseSelect');//沪牌
- // loading = layer.load(1, {shade: [0.3, '#fff']});
- // var $ = layui.jquery;
- // var excel = layui.excel;
- $.ajax({
- url: '/charge/monthExcel',
- dataType: 'json',
- type:'POST',
- data: {
- 'EP_type': ep.val(),
- 'car_type': car.val(),
- 'customer': customer.val(),
- 'contracted': contracted.val(),
- 'date': date.val(),
- 'license': license.val()
- },
- success: function(res) {
- // layer.close(loading);
- layer.msg(res.msg);
- // 假如返回的 res.data 是需要导出的列表数据
- // 1. 数组头部新增表头
- res.data.unshift({
- // sdId: 'ID',sdMoney: '交易金额',sdTime:'交易时间',type:'交易类型',sdWater:'交易流水编号',order:'订单号'
- license:'车牌',
- EP_type:'环保类型',
- car_type:'安检类型',
- customer:'挂账客户',
- contracted_customer:'签约客户',
- ali_pay:'支付宝',
- on_account:'挂账金额',
- EP_receivable:'环检应收',
- Safe_receivable:'安检应收',
- receivable:'应收总和',
- cost:'实收总和',
- telephone:'电话',
- remarks:'备注'
- });
- // console.log(res.data)
- // 3. 执行导出函数,系统会弹出弹框
- excel.exportExcel({
- sheet1: res.data
- }, res.filename, 'xlsx');
- },
- error:function(res){
- // layer.close(loading);
- layer.msg(res.msg);
- }
- });
- }
- };
- $('.test-table-reload-btn .layui-btn').on('click', function(){
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- laydate.render({
- elem: '#test-laydate-range-date',
- type:'month'
- });
- //新接口打印
- // form.on('submit(uploadImg)', function(data){
- // // loading = layer.load(1, {shade: [0.3, '#fff']});
- // // var $ = layui.jquery;
- // // var excel = layui.excel;
- // console.log(111);
- // $.ajax({
- // url: '/charge/chargeMonth',
- // dataType: 'json',
- // type:'POST',
- // data: {
- // 'EP_type': "",
- // 'car_type': "",
- // 'customer': "",
- // 'date': ""
- // },
- // success: function(res) {
- // // layer.close(loading);
- // layer.msg(res.msg);
- // // 假如返回的 res.data 是需要导出的列表数据
- // console.log(res.data);//
- // // 1. 数组头部新增表头
- // res.data.unshift({sdId: 'ID',sdMoney: '交易金额',sdTime:'交易时间',type:'交易类型',sdWater:'交易流水编号',order:'订单号'});
- // // 3. 执行导出函数,系统会弹出弹框
- // excel.exportExcel({
- // sheet1: [1, 2, 3]
- // }, '平台流水.xlsx', 'xlsx');
- // },
- // error:function(res){
- // // layer.close(loading);
- // layer.msg(res.msg);
- // }
- // });
- // });
- });
- </script>
- </html>
|