|
@@ -0,0 +1,76 @@
|
|
|
+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: 'company_id', title: __('Company_id')},
|
|
|
+ {field: 'user_id', title: __('User_id')},
|
|
|
+ {field: 'baojia_staffid', title: __('Baojia_staffid')},
|
|
|
+ {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: '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: 'maintain.orderno', title: __('Maintain.orderno'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
+ {field: 'company.companyname', title: __('Company.companyname'), operate: 'LIKE'},
|
|
|
+ {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
|
|
+ {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
|
|
|
+ {field: 'admin.username', title: __('Admin.username'), operate: 'LIKE'},
|
|
|
+ {field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
|
|
+ {field: 'admin.mobile', title: __('Admin.mobile'), operate: 'LIKE'},
|
|
|
+ {field: 'admin.username', title: __('Admin.username'), operate: 'LIKE'},
|
|
|
+ {field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
|
|
+ {field: 'admin.mobile', title: __('Admin.mobile'), operate: 'LIKE'},
|
|
|
+ {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;
|
|
|
+});
|