define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'order/jingdong/index' + location.search, add_url: 'order/jingdong/add', edit_url: 'order/jingdong/edit', del_url: 'order/jingdong/del', multi_url: 'order/jingdong/multi', import_url: 'order/jingdong/import', table: 'order_jingdong', } }); 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: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, {field: 'order_id', title: __('Order_id'), operate: 'LIKE'}, {field: 'sku_name', title: __('Sku_name'), operate: 'LIKE'}, {field: 'image_url', title: __('Image_url'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'sku_num', title: __('Sku_num')}, {field: 'actual_cos_price', title: __('Actual_cos_price'), operate:'BETWEEN'}, {field: 'commission_rate', title: __('Commission_rate'), operate: 'LIKE'}, {field: 'estimate_fee', title: __('Estimate_fee'), operate:'BETWEEN'}, {field: 'valid_code', title: __('Valid_code'), searchList: {"-1":"未知", "2":"无效-拆单","3":"无效-取消", "4":"无效-京东帮帮主订单", "5":"无效-账号异常", "6":"无效-赠品类目不返佣", "7":"无效-校园订单","8":"无效-企业订单", "9":"无效-团购订单", "10":"无效-开增值税专用发票订单", "11":"无效-乡村推广员下单", "12":"无效-自己推广自己下单", "13":"无效-违规订单", "14":"无效-来源与备案网址不符", "15":"待付款", "16":"已付款", "17":"已完成", "18":"已结算"}, formatter: Table.api.formatter.status}, {field: 'position_id', title: __('Position_id'), operate: 'LIKE'}, {field: 'order_time', title: __('Order_time'), operate: 'BETWEEN', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD"'}, {field: 'order_row_id', title: __('Order_row_id'), operate: 'LIKE'}, ] ] }); // 为表格绑定事件 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; });