🐞 fix(ID1000759): 提货按钮无效
【提货按钮无效】 https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001000759
This commit is contained in:
parent
1a87fb7cbc
commit
3848d26501
@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState, FC, memo } from 'rea
|
||||
import styles from './index.module.scss'
|
||||
import Search from '@/components/search'
|
||||
import { DeliverNoticeOrderList, EnumSaleorderStatus } from '@/api/index'
|
||||
import Taro from '@tarojs/taro'
|
||||
import Taro, { useDidShow } from '@tarojs/taro'
|
||||
import { useRouter } from '@tarojs/taro'
|
||||
import InfiniteScroll from '@/components/infiniteScroll'
|
||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||
@ -38,6 +38,8 @@ const Delivery: FC = () => {
|
||||
const [search, setSearch] = useState<SearchData>(defaultSearchFields)
|
||||
const [deliveryOrderList, setDeliveryOrderList] = useState<{ list: any[]; total: number }>({ list: [], total: 0 })
|
||||
|
||||
const isFirst = useRef(true)
|
||||
|
||||
const { fetchData: FetchDeliveryOrderList, state: orderState } = DeliverNoticeOrderList()
|
||||
//数据加载状态
|
||||
const statusMore = useMemo(() => {
|
||||
@ -51,10 +53,15 @@ const Delivery: FC = () => {
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('useEffect ===> search', search)
|
||||
if(!isFirst.current){
|
||||
getData()
|
||||
}
|
||||
}, [search])
|
||||
|
||||
useDidShow(()=>{
|
||||
getData()
|
||||
})
|
||||
|
||||
//上拉加载数据
|
||||
const pageNum = useRef({ size: search.size, page: search.page })
|
||||
|
||||
|
@ -36,7 +36,7 @@ const ItemList:FC<PropsType> = (props) => {
|
||||
confirmColor: '#337FFF',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const res = await fetchData({ id })
|
||||
const res = await fetchData({ take_goods_order_id: [id] })
|
||||
if (res.success) {
|
||||
Taro.showToast({ title: '提货成功', icon: 'success' })
|
||||
onSuccess?.()
|
||||
@ -66,7 +66,7 @@ const ItemList:FC<PropsType> = (props) => {
|
||||
<View className={styles.content__row__left}>货品信息:</View>
|
||||
<View className={styles.content__row__right}>
|
||||
<SaleModeTag saleMode={itemData.sale_mode} size='small' customClassName={styles.tag}></SaleModeTag>
|
||||
{itemData.delivery_product_nums}种面料,{itemData.delivery_product_color_nums}种颜色,共
|
||||
{itemData.product_count}种面料,{itemData.product_color_count}种颜色,共
|
||||
{itemData?.sale_mode === EnumSaleMode.Bulk ? `${itemData?.take_roll}条` : `${formatMeterDiv(itemData?.take_meters)}米`}
|
||||
</View>
|
||||
</View>
|
||||
|
@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState, FC, memo } from 'rea
|
||||
import styles from './index.module.scss'
|
||||
import Search from '@/components/search'
|
||||
import { TakeGoodsOrderList } from '@/api/index'
|
||||
import Taro from '@tarojs/taro'
|
||||
import Taro, { useDidShow } from '@tarojs/taro'
|
||||
import { useRouter } from '@tarojs/taro'
|
||||
import InfiniteScroll from '@/components/infiniteScroll'
|
||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||
@ -40,6 +40,8 @@ const Delivery: FC = () => {
|
||||
const [search, setSearch] = useState<SearchData>(defaultSearchFields)
|
||||
const [takeDeliveryOrderList, setDeliveryOrderList] = useState<{ list: any[]; total: number }>({ list: [], total: 0 })
|
||||
|
||||
const isFirst = useRef(true)
|
||||
|
||||
const { fetchData: FetchDeliveryOrderList, state: orderState } = TakeGoodsOrderList()
|
||||
//数据加载状态
|
||||
const statusMore = useMemo(() => {
|
||||
@ -54,9 +56,17 @@ const Delivery: FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
console.log('useEffect ===> search', search)
|
||||
// 已经不是第一次加载该页面了
|
||||
if(!isFirst.current){
|
||||
getData()
|
||||
}
|
||||
}, [search])
|
||||
|
||||
useDidShow(()=>{
|
||||
getData()
|
||||
isFirst.current = false
|
||||
})
|
||||
|
||||
//上拉加载数据
|
||||
const pageNum = useRef({ size: search.size, page: search.page })
|
||||
|
||||
|
@ -66,7 +66,7 @@ const TakeDeliveryDetail: FC = () => {
|
||||
<View className={styles['detailInfoItem--detail--count']}>
|
||||
x{weightItem?.sale_mode === 0 ? `${weightItem.sale_roll} 条` : `${formatMeterDiv(weightItem?.sale_length || 0)} 米`}
|
||||
</View>
|
||||
<View className={styles['detailInfoItem--detail--weight']}>{formatWeightDiv(weightItem.weight)}/kg</View>
|
||||
<View className={styles['detailInfoItem--detail--weight']}>{formatWeightDiv(weightItem.weight)}kg</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
@ -119,7 +119,7 @@ const TakeDeliveryDetail: FC = () => {
|
||||
title: '确定要提货?',
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
const res = await FetchAudit({ id: Number(router.params.id) })
|
||||
const res = await FetchAudit({ take_goods_order_id: [Number(router.params.id)] })
|
||||
if (res.success) {
|
||||
alert.success('提货成功')
|
||||
getData()
|
||||
@ -174,9 +174,9 @@ const TakeDeliveryDetail: FC = () => {
|
||||
<View className={styles.total}>
|
||||
<Text>汇总:</Text>
|
||||
<Text className={styles.totalContent}>
|
||||
共{detailInfo?.dyelot_number_list?.length || 0}种面料,4种颜色,共
|
||||
{detailInfo?.sale_mode === 0 ? `${detailInfo?.take_roll}条` : `${formatMeterDiv(detailInfo?.take_meters)}米`}
|
||||
,重量{detailInfo?.weight}kg
|
||||
共{detailInfo?.product_count || 0}种面料,{detailInfo?.product_color_count || 0}种颜色,共
|
||||
{detailInfo?.sale_mode === 0 ? `${detailInfo?.take_roll}条` : `${formatMeterDiv(detailInfo?.take_meters).toLocaleString()}米`}
|
||||
,重量{formatWeightDiv(detailInfo?.total_take_weight).toLocaleString()}kg
|
||||
</Text>
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
|
Loading…
x
Reference in New Issue
Block a user