123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: async function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'take_cash/index' + location.search,
- add_url: 'take_cash/add',
- edit_url: 'take_cash/edit',
- del_url: 'take_cash/del',
- multi_url: 'take_cash/multi',
- import_url: 'take_cash/import',
- table: 'take_cash',
- }
- });
- var table = $("#table");
- let status = await $.getJSON('take_cash/status')
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- //{checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'user.nickname', title: __('用户昵称'),operate: "LIKE",},
- {field: 'amount', title: __('Amount'), operate: 'BETWEEN'},
- {field: 'created_at', title: __('提交时间'),operate: "RANGE",addclass:'datetimerange',formatter: Table.api.formatter.datetime},
- {field: 'status', title: __('Status'),searchList:status,formatter:Table.api.formatter.normal},
- {field: 'check_status', title: __('打款状态'),searchList:{0:'打款中',1:'成功',2:'失败'},formatter:Table.api.formatter.label},
- {field: 'check_data', title: __('打款失败原因'),formatter(a){
- let reason={
- ACCOUNT_FROZEN:'账户冻结,该用户账户被冻结',
- REAL_NAME_CHECK_FAIL:'用户未实名,收款人未实名认证,需要用户完成微信实名认证',
- NAME_NOT_CORRECT: '用户姓名校验失败,收款人姓名校验不通过,请核实信息',
- OPENID_INVALID: 'Openid校验失败,Openid格式错误或者不属于商家公众账号',
- TRANSFER_QUOTA_EXCEED: '超过用户单笔收款额度,超过用户单笔收款额度,核实产品设置是否准确',
- DAY_RECEIVED_QUOTA_EXCEED: '超过用户单日收款额度,超过用户单日收款额度,核实产品设置是否准确',
- MONTH_RECEIVED_QUOTA_EXCEED: '超过用户单月收款额度,超过用户单月收款额度,核实产品设置是否准确',
- DAY_RECEIVED_COUNT_EXCEED: '超过用户单日收款次数,超过用户单日收款次数,核实产品设置是否准确',
- PRODUCT_AUTH_CHECK_FAIL: '产品权限校验失败,未开通该权限或权限被冻结,请核实产品权限状态',
- OVERDUE_CLOSE: '转账关闭,超过系统重试期,系统自动关闭',
- ID_CARD_NOT_CORRECT: '用户身份证校验失败,收款人身份证校验不通过,请核实信息',
- ACCOUNT_NOT_EXIST: '用户账户不存在,该用户账户不存在',
- TRANSFER_RISK: '转账存在风险,该笔转账可能存在风险,已被微信拦截',
- OTHER_FAIL_REASON_TYPE: '其它失败,其它失败原因',
- REALNAME_ACCOUNT_RECEIVED_QUOTA_EXCEED: '用户账户收款受限,请引导用户在微信支付查看详情',
- RECEIVE_ACCOUNT_NOT_PERMMIT: '未配置该用户为转账收款人,请在产品设置中调整,添加该用户为收款人',
- PAYEE_ACCOUNT_ABNORMAL: '用户账户收款异常,请联系用户完善其在微信支付的身份信息以继续收款',
- PAYER_ACCOUNT_ABNORMAL: '商户账户付款受限,可前往商户平台获取解除功能限制指引',
- TRANSFER_SCENE_UNAVAILABLE: '该转账场景暂不可用,该转账场景暂不可用,请确认转账场景ID是否正确',
- TRANSFER_SCENE_INVALID: '你尚未获取该转账场景,你尚未获取该转账场景,请确认转账场景ID是否正确',
- TRANSFER_REMARK_SET_FAIL: '转账备注设置失败,转账备注设置失败, 请调整后重新再试',
- RECEIVE_ACCOUNT_NOT_CONFIGURE: '未配置该用户在收款用户列表,请前往商户平台-商家转账到零钱-前往功能-转账场景中添加',
- BLOCK_B2C_USERLIMITAMOUNT_BSRULE_MONTH: '超出用户单月转账收款20w限额,本月不支持继续向该用户付款',
- BLOCK_B2C_USERLIMITAMOUNT_MONTH: '用户账户存在风险收款受限,本月不支持继续向该用户付款',
- }
- return reason[a]||a
- }},
- {
- field: 'operate',
- title: __('Operate'),
- table: table,
- events: Table.api.events.operate,
- formatter: Table.api.formatter.buttons,
- buttons:[
- {
- name: 'edit',
- text: __('审核'),
- title: __('审核'),
- classname: 'btn btn-xs btn-info btn-dialog',
- icon: 'fa',
- url: 'take_cash/edit',
- callback: function (data) {
- //Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
- $('.btn-refresh').trigger('click')
- },
- visible: function (row) {
- //返回true时按钮显示,返回false隐藏
- return row.status===0;
- }
- },
- ]
- }
- ]
- ]
- });
- // 为表格绑定事件
- 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;
- });
|