12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
-
- Table.api.init({
- extend: {
- index_url: 'userdecoratelianmeng/index' + location.search,
- add_url: 'userdecoratelianmeng/add',
- multi_url: 'userdecoratelianmeng/multi',
- import_url: 'userdecoratelianmeng/import',
- table: 'user_decorate_lianmeng',
- }
- });
- 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.username', title: __('User.username'), operate: 'LIKE'},
- {field: 'decorate_id', title: __('Decorate_id')},
- {field: 'decoratelianmeng.name', title: __('Decoratelianmeng.name'), operate: 'LIKE'},
- {field: 'decoratelianmeng.type', title: __('Decoratelianmeng.type'),searchList: {"1":__('Decoratelianmeng.type 1'),"2":__('Decoratelianmeng.type 2'),"3":__('Decoratelianmeng.type 3'),"4":__('Decoratelianmeng.type 4')}, formatter: Table.api.formatter.normal},
- {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: 'is_using', sortable:true, title: __('Is_using'), searchList: {"1":__('Is_using 1'),"0":__('Is_using 0')}, formatter: Table.api.formatter.normal},
- {field: 'plat_name', title: __('Plat_name'), operate: 'LIKE'},
- {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
- {field: 'audittime', title: __('Audittime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'auditremark', title: __('Auditremark'), operate: 'LIKE'},
- {field: 'operate', title: __('Operate'), table: table,
- buttons:[
- {
- name:'audit',
- text:'核销',
- title:'核销',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'userdecoratelianmeng/audit/id/{ids}?dialog=1',
- target:'_self',
- hidden:function(row){
- return row.status==0 && row.is_using == 1 ? false : true;
- }
- }
- ],
- events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
-
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- audit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|