123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <title>撤单删除管理</title>
- <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">
- <input class="layui-input" name="车牌号" id="test-table-demoReload" style="text-transform:uppercase;">
- <!--autocomplete="off"-->
- </div>
- 检测日期:
- <div class="layui-input-inline">
- <input type="text" class="layui-input" id="test-laydate-range-date">
- </div>
- <button class="layui-btn" data-type="reload">搜索</button>
- </div>
- <table class="layui-hide" id="test-table-radio" lay-filter="test-table-radio"></table>
- <script type="text/html" id="test-table-radio-toolbarDemo">
- <div class="layui-btn-container">
- <button class="layui-btn layui-btn-sm" lay-event="edit">撤单选择</button>
- </div>
- </script>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <script>
- layui.use(['admin', 'table','layer','form','view','laydate'], function(){
- var admin = layui.admin
- ,$ = layui.$
- ,layer = layui.layer
- ,view = layui.view
- ,form = layui.form
- ,laydate = layui.laydate
- ,table = layui.table;
- table.render({
- elem: '#test-table-radio'
- ,url:'/charge/selectCharge'
- ,method:'post'
- // ,where:{"date":new Date()}
- ,toolbar: '#test-table-radio-toolbarDemo'
- ,title: '收费记录数据表'
- ,even: true//隔行背景
- ,cols: [[
- {type: 'radio', fixed: 'left'}
- ,{field:'license', title:'车牌', width:120}
- ,{field:'VIN', title:'车架号', width:120}
- ,{field:'owner', title:'所有人', width:120}
- ,{field:'EP_type', title:'环保类型', width:120}
- ,{field:'car_type', title:'安检类型', width:120}
- ,{field:'customer', title:'挂账客户', width:120}
- ,{field:'contracted_customer', title:'签约客户', width:120}
- ,{field:'EP_receivable', title:'环检应收', width:120}
- ,{field:'Safe_receivable', title:'安检应收', width:120}
- ,{field:'receivable', title:'应收总和', width:120}
- ,{field:'cost', title:'实收总和', width:120}
- ,{field:'telephone', title:'联系电话', width:120}
- ,{field:'date', title:'检测日期', width:120}
- ,{field:'remarks', title:'备注', width:120}
- // ,{fixed: 'right', title:'操作', toolbar: '#test-table-toolbar-barDemo', width:150}
- ]]
- ,page: true
- });
- laydate.render({
- elem: '#test-laydate-range-date'
- });
- var active = {
- reload: function(){
- var demoReload = $('#test-table-demoReload');
- var date = $('#test-laydate-range-date');
- //执行重载
- table.reload('test-table-radio', {
- where: {
- 'license': demoReload.val(),
- 'date': date.val()
- }
- ,page: {
- curr: 1 //重新从第 1 页开始
- }
- });
- }
- };
- $('.test-table-reload-btn .layui-btn').on('click', function(){
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- //头工具栏事件
- table.on('toolbar(test-table-radio)', function(obj){
- var checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
- var data = checkStatus.data; //获取选中行数据
- switch(obj.event){
- case 'edit':
- if (data.length !== 0) {//选中
- admin.popup({
- title: '撤单删除管理'
- ,area: ['500px', '480px']
- ,id: 'LAY-popup-charge-del'
- ,success:function (layero, index) {
- view(this.id).render('detection/layer/popupChargeDel').done(function(){
- form.val('charge-form-del',{
- 'license':data[0].license,
- 'Safe_receivable':data[0].Safe_receivable,
- 'EP_receivable':data[0].EP_receivable,
- 'remarks':data[0].remarks,
- 'cost':data[0].cost,
- });
- //监听提交
- form.on('submit(LAY-charge-del-submit)', function(editData){
- var field = editData.field;
- field['id'] = data[0].id;
- admin.req({
- type:"POST",
- url:"/charge/chargeDel",
- data:field,
- done:function (res) {
- if (res && res.code === 0){
- layer.msg(res.msg)
- }else {//撤单失败
- layer.msg(res.msg)
- }
- layer.close(index);
- layui.table.reload('test-table-radio'); //重载表格
- }
- });
- })
- })
- }
- })
- }else {//未选中
- layer.msg("请选择!");
- }
- // layer.alert(JSON.stringify(data));
- break;
- };
- });
- });
- </script>
|