feat(split): 完善分账接收方列表展示功能 - 添加用户信息查询和展示,包括昵称、手机号等用户详情 - 增加汇付进件状态显示和账号匹配校验功能 - 优化前端表格界面,新增用户关联信息、进件核对状态等列 - 改进数据格式化处理,提供更详细的分账接收方信息展示 - 更新表单提示文案,明确用户ID填写规则和要求 ```
54 行
2.6 KiB
JavaScript
54 行
2.6 KiB
JavaScript
define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backend, Form) {
|
|
var Controller = {
|
|
index: function () {
|
|
new Vue({
|
|
el: '#splitReceiverIndex',
|
|
data: {
|
|
listData: [],
|
|
loading: false,
|
|
splitHuifuOnly: !!(typeof Config !== 'undefined' && Config.splitHuifuOnly),
|
|
},
|
|
mounted() { this.getList(); },
|
|
methods: {
|
|
getList() {
|
|
this.loading = true;
|
|
Fast.api.ajax({ url: 'shopro/split/receiver/index', type: 'GET', data: { limit: 100 } }, (ret, res) => {
|
|
this.listData = (res.data && res.data.rows) || [];
|
|
this.loading = false;
|
|
return false;
|
|
}, () => { this.loading = false; });
|
|
},
|
|
openAdd() { Backend.api.open('shopro/split/receiver/add', '添加接收方', { callback: () => this.getList() }); },
|
|
syncWx(id) { Fast.api.ajax({ url: 'shopro/split/receiver/syncWx/ids/' + id, type: 'POST' }, () => this.getList()); },
|
|
wxStatusText(s) { return { 0: '待同步', 1: '已同步', 2: '失败' }[s] || '-'; },
|
|
channelText(c) { return c === 'huifu' ? '汇付' : '微信'; },
|
|
roleTypeText(type) {
|
|
const map = {
|
|
platform: '平台',
|
|
promoter: '推广员',
|
|
regional_agent: '区域公司',
|
|
};
|
|
return map[type] || type;
|
|
},
|
|
matchTagClass(text) {
|
|
if (!text || text === '—') return 'match-tag neutral';
|
|
if (text === '与进件一致') return 'match-tag ok';
|
|
if (text === '未进件' || text === '未填账号' || text === '未配置') return 'match-tag warn';
|
|
return 'match-tag err';
|
|
},
|
|
scrollCellWheel(e) {
|
|
var el = e.currentTarget;
|
|
if (!el || el.scrollWidth <= el.clientWidth) return;
|
|
if (Math.abs(e.deltaY) >= Math.abs(e.deltaX)) {
|
|
e.preventDefault();
|
|
el.scrollLeft += e.deltaY;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
},
|
|
add: function () { Form.api.bindevent($('form[role=form]')); }
|
|
};
|
|
return Controller;
|
|
});
|