orders.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: 'product/orders/index' + location.search+'&ids='+Config.ids,
  8. table: 'product_order',
  9. }
  10. });
  11. var table = $("#table");
  12. // 初始化表格
  13. table.bootstrapTable({
  14. url: $.fn.bootstrapTable.defaults.extend.index_url,
  15. pk: 'id',
  16. sortName: 'id',
  17. fixedColumns: false,
  18. columns: [
  19. [
  20. {checkbox: true},
  21. {field: 'user_id', title: __('用户Id'), operate: 'LIKE'},
  22. {field: 'users.address', title: __('用户地址'), operate: 'LIKE'},
  23. {field: 'total_num', title: __('持有数量'), operate: false},
  24. ]
  25. ]
  26. });
  27. // 为表格绑定事件
  28. Table.api.bindevent(table);
  29. },
  30. api: {
  31. bindevent: function () {
  32. Form.api.bindevent($("form[role=form]"));
  33. }
  34. }
  35. };
  36. return Controller;
  37. });