123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'company/index' + location.search,
- add_url: 'company/add',
- edit_url: 'company/edit',
- del_url: 'company/del',
- multi_url: 'company/multi',
- import_url: 'company/import',
- table: 'company',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: true,
- fixedRightNumber: 1,
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'name', title: __('Name'), operate: 'LIKE'},
- // {field: 'back_ids', title: __('Back_ids'), operate: 'LIKE'},
- // {field: 'service_ids', title: __('Service_ids'), operate: 'LIKE'},
- {field: 'service_price', title: __('Service_price')},
- {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
- {field: 'province_name', title: __('Province_name'), operate: 'LIKE'},
- {field: 'city_name', title: __('City_name'), operate: 'LIKE'},
- {field: 'area_name', title: __('Area_name'), operate: 'LIKE'},
- // {field: 'province_id', title: __('Province_id')},
- // {field: 'city_id', title: __('City_id')},
- // {field: 'area_id', title: __('Area_id')},
- {field: 'address', title: __('Address'), operate: 'LIKE'},
- // {field: 'longitude', title: __('Longitude'), operate:'BETWEEN'},
- // {field: 'latitude', title: __('Latitude'), operate:'BETWEEN'},
- {field: 'truename', title: __('Truename'), operate: 'LIKE'},
- {field: 'idcard', title: __('Idcard'), operate: 'LIKE'},
- // {field: 'idcard_images', title: __('Idcard_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
- // {field: 'bank_name', title: __('Bank_name'), operate: 'LIKE'},
- // {field: 'bank_branchname', title: __('Bank_branchname'), operate: 'LIKE'},
- // {field: 'bank_account', title: __('Bank_account'), operate: 'LIKE'},
- // {field: 'bank_card', title: __('Bank_card'), operate: 'LIKE'},
- {field: 'company_name', title: __('Company_name'), operate: 'LIKE'},
- // {field: 'company_code', title: __('Company_code'), operate: 'LIKE'},
- // {field: 'company_registerdate', title: __('Company_registerdate')},
- // {field: 'company_address', title: __('Company_address'), operate: 'LIKE'},
- // {field: 'company_image', title: __('Company_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- // {field: 'rule', title: __('Rule')},
- // {field: 'back.name', title: __('Back.name'), operate: 'LIKE'},
- // {field: 'service.name', title: __('Service.name'), operate: 'LIKE'},
- // {field: 'area.name', title: __('Area.name'), operate: 'LIKE'},
- {field: 'status', title: __('Status'), searchList: {"-1":__('Status -1'),"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
- {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
- $("#c-province_id").data("params", function (obj) {
- return {
- custom: {pid: 0}
- };
- });
- $("#c-city_id").data("params", function (obj) {
- return {
- custom: {pid: $("#c-province_id").val()}
- };
- });
- $("#c-area_id").data("params", function (obj) {
- return {
- custom: {pid: $("#c-city_id").val()}
- };
- });
- $(document).on("change","#c-province_id",function(){
- $("#c-city_id").selectPageClear();
- $("#c-area_id").selectPageClear();
- });
- $(document).on("change","#c-city_id",function(){
- $("#c-area_id").selectPageClear();
- })
|