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

调整账单列表显示字段,添加本期表数,上期表数,并计算用电量

上级 39b092aa
......@@ -33,13 +33,15 @@ class EmInvoice extends Base
$data = self::alias('inv')
->field('inv.*')
->field('station.station_name,em.em_numb')
->field('eu.last_sum_numb,eu.current_sum_numb')
->join(['em_invoice_useage'=>'eiu'],'eiu.invoice_id = inv.invoice_id')
->join(['em_useage'=>'eu'],'eu.useage_id = eiu.useage_id')
->join(['em_account'=>'ea'],'ea.account_id = inv.account_id')
->join(['em'],'em.id=ea.em_id')
->join(['station_info'=>'station'],'station.station_id=em.station_id')
->where($map)
->page($Nowpage, $limits)
->order('inv.id desc')
->select()
->toarray();
foreach ($data as &$item){
......
......@@ -47,10 +47,10 @@
<th lay-data="{templet: '#invoice_id',sort: true} ">账单号</th>
<th lay-data="{field:'station_name',sort: true}">所属基站名</th>
<th lay-data="{templet:'#em_numb',sort: true} ">所属电表号</th>
<th lay-data="{field:'payment_amount'}">应缴金额</th>
<th lay-data="{field:'paid_amount'}">已缴金额</th>
<th lay-data="{field: 'settle_amount'}">应结金额</th>
<th lay-data="{field:'sett_amount'}">已结金额</th>
<th lay-data="{templet: '#useage'} ">抄表度数</th>
<th lay-data="{templet: '#repo_numb'}">用电量</th>
<th lay-data="{templet:'#payment',sort: true}">缴费金额</th>
<th lay-data="{templet:'#settle',sort: true}">结算金额</th>
<th lay-data="{field: 'status'}">账单状态</th>
<th lay-data="{field: 'create_time',sort: true}">创建时间</th>
<!--<th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">操作</th>-->
......@@ -73,6 +73,19 @@
<script type="text/html" id="em_numb">
<a class="layui-link" title="查看电表" href="/em_edit/{{d.em_id}}">{{d.em_numb}}</a>
</script>
<script type="text/html" id="payment">
应缴: {{ d.payment_amount }} 已缴:{{ d.paid_amount }}
</script>
<script type="text/html" id="settle">
应结: {{ d.settle_amount }} 已结:{{ d.sett_amount }}
</script>
<script type="text/html" id="useage">
上期表数: {{ d.last_sum_numb }} 本次表数:{{ d.current_sum_numb }}
</script>
<script type="text/html" id="repo_numb">
{{ d.current_sum_numb - d.last_sum_numb }}
</script>
<script type="text/javascript">
var $list = new Set();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论