| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'trade/money_out/index' + location.search,
- table: 'money_out',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'order_type', title: __("Order_type"),
- searchList: {1:__('Usdt'), 2:__('Bank')},
- formatter: Table.api.formatter.status
- },
- {field: 'users.mobile', title: __('User_id')},
- {field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'bank_name', title: __('Bank_name'), operate: 'LIKE'},
- {field: 'bank_card', title: __('Bank_card'), operate: 'LIKE'},
- {field: 'account_name', title: __('Account_name'), operate: 'LIKE'},
- {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
- {field: 'fee', title: __('Fee'), operate:'BETWEEN'},
- {field: 'real_amount', title: __('Real_amount'), operate:'BETWEEN'},
- {field: 'status', title: __('Status')},
- {field: 'status', title: __("Status"),
- searchList: {0:__('Pending'), 1:__('Success'), 2:__('Fail')},
- formatter: Table.api.formatter.status
- },
- {field: 'admins.nickname', title: __('Admin_id')},
- {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'operate', title: __('Operate'),
- table: table,
- buttons: [{
- name: "operate",
- text: __('Success'),
- classname: 'btn btn-xs btn-success btn-magic btn-ajax',
- confirm: __('Confirm review'),
- url: 'trade/money_out/review/status/1',
- visible: function (row) {
- if(row.status == 0) return true;
- return false;
- },
- refresh: true
- },
- {
- name: "operate",
- text: __('Fail'),
- classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
- confirm: __('Confirm review'),
- url: 'trade/money_out/review/status/2',
- visible: function (row) {
- if(row.status == 0) return true;
- return false;
- },
- refresh: true
- }],
- events: Table.api.events.operate, formatter: Table.api.formatter.operate
- }
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- //绑定TAB事件
- $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
- var typeStr = $(this).attr("href").replace('#', '');
- var options = table.bootstrapTable('getOptions');
- options.pageNumber = 1;
- options.queryParams = function (params) {
- params.order_type = typeStr;
- return params;
- };
- table.bootstrapTable('refresh', {});
- return false;
- });
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|