init commit
This commit is contained in:
81
public/assets/js/backend/wdsxh/points/order.js
Normal file
81
public/assets/js/backend/wdsxh/points/order.js
Normal file
@@ -0,0 +1,81 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/points/order/index' + location.search,
|
||||
table: 'wdsxh_points_order',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
||||
{field: 'goods_info.name', title: __('Goods_info.name'), operate: false},
|
||||
{field: 'goods_info.image', title: __('Goods_info.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'points', title: __('Goods_info.points'), operate: false},
|
||||
{field: 'number', title: __('Number')},
|
||||
{field: 'real_name', title: __('Real_name'), operate: 'LIKE'},
|
||||
{field: 'user_phone', title: __('User_phone'), operate: 'LIKE'},
|
||||
{field: 'user_address', title: __('User_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'state', title: __('State'), searchList: {"2":__('State 2'),"3":__('State 3'),"4":__('State 4')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'total_points', title: __('Total_points')},
|
||||
{field: 'redemption_time', title: __('Redemption_time'), 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,buttons:[
|
||||
{
|
||||
name: 'delivery',
|
||||
text:'发货',
|
||||
classname: 'btn btn-xs btn-primary btn-dialog bg-aqua',
|
||||
icon: 'fa',
|
||||
extend:'data-area=["80%","80%"]',
|
||||
url: 'wdsxh/points/order/delivery',
|
||||
visible:function(row){
|
||||
if(row['state']==2){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
refresh:true
|
||||
},
|
||||
{
|
||||
text:'订单详情',
|
||||
name: 'details',
|
||||
title: '订单详情',
|
||||
classname: 'btn btn-xs btn-primary btn-dialog bg-aqua',
|
||||
icon: 'fa',
|
||||
url: 'wdsxh/points/order/details',
|
||||
extend:'data-area=["95%","95%"]',
|
||||
},
|
||||
|
||||
]}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
delivery: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
Reference in New Issue
Block a user