| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'agency/index' + location.search,
- // add_url: 'agency/add',
- edit_url: 'agency/edit',
- del_url: 'agency/del',
- multi_url: 'agency/multi',
- import_url: 'agency/import',
- table: 'agency',
- }
- });
- 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: 'name', title: __('Name'), operate: 'LIKE'},
- {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
- {field: 'id_card', title: __('Id_card'), operate: 'LIKE'},
- {field: 'id_card', title: __('Id_card'), operate: 'LIKE'},
- {field: 'budget', title: __('投资预算'), operate: 'LIKE'},
- {
- field: 'license_images',
- title: __('License_images'),
- operate: false,
- events: Table.api.events.image,
- formatter: Table.api.formatter.images
- },
- {
- field: 'status',
- title: __('Status'),
- searchList: {"process": __('Process'), "reject": __('Reject'), "allow": __('Allow')},
- 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: 'agency/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: 'agency/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;
- });
|