fastadmin使用技巧分享 日期变更事件
var table = $("#table");
table.on('', function (event, table) {
var form = $("form", table.$commonsearch);
$("input[name='processinstance_id']", form).addClass("selectpage").data("source", "processinstance/index").data("primaryKey", "id").data("field", "process_code").data("orderBy", "id desc");
$("input[name='department_id']", form).addClass("selectpage").data("source", "department/index").data("primaryKey", "id").data("field", "name").data("orderBy", "id asc");
$("input[name='user_id']", form).addClass("selectpage").data("source", "user/user/index").data("primaryKey", "id").data("field", "nickname").data("orderBy", "id asc");
Form.events.cxselect(form);
Form.events.selectpage(form);
});
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: '', title: __(''),operate:false},
{field: 'department_id', title: __('Department'),visible:false},
{field: '', title: __('Department'),operate:false},
{field: 'createdate', title: __('Createdate'), operate:'RANGE', addclass:'datetimerange'},
{field: 'type', title: __('申领部门'), searchList: {0:__('月购'),"1":__('急购')}, formatter: Table.api.formatter.status},
{field: 'month', title: __('Month'), searchList: {"1":__('Month 1'),"2":__('Month 2'),"3":__('Month 3'),"4":__('Month 4'),"5":__('Month 5'),"6":__('Month 6'),"7":__('Month 7'),"8":__('Month 8'),"9":__('Month 9'),"10":__('Month 10'),"11":__('Month 11'),"12":__('Month 12')}, formatter: Table.api.formatter.normal},
{field: 'remarks', title: __('Remarks'),visible:false},
{field: 'status', title: __('申请状态'), searchList: {0:__('待审核'),"1":__('已同意'),'2':__('已拒绝'),'3':__('已撤销'),'4':'已处理'}, formatter: Table.api.formatter.status},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'processinstance_id', title: __('Processinstance.process_code'),visible:false},
{field: 'processinstance.task_action_type', title: __('Task_action_type'), searchList: {"AND":__('Task_action_type and'),"OR":__('Task_action_type or'),"NONE":__('Task_action_type none'),"ORDER":__('Task_action_type order')}, formatter: Table.api.formatter.normal},
{field: 'processinstance.user_ids', title: __('Processinstance.user_ids')},
{field: 'processinstance.cc_list', title: __('Processinstance.cc_list')},
{field: 'processinstance.cc_position', title: __('Processinstance.Cc_position'), searchList: {"START":__('Cc_position start'),"FINISH":__('Cc_position finish'),"START_FINISH":__('Cc_position start_finish')}, formatter: Table.api.formatter.normal},
{field: '', title: __(''), searchList: {"NEW":__('Status new'),"RUNNING":__('Status running'),"TERMINATED":__('Status terminated'),"COMPLETED":"已完成"}, formatter: Table.api.formatter.status,custom: {NEW:'yellow', RUNNING:'info',TERMINATED:'danger',COMPLETED:'success'}},
{field: 'custom', title: __('采购单'), operate: false, formatter: Controller.api.formatter.custom},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});