project_donation_order.js 5.2 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: 'project/project_donation_order/index' + location.search,
  8. add_url: 'project/project_donation_order/add',
  9. edit_url: 'project/project_donation_order/edit',
  10. del_url: 'project/project_donation_order/del',
  11. multi_url: 'project/project_donation_order/multi',
  12. import_url: 'project/project_donation_order/import',
  13. table: 'project_donation_order',
  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. columns: [
  23. [
  24. {checkbox: true},
  25. {field: 'id', title: __('Id')},
  26. {field: 'cid', title: __('Cid')},
  27. {field: 'uid', title: __('Uid')},
  28. {field: 'name', title: __('Name'), operate: 'LIKE'},
  29. {field: 'project_id', title: __('Project_id')},
  30. {field: 'project_user_id', title: __('Project_user_id')},
  31. {field: 'total_num', title: __('Total_num')},
  32. {field: 'order_sn', title: __('Order_sn'), operate: 'LIKE'},
  33. {field: 'order_status', title: __('Order_status'), searchList: {"0":__('Order_status 0'),"1":__('Order_status 1'),"-1":__('Order_status -1'),"2":__('Order_status 2'),"3":__('Order_status 3'),"4":__('Order_status 4'),"5":__('Order_status 5'),"6":__('Order_status 6')}, formatter: Table.api.formatter.status},
  34. {field: 'add_time', title: __('Add_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  35. {field: 'delivery_name', title: __('Delivery_name'), operate: 'LIKE'},
  36. {field: 'delivery_id', title: __('Delivery_id'), operate: 'LIKE'},
  37. {field: 'delivery_time', title: __('Delivery_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  38. {field: 'verify_time', title: __('Verify_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  39. {field: 'verify_admin', title: __('Verify_admin')},
  40. {field: 'verify_remark', title: __('Verify_remark'), operate: 'LIKE'},
  41. {field: 'receiving_admin', title: __('Receiving_admin')},
  42. {field: 'receiving_time', title: __('Receiving_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  43. {field: 'receiving_remark', title: __('Receiving_remark'), operate: 'LIKE'},
  44. {field: 'matter', title: __('Matter'), operate: 'LIKE'},
  45. {field: 'qc', title: __('Qc'), operate: 'LIKE'},
  46. {field: 'worth', title: __('Worth'), operate: 'LIKE'},
  47. {field: 'total_amount', title: __('Total_amount'), operate:'BETWEEN'},
  48. {field: 'logistics', title: __('Logistics'), operate: 'LIKE'},
  49. {field: 'feedback', title: __('Feedback'), operate: 'LIKE'},
  50. {field: 'feedback_admin', title: __('Feedback_admin')},
  51. {field: 'feedback_time', title: __('Feedback_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  52. {field: 'out_delivery_admin', title: __('Out_delivery_admin')},
  53. {field: 'out_delivery_time', title: __('Out_delivery_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  54. {field: 'out_delivery_remark', title: __('Out_delivery_remark'), operate: 'LIKE'},
  55. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  56. ]
  57. ]
  58. });
  59. // 为表格绑定事件
  60. Table.api.bindevent(table);
  61. },
  62. add: function () {
  63. $("#c-project_id").data("params", function (obj) {
  64. return {custom: {cid: $("#c-cid").val()}};
  65. });
  66. Controller.api.bindevent();
  67. },
  68. edit: function () {
  69. $("#c-project_id").data("params", function (obj) {
  70. return {custom: {cid: $("#c-cid").val()}};
  71. });
  72. Controller.api.bindevent();
  73. },
  74. api: {
  75. bindevent: function () {
  76. Form.api.bindevent($("form[role=form]"));
  77. }
  78. }
  79. };
  80. return Controller;
  81. });