diff --git a/src/pages/order/order-summary-manage/index.jsx b/src/pages/order/order-summary-manage/index.jsx index 5b178ac..386b6c6 100644 --- a/src/pages/order/order-summary-manage/index.jsx +++ b/src/pages/order/order-summary-manage/index.jsx @@ -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: () => ( - - ), - }, - { - title: '商品名称', - dataIndex: 'goodsId', + title: '日期范围', + dataIndex: 'startTime', + valueType: 'dateRange', hideInTable: true, - valueType: 'select', - fixed: 'left', - width: 120, - renderFormItem: () => ( - + // ), + // }, + // { + // title: '商品名称', + // dataIndex: 'goodsId', + // hideInTable: true, + // valueType: 'select', + // fixed: 'left', + // width: 120, + // renderFormItem: () => ( + //