12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'maintainbaojia/index' + location.search,
- add_url: 'maintainbaojia/add',
- edit_url: 'maintainbaojia/edit',
- del_url: 'maintainbaojia/del',
- multi_url: 'maintainbaojia/multi',
- import_url: 'maintainbaojia/import',
- table: 'maintain_baojia',
- }
- });
- 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: 'order_id', title: __('Order_id')},
- {field: 'maintain.orderno', title: __('Maintain.orderno'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- // {field: 'company_id', title: __('Company_id')},
- // {field: 'company.companyname', title: __('Company.companyname'), operate: 'LIKE'},
- // {field: 'user_id', title: __('User_id')},
- // {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
- // {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
- {field: 'baojia_staffid', title: __('Baojia_staffid')},
- {field: 'admina.username', title: __('Admina.username'), operate: 'LIKE'},
- {field: 'admina.nickname', title: __('Admina.nickname'), operate: 'LIKE'},
- // {field: 'admina.mobile', title: __('Admina.mobile'), operate: 'LIKE'},
- {field: 'baojia_time', title: __('Baojia_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'baojia_filename', title: __('Baojia_filename'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'baojia_file', title: __('Baojia_file'), operate: false, formatter: Table.api.formatter.file},
- {field: 'status', title: __('Status'), searchList: {"20":__('Status 20'),"22":__('Status 22'),"30":__('Status 30'),"40":__('Status 40')}, formatter: Table.api.formatter.status},
- {field: 'baojia_audit_staffid', title: __('Baojia_audit_staffid')},
- {field: 'adminb.username', title: __('Adminb.username'), operate: 'LIKE'},
- {field: 'adminb.nickname', title: __('Adminb.nickname'), operate: 'LIKE'},
- // {field: 'adminb.mobile', title: __('Adminb.mobile'), operate: 'LIKE'},
- {field: 'baojia_audit_time', title: __('Baojia_audit_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'baojia_audit_reason', title: __('Baojia_audit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'baojia_useraudit_time', title: __('Baojia_useraudit_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- // {field: 'baojia_useraudit_reason', title: __('Baojia_useraudit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- // {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;
- });
|