Commit 0b59cc72 authored by lvxiaowu's avatar lvxiaowu

excel

parent 6e755f68
...@@ -39,14 +39,16 @@ const ExchangeCode: React.FC = () => { ...@@ -39,14 +39,16 @@ const ExchangeCode: React.FC = () => {
}; };
const download = () => { const download = () => {
api('/yizhi_server/api/account/analyse/download', { api('/51business/api/course/back/export/redeem', {
type: 'GET', type: 'GET',
data: { data: {
product: 'JSON.stringify(info.product)' class_name: class_name,
limit: limit,
page: page
}, },
responseType: 'arrayBuffer' responseType: 'arrayBuffer'
}).then(r => { }).then(r => {
excelFn(r, `分析明细`); excelFn(r, `兑换码列表`);
}); });
}; };
......
...@@ -15,7 +15,7 @@ const tailLayout = { ...@@ -15,7 +15,7 @@ const tailLayout = {
const GenerateCode: React.FC = () => { const GenerateCode: React.FC = () => {
const [courseData, set_courseData] = useState([]); const [courseData, set_courseData] = useState([]);
const [classData, set_classData] = useState([]); const [classData, set_classData] = useState([] as any[]);
const [institution_name, set_institutionName] = useState(''); const [institution_name, set_institutionName] = useState('');
const [form] = Form.useForm(); const [form] = Form.useForm();
...@@ -50,8 +50,13 @@ const GenerateCode: React.FC = () => { ...@@ -50,8 +50,13 @@ const GenerateCode: React.FC = () => {
const onChange = (val: any) => { const onChange = (val: any) => {
form.resetFields(['class_id']); form.resetFields(['class_id']);
let d: any = courseData[val - 1]; let d: any[] = [];
set_classData((d && d.class) || []); courseData.map((item: any) => {
if (item.id === val) {
d = item.class;
}
});
set_classData(d);
}; };
const onSearch = (val: string) => { const onSearch = (val: string) => {
getClassData(val); getClassData(val);
......
...@@ -87,18 +87,17 @@ const OrderList: React.FC = () => { ...@@ -87,18 +87,17 @@ const OrderList: React.FC = () => {
}; };
const download = () => { const download = () => {
api('/yizhi_server/api/account/analyse/download', { api('/51business/api/course/back/export/order', {
type: 'GET', type: 'GET',
data: { data: {
class_name, class_name,
user_name, user_name,
start_time, start_time: start_time ? start_time + ' 00:00:00' : '',
end_time, end_time: end_time ? end_time + ' 23:59:59' : ''
product: 'JSON.stringify(info.product)'
}, },
responseType: 'arrayBuffer' responseType: 'arrayBuffer'
}).then(r => { }).then(r => {
excelFn(r, `分析明细${start_time}_${end_time}`); excelFn(r, `购买订单列表${start_time}_${end_time}`);
}); });
}; };
......
...@@ -8,6 +8,8 @@ interface DeatilI { ...@@ -8,6 +8,8 @@ interface DeatilI {
class_name: string | number; class_name: string | number;
address: () => {}; address: () => {};
pay: string | number; pay: string | number;
redeem: string | number;
type: string | number;
pay_time: string; pay_time: string;
} }
...@@ -68,6 +70,19 @@ const columns = [ ...@@ -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: '付款金额(元)', title: '付款金额(元)',
dataIndex: 'pay', dataIndex: 'pay',
key: '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