Update index_search.html

This commit is contained in:
邹景立 2021-03-19 18:40:09 +08:00
parent eea2f168d4
commit 41aecdf38c

View File

@ -137,19 +137,30 @@
window.form.render(); window.form.render();
require(['excel'], function (excel) { require(['excel'], function (excel) {
excel.bind(function (data) { excel.bind(function (data) {
data.forEach(function (item, index) { console.log(data);
data[index] = [ var items = [];
item.order_no, items.push(['订单号', '用户手机', '用户姓名', '商品名称', '商品编码', '商品规格SKU', '商品规格描述', '商品数量', '商品单价', '支付单号', '支付方式', '支付状态', '支付金额', '支付时间']);
item.user.phone, data.forEach(function (order, index) {
item.user.username || item.user.nickname || '', order.items.forEach(function (goods) {
item.payment_trade || '', items.push([
item.payment_status ? '已支付' : '未支付', order.order_no,
item.payment_amount || '0.00', order.user.phone,
item.payment_datetime || '', order.user.username || order.user.nickname || '',
]; goods.goods_name,
goods.goods_code,
goods.goods_sku,
goods.goods_spec,
goods.stock_sales,
goods.price_selling,
order.payment_trade || '',
order.payment_name || order.payment_type || '',
order.payment_status ? '已支付' : '未支付',
order.payment_amount || '0.00',
order.payment_datetime || '',
]);
}); });
data.unshift(['订单单号', '用户手机', '用户姓名', '支付单号', '支付状态', '支付金额', '支付时间']); });
return data; return items;
}, '用户订单记录'); }, '用户订单记录');
}); });
</script> </script>