aiyou před 4 roky
rodič
revize
71aa93a999

+ 94 - 0
application/admin/controller/cost/CostPrint.php

@@ -0,0 +1,94 @@
+<?php
+
+namespace app\admin\controller\cost;
+
+use app\common\controller\Backend;
+
+/**
+ * 物业账单
+ *
+ * @icon fa fa-circle-o
+ */
+class CostPrint extends Backend
+{
+    
+    /**
+     * CostPrint模型对象
+     * @var \app\admin\model\cost\CostPrint
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\cost\CostPrint;
+
+    }
+    
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+    /**
+     * 查看
+     */
+    public function index($bill_id=null)
+    {
+
+
+        //  printer_open
+
+        //设置过滤方法
+        $this->request->filter(['strip_tags']);
+        if ($this->request->isAjax()) {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField')) {
+                return $this->selectpage();
+            }
+
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+
+
+            $total = $this->model
+                ->where('id',$bill_id)
+                ->order($sort, $order)
+                ->count();
+
+            $list = $this->model
+
+                ->where('id',$bill_id)
+                ->with(['village','dong','danyuan','hu','item'])
+                ->order($sort, $order)
+                ->limit($offset, $limit)
+                ->select();
+            $list = collection($list)->toArray();
+            $result = array("total" => $total, "rows" => $list);
+
+            return json($result);
+        }
+        $list = $this->model
+
+            ->where('id',$bill_id)
+            ->with(['village','dong','danyuan','hu','item'])
+                       ->find();
+        $list['pay_date']=date('Y-m-d H:i:s',$list['pay_time']);
+        $this->view->assign('row',$list);
+        return $this->view->fetch();
+    }
+    /**
+     * 打印
+     */
+    public function prints($bill_id=null)
+    {
+
+
+        $list = $this->model
+
+            ->where('id',$bill_id)
+            ->with(['village','dong','danyuan','hu','item'])
+            ->find();
+
+        return $this->view->fetch();
+    }
+}

+ 24 - 0
application/admin/lang/zh-cn/cost/cost_print.php

@@ -0,0 +1,24 @@
+<?php
+
+return [
+    'Id'           => 'ID',
+    'Order_number' => '编号',
+    'Item_id'      => '所属收费项目',
+    'Property_id'  => '所属物业',
+    'Village_id'   => '所属小区',
+    'Dong_id'      => '所属哪一栋楼',
+    'Danyuan_id'   => '所属哪个单元',
+    'Hu_id'        => '所属哪一户',
+    'Mid'          => '用户id',
+    'Price'        => '价格',
+    'True_price'   => '实付金额',
+    'Start_time'   => '账单开始时间',
+    'End_time'     => '账单结束时间',
+    'Pay_time'     => '缴费日期',
+    'Pay_status'   => '0未付款1已付款',
+    'Createtime'   => '创建时间',
+    'Updatetime'   => '更新时间',
+    'Status'       => '状态',
+    'Is_delete'    => '是否删除',
+    'Mark'         => '备注'
+];

+ 96 - 0
application/admin/model/cost/CostPrint.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace app\admin\model\cost;
+
+use think\Model;
+
+
+class CostPrint extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'cost_bill';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'int';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'start_time_text',
+        'end_time_text',
+        'pay_time_text'
+    ];
+
+
+
+
+    public function getStartTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
+
+        return is_numeric($value) ? date("Y-m", $value) : $value;
+    }
+
+
+    public function getEndTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
+        return is_numeric($value) ? date("Y-m", $value) : $value;
+    }
+
+
+
+    public function getPayTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['pay_time']) ? $data['pay_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setStartTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setEndTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setPayTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    public function village(){
+        return $this->belongsTo('app\admin\model\village\Village','village_id','id')->field('id,v_name as name');
+    }
+
+    public function dong(){
+        return $this->belongsTo('app\admin\model\village\VillageDong','dong_id','id')->field('id,d_name as name');
+    }
+
+    public function danyuan(){
+        return $this->belongsTo('app\admin\model\village\VillageDanyuan','danyuan_id','id')->field('id,dy_name as name');
+    }
+
+    public function hu(){
+        return $this->belongsTo('app\admin\model\village\VillageHu','hu_id','id')->field('id,hu_name as name,usesr_name');
+    }
+
+    public function member(){
+        return $this->belongsTo('app\admin\model\Member','mid','id')->field('id,avatar,nickname');
+    }
+    public function item(){
+        return $this->belongsTo('app\admin\model\cost\CostItem','item_id','id')->field('id,item');
+    }
+
+}

+ 27 - 0
application/admin/validate/cost/CostPrint.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate\cost;
+
+use think\Validate;
+
+class CostPrint extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 112 - 0
application/admin/view/cost/cost_print/add.html

@@ -0,0 +1,112 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Order_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-order_number" data-rule="required" class="form-control" name="row[order_number]" type="text" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Item_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-item_id" data-rule="required" data-source="item/index" class="form-control selectpage" name="row[item_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Property_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-property_id" data-rule="required" data-source="property/index" class="form-control selectpage" name="row[property_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Village_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-village_id" data-rule="required" data-source="village/index" class="form-control selectpage" name="row[village_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Dong_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-dong_id" data-rule="required" data-source="dong/index" class="form-control selectpage" name="row[dong_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Danyuan_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-danyuan_id" data-rule="required" data-source="danyuan/index" class="form-control selectpage" name="row[danyuan_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Hu_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-hu_id" data-rule="required" data-source="hu/index" class="form-control selectpage" name="row[hu_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mid" data-rule="required" class="form-control" name="row[mid]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('True_price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-true_price" data-rule="required" class="form-control" step="0.01" name="row[true_price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pay_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_status" class="form-control" name="row[pay_status]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="1">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_delete')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-is_delete" data-rule="required" class="form-control" name="row[is_delete]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mark')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mark" data-rule="required" class="form-control" name="row[mark]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 112 - 0
application/admin/view/cost/cost_print/edit.html

@@ -0,0 +1,112 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Order_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-order_number" data-rule="required" class="form-control" name="row[order_number]" type="text" value="{$row.order_number|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Item_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-item_id" data-rule="required" data-source="item/index" class="form-control selectpage" name="row[item_id]" type="text" value="{$row.item_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Property_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-property_id" data-rule="required" data-source="property/index" class="form-control selectpage" name="row[property_id]" type="text" value="{$row.property_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Village_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-village_id" data-rule="required" data-source="village/index" class="form-control selectpage" name="row[village_id]" type="text" value="{$row.village_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Dong_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-dong_id" data-rule="required" data-source="dong/index" class="form-control selectpage" name="row[dong_id]" type="text" value="{$row.dong_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Danyuan_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-danyuan_id" data-rule="required" data-source="danyuan/index" class="form-control selectpage" name="row[danyuan_id]" type="text" value="{$row.danyuan_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Hu_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-hu_id" data-rule="required" data-source="hu/index" class="form-control selectpage" name="row[hu_id]" type="text" value="{$row.hu_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mid" data-rule="required" class="form-control" name="row[mid]" type="number" value="{$row.mid|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('True_price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-true_price" data-rule="required" class="form-control" step="0.01" name="row[true_price]" type="number" value="{$row.true_price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:$row.start_time?datetime($row.start_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:$row.end_time?datetime($row.end_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pay_time]" type="text" value="{:$row.pay_time?datetime($row.pay_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_status" class="form-control" name="row[pay_status]" type="number" value="{$row.pay_status|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="{$row.status|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Is_delete')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-is_delete" data-rule="required" class="form-control" name="row[is_delete]" type="number" value="{$row.is_delete|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mark')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mark" data-rule="required" class="form-control" name="row[mark]" type="text" value="{$row.mark|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 66 - 0
application/admin/view/cost/cost_print/index.html

@@ -0,0 +1,66 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        缴费日期:{$row.pay_date}
+                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+                        业主:{$row.hu.usesr_name}
+                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+                        房产:{$row.village.name}{$row.dong.name}{$row.danyuan.name}{$row.hu.name}
+                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+                        应缴金额:{$row.true_price}元
+                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+                        <span style="float: right">凭证编号:{$row.order_number}</span>
+<!--                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>-->
+<!--                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('cost/cost_print/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('cost/cost_print/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('cost/cost_print/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('cost/cost_print/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>-->
+
+<!--                        <div class="dropdown btn-group {:$auth->check('cost/cost_print/multi')?'':'hide'}">-->
+<!--                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
+<!--                            <ul class="dropdown-menu text-left" role="menu">-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->
+<!--                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->
+<!--                            </ul>-->
+<!--                        </div>-->
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('cost/cost_print/edit')}" 
+                           data-operate-del="{:$auth->check('cost/cost_print/del')}"
+                           data-pagination="false"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>
+<input id="btnPrint" type="button" value="打印"onclick="javascript:window.print();" />
+<input id="btnPrint" type="button" value="打印预览" onclick="preview(1)"/>
+
+<script>
+    function preview(oper)
+    {
+        if (oper <10)
+        {
+            bdhtml=window.document.body.innerHTML;//获取当前页的html代码
+            sprnstr="<!–startprint"+oper+"–>";//设置打印開始区域
+            eprnstr="<!–endprint"+oper+"–>";//设置打印结束区域
+            prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18);//从開始代码向后取html
+            prnhtmlprnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html
+            window.document.body.innerHTML=prnhtml;
+            window.print();
+            window.document.body.innerHTML=bdhtml;
+        } else {
+            window.print();
+        }
+    }
+</script>

+ 1 - 1
public/assets/js/backend/cost/cost_bill.js

@@ -46,7 +46,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
                         //{field: 'dong.name', title: __('楼宇')},
 
-
+                        {field: 'dong.name', title: __('楼宇'),operate:false},
 
 
                         {field: 'danyuan.name', title: __('单元'),operate:false},

+ 1 - 1
public/assets/js/backend/cost/cost_bill_auto.js

@@ -49,7 +49,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
 
 
-
+                        {field: 'dong.name', title: __('楼宇'),operate:false},
                         {field: 'danyuan.name', title: __('单元'),operate:false},
                         {field: 'hu.name', title: __('房产'),operate:false},
                         {field: 'hu.usesr_name', title: __('业主'),operate:'LIKE'},

+ 27 - 2
public/assets/js/backend/cost/cost_bill_paid.js

@@ -68,7 +68,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
 
 
-
+                        {field: 'dong.name', title: __('楼宇'),operate:false},
                         {field: 'danyuan.name', title: __('单元'),operate:false},
                         {field: 'hu.name', title: __('房产'),operate:false},
                         {field: 'hu.usesr_name', title: __('业主'),operate:'LIKE'},
@@ -81,7 +81,32 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
                         // {field: 'status', title: __('Status')},
                         // {field: 'is_delete', title: __('Is_delete')},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                        {field: 'operate', title: __('Operate'), table: table,
+                            buttons: [
+                                {
+                                    name: 'detail',
+                                    text: __('账单打印'),
+                                    title: '账单打印',
+                                    classname: 'btn btn-xs btn-success btn-dialog',
+                                    icon: 'fa fa-list',
+                                    url: function(row){
+                                        return 'cost/cost_print/index?bill_id='+row.id;
+                                    },
+                                  //  dropdown:'更多操作',
+                                    callback: function (data) {
+
+                                        Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
+                                    },
+                                    visible: function (row) {
+                                        //返回true时按钮显示,返回false隐藏
+                                        return true;
+                                    }
+                                }
+                            ],
+
+
+                            events: Table.api.events.operate, formatter: Table.api.formatter.operate
+                        }
                     ]
                 ]
             });

+ 91 - 0
public/assets/js/backend/cost/cost_print.js

@@ -0,0 +1,91 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'cost/cost_print/index' + location.search,
+                    add_url: 'cost/cost_print/add',
+                  //  edit_url: 'cost/cost_print/edit',
+                  //  del_url: 'cost/cost_print/del',
+                    multi_url: 'cost/cost_print/multi',
+                    table: 'cost_bill',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                search:false,
+                showToggle: false,
+                showColumns: false,
+                visible: false,
+                showExport: false,
+                commonSearch: false,
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('序号'),operate:false},
+                        //  {field: 'item_id', title: __('Item_id')},
+                        {field: 'item.item', title: __('项目'),   formatter: function (value, row, index) {
+                                //return row.village.name;
+                                if(row.item_id=='1'){
+                                    return '水费';
+                                }else{
+                                    if (row.item_id=='2'){
+                                        return '电费';
+                                    }else{
+                                        if(row.item.item=='1'){
+                                            return '物业费';
+                                        }
+                                        if(row.item.item=='1'){
+                                            return '垃圾处理费';
+                                        }
+                                        if(row.item.item=='1'){
+                                            return '停车费';
+                                        }
+                                    }
+                                }
+
+
+                            },operate:false},
+                        // {field: 'property_id', title: __('Property_id')},
+
+                        {field: 'start_time_text', title: __('缴费周期'), operate:false,formatter:function(value,row){return row.start_time_text + "~" + row.end_time_text; }},
+
+
+
+                        {field: 'price', title: __('金额'),operate:false},
+
+
+
+
+                        {field: 'true_price', title: __('实收'),operate:false},
+
+                        // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

binární
~$后台操作文档.docx