Commit 0b59cc72 authored by lvxiaowu's avatar lvxiaowu

excel

parent 6e755f68
......@@ -39,14 +39,16 @@ const ExchangeCode: React.FC = () => {
};
const download = () => {
api('/yizhi_server/api/account/analyse/download', {
api('/51business/api/course/back/export/redeem', {
type: 'GET',
data: {
product: 'JSON.stringify(info.product)'
class_name: class_name,
limit: limit,
page: page
},
responseType: 'arrayBuffer'
}).then(r => {
excelFn(r, `分析明细`);
excelFn(r, `兑换码列表`);
});
};
......
......@@ -15,7 +15,7 @@ const tailLayout = {
const GenerateCode: React.FC = () => {
const [courseData, set_courseData] = useState([]);
const [classData, set_classData] = useState([]);
const [classData, set_classData] = useState([] as any[]);
const [institution_name, set_institutionName] = useState('');
const [form] = Form.useForm();
......@@ -50,8 +50,13 @@ const GenerateCode: React.FC = () => {
const onChange = (val: any) => {
form.resetFields(['class_id']);
let d: any = courseData[val - 1];
set_classData((d && d.class) || []);
let d: any[] = [];
courseData.map((item: any) => {
if (item.id === val) {
d = item.class;
}
});
set_classData(d);
};
const onSearch = (val: string) => {
getClassData(val);
......
......@@ -87,18 +87,17 @@ const OrderList: React.FC = () => {
};
const download = () => {
api('/yizhi_server/api/account/analyse/download', {
api('/51business/api/course/back/export/order', {
type: 'GET',
data: {
class_name,
user_name,
start_time,
end_time,
product: 'JSON.stringify(info.product)'
start_time: start_time ? start_time + ' 00:00:00' : '',
end_time: end_time ? end_time + ' 23:59:59' : ''
},
responseType: 'arrayBuffer'
}).then(r => {
excelFn(r, `分析明细${start_time}_${end_time}`);
excelFn(r, `购买订单列表${start_time}_${end_time}`);
});
};
......
......@@ -8,6 +8,8 @@ interface DeatilI {
class_name: string | number;
address: () => {};
pay: string | number;
redeem: string | number;
type: string | number;
pay_time: string;
}
......@@ -68,6 +70,19 @@ const columns = [
}
},
{
title: '支付方式',
dataIndex: 'type',
key: 'type',
render: (row: any) => {
return <span>{row === 1 ? '微信' : '兑换码'}</span>;
}
},
{
title: '兑换码',
dataIndex: 'redeem',
key: 'redeem'
},
{
title: '付款金额(元)',
dataIndex: 'pay',
key: 'pay'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment