mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改模板文件
This commit is contained in:
parent
41aecdf38c
commit
bd2429dd4a
@ -137,28 +137,20 @@
|
||||
window.form.render();
|
||||
require(['excel'], function (excel) {
|
||||
excel.bind(function (data) {
|
||||
console.log(data);
|
||||
var items = [];
|
||||
items.push(['订单号', '用户手机', '用户姓名', '商品名称', '商品编码', '商品规格SKU', '商品规格描述', '商品数量', '商品单价', '支付单号', '支付方式', '支付状态', '支付金额', '支付时间']);
|
||||
data.forEach(function (order, index) {
|
||||
order.items.forEach(function (goods) {
|
||||
items.push([
|
||||
order.order_no,
|
||||
order.user.phone,
|
||||
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 || '',
|
||||
]);
|
||||
});
|
||||
items.push(['订单号', '用户手机', '用户姓名', '订单类型', '支付单号', '支付方式', '支付状态', '支付金额', '支付时间']);
|
||||
data.forEach(function (order) {
|
||||
items.push([
|
||||
order.order_no,
|
||||
order.user.phone,
|
||||
order.user.username || order.user.nickname || '',
|
||||
order.truck_type ? '虚拟商品' : '实物商品',
|
||||
order.payment_trade || '',
|
||||
order.payment_name || order.payment_type || '',
|
||||
order.payment_status ? '已支付' : '未支付',
|
||||
order.payment_amount || '0.00',
|
||||
order.payment_datetime || '',
|
||||
]);
|
||||
});
|
||||
return items;
|
||||
}, '用户订单记录');
|
||||
|
@ -98,6 +98,8 @@
|
||||
rows.push([
|
||||
order.order_no,
|
||||
item.goods_name,
|
||||
item.goods_sku,
|
||||
item.goods_spec,
|
||||
item.stock_sales,
|
||||
item.price_selling,
|
||||
item.total_selling,
|
||||
@ -110,10 +112,10 @@
|
||||
order.truck.address_area,
|
||||
order.truck.address_content,
|
||||
]);
|
||||
})
|
||||
});
|
||||
});
|
||||
rows.unshift([
|
||||
'订单号', '物品名称', '数量', '单价', '总额',
|
||||
'订单号', '物品名称', '物品SKU编码', '物品规格描述', '数量', '单价', '总额',
|
||||
'寄件方', '身份证号', '收货人', '电话', '省份', '城市', '区', '地址'
|
||||
]);
|
||||
return rows;
|
||||
|
Loading…
x
Reference in New Issue
Block a user