userordermoneysum.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. Table.api.init({
  5. extend: {
  6. index_url: 'auth/userordermoneysum/index/ids/' + Config.id+'/pay/'+Config.pay,
  7. },
  8. search: false,
  9. commonSearch: false,
  10. searchFormVisible: false
  11. });
  12. var table = $("#table");
  13. // 初始化表格
  14. table.bootstrapTable({
  15. url: $.fn.bootstrapTable.defaults.extend.index_url,
  16. pk: 'id',
  17. sortName: 'id',
  18. columns: [Controller.api.showColumns()]
  19. });
  20. Table.api.bindevent(table);
  21. },
  22. api: {
  23. bindevent: function () {
  24. Form.api.bindevent($("form[role=form]"));
  25. },
  26. formatter: {
  27. formateOrderType: function (value, row, index) {
  28. if(row.type == '1'){
  29. return '书币充值';
  30. }else{
  31. return 'VIP充值';
  32. }
  33. },
  34. formateOrderState: function (value, row, index) {
  35. if(row.state == '1'){
  36. return '已支付';
  37. }else{
  38. return '未支付';
  39. }
  40. },
  41. formateBusinessLine: function (value, row, index) {
  42. if(row.business_line == '1'){
  43. return '客户端';
  44. }else{
  45. return '分销站';
  46. }
  47. },
  48. formateFinishtime:function (value, row, index) {
  49. if(row.finishtime != '0'){
  50. return row.finishtime_text;
  51. }else{
  52. return '-';
  53. }
  54. }
  55. },
  56. showColumns: function () {
  57. var cols = new Array();
  58. cols.push({field: 'out_trade_no', title: __('商户单号'), operate: false});
  59. cols.push({field: 'transaction_id', title: __('交易单号'), operate: false});
  60. cols.push({field: 'type', title: __('订单类型'), operate: false, formatter: Controller.api.formatter.formateOrderType});
  61. cols.push({field: 'money', title: __('总额'), operate: false});
  62. cols.push({field: 'state', title: __('订单状态'), operate: false,formatter: Controller.api.formatter.formateOrderState});
  63. if (Config.isShowBusinessLine == true) {
  64. cols.push({field: 'business_line', title: __('来源'), operate: false,formatter: Controller.api.formatter.formateBusinessLine});
  65. }
  66. cols.push({field: 'createtime', title: __('下单时间'), operate: false});
  67. cols.push({field: 'finishtime', title: __('完成时间'), operate: false, formatter: Controller.api.formatter.formateFinishtime});
  68. return cols;
  69. }
  70. }
  71. };
  72. return Controller;
  73. });