123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'order/goods/index' + location.search,
- add_url: 'order/goods/add',
- edit_url: 'order/goods/edit',
- del_url: 'order/goods/del',
- multi_url: 'order/goods/multi',
- import_url: 'order/goods/import',
- table: 'order_goods',
- }
- });
- 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_no', title: __('Order_no'), operate: 'LIKE'},
- {field: 'spu_id', title: __('Spu_id'), operate: 'LIKE'},
- {field: 'sku_id', title: __('Sku_id'), operate: 'LIKE'},
- {field: 'room_id', title: __('Room_id'), operate: 'LIKE'},
- {field: 'goods_main_type', title: __('Goods_main_type')},
- {field: 'goods_vice_type', title: __('Goods_vice_type')},
- {field: 'goods_name', title: __('Goods_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'goods_picture_url', title: __('Goods_picture_url'), operate: 'LIKE', formatter: Table.api.formatter.url},
- {field: 'origin_price', title: __('Origin_price'), operate:'BETWEEN'},
- {field: 'actual_price', title: __('Actual_price'), operate:'BETWEEN'},
- {field: 'buy_quantity', title: __('Buy_quantity')},
- {field: 'item_total_amount', title: __('Item_total_amount'), operate:'BETWEEN'},
- {field: 'item_discount_amount', title: __('Item_discount_amount'), operate:'BETWEEN'},
- {field: 'item_payment_amount', title: __('Item_payment_amount'), operate:'BETWEEN'},
- {field: 'goods_payment_price', title: __('Goods_payment_price'), operate:'BETWEEN'},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'orders.id', title: __('Orders.id')},
- {field: 'orders.user_id', title: __('Orders.user_id')},
- {field: 'orders.saas_id', title: __('Orders.saas_id'), operate: 'LIKE'},
- {field: 'orders.store_id', title: __('Orders.store_id'), operate: 'LIKE'},
- {field: 'orders.store_name', title: __('Orders.store_name'), operate: 'LIKE'},
- {field: 'orders.parent_order_no', title: __('Orders.parent_order_no'), operate: 'LIKE'},
- {field: 'orders.order_id', title: __('Orders.order_id'), operate: 'LIKE'},
- {field: 'orders.order_no', title: __('Orders.order_no'), operate: 'LIKE'},
- {field: 'orders.order_type', title: __('Orders.order_type')},
- {field: 'orders.order_sub_type', title: __('Orders.order_sub_type')},
- {field: 'orders.order_status', title: __('Orders.order_status')},
- {field: 'orders.order_sub_status', title: __('Orders.order_sub_status')},
- {field: 'orders.total_amount', title: __('Orders.total_amount'), operate:'BETWEEN'},
- {field: 'orders.goods_amount', title: __('Orders.goods_amount'), operate:'BETWEEN'},
- {field: 'orders.goods_amount_app', title: __('Orders.goods_amount_app'), operate:'BETWEEN'},
- {field: 'orders.payment_amount', title: __('Orders.payment_amount'), operate:'BETWEEN'},
- {field: 'orders.freight_fee', title: __('Orders.freight_fee'), operate:'BETWEEN'},
- {field: 'orders.package_fee', title: __('Orders.package_fee'), operate:'BETWEEN'},
- {field: 'orders.discount_amount', title: __('Orders.discount_amount'), operate:'BETWEEN'},
- {field: 'orders.channel_type', title: __('Orders.channel_type')},
- {field: 'orders.channel_source', title: __('Orders.channel_source'), operate: 'LIKE'},
- {field: 'orders.channel_identity', title: __('Orders.channel_identity'), operate: 'LIKE'},
- {field: 'orders.remark', title: __('Orders.remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'orders.cancel_type', title: __('Orders.cancel_type')},
- {field: 'orders.cancel_reason_type', title: __('Orders.cancel_reason_type')},
- {field: 'orders.cancel_reason', title: __('Orders.cancel_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'orders.rights_type', title: __('Orders.rights_type')},
- {field: 'orders.auto_cancel_time', title: __('Orders.auto_cancel_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'orders.order_status_remark', title: __('Orders.order_status_remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'orders.createtime', title: __('Orders.createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'orders.updatetime', title: __('Orders.updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {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;
- });
|