🐞 fix:修复客户管理不允许二次弹窗

This commit is contained in:
Haiyi 2022-11-11 17:58:46 +08:00
parent 45c656e0ed
commit ca9638ca48
7 changed files with 59 additions and 33 deletions

View File

@ -70,7 +70,7 @@ export default memo((props: props) => {
<View className={styles.leftFontsbox}>
<View className={styles.title}>{props.value?.code} {props.value?.name}</View>
<View className={styles.productNums}>{props.value?.roll}</View>
<View className={styles.productName}>{props?.value?.weight_error as number / 1000}Kg</View>
<View className={styles.productName}>{props?.value?.weight_error as number / 1000 || 0}Kg</View>
</View>
<View className={styles.rightFontsbox}>
<View className={styles.money}>¥{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'}</View>

View File

@ -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<any>()
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 (
<DropDownItem ref={DropDownItemRef} title={'所有省市'} value={-1} activeColor='#337fff'>
<DropDownItem ref={DropDownItemRef} title={'所有省市'} value={-1} activeColor='#337fff' onCloseOverlay={props?.onCloseOverlay}>
<View className={styles.mainBox}>
<Tabs list={TarBarList} handChose={(item) => handChose?.(item)} handReset={() => handReset()}></Tabs>
{

View File

@ -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<any>()
// 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<ListType[]>([
@ -88,7 +94,7 @@ export default memo(forwardRef((props: Props, ref) => {
return (
<DropDownItem ref={DropDownItemRef} title={title} value={currentValue} activeColor='#337fff'>
<DropDownItem ref={DropDownItemRef} title={title} value={currentValue} activeColor='#337fff' onCloseOverlay={props?.onCloseOverlay}>
<View className={styles.mainBox}>
{
list.map((item, index) => {

View File

@ -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<any>()
useImperativeHandle(ref, () => ({
DropDownItemRef
}))
useImperativeHandle(
ref,
() => {
return {
show: DropDownItemRef?.current?.show,
showPopup: DropDownItemRef?.current.showPopup,
closePopup: DropDownItemRef?.current?.closePopup,
}
},
[DropDownItemRef?.current],
)
const [currentValue, setCurrentValue] = useState<number>(-1)
const [list, setlist] = useState<any[]>([
@ -81,7 +90,7 @@ export default memo(forwardRef((props: Props, ref) => {
}
return (
<DropDownItem ref={DropDownItemRef} title={'自定标签'} value={currentValue} activeColor='#337fff'>
<DropDownItem ref={DropDownItemRef} title={'自定标签'} value={currentValue} activeColor='#337fff' onCloseOverlay={props?.onCloseOverlay}>
<View className={styles.mainBox}>
<View className={styles.pussTitle}></View>
<View className={styles.pussBox}>

View File

@ -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 () => {
<View className={styles.search_input}>
<Search placeholder='搜索客户名称、电话、业务员' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} />
</View>
<View className={styles.menuBox}>
<Sort ref={SortRef} handSort={handSort}></Sort>
<ChoseCity ref={ChoseCityRef} handCity={handCity}></ChoseCity>
<Tag ref={TagRef} handTags={handTags} handType={handType}></Tag>
<View className={styles.menuBox} >
<SelectGroup>
<Sort ref={SortRef} handSort={handSort} onCloseOverlay={() => true}></Sort>
<ChoseCity ref={ChoseCityRef} handCity={handCity} onCloseOverlay={() => true}></ChoseCity>
<Tag ref={TagRef} handTags={handTags} handType={handType} onCloseOverlay={() => true}></Tag>
</SelectGroup>
</View>
</View>
<View className={styles.totalFont}> {orderData?.total || 0} </View>

View File

@ -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())

View File

@ -165,7 +165,6 @@ const saleStatistic = () => {
<View className={styles.saleStatistic}>
<View className={styles['saleStatistic--filterBar']}>
<SelectGroup>
<View></View>
<SelectSaleType onChange={onChangeSaleType} onCloseOverlay={()=>true} ref={selectSaleTypeRef}></SelectSaleType>
<SelectMarketingDepartment onChange={onChangeDepartment} onCloseOverlay={()=>true} ref={selectMarketingDepartmentRef}></SelectMarketingDepartment>
<SelectTimePicker onChange={onChangeTimePicker} onCloseOverlay={()=>true} defaultValue='0' timeOptions={FilterTimeOptions} ref={selectTimePickerRef}></SelectTimePicker>