define(['jquery', 'bootstrap', 'backend', 'table', 'form','selectpage'], function ($, undefined, Backend, Table, Form,Selectpage) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'statistics/finance/index' + location.search, table: 'exams', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', pagination:false, columns: [ [ {checkbox: true}, {field: 'time', title: '日期', addclass: 'datetimerange', data: 'data-date-format="YYYY-MM-DD" autocomplete="off"',visible: false}, {field: 'name', title:'医院',searchable:false}, {field: 'institution_id', title:'医院',visible: false}, {field: 'count', title:'检查数',searchable:false}, {field: 'exam_class', title:'检查类型',searchable:false}, {field: 'remote', title:'远程发起数量',searchable:false}, {field: 'pay_status', title:'付费情况',searchList: { 1 : '已收费' },formatter: Controller.api.pay_status} ] ] }); // 为表格绑定事件 Table.api.bindevent(table); $.ajax({ url: 'institution/institution/institutionSelectList', type: 'post', dataType: 'json', success: function success(res) { let data = res.rows; $('#institution_id').selectPage({ data : data, orderBy: 'index' }); } }); }, add: function () { Controller.api.bindevent(); }, edit: function () { Controller.api.bindevent(); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); }, pay_status: function (value) { switch (value) { case '0': return "未付费"; case '1': return "已付费"; default: return ''; } } } }; return Controller; });