Przeglądaj źródła

订单汇总

tags/小炒逻辑变更前
gwbvipvip 2 lat temu
rodzic
commit
e9d98811ce
1 zmienionych plików z 193 dodań i 131 usunięć
  1. +193
    -131
      src/pages/order/order-summary-manage/index.jsx

+ 193
- 131
src/pages/order/order-summary-manage/index.jsx Wyświetl plik

@@ -1,12 +1,13 @@
import { DropboxOutlined, PlusOutlined, DownloadOutlined } from '@ant-design/icons';
import { Button, message, Select, Input, Drawer } from 'antd';
import { Button, message, Select, Input, Drawer,TreeSelect } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import ExportJsonExcel from 'js-export-excel';
import api from './service';

import { gettree } from '../../sys/org/service';
import moment from 'moment';
//页面 相当于 class
const Manage = () => {
//获取店铺类型(店铺类型)
@@ -22,8 +23,44 @@ const Manage = () => {
const [dataList, setdataList] = useState([]);
//绑定
const actionRef = useRef();

const [OrgList, setOrgList] = useState([]);
const [OrgListArray, setOrgListArray] = useState([]);
// 获取店铺分类、商品名称信息
useEffect(() => {


function initOrgList() {
gettree().then((r) => {
inittree(r.data);
function inittree(datas) {
for (var i in datas) {
if( datas[i]['type']==2|| datas[i]['type']==3){
datas[i]['disabled']=false;
}else{
datas[i]['disabled']=true;
}
if (datas[i].children) {
inittree(datas[i].children);
}
}
}
setOrgList(r.data);
let list = {};
formateData(r.data);
function formateData(datas) {
for (var i in datas) {
list[datas[i]['disabled']]=true;
list[datas[i]['value']] = { text: datas[i]['title'] };
if (datas[i].children) {
formateData(datas[i].children);
}
}
}
setOrgListArray(list);
});
}
// //加盟商
// function initfranchList() {
// api.franchList({ current: 1, pageSize: 20, status: '0' }).then((r) => {
@@ -85,6 +122,7 @@ const Manage = () => {
initsrdTypeList();
initgoodsList();
initgoodsTypeList();
initOrgList();
}, []);
function handleExport() {
const { ReqDetailList } = dataList; // 网络请求命名空间
@@ -138,31 +176,31 @@ const Manage = () => {
// title: '加盟商',
// dataIndex: 'franchiseeName',
// hideInSearch: true,
// // },
// {
// title: '店铺分类',
// dataIndex: 'storeTypeId',
// hideInTable: true,
// valueType: 'select',
// valueEnum: srdTypeList,
// fixed: 'left',
// width: 120,
// },
// {
// title: '订单时间',
// dataIndex: 'order_CreateTime',
// valueType: 'dateRange',
// width: 120,
// hideInTable: true,
// search: {
// transform: (value) => {
// return {
// order_CreateTime: value[0],
// order_EndTime: value[1],
// };
// },
// },
// },
{
title: '店铺分类',
dataIndex: 'storeTypeId',
hideInTable: true,
valueType: 'select',
valueEnum: srdTypeList,
fixed: 'left',
width: 120,
},
{
title: '订单时间',
dataIndex: 'order_CreateTime',
valueType: 'dateRange',
width: 120,
hideInTable: true,
search: {
transform: (value) => {
return {
order_CreateTime: value[0],
order_EndTime: value[1],
};
},
},
},
{
title: '店铺名称',
dataIndex: 'storeId',
@@ -170,57 +208,64 @@ const Manage = () => {
fixed: 'left',
width: 120,
renderFormItem: () => (
<Select
mode="multiple"
showArrow
placeholder="请选择店铺"
style={{ width: '100%' }}
options={srdList}
/>
<TreeSelect
style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={OrgList}
placeholder="归属门店"
treeDefaultExpandAll
/>
),
},
{
title: '商品类型',
dataIndex: 'goodsTypeId',
hideInTable: true,
valueType: 'select',
fixed: 'left',
width: 120,
renderFormItem: () => (
<Select
mode="multiple"
showArrow
placeholder="请选择商品类型"
style={{ width: '100%' }}
options={goodsTypeList}
/>
),
},
{
title: '商品名称',
dataIndex: 'goodsId',
title: '日期范围',
dataIndex: 'startTime',
valueType: 'dateRange',
hideInTable: true,
valueType: 'select',
fixed: 'left',
width: 120,
renderFormItem: () => (
<Select
mode="multiple"
showArrow
optionFilterProp="label"
placeholder="请选择商品"
style={{ width: '100%' }}
options={goodList}
/>
),
},
{
title: '店铺分类',
dataIndex: 'storeTypeName',
hideInSearch: true,
fixed: 'left',
width: 120,
initialValue: [],
},
// {
// title: '商品类型',
// dataIndex: 'goodsTypeId',
// hideInTable: true,
// valueType: 'select',
// fixed: 'left',
// width: 120,
// renderFormItem: () => (
// <Select
// mode="multiple"
// showArrow
// placeholder="请选择商品类型"
// style={{ width: '100%' }}
// options={goodsTypeList}
// />
// ),
// },
// {
// title: '商品名称',
// dataIndex: 'goodsId',
// hideInTable: true,
// valueType: 'select',
// fixed: 'left',
// width: 120,
// renderFormItem: () => (
// <Select
// mode="multiple"
// showArrow
// optionFilterProp="label"
// placeholder="请选择商品"
// style={{ width: '100%' }}
// options={goodList}
// />
// ),
// },
// {
// title: '店铺分类',
// dataIndex: 'storeTypeName',
// hideInSearch: true,
// fixed: 'left',
// width: 120,
// },

{
title: '店铺名称',
@@ -230,24 +275,24 @@ const Manage = () => {
width: 120,
},

{
title: '商品类型',
dataIndex: 'goodsTypeName',
hideInSearch: true,
fixed: 'left',
width: 120,
},
// {
// title: '商品类型',
// dataIndex: 'goodsTypeName',
// hideInSearch: true,
// fixed: 'left',
// width: 120,
// },

{
title: '商品名称',
dataIndex: 'goodsName',
hideInSearch: true,
fixed: 'left',
width: 120,
},
// {
// title: '商品名称',
// dataIndex: 'goodsName',
// hideInSearch: true,
// fixed: 'left',
// width: 120,
// },
{
title: '应付款金额',
dataIndex: 'order_OriginalMoney',
dataIndex: 'orderOriginalMoney',
renderText: (val) => `${val}¥`,
hideInSearch: true,
fixed: 'left',
@@ -255,7 +300,7 @@ const Manage = () => {
},
{
title: '实际付款金额',
dataIndex: 'order_RealMoney',
dataIndex: 'orderRealMoney',
hideInSearch: true,
renderText: (val) => `${val}¥`,
fixed: 'left',
@@ -263,7 +308,7 @@ const Manage = () => {
},
{
title: '退款金额',
dataIndex: 'refundMoney',
dataIndex: 'refundRealMoney',
hideInSearch: true,
renderText: (val) => `${val}¥`,
fixed: 'left',
@@ -276,57 +321,64 @@ const Manage = () => {
fixed: 'left',
width: 120,
},
// {
// title: '下单总碗数(碗)',
// dataIndex: 'countDetail',
// hideInSearch: true,
// fixed: 'left',
// width: 160,
// },
{
title: '下单总碗数(碗)',
dataIndex: 'countDetail',
hideInSearch: true,
fixed: 'left',
width: 160,
},
{
title: '退款订单',
dataIndex: 'refund',
title: '正常订单',
dataIndex: 'successfulCount',
hideInSearch: true,
fixed: 'left',
width: 120,
},
{
title: '退款碗数(碗)',
dataIndex: 'refundNum',
title: '退款订单',
dataIndex: 'refundCount',
hideInSearch: true,
fixed: 'left',
width: 120,
},
{
title: '正常订单(碗)',
dataIndex: 'orderNum',
hideInSearch: true,
width: 120,
},
{
title: '盲盒订单(碗)',
dataIndex: 'boxNum',
hideInSearch: true,
width: 120,
},
{
title: '立即吃面订单(碗)',
dataIndex: 'nowNum',
hideInSearch: true,
width: 160,
},
{
title: '废弃订单(碗)',
dataIndex: 'abandoned',
hideInSearch: true,
width: 120,
},
{
title: '下单总人数',
dataIndex: 'customer',
hideInSearch: true,
width: 120,
},
// {
// title: '退款碗数(碗)',
// dataIndex: 'refundNum',
// hideInSearch: true,
// fixed: 'left',
// width: 120,
// },
// {
// title: '正常订单(碗)',
// dataIndex: 'orderNum',
// hideInSearch: true,
// width: 120,
// },
// {
// title: '盲盒订单(碗)',
// dataIndex: 'boxNum',
// hideInSearch: true,
// width: 120,
// },
// {
// title: '立即吃面订单(碗)',
// dataIndex: 'nowNum',
// hideInSearch: true,
// width: 160,
// },
// {
// title: '废弃订单(碗)',
// dataIndex: 'abandoned',
// hideInSearch: true,
// width: 120,
// },
// {
// title: '下单总人数',
// dataIndex: 'customer',
// hideInSearch: true,
// width: 120,
// },
];

return (
@@ -371,7 +423,17 @@ const Manage = () => {
// }
// 表单搜索项会从 params 传入,传递给后端接口。
//const msg = await api.orderSummaryList(params);
await api.orderSummaryList(params).then((r) => {

var obj=
{
current:params.current,
pageSize:params.pageSize,
storeId:[params.storeId],
Order_CreateTime:params.startTime[0],
Order_EndTime:params.startTime[1]

}
await api.orderSummaryList(obj).then((r) => {
orderSummayData = r.data.data;
total = r.data.total;
setdataList(r.data.data);


Ładowanie…
Anuluj
Zapisz