- 新增充值订单菜单及独立路由 - 禁用通用退款入口处理充值订单 - 完善支付场景类型及状态显示 - 补充充值退款测试用例 - 优化各模块未知状态显示提示 - 升级版本号至1.0.94
100 行
5.3 KiB
JavaScript
100 行
5.3 KiB
JavaScript
define(['jquery', 'bootstrap', 'backend', 'table', 'backend/admin-table-layout', 'form'], function ($, undefined, Backend, Table, TableLayout, Form) {
|
|
|
|
var Controller = {
|
|
index: function () {
|
|
Table.api.init({
|
|
extend: {
|
|
index_url: 'invoice/index' + location.search,
|
|
detail_url: 'invoice/detail',
|
|
edit_url: 'invoice/edit',
|
|
table: 'invoice',
|
|
}
|
|
});
|
|
|
|
var table = $("#table");
|
|
|
|
table.bootstrapTable({
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
pk: 'id',
|
|
sortName: 'id',
|
|
sortOrder: 'desc',
|
|
fixedColumns: false,
|
|
fixedRightNumber: 0,
|
|
columns: [
|
|
[
|
|
{field: 'index', title: '序号', operate: false, formatter: Table.api.formatter.index, width: '55px'},
|
|
{field: 'invoice_sn', title: '申请单号', operate: 'LIKE'},
|
|
{field: 'title', title: '发票抬头', operate: 'LIKE', align: 'left'},
|
|
{field: 'tax_no', title: '税号', operate: 'LIKE', visible: false},
|
|
{field: 'title_type', title: '抬头类型', searchList: {"personal":__('Personal'),"enterprise":__('Enterprise')}, visible: false},
|
|
{field: 'type', title: '发票类型', searchList: {"normal":__('Ordinary'),"special":__('Special')}, formatter: Table.api.formatter.label, custom: {normal: 'info', special: 'warning'}},
|
|
{field: 'amount', title: '开票金额', operate: 'BETWEEN'},
|
|
{field: 'merchant.name', title: '申请企业', operate: 'LIKE', align: 'left'},
|
|
{field: 'user.nickname', title: '申请用户', operate: 'LIKE'},
|
|
{field: 'email', title: '接收邮箱', operate: 'LIKE', visible: false},
|
|
{field: 'status', title: '处理状态', searchList: {"wait":__('Wait'),"issued":__('Issued'),"reject":__('Reject'),"cancel":__('Cancel')}, formatter: Table.api.formatter.status, custom: {wait: 'warning', issued: 'success', reject: 'danger', cancel: 'gray'}},
|
|
{field: 'invoice_no', title: '发票号码', operate: 'LIKE'},
|
|
{field: 'invoice_file', title: '电子票', operate: false, formatter: function (v) { return v ? '<a href="' + Fast.api.escape(Fast.api.cdnurl(v)) + '" target="_blank" rel="noopener">查看</a>' : '—'; }},
|
|
{field: 'audit_msg', title: '处理说明', operate: 'LIKE', visible: false},
|
|
{field: 'createtime', title: '申请时间', operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime, width: '145px'},
|
|
{field: 'operate', title: '操作', table: table, events: Table.api.events.operate,
|
|
buttons: [
|
|
{
|
|
name: 'detail',
|
|
text: '详情',
|
|
title: '开票申请详情',
|
|
classname: 'btn btn-xs btn-info btn-detailone',
|
|
extend: 'data-area=\'["920px","86%"]\''
|
|
},
|
|
{
|
|
name: 'edit',
|
|
text: '开票处理',
|
|
title: '财务开票处理',
|
|
classname: 'btn btn-xs btn-success btn-editone',
|
|
extend: 'data-area=\'["920px","86%"]\'',
|
|
visible: function (row) {
|
|
return row.status === 'wait';
|
|
}
|
|
}
|
|
],
|
|
formatter: Table.api.formatter.operate}
|
|
]
|
|
]
|
|
});
|
|
|
|
Table.api.bindevent(table);
|
|
},
|
|
edit: function () {
|
|
$(document).on('change', 'input[name="row[status]"]', function () {
|
|
var val = $(this).val();
|
|
if (val === 'reject') {
|
|
$('#box-issued-fields').slideUp(150);
|
|
$('#invoice-issued-hint').hide();
|
|
$('#invoice-reject-hint').show();
|
|
$('#invoice-submit').text('确认驳回申请');
|
|
} else {
|
|
$('#box-issued-fields').slideDown(150);
|
|
$('#invoice-issued-hint').show();
|
|
$('#invoice-reject-hint').hide();
|
|
$('#invoice-submit').text('确认登记开票结果');
|
|
}
|
|
});
|
|
$('#edit-form').on('reset', function () {
|
|
setTimeout(function () {
|
|
$('input[name="row[status]"]:checked').trigger('change');
|
|
}, 0);
|
|
});
|
|
Controller.api.bindevent();
|
|
},
|
|
detail: function () {
|
|
Controller.api.bindevent();
|
|
},
|
|
api: {
|
|
bindevent: function () {
|
|
Form.api.bindevent($("form[role=form]"));
|
|
}
|
|
}
|
|
};
|
|
return Controller;
|
|
});
|