From ca9638ca48868a796609cdc7d9d070d48c95b44b Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Fri, 11 Nov 2022 17:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=E4=BF=AE=E5=A4=8D=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=E4=B8=8D=E5=85=81=E8=AE=B8=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/goodsItem/index.tsx | 2 +- .../components/ChoseCity/index.tsx | 21 +++++++++++++----- .../components/Sort/index.tsx | 22 ++++++++++++------- .../components/Tag/index.tsx | 21 +++++++++++++----- src/pages/customerManagement/index.tsx | 11 ++++++---- src/pages/newCollection/index.tsx | 14 ++++++------ src/pages/saleStatistic/index.tsx | 1 - 7 files changed, 59 insertions(+), 33 deletions(-) diff --git a/src/components/goodsItem/index.tsx b/src/components/goodsItem/index.tsx index 2f1bd17..6915265 100644 --- a/src/components/goodsItem/index.tsx +++ b/src/components/goodsItem/index.tsx @@ -70,7 +70,7 @@ export default memo((props: props) => { {props.value?.code} {props.value?.name} 剩:{props.value?.roll}件 - 空差:{props?.value?.weight_error as number / 1000}Kg + 空差:{props?.value?.weight_error as number / 1000 || 0}Kg ¥{props?.modeFont === 0 ? Number(props.value?.bulk_price) / 100 : props.modeFont === 1 ? Number(props.value?.length_cut_price) / 100 : Number(props.value?.weight_cut_price) / 100}{props.modeFont != 1 ? '/Kg' : '/m'} diff --git a/src/pages/customerManagement/components/ChoseCity/index.tsx b/src/pages/customerManagement/components/ChoseCity/index.tsx index 2bc5b06..93003fc 100644 --- a/src/pages/customerManagement/components/ChoseCity/index.tsx +++ b/src/pages/customerManagement/components/ChoseCity/index.tsx @@ -11,20 +11,29 @@ import Tabs from "../tabs" import IconFont from '@/components/iconfont/iconfont'; interface Props { handCity?: (province: any, city: any) => void, - value?: any + value?: any, + onCloseOverlay?: () => void } export default memo(forwardRef((props: Props, ref) => { - useImperativeHandle(ref, () => ({ - close, - DropDownItemRef - })) + const DropDownItemRef = useRef() const close = () => { DropDownItemRef.current.closePopup() } + useImperativeHandle( + ref, + () => { + return { + show: DropDownItemRef?.current?.show, + showPopup: DropDownItemRef?.current.showPopup, + closePopup: DropDownItemRef?.current?.closePopup, + } + }, + [DropDownItemRef?.current], + ) //获取地址 const { fetchData } = GetAddressListApi() @@ -183,7 +192,7 @@ export default memo(forwardRef((props: Props, ref) => { props.handCity?.('', '') } return ( - + handChose?.(item)} handReset={() => handReset()}> { diff --git a/src/pages/customerManagement/components/Sort/index.tsx b/src/pages/customerManagement/components/Sort/index.tsx index e5d3730..b6ad07c 100644 --- a/src/pages/customerManagement/components/Sort/index.tsx +++ b/src/pages/customerManagement/components/Sort/index.tsx @@ -8,7 +8,8 @@ import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format import DropDownItem from '@/components/dropDown-item' interface Props { handSort?: (any) => void, - value?: any + value?: any, + onCloseOverlay?: () => void } type ListType = { @@ -20,12 +21,17 @@ type ListType = { export default memo(forwardRef((props: Props, ref) => { const DropDownItemRef = useRef() - // const close = () => { - // DropDownItemRef.current.closePopup() - // } - useImperativeHandle(ref, () => ({ - DropDownItemRef - })) + useImperativeHandle( + ref, + () => { + return { + show: DropDownItemRef?.current?.show, + showPopup: DropDownItemRef?.current.showPopup, + closePopup: DropDownItemRef?.current?.closePopup, + } + }, + [DropDownItemRef?.current], + ) const [list, setlist] = useState([ @@ -88,7 +94,7 @@ export default memo(forwardRef((props: Props, ref) => { return ( - + { list.map((item, index) => { diff --git a/src/pages/customerManagement/components/Tag/index.tsx b/src/pages/customerManagement/components/Tag/index.tsx index f147e8e..80de9ad 100644 --- a/src/pages/customerManagement/components/Tag/index.tsx +++ b/src/pages/customerManagement/components/Tag/index.tsx @@ -5,21 +5,30 @@ import classnames from "classnames"; import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro'; import { alert } from '@/common/common' import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format' -import {EnumPurchaserType} from '@/api/order' +import { EnumPurchaserType } from '@/api/order' import DropDownItem from '@/components/dropDown-item' import { mppurchaserlist } from "@/api/customer" interface Props { handType: (any) => void, handTags: (any) => void, - value?: any + value?: any, + onCloseOverlay?: () => void } export default memo(forwardRef((props: Props, ref) => { const DropDownItemRef = useRef() - useImperativeHandle(ref, () => ({ - DropDownItemRef - })) + useImperativeHandle( + ref, + () => { + return { + show: DropDownItemRef?.current?.show, + showPopup: DropDownItemRef?.current.showPopup, + closePopup: DropDownItemRef?.current?.closePopup, + } + }, + [DropDownItemRef?.current], + ) const [currentValue, setCurrentValue] = useState(-1) const [list, setlist] = useState([ @@ -81,7 +90,7 @@ export default memo(forwardRef((props: Props, ref) => { } return ( - + 客户类型 diff --git a/src/pages/customerManagement/index.tsx b/src/pages/customerManagement/index.tsx index cf43e8d..4ffd007 100644 --- a/src/pages/customerManagement/index.tsx +++ b/src/pages/customerManagement/index.tsx @@ -16,6 +16,7 @@ import ItemLiist from "./components/ItemList" import InfiniteScroll from '@/components/infiniteScroll' import { ClientListApi } from '@/api/order' import { goLink } from '@/common/common' +import SelectGroup from '@/components/SelectGroup' export default () => { const [searchField, setSearchField] = useState< @@ -142,10 +143,12 @@ export default () => { - - - - + + + true}> + true}> + true}> + 共 {orderData?.total || 0} 个客户 diff --git a/src/pages/newCollection/index.tsx b/src/pages/newCollection/index.tsx index 0062c6d..258764e 100644 --- a/src/pages/newCollection/index.tsx +++ b/src/pages/newCollection/index.tsx @@ -29,8 +29,8 @@ export default () => { page: 1, size: 10, search_name: '', - start_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).format('YYYY-MM-DD')} 00:00:00`, - end_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).add(14, 'day').format('YYYY-MM-DD')} 00:00:00`, + start_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).subtract(14, 'day').format('YYYY-MM-DD')} 00:00:00`, + end_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).format('YYYY-MM-DD')} 00:00:00`, }) const pageNum = useRef({ size: searchField.size, page: searchField.page }) @@ -73,7 +73,7 @@ export default () => { } //数据加载状态 const statusMore = useMemo(() => { - return dataLoadingStatus({ list: orderData.list, total: orderData.total, status: orderState.loading }) + return dataLoadingStatus({ list: orderData.list, total: orderData.total, status: orderState.loading as any }) }, [orderData, orderState]) //上拉加载数据 @@ -119,8 +119,8 @@ export default () => { { id: 1, name: '默认14天内', - start_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).format('YYYY-MM-DD')} 00:00:00`, - end_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).add(14, 'day').format('YYYY-MM-DD')} 00:00:00`, + start_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).subtract(14, 'day').format('YYYY-MM-DD')} 00:00:00`, + end_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).format('YYYY-MM-DD')} 00:00:00`, checked: true }, { @@ -164,8 +164,8 @@ export default () => { pageNum.current.size = 10 setSearchField({ ...searchField, - start_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).format('YYYY-MM-DD')} 00:00:00`, - end_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).add(14, 'day').format('YYYY-MM-DD')} 00:00:00`, + start_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).subtract(14, 'day').format('YYYY-MM-DD')} 00:00:00`, + end_time: `${dayjs(new Date(myDate?.toLocaleDateString() + ' ' + '00:00:00',)).format('YYYY-MM-DD')} 00:00:00`, size: 10 }) setStart(myDate.toLocaleDateString()) diff --git a/src/pages/saleStatistic/index.tsx b/src/pages/saleStatistic/index.tsx index 29a74c8..8b17652 100644 --- a/src/pages/saleStatistic/index.tsx +++ b/src/pages/saleStatistic/index.tsx @@ -165,7 +165,6 @@ const saleStatistic = () => { - true} ref={selectSaleTypeRef}> true} ref={selectMarketingDepartmentRef}> true} defaultValue='0' timeOptions={FilterTimeOptions} ref={selectTimePickerRef}>