| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'massager/visa/index' + location.search,
- multi_url: 'massager/visa/multi',
- import_url: 'massager/visa/import',
- table: 'massager_visa',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'massager_id', title: __('Massager_id')},
- {field: 'massager.name', title: __('Massager.name'), operate: 'LIKE'},
- {field: 'old_area_name', title: __('Old_area_code')},
- {field: 'new_area_name', title: __('New_area_code')},
- {field: 'description', title: __('Description'), operate: 'LIKE'},
- {
- field: 'status',
- title: __('Status'),
- searchList: {"default": __('Default'), "reject": __('Reject'), "pass": __('Pass')},
- formatter: Table.api.formatter.status
- },
- {
- field: 'updatetime',
- title: __('Updatetime'),
- operate: 'RANGE',
- addclass: 'datetimerange',
- autocomplete: false,
- formatter: Table.api.formatter.datetime
- },
- {
- field: 'operate',
- title: __('Operate'),
- table: table,
- buttons:[
- {
- name: 'check_pass',
- text: '',
- title: '通过审核',
- classname: 'btn btn-xs btn-success btn-view btn-ajax',
- icon: 'fa fa-check',
- url: 'massager/visa/check?id={id}&check=pass',
- visible: function (row) {
- return "default" === row["status"];
- },
- refresh: true
- },
- {
- name: 'check_reject',
- text: '',
- title: '拒绝审核',
- classname: 'btn btn-xs btn-warning btn-view btn-ajax',
- icon: 'fa fa-times',
- url: 'massager/visa/check?id={id}&check=reject',
- visible: function (row) {
- return "default" === row["status"];
- },
- refresh: true
- },
- ],
- 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;
- });
|