1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- Table.api.init({
- extend: {
- index_url: 'auth/userordermoneysum/index/ids/' + Config.id+'/pay/'+Config.pay,
- },
- search: false,
- commonSearch: false,
- searchFormVisible: false
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [Controller.api.showColumns()]
- });
- Table.api.bindevent(table);
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- },
- formatter: {
- formateOrderType: function (value, row, index) {
- if(row.type == '1'){
- return '书币充值';
- }else{
- return 'VIP充值';
- }
- },
- formateOrderState: function (value, row, index) {
- if(row.state == '1'){
- return '已支付';
- }else{
- return '未支付';
- }
- },
- formateBusinessLine: function (value, row, index) {
- if(row.business_line == '1'){
- return '客户端';
- }else{
- return '分销站';
- }
- },
- formateFinishtime:function (value, row, index) {
- if(row.finishtime != '0'){
- return row.finishtime_text;
- }else{
- return '-';
- }
- }
- },
- showColumns: function () {
- var cols = new Array();
- cols.push({field: 'out_trade_no', title: __('商户单号'), operate: false});
- cols.push({field: 'transaction_id', title: __('交易单号'), operate: false});
- cols.push({field: 'type', title: __('订单类型'), operate: false, formatter: Controller.api.formatter.formateOrderType});
- cols.push({field: 'money', title: __('总额'), operate: false});
- cols.push({field: 'state', title: __('订单状态'), operate: false,formatter: Controller.api.formatter.formateOrderState});
- if (Config.isShowBusinessLine == true) {
- cols.push({field: 'business_line', title: __('来源'), operate: false,formatter: Controller.api.formatter.formateBusinessLine});
- }
- cols.push({field: 'createtime', title: __('下单时间'), operate: false});
- cols.push({field: 'finishtime', title: __('完成时间'), operate: false, formatter: Controller.api.formatter.formateFinishtime});
- return cols;
- }
- }
- };
- return Controller;
- });
|