|
|
@@ -0,0 +1,59 @@
|
|
|
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
+
|
|
|
+ var Controller = {
|
|
|
+ index: function () {
|
|
|
+ // 初始化表格参数配置
|
|
|
+ Table.api.init({
|
|
|
+ extend: {
|
|
|
+ index_url: 'ledger/ledger_teac_ecoly_change/index' + location.search,
|
|
|
+
|
|
|
+ multi_url: 'ledger/ledger_teac_ecoly_change/multi',
|
|
|
+ import_url: 'ledger/ledger_teac_ecoly_change/import',
|
|
|
+ table: 'ledger_teac_ecoly_change',
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var table = $("#table");
|
|
|
+
|
|
|
+ // 初始化表格
|
|
|
+ table.bootstrapTable({
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
+ pk: 'id',
|
|
|
+ sortName: 'id',
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ {checkbox: true},
|
|
|
+ {field: 'id', title: '编号'},
|
|
|
+ {field: 'user_id', title: '用户ID'},
|
|
|
+ {field: 'address', title: '用户地址'},
|
|
|
+ {
|
|
|
+ field: 'action', title: '账变类型', searchList: {
|
|
|
+ '0': 'TeaC·生态发展划转',
|
|
|
+ '1': '',
|
|
|
+
|
|
|
+ }, operate: 'FIND_IN_SET', formatter: Table.api.formatter.label
|
|
|
+ },
|
|
|
+ {field: 'change_amount', title: '变动金额', operate:'BETWEEN'},
|
|
|
+ {field: 'present_amount', title: '实时余额', operate:'BETWEEN'},
|
|
|
+ {field: 'from_id', title: '来源ID'},
|
|
|
+ {field: 'create_time', title: '变动时间', operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ // 为表格绑定事件
|
|
|
+ Table.api.bindevent(table);
|
|
|
+ },
|
|
|
+ add: function () {
|
|
|
+ Controller.api.bindevent();
|
|
|
+ },
|
|
|
+ edit: function () {
|
|
|
+ Controller.api.bindevent();
|
|
|
+ },
|
|
|
+ api: {
|
|
|
+ bindevent: function () {
|
|
|
+ Form.api.bindevent($("form[role=form]"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return Controller;
|
|
|
+});
|