define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'selectpage'], function ($, undefined, Backend, Table, Form, Selectpage) { require(['layui'], function(undefined){ layui.use('element', function(){ var element = layui.element; console.log(element); }); }); var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'remote/remote/index' + location.search, table: 'remote_application', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'req_date_time', showToggle: false, showColumns: false, showExport: false, pageList: [10, 15, 25, 50], columns: [ [ {field: 'name', title: __('Name'), operate: 'LIKE %...%'}, {field: 'sex', title: __('Sex'), searchable: false}, {field: 'age', title: __('Age'), operate: 'BETWEEN'}, {field: 'req_doctor_name', title: __('Req_doctor_name')}, {field: 'local_institution_id', title: __('Local_institution_name'), visible: false}, {field: 'local_institution_name', title: __('Local_institution_name'), searchable: false}, {field: 'remote_doctor_name', title: __('Remote_doctor_name')}, {field: 'remote_institution_id', title: __('Remote_institution_name'), visible: false}, {field: 'remote_institution_name', title: __('Remote_institution_name'), searchable: false}, {field: 'report_status', title: __('Report_status'), align: 'left', width: '10%', formatter: Table.api.formatter.normal, custom: {2:'info',3:'info',4:'info',5:'danger',6:'info',7:'info',8:'info',9:'info',10:'info',11:'danger', }, searchList: { 2 : '获取完善病例资料', 3 : '完善病例资料保存继续', 4 : '选择医院发起申请', 5 : '驳回申请', 6 : '接收申请', 7 : '书写报告', 8 : '审核报告', 9 : '最终完成报告', 10 : '确认报告', 11 : '撤回报告', 12 : '撤回', },}, {field: 'req_date_time', title: __('Req_date_time'), operate:'RANGE', addclass:'datetimerange', sortable: true}, { field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate, buttons: [ { name: 'detail', title: __('查看进度'), classname: 'btn btn-xs btn-primary btn-dialog', icon: 'fa fa-list', url: 'remote/remote/schedule', extend: 'data-area = \'["90%", "500px"]\'', callback: function (data) { Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"}); } } ], } ] ] }); $.ajax({ url: 'institution/institution/institutionSelectList', type: 'post', dataType: 'json', success: function success(res) { let data = res.rows; $('#local_institution_id').selectPage({ data : data, orderBy: 'index' }); $('#remote_institution_id').selectPage({ data : data, orderBy: 'index' }); } }); // 为表格绑定事件 Table.api.bindevent(table); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; return Controller; });