酒店预订平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

72 lines
3.7 KiB

  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: 'purchase/index' + location.search,
  8. add_url: 'purchase/add',
  9. edit_url: 'purchase/edit',
  10. del_url: 'purchase/del',
  11. multi_url: 'purchase/multi',
  12. import_url: 'purchase/import',
  13. table: 'purchase',
  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: 'del_flag', title: __('Del_flag'), formatter: Table.api.formatter.flag},
  27. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  28. {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  29. {field: 'order_id', title: __('Order_id')},
  30. {field: 'prod_type', title: __('Prod_type'), operate: 'LIKE'},
  31. {field: 'order_detail_id', title: __('Order_detail_id')},
  32. {field: 'group_id', title: __('Group_id')},
  33. {field: 'pro_name', title: __('Pro_name'), operate: 'LIKE'},
  34. {field: 'item_name', title: __('Item_name'), operate: 'LIKE'},
  35. {field: 'item_unit', title: __('Item_unit'), operate: 'LIKE'},
  36. {field: 'check_in_date', title: __('Check_in_date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  37. {field: 'check_out_date', title: __('Check_out_date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  38. {field: 'count', title: __('Count')},
  39. {field: 'total_price', title: __('Total_price'), operate:'BETWEEN'},
  40. {field: 'supplier_name', title: __('Supplier_name'), operate: 'LIKE'},
  41. {field: 'total_cost', title: __('Total_cost'), operate:'BETWEEN'},
  42. {field: 'profit', title: __('Profit'), operate:'BETWEEN'},
  43. {field: 'receipt_status', title: __('Receipt_status')},
  44. {field: 'receipt_id', title: __('Receipt_id')},
  45. {field: 'pay_status', title: __('Pay_status')},
  46. {field: 'payment_id', title: __('Payment_id')},
  47. {field: 'purchase_user_id', title: __('Purchase_user_id')},
  48. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  49. ]
  50. ]
  51. });
  52. // 为表格绑定事件
  53. Table.api.bindevent(table);
  54. },
  55. add: function () {
  56. Controller.api.bindevent();
  57. },
  58. edit: function () {
  59. Controller.api.bindevent();
  60. },
  61. api: {
  62. bindevent: function () {
  63. Form.api.bindevent($("form[role=form]"));
  64. }
  65. }
  66. };
  67. return Controller;
  68. });