maintainbaojia.js 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. // 初始化表格参数配置
  5. Table.api.init({
  6. extend: {
  7. index_url: 'maintainbaojia/index' + location.search,
  8. add_url: 'maintainbaojia/add',
  9. edit_url: 'maintainbaojia/edit',
  10. del_url: 'maintainbaojia/del',
  11. multi_url: 'maintainbaojia/multi',
  12. import_url: 'maintainbaojia/import',
  13. table: 'maintain_baojia',
  14. }
  15. });
  16. var table = $("#table");
  17. // 初始化表格
  18. table.bootstrapTable({
  19. url: $.fn.bootstrapTable.defaults.extend.index_url,
  20. pk: 'id',
  21. sortName: 'id',
  22. // fixedColumns: true,
  23. // fixedRightNumber: 1,
  24. columns: [
  25. [
  26. {checkbox: true},
  27. {field: 'id', title: __('Id')},
  28. {field: 'order_id', title: __('Order_id')},
  29. {field: 'maintain.orderno', title: __('Maintain.orderno'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  30. // {field: 'company_id', title: __('Company_id')},
  31. // {field: 'company.companyname', title: __('Company.companyname'), operate: 'LIKE'},
  32. // {field: 'user_id', title: __('User_id')},
  33. // {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
  34. // {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
  35. {field: 'baojia_staffid', title: __('Baojia_staffid')},
  36. {field: 'admina.username', title: __('Admina.username'), operate: 'LIKE'},
  37. {field: 'admina.nickname', title: __('Admina.nickname'), operate: 'LIKE'},
  38. // {field: 'admina.mobile', title: __('Admina.mobile'), operate: 'LIKE'},
  39. {field: 'baojia_time', title: __('Baojia_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  40. {field: 'baojia_filename', title: __('Baojia_filename'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  41. {field: 'baojia_file', title: __('Baojia_file'), operate: false, formatter: Table.api.formatter.file},
  42. {field: 'status', title: __('Status'), searchList: {"20":__('Status 20'),"22":__('Status 22'),"30":__('Status 30'),"40":__('Status 40')}, formatter: Table.api.formatter.status},
  43. {field: 'baojia_audit_staffid', title: __('Baojia_audit_staffid')},
  44. {field: 'adminb.username', title: __('Adminb.username'), operate: 'LIKE'},
  45. {field: 'adminb.nickname', title: __('Adminb.nickname'), operate: 'LIKE'},
  46. // {field: 'adminb.mobile', title: __('Adminb.mobile'), operate: 'LIKE'},
  47. {field: 'baojia_audit_time', title: __('Baojia_audit_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  48. {field: 'baojia_audit_reason', title: __('Baojia_audit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  49. // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  50. {field: 'baojia_useraudit_time', title: __('Baojia_useraudit_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  51. // {field: 'baojia_useraudit_reason', title: __('Baojia_useraudit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  52. // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  53. ]
  54. ]
  55. });
  56. // 为表格绑定事件
  57. Table.api.bindevent(table);
  58. },
  59. add: function () {
  60. Controller.api.bindevent();
  61. },
  62. edit: function () {
  63. Controller.api.bindevent();
  64. },
  65. api: {
  66. bindevent: function () {
  67. Form.api.bindevent($("form[role=form]"));
  68. }
  69. }
  70. };
  71. return Controller;
  72. });