1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'pricing/orderinvoice/index' + location.search,
- add_url: 'pricing/orderinvoice/add',
- edit_url: 'pricing/orderinvoice/edit',
- del_url: 'pricing/orderinvoice/del',
- multi_url: 'pricing/orderinvoice/multi',
- import_url: 'pricing/orderinvoice/import',
- table: 'order_invoice',
- }
- });
- 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: 'uid', title: __('Uid')},
- {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
- {field: 'invoice_type', title: __('Invoice_type'),formatter: function (d){
- if(d==1){
- return '普通发票';
- }else {
- return '增值税发票';
- }
- }},
- {field: 'invoice_shape', title: __('Invoice_shape'),formatter: function (d){
- if(d==1){
- return '纸质发票';
- }else {
- return '电子发票';
- }
- }},
- {field: 'type', title: __('Type'),formatter: function (d){
- if(d==1){
- return '个人';
- }else {
- return '企业';
- }
- }},
- {field: 'name', title: __('Name'), operate: 'LIKE'},
- {field: 'duty_paragraph', title: __('Duty_paragraph')},
- {field: 'address', title: __('Address'), operate: 'LIKE'},
- {field: 'company_phone', title: __('Company_phone')},
- {field: 'bank', title: __('Bank'), operate: 'LIKE'},
- {field: 'compellation', title: __('Compellation'), operate: 'LIKE'},
- {field: 'phone', title: __('Phone')},
- {field: 'location', title: __('Location'), operate: 'LIKE'},
- {field: 'postcode', title: __('Postcode'), operate: 'LIKE'},
- {field: 'emial', title: __('Emial'), operate: 'LIKE'},
- {field: 'apply_time', title: __('Apply_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
- {field: 'status', title: __('Status'),formatter: function (d){
- if(d==1){
- return '待开票';
- }else if(d==2){
- return '已寄出';
- }else {
- return '已完成';
- }
- }},
- {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;
- });
|