提交 c6e84572 authored 作者: chengye's avatar chengye

test

上级 a3de72d4
......@@ -111,7 +111,6 @@ class Invoice extends Base
if(Request::param('page')){
return ['code'=>0,'msg'=>'','count'=>$InvoiceCount,'data'=>$data];
}
return $this->fetch();
}
......
......@@ -32,7 +32,7 @@ class EmInvoice extends Base
public function getInvoiceList($map,$Nowpage,$limits){
$data = self::alias('inv')
->field('inv.*')
->field('station.station_name,em.em_numb')
->field('station.station_name,em.em_numb,em.em_type_id')
->field('eu.last_sum_numb,eu.current_sum_numb,eu.current_date,FROM_UNIXTIME(eu.current_date,"%Y-%m-%d %H:%i:%S") as now_date,eu.em_id')
->join(['em_invoice_useage'=>'eiu'],'eiu.invoice_id = inv.invoice_id')
->join(['em_useage'=>'eu'],'eu.useage_id = eiu.useage_id')
......
......@@ -122,10 +122,12 @@
var form = layui.form,
layer = layui.layer,
laydate = layui.laydate,
table = layui.table,
element = layui.element,
slider = layui.slider,
upload = layui.upload;
table = layui.table;
table.on('checkbox(idTest)', function(obj){
console.log(obj.data.em.em_type_id); //选中行的相关数据
});
laydate.render({
elem:'#date_end',
trigger:'click',
......@@ -187,6 +189,8 @@
xadmin.open('合并账单',url)
}
}
</script>
{/block}
......
{extend name="public:base" /}
{block name="body"}
<style type="text/css">
.layui-table-page{
text-align: right;
}
</style>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<form class="layui-form">
<div class="layui-input-inline" style="width:150px;">
<select name="search_type" id="search_type" >
<option value="1" selected="selected" {if $search_type eq 1 } selected {/if}>账单号</option>
<option value="2" {if $search_type eq 2 } selected {/if}>所属基站名</option>
<option value="3" {if $search_type eq 3 } selected {/if}>所属电表号</option>
</select>
</div>
<div class="layui-input-inline">
<input type="text" name="search_text"
style="width:150px;" placeholder="搜索内容" autocomplete="off" id="search_text" class="layui-input" value="{$search_text}">
</div>
<div class="layui-input-inline">
<button class="layui-btn" lay-submit="" lay-filter="search">
<i class="layui-icon">&#xe615;</i></button>
</div>
</form>
</div>
<div class="layui-card-body ">
<div>
<a href="javascript:;" class="layui-btn" id="merge_add">添加到合并列表</a>
<button class="layui-btn" onclick="merge_list()">
合并账单<span class="layui-badge layui-bg-orange" id="merge_list">0</span>
</button>
</div>
<table class="layui-table" lay-data="{ url:'/invoice', page:true, id:'idTest',where:{search_type:document.getElementById('search_type').value,search_text:document.getElementById('search_text').value} }"> <thead>
<tr>
<th lay-data="{type: 'checkbox', fixed: 'left'} "></th>
<th lay-data="{templet: '#invoice_id'} ">账单号</th>
<th lay-data="{field:'station_name'}">所属基站名</th>
<th lay-data="{field:'em_numb'} ">所属电表号</th>
<th lay-data="{field:'payment_amount'}">应费金额</th>
<th lay-data="{field: 'settle_amount'}">应结金额</th>
<th lay-data="{field: 'status'}">账单状态</th>
<!--<th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">操作</th>-->
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
{/block}
{block name="js"}
<script type="text/html" id="invoice_id">
<a class="layui-link" title="查看" href="/invoice/{{d.id}}">{{d.invoice_id}}</a>
</script>
<script type="text/javascript">
var $list = new Set();
layui.use(['form', 'layer', 'laydate', 'upload','table'],
function () {
$ = layui.jquery;
var form = layui.form,
layer = layui.layer,
laydate = layui.laydate,
table = layui.table,
upload = layui.upload;
laydate.render({
elem:'#date_end',
trigger:'click',
})
laydate.render({
elem:'#date_start',
trigger:'click',
})
var $ma = $("#merge_add");
var $ml = $("#merge_list");
//添加合并单号到列表
$ma.on('click',function(){
var $mi = $('.merge_item');
$mi.each(function(i){
if(this.checked){
$list.add($(this).val())
}
})
$ml.text($list.size)
})
table.on('toolbar(idTest)', function(obj){
var checkStatus = table.checkStatus(obj.config.id);
switch(obj.event){
case 'getCheckData':
var data = checkStatus.data;
layer.alert(JSON.stringify(data));
break;
case 'getCheckLength':
var data = checkStatus.data;
layer.msg('选中了:'+ data.length + ' 个');
break;
case 'isAll':
layer.msg(checkStatus.isAll ? '全选': '未全选');
break;
//自定义头工具栏右侧图标 - 提示
case 'LAYTABLE_TIPS':
layer.alert('这是工具栏右侧自定义的一个图标按钮');
break;
};
});
})
function merge_list()
{
var iDs = '';
if($list.size != 0){
$list.forEach(
function($value,$key){
iDs += $value + '_'
}
)
url = '/invoice/merge/list/'+iDs;
url = url.substr(0,(url.length -1))
xadmin.open('合并账单',url)
}
}
function del(obj,id){
layer.confirm('确认要删除吗?',function(index){
$.ajax({
url: '/copy_del',
method: "POST",
data: {id:id},
dataType: "json",
success: function (data) {
if(data.status == 1){
layer.msg(data.message,{icon:1,time:1000});
location.reload()
} else {
layer.alert(data.message, {
icon: 5
});
}
}
});
});
}
</script>
{/block}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论