文件
yjyf/server/public/assets/js/backend/invoice.js
MiAn 230e39df5f update(admin): 优化财务菜单结构与功能体验
- 调整财务相关菜单名称、排序与权限逻辑
- 新增充值订单与退款记录的页签切换功能
- 修改结算时间、状态等术语表述,优化理解性
- 隐藏非核心列表字段,简化页面展示
- 完善钱包流水统计说明,明确数据口径
- 新增企业资质审核相关关联入口
- 修复充值退款菜单重复显示问题
- 新增相关测试用例保障功能稳定性
2026-11-21 15:55:01 +08:00

100 行
5.4 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', visible: false, 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', visible: false, title: '发票号码', operate: 'LIKE'},
{field: 'invoice_file', visible: false, 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;
});