```
feat(split-order): 完善分账订单管理功能 - 添加订单关联关系,支持查询原始订单信息 - 实现分账订单列表的搜索过滤功能,支持买家、订单号、状态等多维度筛选 - 优化前端页面展示,添加分页、样式美化和交互提示 - 增加重试分账和查询状态的操作确认提示 - 格式化显示买家信息、金额和时间等数据字段 - 支持汇付和微信两种分账通道的状态显示 ```
这个提交包含在:
@@ -3,20 +3,108 @@ define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backe
|
||||
index: function () {
|
||||
new Vue({
|
||||
el: '#splitOrderIndex',
|
||||
data: { listData: [], loading: false },
|
||||
mounted() { this.getList(); },
|
||||
data() {
|
||||
return {
|
||||
listData: [],
|
||||
loading: false,
|
||||
currentPage: 1,
|
||||
limit: 20,
|
||||
total: 0,
|
||||
dateRange: [],
|
||||
filters: {
|
||||
buyer_keyword: '',
|
||||
order_sn: '',
|
||||
status: '',
|
||||
channel: ''
|
||||
},
|
||||
splitHuifuOnly: !!(typeof Config !== 'undefined' && Config.splitHuifuOnly)
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
buildFilter() {
|
||||
var filter = Object.assign({}, this.filters);
|
||||
if (this.dateRange && this.dateRange.length === 2) {
|
||||
filter.createtime = this.dateRange[0] + ' - ' + this.dateRange[1];
|
||||
}
|
||||
return filter;
|
||||
},
|
||||
search() {
|
||||
this.currentPage = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetFilters() {
|
||||
this.filters = { buyer_keyword: '', order_sn: '', status: '', channel: '' };
|
||||
this.dateRange = [];
|
||||
this.currentPage = 1;
|
||||
this.getList();
|
||||
},
|
||||
onSizeChange() {
|
||||
this.currentPage = 1;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
Fast.api.ajax({ url: 'shopro/split/order/index', type: 'GET', data: { limit: 50, sort: 'id', order: 'desc' } }, (ret, res) => {
|
||||
this.listData = (res.data && res.data.rows) || [];
|
||||
Fast.api.ajax({
|
||||
url: 'shopro/split/order/index',
|
||||
type: 'GET',
|
||||
data: {
|
||||
offset: (this.currentPage - 1) * this.limit,
|
||||
limit: this.limit,
|
||||
sort: 'id',
|
||||
order: 'desc',
|
||||
filter: JSON.stringify(this.buildFilter()),
|
||||
op: JSON.stringify({})
|
||||
}
|
||||
}, (ret, res) => {
|
||||
const data = res.data || {};
|
||||
this.listData = data.rows || [];
|
||||
this.total = data.total || 0;
|
||||
this.loading = false;
|
||||
return false;
|
||||
}, () => { this.loading = false; });
|
||||
},
|
||||
retry(id) { Fast.api.ajax({ url: 'shopro/split/order/retry/ids/' + id, type: 'POST' }, () => this.getList()); },
|
||||
query(id) { Fast.api.ajax({ url: 'shopro/split/order/query/ids/' + id, type: 'POST' }, () => this.getList()); },
|
||||
statusText(s) { return { 0: '待分账', 1: '分账中', 2: '成功', 3: '部分成功', 4: '失败' }[s] || '-'; }
|
||||
formatMoney(v) {
|
||||
var n = parseFloat(v);
|
||||
return isNaN(n) ? '0.00' : n.toFixed(2);
|
||||
},
|
||||
openOrder(orderId) {
|
||||
if (!orderId) return;
|
||||
Fast.api.open('shopro/order/order/detail?id=' + orderId, '订单详情');
|
||||
},
|
||||
retry(row) {
|
||||
var tip = this.splitHuifuOnly
|
||||
? '将向汇付重新发起该笔分账。若订单资金仍被冻结,请先发货/确认收货或按文档处理 FREEZE。'
|
||||
: '将向微信/汇付重新发起该笔分账,请确认该订单尚未分账成功。';
|
||||
Layer.confirm(
|
||||
'订单 ' + (row.order_sn || '') + '(' + (row.buyer_display || '买家') + ')<br>' + tip,
|
||||
{ title: '确认重试分账', btn: ['重试', '取消'] },
|
||||
() => {
|
||||
Fast.api.ajax({ url: 'shopro/split/order/retry/ids/' + row.id, type: 'POST' }, () => {
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
query(id) {
|
||||
Fast.api.ajax({ url: 'shopro/split/order/query/ids/' + id, type: 'POST' }, (ret, res) => {
|
||||
var hint = '已同步通道状态并更新记录';
|
||||
if (res.data) {
|
||||
try {
|
||||
var d = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
|
||||
var parts = [d.resp_desc, d.resp_code, d.bank_message, d.status].filter(Boolean);
|
||||
if (parts.length) {
|
||||
hint += ':' + parts.join(' ');
|
||||
}
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
Layer.msg(hint, { time: 4000 });
|
||||
this.getList();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户