| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'profit/bill/index' + location.search,
- edit_url: 'profit/bill/edit',
- multi_url: 'profit/bill/multi',
- import_url: 'profit/bill/import',
- table: 'profit_bill',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {
- field: 'identity_type',
- title: __('Identity_type'),
- searchList: {
- "platform": __('Platform'),
- "agency": __('Agency'),
- "store": __('Store'),
- "massager": __('Massager'),
- "user": __("用户")
- },
- formatter: Table.api.formatter.normal
- },
- {field: 'target_id', title: __('Target_id')},
- {field: 'target_name', title: __('Target_name'), operate: 'LIKE'},
- {
- field: 'change_type',
- title: __('Change_type'),
- searchList: {
- "profit": __('Profit'),
- "drawings": __('Drawings'),
- "closing_expend": "结算支出",
- "closing_income": "结算收入",
- "channel_expend": "渠道支出",
- "channel_income": "渠道收入"
- },
- formatter: Table.api.formatter.normal
- },
- {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
- {field: 'total_amount', title: __('Total_amount'), operate: 'BETWEEN'},
- {field: 'rate', title: __('Rate'), operate: 'BETWEEN'},
- {field: 'change', title: __('Change'), operate: 'BETWEEN'},
- {field: 'before', title: __('Before'), operate: 'BETWEEN'},
- {field: 'after', title: __('After'), operate: 'BETWEEN'},
- {
- field: 'createtime',
- title: __('Createtime'),
- operate: 'RANGE',
- addclass: 'datetimerange',
- autocomplete: false,
- formatter: Table.api.formatter.datetime
- },
- {
- field: 'city_code',
- title: __('区域'),
- searchList: Config.allow_areas,
- visible: false
- },
- {
- field: 'operate',
- title: __('Operate'),
- table: table,
- events: Table.api.events.operate,
- formatter: Table.api.formatter.operate
- }
- ]
- ]
- });
- // 为表格绑定事件
- 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;
- });
|