123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'productchufabanci/index' + location.search,
- add_url: 'productchufabanci/add',
- edit_url: 'productchufabanci/edit',
- del_url: 'productchufabanci/del',
- multi_url: 'productchufabanci/multi',
- import_url: 'productchufabanci/import',
- table: 'product_chufabanci',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'chufatime', title: __('Chufatime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'ticket_number', title: __('Ticket_number')},
- {field: 'ticket_remain', title: __('Ticket_remain')},
- {field: 'chufatype', title: __('Chufatype'), searchList: {"1":__('Chufatype 1'),"2":__('Chufatype 2')}, formatter: Table.api.formatter.normal},
- {field: 'chepaihao', title: __('Chepaihao'), operate: 'LIKE'},
- {field: 'sijimobile', title: __('Sijimobile'), operate: 'LIKE'},
- {field: 'fache_status', title: __('Fache_status'), searchList: {"0":__('Fache_status 0'),"1":__('Fache_status 1'),"2":__('Fache_status 2')}, formatter: Table.api.formatter.status},
- {field: 'fache_time', title: __('Fache_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'daozhan_time', title: __('Daozhan_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'road_id', title: __('Road_id')},
- {field: 'road.roadname', title: __('Road.roadname'), operate: 'LIKE'},
- {field: 'product_id', title: __('Product_id')},
- {field: 'product.name', title: __('Product.name'), operate: 'LIKE'},
- {field: 'car_id', title: __('Car_id')},
- {field: 'car.chepaihao', title: __('Car.chepaihao'), operate: 'LIKE'},
- {field: 'coach_id', title: __('Coach_id')},
- {field: 'coach.nickname', title: __('Coach.nickname'), operate: 'LIKE'},
- {field: 'coach.mobile', title: __('Coach.mobile'), operate: 'LIKE'},
- {field: 'operate', title: __('Operate'), table: table,
- buttons:[
- {
- name:'copytomorrow',
- text:'顺延N天',
- title:'顺延N天',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'productchufabanci/copytomorrow/id/{ids}',
- target:'_self',
- refresh: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();
- },
- copytomorrow: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
- $("#c-road_id").data("params", function (obj) {
- return {
- custom: {product_id: $("#c-product_id").val(),roadtype:['IN','1,2']}
- };
- });
- $(document).on("change","#c-product_id",function(){
- $("#c-road_id").selectPageClear();
- })
- $("#c-car_id").data("params", function (obj) {
- return {
- custom: {leasetype: 1}
- };
- });
|