qinzexin 32e079b44f 后台处理开票流程
搜索里,平台活动类别,也能搜索
2025-06-18 18:29:31 +08:00

123 lines
6.3 KiB
JavaScript

define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'user/invoice/apply/index' + location.search,
add_url: 'user/invoice/apply/add'+ location.search,
edit_url: 'user/invoice/apply/edit'+ location.search,
del_url: 'user/invoice/apply/del',
multi_url: 'user/invoice/apply/multi',
import_url: 'user/invoice/apply/import',
table: 'user_invoice_apply',
}
});
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: 'user_id', title: __('User_id')},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
{field: 'apply_type', title: __('Apply_type'), searchList: {"1":__('Apply_type 1'),"2":__('Apply_type 2')}, formatter: Table.api.formatter.normal},
{field: 'price', title: __('Price'), operate:'BETWEEN'},
{field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'},
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'head_type', title: __('Head_type'), searchList: {"personal":__('Head_type personal'),"corporate":__('Head_type corporate')}, formatter: Table.api.formatter.normal},
{field: 'invoice_type', title: __('Invoice_type'), searchList: {"ordinary":__('Invoice_type ordinary'),"special":__('Invoice_type special')}, formatter: Table.api.formatter.normal},
{field: 'invoice_header', title: __('Invoice_header'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'tax_id', title: __('Tax_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'bank_deposit', title: __('Bank_deposit'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'bank_number', title: __('Bank_number'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'enterprise_address', title: __('Enterprise_address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'enterprise_phone', title: __('Enterprise_phone'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'invoice_reservation_phone', title: __('Invoice_reservation_phone'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'invoice_reservation_email', title: __('Invoice_reservation_email'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'invoicingtime', title: __('Invoicingtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{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: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{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 () {
shop_apply.listen();
Form.api.bindevent($("form[role=form]"));
}
}
};
var shop_apply = {
listen:function () {
this.setOfflineType($("select[name='row[head_type]']").val());
this.offlineListen();
},
offlineListen:function () {
var that = this;
// console.log($("input:radio[name='row[address_type]']").val())
// this.setOfflineType($("input:radio[name='row[address_type]']").val());
// $("input:radio[name='row[head_type]']").change(function (){
//
// console.log(1111111);
// that.setOfflineType($(this).val());
// });
//改成下拉
$("select[name='row[head_type]']").change(function (){
that.setOfflineType($(this).val());
});
},
setOfflineType:function (val) {
switch (val) {
case 'personal': //个人
$('#enterprise_data').hide();
break;
case 'corporate': //企业
$('#enterprise_data').show();
break;
}
},
}
return Controller;
});