5 changed files with 325 additions and 39 deletions
-
2scripts/webpack.dev.js
-
109src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffDetail/loadable.jsx
-
76src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffStat/index.scss
-
164src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffStat/loadable.jsx
-
13src/services/OperationCenter/OperationSales/index.js
@ -1,23 +1,163 @@ |
|||||
import React, { useState, useRef, useEffect } from "react"; |
import React, { useState, useRef, useEffect } from "react"; |
||||
// import { message, Pagination, Table, Space, Modal, } from "antd"; |
|
||||
// import { dictionary, utils } from "@/config/common"; |
|
||||
|
import { message, Pagination, Table, Space, Modal, } from "antd"; |
||||
|
import { dictionary, utils } from "@/config/common"; |
||||
// import moment from 'moment' |
// import moment from 'moment' |
||||
// import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; |
|
||||
|
import { useSetState, useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; |
||||
// import ajax from "@/services" |
// import ajax from "@/services" |
||||
// import { FormInput, FormSelect, OptionPanel, ResultPanel, FormSliderPicker, AreaCascader, ImgResize, ImgZoom, } from "@/components" |
// import { FormInput, FormSelect, OptionPanel, ResultPanel, FormSliderPicker, AreaCascader, ImgResize, ImgZoom, } from "@/components" |
||||
// import "./index.scss"; |
// import "./index.scss"; |
||||
// import errorImg from "@/assets/images/layout/error.png" |
// import errorImg from "@/assets/images/layout/error.png" |
||||
// import { useLocation } from "react-router-dom"; |
// import { useLocation } from "react-router-dom"; |
||||
//序号 优惠券名称 优惠券类型 领取量 使用量 核销总额 |
|
||||
// "couponStatisticsId": "1816989566343731019", |
|
||||
// "couponRuleId": "1816961195247290414", |
|
||||
// "couponType": 0, |
|
||||
// "receiveAmount": 65, |
|
||||
// "usedAmount": 0, |
|
||||
// "totalMoney": 0, |
|
||||
// "couponName": "8月新增道路泊位优惠券" |
|
||||
|
import ajax from '@/services/OperationCenter/OperationSales/index' |
||||
|
import { FormInput, FormSelect, ResultFlow } from "@/components" |
||||
|
import "./index.scss"; |
||||
|
|
||||
function WriteOffStat() { |
function WriteOffStat() { |
||||
return <div>WriteOffStat</div> |
|
||||
|
const [resultData, setResultData] = useState([]) |
||||
|
const [loading, setLoading] = useState(false) |
||||
|
const [defaultParams, setDefaultParams] = useSessionStorageState('writeOffStat_formData',{ |
||||
|
defaultValue:{} |
||||
|
}) |
||||
|
const [pageData, setPageData] = useSetState({ // 分页参数 |
||||
|
pn: defaultParams?.pn || 1, |
||||
|
page_size:defaultParams?.page_size || 20, |
||||
|
}) |
||||
|
const [formData, setFormData] = useSetState({ |
||||
|
name: defaultParams ? defaultParams.name : '', |
||||
|
status: defaultParams ? defaultParams.status : '', |
||||
|
coupon_type: defaultParams ? defaultParams.coupon_type : '', |
||||
|
}) |
||||
|
const getCountList = ()=>{ |
||||
|
ajax.getCountList().then((res)=>{ |
||||
|
if(res.status == 20000){ |
||||
|
setResultData(res.data) |
||||
|
}else{ |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
const columns = [ |
||||
|
{ |
||||
|
title: '序号', |
||||
|
dataIndex: 'id', |
||||
|
key: 'id', |
||||
|
width: 150, |
||||
|
}, |
||||
|
{ |
||||
|
title: '优惠券名称', |
||||
|
dataIndex: 'name', |
||||
|
key: 'name', |
||||
|
// width: 150, |
||||
|
ellipsis: true, |
||||
|
align: 'center' |
||||
|
}, |
||||
|
{ |
||||
|
title: '优惠券类型', |
||||
|
dataIndex: 'type', |
||||
|
key: 'type', |
||||
|
// width: 150, |
||||
|
ellipsis: true, |
||||
|
align: 'center' |
||||
|
}, |
||||
|
{ |
||||
|
title: '领取量', |
||||
|
dataIndex: 'get_num', |
||||
|
key: 'get_num', |
||||
|
// width: 150, |
||||
|
ellipsis: true, |
||||
|
align: 'center' |
||||
|
}, |
||||
|
{ |
||||
|
title: '使用量', |
||||
|
dataIndex: 'use_num', |
||||
|
key: 'use_num', |
||||
|
// width: 150, |
||||
|
ellipsis: true, |
||||
|
align: 'center' |
||||
|
}, |
||||
|
{ |
||||
|
title: '核销总额', |
||||
|
dataIndex: 'total', |
||||
|
key: 'total', |
||||
|
// width: 150, |
||||
|
ellipsis: true, |
||||
|
align: 'center' |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
const onShowSizeChange = (current, pageSize) => { |
||||
|
let pn |
||||
|
if (pageData.page_size == pageSize) { |
||||
|
pn = current |
||||
|
} else { |
||||
|
pn = 1 |
||||
|
} |
||||
|
setPageData({ |
||||
|
pn: pn, |
||||
|
page_size: pageSize, |
||||
|
}) |
||||
|
} |
||||
|
useEffect(()=>{ |
||||
|
getCountList() |
||||
|
},[]) |
||||
|
return ( |
||||
|
<> |
||||
|
<div className="inroad-search-container off-detail"> |
||||
|
<div className="left-search"> |
||||
|
<div className="title">查询条件</div> |
||||
|
<FormInput |
||||
|
yisaLabel="优惠券名称" |
||||
|
placeholder="输入优惠券名称" |
||||
|
value="aaa" |
||||
|
showClose={true} |
||||
|
onChange={e => { } } |
||||
|
/> |
||||
|
</div> |
||||
|
<div className="right-list"> |
||||
|
<ResultFlow |
||||
|
hasLoad={true} |
||||
|
loading={loading} |
||||
|
resultData={resultData.list} |
||||
|
message={"暂无数据"} |
||||
|
> |
||||
|
<div className="total-row-wrapper"> |
||||
|
{/* <ExportBtn {...exportParams} ><div className="export-content">导出</div></ExportBtn> */} |
||||
|
<span className="number-wrapper"> |
||||
|
<span className="letter">共查询到</span> |
||||
|
<span className="total-number"> {resultData.total} </span> |
||||
|
<span className="letter">条结果</span> |
||||
|
</span> |
||||
|
</div> |
||||
|
<div className="table-wrap"> |
||||
|
<Table |
||||
|
rowKey='id' |
||||
|
columns={columns} |
||||
|
className="yisa-table" |
||||
|
dataSource={resultData.list} |
||||
|
loading={loading} |
||||
|
pagination={false} |
||||
|
></Table> |
||||
|
</div> |
||||
|
<div> |
||||
|
<Pagination |
||||
|
className="pagination-common" |
||||
|
showSizeChanger={true} |
||||
|
showQuickJumper={true} |
||||
|
// showTotal={() => `共 ${total_records} 条`} |
||||
|
total={resultData.total} |
||||
|
current={pageData.pn} |
||||
|
pageSize={pageData.page_size} |
||||
|
pageSizeOptions={dictionary?.pageSizeOptions} |
||||
|
onChange={onShowSizeChange} |
||||
|
onShowSizeChange={onShowSizeChange} |
||||
|
/> |
||||
|
</div> |
||||
|
</ResultFlow> |
||||
|
</div> |
||||
|
</div> |
||||
|
</> |
||||
|
) |
||||
} |
} |
||||
|
|
||||
|
|
||||
export default WriteOffStat; |
export default WriteOffStat; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue