文件
fenleixinxi/public/assets/js/backend/fc/financeflow.js
MiAn cb12bf5fc8 feat: 新增地址选择插件及订阅消息等多项功能优化
- 新增地址选择插件,支持地图位置选择并返回地址和经纬度
- 新增微信订阅消息发送功能,支持审核结果、提现通知等场景
- 新增订单支付状态查询、提现收款人姓名保存等接口
- 新增服务区域管理,支持按省市区划分并同步到信息发布
- 新增资金流水和营收报表导出功能
- 新增可用优惠券查询、订单退款拆分处理等功能
- 优化后台角标显示、首页数据统计、UI配置下发等
- 修复订单支付并发问题、地区管理逻辑等
2026-10-22 17:14:56 +08:00

90 行
4.2 KiB
JavaScript

define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'fc/financeflow/index' + location.search,
add_url: 'fc/financeflow/add',
edit_url: 'fc/financeflow/edit',
del_url: 'fc/financeflow/del',
multi_url: 'fc/financeflow/multi',
import_url: 'fc/financeflow/import',
table: 'fc_finance_flow',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
{field: 'flow_no', title: __('Flow_no'), operate: 'LIKE'},
{
field: 'type', title: __('Type'),
searchList: {income: __('收入'), expense: __('支出')},
formatter: function (value) {
var m = {income: __('收入'), expense: __('支出')};
return m[value] !== undefined ? m[value] : '-';
}
},
{field: 'scene', title: __('Scene'), operate: 'LIKE'},
{
field: 'amount', title: __('Amount'), operate: 'BETWEEN',
formatter: function (value) {
return value === '' || value === null ? '-' : '¥' + parseFloat(value).toFixed(2);
}
},
{
field: 'balance', title: __('Balance'), operate: 'BETWEEN',
formatter: function (value) {
return value === '' || value === null ? '-' : '¥' + parseFloat(value).toFixed(2);
}
},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'related_text', title: '关联单号', operate: false, sortable: false, formatter: function (value) {
return value ? value : '-';
}},
{field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
// 导出资金流水(沿用当前 URL 上的 type 过滤)
$(document).on('click', '.btn-export-flow', function () {
var type = Fast.api.query('type') || '';
window.open(Fast.api.fixurl('fc/financeflow/export?type=' + encodeURIComponent(type)));
});
// 导出营收报表(按日/月/年)
$(document).on('click', '.btn-export-report', function () {
var period = $('#report-period').val() || 'month';
window.open(Fast.api.fixurl('fc/financeflow/exportReport?period=' + encodeURIComponent(period)));
});
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});