diff --git a/src/api/delivery/index.ts b/src/api/delivery/index.ts new file mode 100644 index 0000000..fe211d4 --- /dev/null +++ b/src/api/delivery/index.ts @@ -0,0 +1,51 @@ +import { useRequest } from '@/use/useHttp' +//列表 +export const DeliverNoticeOrderList = () => { + return useRequest({ + url: `/v1/mp/deliveryNoticeOrder/list`, + method: 'get', + }) +} +//发货详情 +export const DeliverNoticeOrder = () => { + return useRequest({ + url: `/v1/mp/deliveryNoticeOrder`, + method: 'get', + }) +} +//发货附件上传 +export const DeliveryNoticeOrderUpload = () => { + return useRequest({ + url: `/v1/mp/deliveryNoticeOrder/upload`, + method: 'put', + }) +} +//审核发货单 +export const DeliveryNoticeOrderAudit = () => { + return useRequest({ + url: `/v1/mp/deliveryNoticeOrder/audit`, + method: 'put', + }) +} +//采购退货的拒收接口 +export const DeliveryNoticeOrderRejection = () => { + return useRequest({ + url: `/v1/mp/deliveryNoticeOrder/rejection`, + method: 'put', + }) +} + +//类型枚举 +export const EnumDeliveryNoticeTypeList = () => { + return useRequest({ + url: `/v1/mp/enum/deliveryNoticeType/list`, + method: 'get', + }) +} +//tabs枚举 +export const EnumSaleorderStatus = () => { + return useRequest({ + url: `/v1/mp/enum/sale/order/status`, + method: 'get', + }) +} diff --git a/src/api/index.ts b/src/api/index.ts index 5fd0136..35f83bc 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -11,6 +11,16 @@ export { export { ShoppingCartUpdateApi, ShoppingCartDeleteApi, ShoppingCartListApi } from './shopping/index' +export { + DeliverNoticeOrderList, + DeliverNoticeOrder, + DeliveryNoticeOrderUpload, + DeliveryNoticeOrderAudit, + DeliveryNoticeOrderRejection, + EnumDeliveryNoticeTypeList, + EnumSaleorderStatus, +} from './delivery/index' + import { useRequest } from '@/use/useHttp' /** * 系列列表 diff --git a/src/components/SegmentedControl/index.module.scss b/src/components/SegmentedControl/index.module.scss index 3e79f43..3a40726 100644 --- a/src/components/SegmentedControl/index.module.scss +++ b/src/components/SegmentedControl/index.module.scss @@ -1,19 +1,22 @@ -.status_list{ - background-color: #fff; - font-size: $font_size; - color: #000; - // margin-top: 20px; - .status_item{ - padding: 20px; - box-sizing: border-box; - } - .selected{ - font-weight: 700; - color: #337FFF; - border-bottom: 4px solid #337FFF; - } - .list_scroll{ - white-space: nowrap; - display: flex; - } +.status_list { + display: flex; + flex-flow: row nowrap; + background-color: #fff; + font-size: $font_size; + color: #000; + // margin-top: 20px; + .status_item { + padding: 20px; + box-sizing: border-box; + } + .list_scroll { + display: flex; + justify-content: space-around; + white-space: nowrap; + } +} +.selected { + font-weight: 700; + color: #337fff; + border-bottom: 4px solid #337fff; } diff --git a/src/components/SegmentedControl/index.tsx b/src/components/SegmentedControl/index.tsx index 10d7ad1..72e8f93 100644 --- a/src/components/SegmentedControl/index.tsx +++ b/src/components/SegmentedControl/index.tsx @@ -3,9 +3,14 @@ import classnames from 'classnames' import { FC, useEffect, useState } from 'react' import styles from './index.module.scss' +type Segment = { + id: number + name: string +} + type PropsType = { - list: { id: number; name: string }[] - defaultId?: number | null + list: Segment[] + defaultId?: number onSelect?: (val: number) => void } @@ -14,9 +19,10 @@ const segmentedControl: FC = (props) => { selected: -1, //当前选中的id tabId: '', //需要滚动到的id }) - const { list, defaultId, onSelect } = props + const { list, defaultId = -1, onSelect } = props useEffect(() => { + console.log('defaultId', defaultId) if (typeof defaultId === 'number' && defaultId >= 0) { console.log('defaultId:::', defaultId) const index = list?.findIndex((item) => { @@ -28,6 +34,7 @@ const segmentedControl: FC = (props) => { } } setSelectInfo((e) => ({ ...e, selected: defaultId || -1 })) + console.log('selectInfo', selectInfo) }, [defaultId]) const clickEvent = ({ item, index }: { item: any; index: number }) => { @@ -41,12 +48,13 @@ const segmentedControl: FC = (props) => { {list.map((item, index) => { + console.log('selected=+>', selectInfo.selected) return ( clickEvent({ item, index })} - className={classnames(styles.status_item, selectInfo.selected == item.id && styles.selected)}> + className={classnames(styles.status_item, selectInfo.selected === item.id ? styles.selected : '')}> {item.name} ) diff --git a/src/components/tag/index.tsx b/src/components/tag/index.tsx index ec3a84f..4300a89 100644 --- a/src/components/tag/index.tsx +++ b/src/components/tag/index.tsx @@ -15,10 +15,21 @@ interface PropsType { onClick?: Function circle?: boolean customStyle?: React.CSSProperties + customClassName?: string } const Tag: FC = (props) => { - const { type = 'primary', size = 'normal', disabled = false, children, onClick, circle = false, customStyle = {}, plain = false } = props + const { + type = 'primary', + size = 'normal', + disabled = false, + children, + onClick, + circle = false, + customStyle = {}, + plain = false, + customClassName = '', + } = props const handleClick = (event) => { if (disabled) { return @@ -37,7 +48,7 @@ const Tag: FC = (props) => { return classObject } return ( - + {children} ) diff --git a/src/pages/delivery/components/ItemList/index.module.scss b/src/pages/delivery/components/ItemList/index.module.scss index 818974d..dcb414f 100644 --- a/src/pages/delivery/components/ItemList/index.module.scss +++ b/src/pages/delivery/components/ItemList/index.module.scss @@ -2,18 +2,19 @@ margin: 24px; } .topBar { + font-size: 28px; &__orderNo { display: flex; flex-flow: row nowrap; justify-content: space-between; color: $color_font_one; - font-size: 28px; } &__orderType { color: rgba($color: #000000, $alpha: 0.6); font-weight: 550; } &__orderStatus { + font-weight: 550; color: #e42945; } } @@ -36,10 +37,11 @@ flex-flow: row nowrap; justify-content: flex-end; align-items: center; - padding: 0 24px; margin-top: 10px; &__button { margin: 0 24px; + font-size: 28px; + padding: 0 26px; } &__button:last-child { margin: 0; @@ -48,3 +50,6 @@ .bord { color: $color_font_one; } +.tag{ + margin: 0 16px; +} diff --git a/src/pages/delivery/components/ItemList/index.tsx b/src/pages/delivery/components/ItemList/index.tsx index 69c90a9..d1d11b6 100644 --- a/src/pages/delivery/components/ItemList/index.tsx +++ b/src/pages/delivery/components/ItemList/index.tsx @@ -5,6 +5,7 @@ import { View, Text } from '@tarojs/components' import { FC } from 'react' import NormalButton from '@/components/normalButton' import styles from './index.module.scss' +import classnames from 'classnames' type PropsType = { itemData?: Record @@ -30,12 +31,12 @@ const ItemList:FC = (props) => { 销售发货单 - + - + 货品信息: - + 大货 2种面料,4种颜色,共5米 @@ -51,7 +52,12 @@ const ItemList:FC = (props) => { - + 查看详情 diff --git a/src/pages/delivery/index.module.scss b/src/pages/delivery/index.module.scss index 3deedf7..709f21e 100644 --- a/src/pages/delivery/index.module.scss +++ b/src/pages/delivery/index.module.scss @@ -1,104 +1,29 @@ page { background: #f7f7f7; + height: 100%; + display: flex; + flex-flow: column nowrap; } .delivery { display: flex; flex-flow: column nowrap; + overflow: hidden; + padding-bottom: env(safe-area-inset-bottom); .searchBox { display: flex; align-items: center; background: #ffffff; padding: 8px 24px; - + flex: none; } .listBox { + flex: 1 1 auto; background-color: #f7f7f7; + overflow: scroll; } - .itemBox { - margin-left: 24px; - background: #ffffff; - border-radius: 16px; - display: flex; - align-items: center; - margin-top: 24px; - box-sizing: border-box; - - .cussName { - margin-left: 48px; - width: 168px; - height: 34px; - font-size: 28px; - font-family: PingFangSC-Medium, PingFang SC; - font-weight: 500; - color: #000000; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - .phone { - margin-left: 88px; - font-size: 28px; - font-family: PingFangSC-Regular, PingFang SC; - font-weight: 400; - color: #000000; - } - - .woker { - margin-left: 88px; - font-size: 28px; - font-family: PingFangSC-Regular, PingFang SC; - font-weight: 400; - color: #000000; - - } - } - - .acticveitemBox { - margin-left: 24px; - width: 702px; - height: 104px; - background: #ffffff; - border-radius: 16px; - display: flex; - align-items: center; - margin-top: 24px; - box-sizing: border-box; - - border: 1px solid #337fff; - - .cussName { - margin-left: 48px; - width: 168px; - height: 34px; - font-size: 28px; - font-family: PingFangSC-Medium, PingFang SC; - font-weight: 500; - color: #000000; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - .phone { - margin-left: 88px; - font-size: 28px; - font-family: PingFangSC-Regular, PingFang SC; - font-weight: 400; - color: #000000; - } - - .woker { - margin-left: 88px; - font-size: 28px; - font-family: PingFangSC-Regular, PingFang SC; - font-weight: 400; - color: #000000; - } - } } .scanHandler{ width: 40px; diff --git a/src/pages/delivery/index.tsx b/src/pages/delivery/index.tsx index e98cf5f..5a6b85b 100644 --- a/src/pages/delivery/index.tsx +++ b/src/pages/delivery/index.tsx @@ -9,123 +9,123 @@ import { useRouter } from '@tarojs/taro' import InfiniteScroll from '@/components/infiniteScroll' import { dataLoadingStatus, getFilterData } from '@/common/util' import IconText from '@/components/iconText' -import SegmentedControl from '@/components/SegmentedControl' +import SegmentedControl from '@/components/segmentedControl' import IconFont from '@/components/iconfont/iconfont' import ItemList from './components/ItemList' // 发货列表 const Delivery: FC = () => { - const [search, setSearch] = useState({ - name: null, - page: 1, - size: 10, - }) - const [clentList, setClientlist] = useState<{ list: any[]; total: number }>({ list: [], total: 0 }) + // const [search, setSearch] = useState({ + // name: null, + // page: 1, + // size: 10, + // }) + // const [clentList, setClientlist] = useState<{ list: any[]; total: number }>({ list: [], total: 0 }) - const { fetchData: clitentFetch, state: orderState } = ClientListApi() - //数据加载状态 - const statusMore = useMemo(() => { - return dataLoadingStatus({ list: clentList.list, total: clentList.total, status: orderState.loading }) - }, [clentList, orderState]) + // const { fetchData: clitentFetch, state: orderState } = ClientListApi() + // //数据加载状态 + // const statusMore = useMemo(() => { + // return dataLoadingStatus({ list: clentList.list, total: clentList.total, status: orderState.loading }) + // }, [clentList, orderState]) - const [clientObj, setclientObj] = useState({ - clientId: null, - clientName: '', - }) + // const [clientObj, setclientObj] = useState({ + // clientId: null, + // clientName: '', + // }) //输入了搜索关键字 const getSearchData = useCallback((eq) => { - pageNum.current.page = 1 - setClientlist(() => ({ list: [], total: 0 })) - setSearch((e) => ({ ...e, name: eq, size: 10 })) + // pageNum.current.page = 1 + // setClientlist(() => ({ list: [], total: 0 })) + // setSearch((e) => ({ ...e, name: eq, size: 10 })) }, []) - const router = useRouter() + // const router = useRouter() - useEffect(() => { - if (search.name === '') { - setSearch((e) => ({ ...e, name: null })) - } - if (search.name !== '') getCuss() - }, [search]) + // useEffect(() => { + // if (search.name === '') { + // setSearch((e) => ({ ...e, name: null })) + // } + // if (search.name !== '') getCuss() + // }, [search]) - //上拉加载数据 - const pageNum = useRef({ size: search.size, page: search.page }) - const getScrolltolower = useCallback(() => { - if (clentList.list.length < clentList.total) { - pageNum.current.page++ - const size = pageNum.current.size * pageNum.current.page - setSearch((e) => ({ ...e, size })) - console.log(search, 11111) - } - }, [clentList]) + // //上拉加载数据 + // const pageNum = useRef({ size: search.size, page: search.page }) + // const getScrolltolower = useCallback(() => { + // if (clentList.list.length < clentList.total) { + // pageNum.current.page++ + // const size = pageNum.current.size * pageNum.current.page + // setSearch((e) => ({ ...e, size })) + // console.log(search, 11111) + // } + // }, [clentList]) - //列表下拉刷新 - const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false) - const getRefresherRefresh = async () => { - pageNum.current.size = 1 - setRefresherTriggeredStatus(true) - setSearch((val) => ({ ...val, size: 10 })) - } - const getCuss = async () => { - let res = await clitentFetch({ name: search.name === null ? '' : search.name, page: search.page, size: search.size }) - if (router?.params.clientId) { - res.data.list.map((item) => { - if (item.id == router?.params.clientId) { - item.checked = true - } else { - item.checked = false - } - return item - }) - } - setClientlist((e) => ({ ...e, list: res.data?.list, total: res.data?.total })) - setRefresherTriggeredStatus(() => false) - } + // //列表下拉刷新 + // const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false) + // const getRefresherRefresh = async () => { + // pageNum.current.size = 1 + // setRefresherTriggeredStatus(true) + // setSearch((val) => ({ ...val, size: 10 })) + // } + // const getCuss = async () => { + // let res = await clitentFetch({ name: search.name === null ? '' : search.name, page: search.page, size: search.size }) + // if (router?.params.clientId) { + // res.data.list.map((item) => { + // if (item.id == router?.params.clientId) { + // item.checked = true + // } else { + // item.checked = false + // } + // return item + // }) + // } + // setClientlist((e) => ({ ...e, list: res.data?.list, total: res.data?.total })) + // setRefresherTriggeredStatus(() => false) + // } - //选择客户 - const selectClient = (item) => { - clentList.list.map((it) => { - if (item.id === it.id) { - it.checked = true - } else { - it.checked = false - } - return it - }) - setclientObj(item) - let pages = Taro.getCurrentPages() // 获取当前的页面栈 - let prevPage = pages[pages.length - 2] - prevPage.setData({ - //设置上一个页面的值 - clientId: item.id, - clientName: item.name, - }) - setClientlist((e) => ({ ...e, list: clentList?.list, total: clentList?.total })) - Taro.navigateBack({ - delta: 1, - }) - } - useEffect(() => { - if (clientObj?.clientId !== null) { - setclientObj(clientObj) - } else { - let pages = Taro.getCurrentPages() // 获取当前的页面栈 - let prevPage = pages[pages.length - 2] - prevPage.setData({ - //设置上一个页面的值 - clientId: '', - clientName: '', - }) - } - }, [clientObj]) + // //选择客户 + // const selectClient = (item) => { + // clentList.list.map((it) => { + // if (item.id === it.id) { + // it.checked = true + // } else { + // it.checked = false + // } + // return it + // }) + // setclientObj(item) + // let pages = Taro.getCurrentPages() // 获取当前的页面栈 + // let prevPage = pages[pages.length - 2] + // prevPage.setData({ + // //设置上一个页面的值 + // clientId: item.id, + // clientName: item.name, + // }) + // setClientlist((e) => ({ ...e, list: clentList?.list, total: clentList?.total })) + // Taro.navigateBack({ + // delta: 1, + // }) + // } + // useEffect(() => { + // if (clientObj?.clientId !== null) { + // setclientObj(clientObj) + // } else { + // let pages = Taro.getCurrentPages() // 获取当前的页面栈 + // let prevPage = pages[pages.length - 2] + // prevPage.setData({ + // //设置上一个页面的值 + // clientId: '', + // clientName: '', + // }) + // } + // }, [clientObj]) // 筛选列表 const onShowFilter = () => {} const [statusList, setStatusList] = useState([ { - id: 1, + id: -1, name: '待发货', }, { @@ -136,7 +136,7 @@ const Delivery: FC = () => { // //状态改变 const changeStatus = useCallback((e) => { - pageNum.current.page = 1 + // pageNum.current.page = 1 // setSearchField((value) => ({ ...value, status: e, size: 10 })) console.log(e, '123123') @@ -163,7 +163,7 @@ const Delivery: FC = () => { {/* 状态栏 */} - + {/* { ) })} */} - - - - + + + + ) diff --git a/src/pages/deliveryDetail/index.module.scss b/src/pages/deliveryDetail/index.module.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/deliveryDetail/index.tsx b/src/pages/deliveryDetail/index.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index 37db169..f64fedf 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -32,7 +32,7 @@ const feature: IconCardType[] = [ { iconName: 'icon-fahuoliebiao', name: '发货列表', - path: '', + path: '/pages/delivery/index', }, { iconName: 'icon-yaoqingma', @@ -169,7 +169,7 @@ const UserInfo: FC = () => { 统计分析 {statisticAnalysis.map((item) => { - return + return handleClickIconCard(item)}> })}