|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
|
|
var Controller = {
|
|
|
index: function () {
|
|
|
// 初始化表格参数配置
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
|
index_url: 'order_detail/index' + location.search,
|
|
|
del_url: 'order_detail/del',
|
|
|
detail_url: 'order_detail/detail',
|
|
|
send_url: 'order_detail/send',
|
|
|
refund_url: 'order_detail/refund',
|
|
|
table: 'order_detail',
|
|
|
}
|
|
|
});
|
|
|
|
|
|
var table = $("#table");
|
|
|
|
|
|
// 初始化表格
|
|
|
table.bootstrapTable({
|
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
pk: 'id',
|
|
|
sortName: 'id',
|
|
|
columns: [
|
|
|
[
|
|
|
{checkbox: true},
|
|
|
{field: 'id', title: __('Id')},
|
|
|
{field: 'user_id', title: __('User_id')},
|
|
|
{field: 'user.nickname', title: __('User.nickname')},
|
|
|
{field: 'store.name', title: __('Store.name')},
|
|
|
{field: 'num', title: __('Num')},
|
|
|
{field: 'pay_type', title: __('Pay_type'), searchList: {"1":__('Pay_type 1'),"2":__('Pay_type 2'),"3":__('Pay_type 3')}, formatter: Table.api.formatter.normal},
|
|
|
{field: 'express', title: __('Express'), searchList: {"1":__('Express 1'),"2":__('Express 2'),"3":__('Express 3')}, formatter: Table.api.formatter.normal},
|
|
|
{field: 'total', title: __('Total'), operate:'BETWEEN'},
|
|
|
{field: 'goods_total', title: __('Goods_total'), operate:'BETWEEN'},
|
|
|
{field: 'postage_total', title: __('Postage_total'), operate:'BETWEEN'},
|
|
|
{field: 'name', title: __('Name')},
|
|
|
{field: 'mobile', title: __('Mobile')},
|
|
|
{field: 'province_name', title: __('Province_name')},
|
|
|
{field: 'city_name', title: __('City_name')},
|
|
|
{field: 'county_name', title: __('County_name')},
|
|
|
{field: 'address', title: __('Address')},
|
|
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
|
|
|
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
|
|
|
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"7":__('Status 7'),"8":__('Status 8'),"9":__('Status 9'),"10":__('Status 10')}, formatter: Table.api.formatter.status},
|
|
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
|
|
buttons: [
|
|
|
{
|
|
|
name: 'detail',
|
|
|
text: __('详情'),
|
|
|
title: __('详情'),
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
icon: '',
|
|
|
url: $.fn.bootstrapTable.defaults.extend.detail_url,
|
|
|
extend:"data-area='[\"50%\",\"80%\"]'",
|
|
|
},
|
|
|
{
|
|
|
name: 'send',
|
|
|
text: __('发货'),
|
|
|
title: __('发货'),
|
|
|
classname: 'btn btn-xs btn-info btn-ajax',
|
|
|
icon: '',
|
|
|
url: $.fn.bootstrapTable.defaults.extend.send_url + '/status/3',
|
|
|
confirm: '是否确认通过已发货?',
|
|
|
hidden:function(row){
|
|
|
if(row.status != 2){
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
success: function (data) {
|
|
|
table.bootstrapTable('refresh');
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
name: 'refund',
|
|
|
text: __('已退款'),
|
|
|
title: __('已退款'),
|
|
|
classname: 'btn btn-xs btn-success btn-ajax',
|
|
|
icon: '',
|
|
|
url: $.fn.bootstrapTable.defaults.extend.refund_url + '/status/9',
|
|
|
confirm: '是否确认通过已退款?',
|
|
|
hidden:function(row){
|
|
|
if(row.status != 8){
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
success: function (data) {
|
|
|
table.bootstrapTable('refresh');
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
name: 'del',
|
|
|
text: __(''),
|
|
|
title: __('删除'),
|
|
|
classname: 'btn btn-xs btn-danger btn-delone',
|
|
|
icon: 'fa fa-trash',
|
|
|
url: $.fn.bootstrapTable.defaults.extend.refund_url,
|
|
|
hidden:function(row){
|
|
|
if(row.status != 7 && row.status != 10){
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
success: function (data) {
|
|
|
table.bootstrapTable('refresh');
|
|
|
}
|
|
|
},
|
|
|
], formatter: Table.api.formatter.operate}
|
|
|
]
|
|
|
]
|
|
|
});
|
|
|
|
|
|
// 为表格绑定事件
|
|
|
Table.api.bindevent(table);
|
|
|
},
|
|
|
detail: function () {
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
api: {
|
|
|
bindevent: function () {
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
return Controller;
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|