orders.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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: 'user/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. columns: [
  18. [
  19. {checkbox: true},
  20. {field: 'product_id', title: __('产品Id')},
  21. {field: 'products.zh_name', title: __('产品名称'), operate: 'LIKE'},
  22. {field: 'total_num', title: __('持有数量')},
  23. ]
  24. ]
  25. });
  26. // 为表格绑定事件
  27. Table.api.bindevent(table);
  28. },
  29. api: {
  30. bindevent: function () {
  31. Form.api.bindevent($("form[role=form]"));
  32. }
  33. }
  34. };
  35. return Controller;
  36. });