Merge branch 'dev' of ssh://git.online.zzfzyc.com:10022/mp/spider_cloud_warehouse into 售后模块
This commit is contained in:
commit
45de2e92c0
51
src/api/delivery/index.ts
Normal file
51
src/api/delivery/index.ts
Normal file
@ -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',
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -11,6 +11,16 @@ export {
|
|||||||
|
|
||||||
export { ShoppingCartUpdateApi, ShoppingCartDeleteApi, ShoppingCartListApi } from './shopping/index'
|
export { ShoppingCartUpdateApi, ShoppingCartDeleteApi, ShoppingCartListApi } from './shopping/index'
|
||||||
|
|
||||||
|
export {
|
||||||
|
DeliverNoticeOrderList,
|
||||||
|
DeliverNoticeOrder,
|
||||||
|
DeliveryNoticeOrderUpload,
|
||||||
|
DeliveryNoticeOrderAudit,
|
||||||
|
DeliveryNoticeOrderRejection,
|
||||||
|
EnumDeliveryNoticeTypeList,
|
||||||
|
EnumSaleorderStatus,
|
||||||
|
} from './delivery/index'
|
||||||
|
|
||||||
import { useRequest } from '@/use/useHttp'
|
import { useRequest } from '@/use/useHttp'
|
||||||
/**
|
/**
|
||||||
* 系列列表
|
* 系列列表
|
||||||
|
|||||||
@ -40,6 +40,10 @@ export default defineAppConfig({
|
|||||||
root: 'pages/delivery',
|
root: 'pages/delivery',
|
||||||
pages: ['index'],
|
pages: ['index'],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
root: 'pages/deliveryDetail',
|
||||||
|
pages: ['index'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
root: 'pages/colorRelated',
|
root: 'pages/colorRelated',
|
||||||
pages: ['sampleComparison/index', 'takeColor/index', 'findColor/index'],
|
pages: ['sampleComparison/index', 'takeColor/index', 'findColor/index'],
|
||||||
|
|||||||
@ -111,6 +111,7 @@ export const dataLoadingStatus = ({ list = [], total = 0, status = false }: { li
|
|||||||
function delay(delayTime = 25): Promise<null> {
|
function delay(delayTime = 25): Promise<null> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
// @ts-ignore
|
||||||
resolve()
|
resolve()
|
||||||
}, delayTime)
|
}, delayTime)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
.status_list {
|
.status_list {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
font-size: $font_size;
|
font-size: $font_size;
|
||||||
color: #000;
|
color: #000;
|
||||||
@ -7,13 +9,14 @@
|
|||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
.list_scroll {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
.selected {
|
.selected {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #337FFF;
|
color: #337fff;
|
||||||
border-bottom: 4px solid #337FFF;
|
border-bottom: 4px solid #337fff;
|
||||||
}
|
|
||||||
.list_scroll{
|
|
||||||
white-space: nowrap;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,10 +3,15 @@ import classnames from 'classnames'
|
|||||||
import { FC, useEffect, useState } from 'react'
|
import { FC, useEffect, useState } from 'react'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
type Segment = {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
list: { id: number; name: string }[]
|
list: Segment[]
|
||||||
defaultId?: number | null
|
defaultId?: number
|
||||||
onSelect?: (val: number) => void
|
onSelect?: (data: {id: number, name:string}) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const segmentedControl: FC<PropsType> = (props) => {
|
const segmentedControl: FC<PropsType> = (props) => {
|
||||||
@ -14,9 +19,10 @@ const segmentedControl: FC<PropsType> = (props) => {
|
|||||||
selected: -1, //当前选中的id
|
selected: -1, //当前选中的id
|
||||||
tabId: '', //需要滚动到的id
|
tabId: '', //需要滚动到的id
|
||||||
})
|
})
|
||||||
const { list, defaultId, onSelect } = props
|
const { list, defaultId = -1, onSelect } = props
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
console.log('defaultId', defaultId)
|
||||||
if (typeof defaultId === 'number' && defaultId >= 0) {
|
if (typeof defaultId === 'number' && defaultId >= 0) {
|
||||||
console.log('defaultId:::', defaultId)
|
console.log('defaultId:::', defaultId)
|
||||||
const index = list?.findIndex((item) => {
|
const index = list?.findIndex((item) => {
|
||||||
@ -28,12 +34,13 @@ const segmentedControl: FC<PropsType> = (props) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
setSelectInfo((e) => ({ ...e, selected: defaultId || -1 }))
|
setSelectInfo((e) => ({ ...e, selected: defaultId || -1 }))
|
||||||
|
console.log('selectInfo', selectInfo)
|
||||||
}, [defaultId])
|
}, [defaultId])
|
||||||
|
|
||||||
const clickEvent = ({ item, index }: { item: any; index: number }) => {
|
const clickEvent = ({ item, index }: { item: any; index: number }) => {
|
||||||
const num = index > 0 ? index - 1 : 0
|
const num = index > 0 ? index - 1 : 0
|
||||||
setSelectInfo((e) => ({ ...e, tabId: list[num].id.toString(), selected: item.id }))
|
setSelectInfo((e) => ({ ...e, tabId: list[num].id.toString(), selected: item.id }))
|
||||||
onSelect?.(item.id)
|
onSelect?.(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -41,12 +48,13 @@ const segmentedControl: FC<PropsType> = (props) => {
|
|||||||
<ScrollView scrollX scrollIntoView={`tabs_${selectInfo.tabId}`} scrollWithAnimation={true}>
|
<ScrollView scrollX scrollIntoView={`tabs_${selectInfo.tabId}`} scrollWithAnimation={true}>
|
||||||
<View className={styles.list_scroll}>
|
<View className={styles.list_scroll}>
|
||||||
{list.map((item, index) => {
|
{list.map((item, index) => {
|
||||||
|
console.log('selected=+>', selectInfo.selected)
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
key={item.id}
|
key={item.id}
|
||||||
id={`tabs_${item.id}`}
|
id={`tabs_${item.id}`}
|
||||||
onClick={() => clickEvent({ item, index })}
|
onClick={() => 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}
|
{item.name}
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -57,6 +57,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&--text {
|
&--text {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row nowrap;
|
||||||
|
align-items: center;
|
||||||
color: currentColor;
|
color: currentColor;
|
||||||
}
|
}
|
||||||
// active 伪类
|
// active 伪类
|
||||||
|
|||||||
@ -17,6 +17,7 @@ interface PropsType {
|
|||||||
onClick?: Function
|
onClick?: Function
|
||||||
customClassName?: string
|
customClassName?: string
|
||||||
customStyles?: React.CSSProperties
|
customStyles?: React.CSSProperties
|
||||||
|
customTextClassName?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const NormalButton: FC<PropsType> = (props) => {
|
const NormalButton: FC<PropsType> = (props) => {
|
||||||
@ -31,6 +32,7 @@ const NormalButton: FC<PropsType> = (props) => {
|
|||||||
circle = false,
|
circle = false,
|
||||||
customStyles = {},
|
customStyles = {},
|
||||||
customClassName = '',
|
customClassName = '',
|
||||||
|
customTextClassName = ''
|
||||||
} = props
|
} = props
|
||||||
const getClassName = () => {
|
const getClassName = () => {
|
||||||
const classObject = {
|
const classObject = {
|
||||||
@ -54,7 +56,7 @@ const NormalButton: FC<PropsType> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={classnames(styles['button'], getClassName(), customClassName)} style={customStyles} onClick={handleClick}>
|
<View className={classnames(styles['button'], getClassName(), customClassName)} style={customStyles} onClick={handleClick}>
|
||||||
<Text className={styles['button--text']}>{children}</Text>
|
<View className={classnames(styles['button--text'], customTextClassName)}>{children}</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
.icon_a_sousuo1_self {
|
.icon_a_sousuo1_self {
|
||||||
font-size: 37px;
|
|
||||||
color: $color_font_two;
|
color: $color_font_two;
|
||||||
}
|
}
|
||||||
.search_con {
|
.search_con {
|
||||||
@ -13,35 +12,45 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
input{
|
justify-content: space-between;
|
||||||
font-size: 27px;
|
.input_bar {
|
||||||
background: #eee;
|
border-radius: 50px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
border-radius: 50px;
|
flex: 1 1 auto;
|
||||||
padding: 0 60px;
|
padding-left: 60px;
|
||||||
|
padding-right: 30px;
|
||||||
|
background: #eee;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
font-size: 27px;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
&::-webkit-input-placeholder { /* WebKit browsers */
|
&::-webkit-input-placeholder {
|
||||||
|
/* WebKit browsers */
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-moz-placeholder { /* Mozilla Firefox 19+ */
|
&::-moz-placeholder {
|
||||||
|
/* Mozilla Firefox 19+ */
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-ms-input-placeholder { /* Internet Explorer 10+ */
|
&::-ms-input-placeholder {
|
||||||
|
/* Internet Explorer 10+ */
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.search_closeBtn {
|
.search_closeBtn {
|
||||||
position: absolute;
|
margin: 0 15px;
|
||||||
right: 10px;
|
flex: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.btn {
|
.btn {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
@ -50,7 +59,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
.icon_inner {
|
.icon_inner {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
@ -65,5 +73,4 @@
|
|||||||
.input_out {
|
.input_out {
|
||||||
padding-left: 20px !important;
|
padding-left: 20px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,28 +1,32 @@
|
|||||||
import { Input, View } from "@tarojs/components";
|
import { Input, View } from '@tarojs/components'
|
||||||
import styles from "./index.module.scss"
|
import styles from './index.module.scss'
|
||||||
import CloseBtn from "@/components/closeBtn"
|
import CloseBtn from '@/components/closeBtn'
|
||||||
import classnames from "classnames";
|
import classnames from 'classnames'
|
||||||
import { debounce } from "@/common/util";
|
import { debounce } from '@/common/util'
|
||||||
import { Children, forwardRef, memo, ReactElement, ReactNode, useEffect, useImperativeHandle, useRef, useState } from "react";
|
import { Children, forwardRef, memo, ReactElement, ReactNode, useEffect, useImperativeHandle, useRef, useState } from 'react'
|
||||||
|
import IconFont from '../iconfont/iconfont'
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
clickOnSearch?: (val: string) => void
|
clickOnSearch?: (val: string) => void
|
||||||
disabled?: false | true,
|
disabled?: false | true
|
||||||
placeholder?: string,
|
placeholder?: string
|
||||||
changeOnSearch?: (any) => void,
|
changeOnSearch?: (value: string) => void
|
||||||
showIcon?: false | true,
|
showIcon?: false | true
|
||||||
placeIcon?: 'out' | 'inner',
|
placeIcon?: 'out' | 'inner'
|
||||||
style?: Object,
|
style?: Object
|
||||||
showBtn?: false | true,
|
showBtn?: false | true
|
||||||
btnStyle?: Object,
|
btnStyle?: Object
|
||||||
btnTitle?: string,
|
btnTitle?: string
|
||||||
debounceTime?: number //防抖时间,不设默认为零
|
debounceTime?: number //防抖时间,不设默认为零
|
||||||
defaultValue?: string,
|
defaultValue?: string
|
||||||
children?: ReactNode,
|
children?: ReactNode
|
||||||
customRightSlot?: ReactNode
|
customRightSlot?: ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(forwardRef(({
|
export default memo(
|
||||||
|
forwardRef(
|
||||||
|
(
|
||||||
|
{
|
||||||
clickOnSearch, //点击筛选按钮触发
|
clickOnSearch, //点击筛选按钮触发
|
||||||
changeOnSearch, //输入文字触发
|
changeOnSearch, //输入文字触发
|
||||||
disabled = false, //是否禁用
|
disabled = false, //是否禁用
|
||||||
@ -35,8 +39,10 @@ export default memo(forwardRef(({
|
|||||||
debounceTime = 0, //防抖时间,不设默认为零
|
debounceTime = 0, //防抖时间,不设默认为零
|
||||||
defaultValue = '', //默认值
|
defaultValue = '', //默认值
|
||||||
children,
|
children,
|
||||||
customRightSlot
|
customRightSlot,
|
||||||
}: Params, ref) => {
|
}: Params,
|
||||||
|
ref,
|
||||||
|
) => {
|
||||||
const [inputCon, setInputCon] = useState('')
|
const [inputCon, setInputCon] = useState('')
|
||||||
const debounceTimeRef = useRef(0)
|
const debounceTimeRef = useRef(0)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -53,7 +59,7 @@ export default memo(forwardRef(({
|
|||||||
}
|
}
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
clearInput
|
clearInput,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const clearInput = () => {
|
const clearInput = () => {
|
||||||
@ -75,14 +81,12 @@ export default memo(forwardRef(({
|
|||||||
<View className={styles.search_main}>
|
<View className={styles.search_main}>
|
||||||
<View className={styles.search_con}>
|
<View className={styles.search_con}>
|
||||||
{showIcon && (
|
{showIcon && (
|
||||||
<View
|
<IconFont
|
||||||
className={classnames(
|
name='icon-sousuo'
|
||||||
'iconfont',
|
size={37}
|
||||||
'icon-sousuo',
|
customClassName={classnames(styles.icon_a_sousuo1_self, placeIcon == 'inner' ? styles.icon_inner : styles.icon_out)}></IconFont>
|
||||||
styles.icon_a_sousuo1_self,
|
|
||||||
placeIcon == 'inner' ? styles.icon_inner : styles.icon_out,
|
|
||||||
)}></View>
|
|
||||||
)}
|
)}
|
||||||
|
<View className={styles.input_bar}>
|
||||||
<Input
|
<Input
|
||||||
placeholderStyle='color:#ABABAB; font-size:26rpx'
|
placeholderStyle='color:#ABABAB; font-size:26rpx'
|
||||||
onConfirm={onSearch}
|
onConfirm={onSearch}
|
||||||
@ -90,13 +94,13 @@ export default memo(forwardRef(({
|
|||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
value={inputCon}
|
value={inputCon}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onInput={(e) => onInputEven(e)}></Input>
|
onInput={(e) => onInputEven(e)}
|
||||||
{!!inputCon && (
|
/>
|
||||||
<View className={styles.search_closeBtn}>
|
<View className={styles.search_closeBtn}>
|
||||||
<CloseBtn onClose={() => clearInput()} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />
|
{!!inputCon && <CloseBtn onClose={() => clearInput()} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />}
|
||||||
|
</View>
|
||||||
|
<View>{customRightSlot}</View>
|
||||||
</View>
|
</View>
|
||||||
)}
|
|
||||||
{customRightSlot}
|
|
||||||
</View>
|
</View>
|
||||||
{showBtn && (
|
{showBtn && (
|
||||||
<View style={btnStyle} className={styles.btn} onClick={onSearch}>
|
<View style={btnStyle} className={styles.btn} onClick={onSearch}>
|
||||||
@ -107,4 +111,6 @@ export default memo(forwardRef(({
|
|||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}))
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|||||||
@ -15,10 +15,21 @@ interface PropsType {
|
|||||||
onClick?: Function
|
onClick?: Function
|
||||||
circle?: boolean
|
circle?: boolean
|
||||||
customStyle?: React.CSSProperties
|
customStyle?: React.CSSProperties
|
||||||
|
customClassName?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const Tag: FC<PropsType> = (props) => {
|
const Tag: FC<PropsType> = (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) => {
|
const handleClick = (event) => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
return
|
return
|
||||||
@ -37,7 +48,7 @@ const Tag: FC<PropsType> = (props) => {
|
|||||||
return classObject
|
return classObject
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<View className={classnames(styles.tag, getClassName())} style={customStyle} onClick={handleClick}>
|
<View className={classnames(styles.tag, getClassName(), customClassName)} style={customStyle} onClick={handleClick}>
|
||||||
<Text className={styles['tag--text']}>{children}</Text>
|
<Text className={styles['tag--text']}>{children}</Text>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
42
src/pages/delivery/components/DeliveryStatusList/index.tsx
Normal file
42
src/pages/delivery/components/DeliveryStatusList/index.tsx
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import SegmentedControl from '@/components/segmentedControl'
|
||||||
|
import { FC, memo, useCallback, useEffect, useState } from 'react'
|
||||||
|
import { EnumSaleorderStatus } from '@/api/index'
|
||||||
|
|
||||||
|
type PropsType = {
|
||||||
|
onChangeStatus?: (data: {id: number, name: string}) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
const DeliveryStatusList = memo<PropsType>((props) => {
|
||||||
|
const { onChangeStatus } = props
|
||||||
|
const { fetchData } = EnumSaleorderStatus()
|
||||||
|
const [statusList, setStatusList] = useState([
|
||||||
|
{
|
||||||
|
id: -1,
|
||||||
|
name: '全部',
|
||||||
|
},
|
||||||
|
])
|
||||||
|
// 请求
|
||||||
|
const getDeliveryStatusList = async () => {
|
||||||
|
const res = await fetchData()
|
||||||
|
console.log(res.data.list);
|
||||||
|
setStatusList(
|
||||||
|
res.data.list.filter((item) => {
|
||||||
|
return item.id === 3 || item.id === 4 // 待发货 已完成
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getDeliveryStatusList()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
// //状态改变
|
||||||
|
const changeStatus = useCallback(
|
||||||
|
(data: {id:number, name: string}) => {
|
||||||
|
onChangeStatus && onChangeStatus({ id: data.id, name: data.name })
|
||||||
|
},
|
||||||
|
[onChangeStatus],
|
||||||
|
)
|
||||||
|
return <SegmentedControl list={statusList} onSelect={changeStatus} defaultId={statusList[0].id} />
|
||||||
|
})
|
||||||
|
export default DeliveryStatusList
|
||||||
41
src/pages/delivery/components/Filter/index.module.scss
Normal file
41
src/pages/delivery/components/Filter/index.module.scss
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
.filterItem {
|
||||||
|
margin: 24px 48px;
|
||||||
|
&--title {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 550;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
&--wrapper {
|
||||||
|
margin-top: 24px;
|
||||||
|
display: grid;
|
||||||
|
grid-gap: 16px 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.filter {
|
||||||
|
&--time {
|
||||||
|
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||||
|
|
||||||
|
}
|
||||||
|
&--inputBar {
|
||||||
|
}
|
||||||
|
&--type {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.filterTypeButton{
|
||||||
|
padding: 0 24px;
|
||||||
|
font-size: 28px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.filterTypeText{
|
||||||
|
color: #6e6e6e !important;
|
||||||
|
}
|
||||||
|
.filterTimeButton{
|
||||||
|
padding: 0 24px;
|
||||||
|
font-size: 28px;
|
||||||
|
grid-column-start: span 2;
|
||||||
|
}
|
||||||
|
.selected{
|
||||||
|
background-color: #eaf2ff;
|
||||||
|
}
|
||||||
152
src/pages/delivery/components/Filter/index.tsx
Normal file
152
src/pages/delivery/components/Filter/index.tsx
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
import NormalButton from "@/components/normalButton"
|
||||||
|
import Popup from "@/components/popup"
|
||||||
|
import { View } from "@tarojs/components"
|
||||||
|
import classnames from "classnames"
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
import { FC, memo, useEffect, useState } from 'react'
|
||||||
|
import Search from "@/components/search"
|
||||||
|
import IconFont from "@/components/iconfont/iconfont"
|
||||||
|
import {EnumDeliveryNoticeTypeList} from '@/api/index'
|
||||||
|
|
||||||
|
type SearchFilter = {
|
||||||
|
type?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const scanIcon = () => {
|
||||||
|
// 扫描
|
||||||
|
const handleScan = () => {}
|
||||||
|
return (
|
||||||
|
<View onClick={handleScan} className={styles.scanHandler}>
|
||||||
|
<IconFont name='icon-saomiao' size={40}></IconFont>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const DeliveryFilter: FC = memo(() => {
|
||||||
|
|
||||||
|
const {fetchData} = EnumDeliveryNoticeTypeList()
|
||||||
|
|
||||||
|
const [searchFilter, useSearchFilter] = useState<SearchFilter>({
|
||||||
|
|
||||||
|
})
|
||||||
|
const handleSelectedType = (type: string | number) => {
|
||||||
|
if (typeof type === 'string' && type === 'default') {
|
||||||
|
// setSearch((e) => ({ ...e }))
|
||||||
|
} else {
|
||||||
|
// setSearch((e) => ({ ...e, type: type as number }))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSearchBarChange = () => {}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getEnumData()
|
||||||
|
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
const [typeList, setTypeList] = useState<{id: number, name: string}[]>()
|
||||||
|
|
||||||
|
const getEnumData = async () => {
|
||||||
|
const res = await fetchData()
|
||||||
|
setTypeList(res.data.list)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<View className={styles.filterItem}>
|
||||||
|
<View className={styles['filterItem--title']}>发货类型</View>
|
||||||
|
<View className={classnames(styles['filterItem--wrapper'], styles['filter--type'])}>
|
||||||
|
<NormalButton
|
||||||
|
type={searchFilter.type == null ? 'primary' : 'info'}
|
||||||
|
plain={searchFilter.type === null}
|
||||||
|
circle
|
||||||
|
customClassName={classnames(styles.filterTypeButton)}
|
||||||
|
customTextClassName={searchFilter.type === null && styles.filterTypeText}
|
||||||
|
onClick={() => handleSelectedType('default')}>
|
||||||
|
不限
|
||||||
|
</NormalButton>
|
||||||
|
{!!typeList?.length && typeList?.map(item => {
|
||||||
|
return (
|
||||||
|
<NormalButton
|
||||||
|
type={searchFilter.type === item?.id ? 'primary' : 'info'}
|
||||||
|
plain={searchFilter.type !== item?.id}
|
||||||
|
circle
|
||||||
|
customClassName={styles.filterTypeButton}
|
||||||
|
customTextClassName={searchFilter.type === item?.id && styles.filterTypeText}
|
||||||
|
onClick={() => handleSelectedType(item?.id)}>
|
||||||
|
{item.name}
|
||||||
|
</NormalButton>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
{/* <NormalButton
|
||||||
|
type={searchFilter.type === 0 ? 'primary' : 'info'}
|
||||||
|
plain={searchFilter.type !== 0}
|
||||||
|
circle
|
||||||
|
customClassName={styles.filterTypeButton}
|
||||||
|
customTextClassName={searchFilter.type === 0 && styles.filterTypeText}
|
||||||
|
onClick={() => handleSelectedType(1)}>
|
||||||
|
销售发货单
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton
|
||||||
|
type={searchFilter.type === 0 ? 'primary' : 'info'}
|
||||||
|
plain={searchFilter.type !== 0}
|
||||||
|
circle
|
||||||
|
customClassName={styles.filterTypeButton}
|
||||||
|
customTextClassName={searchFilter.type === 1 && styles.filterTypeText}
|
||||||
|
onClick={() => handleSelectedType(2)}>
|
||||||
|
调拨发货单
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton
|
||||||
|
type={searchFilter.type === 0 ? 'primary' : 'info'}
|
||||||
|
plain={searchFilter.type !== 0}
|
||||||
|
circle
|
||||||
|
customClassName={styles.filterTypeButton}
|
||||||
|
customTextClassName={searchFilter.type === 2 && styles.filterTypeText}
|
||||||
|
onClick={() => handleSelectedType(3)}>
|
||||||
|
采购退货单
|
||||||
|
</NormalButton> */}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.filterItem}>
|
||||||
|
<View className={styles['filterItem--title']}>发货单号</View>
|
||||||
|
<View className={classnames(styles['filterItem--wrapper'], styles['filter--inputBar'])}>
|
||||||
|
<Search
|
||||||
|
placeholder='请输入或扫描条形码'
|
||||||
|
showBtn={false}
|
||||||
|
changeOnSearch={handleSearchBarChange}
|
||||||
|
debounceTime={300}
|
||||||
|
customRightSlot={scanIcon()}></Search>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.filterItem}>
|
||||||
|
<View className={styles['filterItem--title']}>查询日期</View>
|
||||||
|
<View className={classnames(styles['filterItem--wrapper'], styles['filter--time'])}>
|
||||||
|
<NormalButton type='primary' circle customClassName={styles.filterTypeButton}>
|
||||||
|
不限
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton type='primary' circle customClassName={styles.filterTypeButton}>
|
||||||
|
今天
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton type='primary' circle customClassName={styles.filterTypeButton}>
|
||||||
|
昨日
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton type='primary' circle customClassName={styles.filterTypeButton}>
|
||||||
|
近7日
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton type='primary' circle customClassName={styles.filterTypeButton}>
|
||||||
|
近30日
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton type='primary' circle customClassName={styles.filterTypeButton}>
|
||||||
|
近90日
|
||||||
|
</NormalButton>
|
||||||
|
<NormalButton type='primary' circle customClassName={styles.filterTimeButton}>
|
||||||
|
自定义起始时间{<IconFont name='icon-chakanquanbukehu' size={60}></IconFont>}
|
||||||
|
</NormalButton>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
export default DeliveryFilter
|
||||||
@ -2,20 +2,26 @@
|
|||||||
margin: 24px;
|
margin: 24px;
|
||||||
}
|
}
|
||||||
.topBar {
|
.topBar {
|
||||||
|
font-size: 28px;
|
||||||
&__orderNo {
|
&__orderNo {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
color: $color_font_one;
|
color: $color_font_one;
|
||||||
font-size: 28px;
|
|
||||||
}
|
}
|
||||||
&__orderType {
|
&__orderType {
|
||||||
color: rgba($color: #000000, $alpha: 0.6);
|
color: rgba($color: #000000, $alpha: 0.6);
|
||||||
font-weight: 550;
|
font-weight: 550;
|
||||||
}
|
}
|
||||||
&__orderStatus {
|
&__orderStatus {
|
||||||
|
font-weight: 550;
|
||||||
|
&--toBeAudited{
|
||||||
color: #e42945;
|
color: #e42945;
|
||||||
}
|
}
|
||||||
|
&--finish{
|
||||||
|
color: $color_main;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
&__row {
|
&__row {
|
||||||
@ -26,8 +32,10 @@
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: rgba($color: #000000, $alpha: 0.4);
|
color: rgba($color: #000000, $alpha: 0.4);
|
||||||
&__left {
|
&__left {
|
||||||
|
min-width: 140px;
|
||||||
}
|
}
|
||||||
&__right {
|
&__right {
|
||||||
|
@include common_ellipsis(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -36,10 +44,11 @@
|
|||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 24px;
|
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
&__button {
|
&__button {
|
||||||
margin: 0 24px;
|
margin: 0 24px;
|
||||||
|
font-size: 28px;
|
||||||
|
padding: 0 26px;
|
||||||
}
|
}
|
||||||
&__button:last-child {
|
&__button:last-child {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -48,3 +57,6 @@
|
|||||||
.bord {
|
.bord {
|
||||||
color: $color_font_one;
|
color: $color_font_one;
|
||||||
}
|
}
|
||||||
|
.tag{
|
||||||
|
margin: 0 16px;
|
||||||
|
}
|
||||||
|
|||||||
@ -5,58 +5,104 @@ import { View, Text } from '@tarojs/components'
|
|||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
import NormalButton from '@/components/normalButton'
|
import NormalButton from '@/components/normalButton'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
import classnames from 'classnames'
|
||||||
|
import { EnumSaleMode } from '@/common/Enumerate'
|
||||||
|
import { formatDateTime } from '@/common/format'
|
||||||
|
import { goLink } from '@/common/common'
|
||||||
|
import { DeliveryNoticeOrderAudit } from '@/api/index'
|
||||||
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
itemData?: Record<string, any>
|
itemData?: Record<string, any>
|
||||||
|
onSuccess?: Function
|
||||||
}
|
}
|
||||||
|
|
||||||
const ItemList:FC<PropsType> = (props) => {
|
const ItemList:FC<PropsType> = (props) => {
|
||||||
const { itemData } = props
|
const { itemData, onSuccess } = props
|
||||||
// 查看详情
|
// 查看详情
|
||||||
const handleDetail = () => {
|
const handleDetail = (id: number) => {
|
||||||
|
goLink('/pages/deliveryDetail/index', {
|
||||||
|
id
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 确认审核
|
|
||||||
const handleAudit = () => {
|
|
||||||
|
|
||||||
|
const {fetchData, state} = DeliveryNoticeOrderAudit()
|
||||||
|
|
||||||
|
// 确认审核
|
||||||
|
const handleAudit = (id: number) => {
|
||||||
|
Taro.showModal({
|
||||||
|
content: '确认要审核吗?',
|
||||||
|
confirmColor: '#337FFF',
|
||||||
|
success: async (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
const res = await fetchData({ id })
|
||||||
|
if (res.success) {
|
||||||
|
Taro.showToast({ title: '审核成功', icon: 'success' })
|
||||||
|
onSuccess?.()
|
||||||
|
}else{
|
||||||
|
Taro.showToast({ title: '审核失败', icon: 'error' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LayoutBlock circle customClassName={styles.layoutBlock}>
|
<LayoutBlock circle customClassName={styles.layoutBlock}>
|
||||||
<View className={styles.topBar}>
|
<View className={styles.topBar}>
|
||||||
<View className={styles.topBar__orderNo}>
|
<View className={styles.topBar__orderNo}>
|
||||||
<View>单号:XS-LY-2208220092</View>
|
<View>单号:{itemData?.order_no}</View>
|
||||||
<View className={styles.topBar__orderStatus}>待审核</View>
|
{itemData?.status === 1 && <View className={classnames(styles.topBar__orderStatus, styles['topBar__orderStatus--finish'])}>已审核</View>}
|
||||||
|
{itemData?.status === 0 && <View className={classnames(styles.topBar__orderStatus, styles['topBar__orderStatus--toBeAudited'])}>待审核</View>}
|
||||||
</View>
|
</View>
|
||||||
<Text className={styles.topBar__orderType}>销售发货单</Text>
|
<Text className={styles.topBar__orderType}>{itemData?.type_name}</Text>
|
||||||
</View>
|
</View>
|
||||||
<Divider direction='horizontal'></Divider>
|
<Divider direction='horizontal' customStyles={{ margin: '30rpx 0' }}></Divider>
|
||||||
<View className={styles.content}>
|
<View className={styles.content}>
|
||||||
<View className={styles.content__row}>
|
<View className={classnames(styles.content__row, styles.bord)}>
|
||||||
<View className={styles.content__row__left}>货品信息:</View>
|
<View className={styles.content__row__left}>货品信息:</View>
|
||||||
<View className={styles.content__row__right}>
|
<View className={styles.content__row__right}>
|
||||||
<Tag type='primary' circle plain>
|
{itemData?.sale_mode === EnumSaleMode.Bulk && (
|
||||||
|
<Tag type='primary' circle plain size='small' customClassName={styles.tag}>
|
||||||
大货
|
大货
|
||||||
</Tag>
|
</Tag>
|
||||||
2种面料,4种颜色,共5米
|
)}
|
||||||
|
{itemData?.sale_mode === EnumSaleMode.Plate && (
|
||||||
|
<Tag type='danger' circle plain size='small' customClassName={styles.tag}>
|
||||||
|
剪板
|
||||||
|
</Tag>
|
||||||
|
)}
|
||||||
|
{itemData?.sale_mode === EnumSaleMode.BulkCut && (
|
||||||
|
<Tag type='warning' circle plain size='small' customClassName={styles.tag}>
|
||||||
|
散剪
|
||||||
|
</Tag>
|
||||||
|
)}
|
||||||
|
2种面料,4种颜色,共{itemData?.sale_mode === EnumSaleMode.Bulk ? `${itemData?.delivery_roll}条` : `${itemData?.delivery_length}米`}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.content__row}>
|
<View className={styles.content__row}>
|
||||||
<View className={styles.content__row__left}>发货地址:</View>
|
<View className={styles.content__row__left}>发货地址:</View>
|
||||||
<View className={styles.content__row__right}>永川纺织有限公司</View>
|
<View className={styles.content__row__right}>{itemData?.delivery_address || '空'}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.content__row}>
|
<View className={styles.content__row}>
|
||||||
<View className={styles.content__row__left}>创建时间:</View>
|
<View className={styles.content__row__left}>创建时间:</View>
|
||||||
<View className={styles.content__row__right}>2022-09-01 18:32:32</View>
|
<View className={styles.content__row__right}>{formatDateTime(itemData?.create_time) || '空'}</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.bottomBar}>
|
<View className={styles.bottomBar}>
|
||||||
<NormalButton customClassName={styles.bottomBar__button} type='info' round onClick={handleDetail}>
|
<NormalButton
|
||||||
|
customClassName={styles.bottomBar__button}
|
||||||
|
type='info'
|
||||||
|
customStyles={{ color: '#8e8e8e', borderColor: '#8e8e8e' }}
|
||||||
|
round
|
||||||
|
onClick={() => handleDetail(itemData?.id)}>
|
||||||
查看详情
|
查看详情
|
||||||
</NormalButton>
|
</NormalButton>
|
||||||
<NormalButton customClassName={styles.bottomBar__button} type='primary' round onClick={handleAudit}>
|
{itemData?.status === 0 && (
|
||||||
|
<NormalButton customClassName={styles.bottomBar__button} type='primary' round onClick={() => handleAudit(itemData?.id)}>
|
||||||
确认审核
|
确认审核
|
||||||
</NormalButton>
|
</NormalButton>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
</LayoutBlock>
|
</LayoutBlock>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,110 +1,39 @@
|
|||||||
page {
|
page {
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delivery {
|
.delivery {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
.searchBox {
|
.searchBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 8px 24px;
|
padding: 8px 24px;
|
||||||
|
flex: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listBox {
|
.listBox {
|
||||||
|
flex: 1 1 auto;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
}
|
overflow: scroll;
|
||||||
|
&--total {
|
||||||
.itemBox {
|
display: block;
|
||||||
margin-left: 24px;
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 16px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
box-sizing: border-box;
|
padding: 0 24px;
|
||||||
|
font-size: 24px;
|
||||||
.cussName {
|
color: #9d9d9d;
|
||||||
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 {
|
.scanHandler {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
position: absolute;
|
|
||||||
right: 40px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon__filter {
|
.icon__filter {
|
||||||
|
|||||||
@ -1,64 +1,89 @@
|
|||||||
import { View, Text } from '@tarojs/components'
|
import { View, Text } from '@tarojs/components'
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState, FC } from 'react'
|
import { useCallback, useEffect, useMemo, useRef, useState, FC, memo } from 'react'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
import Search from '@/components/search'
|
import Search from '@/components/search'
|
||||||
import { ClientListApi } from '@/api/order'
|
import { DeliverNoticeOrderList, EnumSaleorderStatus } from '@/api/index'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import { useRouter } from '@tarojs/taro'
|
import { useRouter } from '@tarojs/taro'
|
||||||
import InfiniteScroll from '@/components/infiniteScroll'
|
import InfiniteScroll from '@/components/infiniteScroll'
|
||||||
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
import { dataLoadingStatus, getFilterData } from '@/common/util'
|
||||||
import IconText from '@/components/iconText'
|
import IconText from '@/components/iconText'
|
||||||
import SegmentedControl from '@/components/SegmentedControl'
|
|
||||||
import IconFont from '@/components/iconfont/iconfont'
|
import IconFont from '@/components/iconfont/iconfont'
|
||||||
import ItemList from './components/ItemList'
|
import ItemList from './components/ItemList'
|
||||||
|
import DeliveryStatusList from './components/DeliveryStatusList'
|
||||||
|
import Popup from '@/components/popup'
|
||||||
|
import DeliveryFilter from './components/Filter'
|
||||||
|
|
||||||
|
type SearchData = {
|
||||||
|
delivery_notice_order_no?: string // 发货单号
|
||||||
|
delivery_notice_order_status?: number | string // 发货状态
|
||||||
|
date_min?: string // 开始时间
|
||||||
|
date_max?: string // 结束时间
|
||||||
|
type?: number // 发货类型
|
||||||
|
page: number
|
||||||
|
size: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const scanIcon = () => {
|
||||||
|
// 扫描
|
||||||
|
const handleScan = () => {}
|
||||||
|
return (
|
||||||
|
<View onClick={handleScan} className={styles.scanHandler}>
|
||||||
|
<IconFont name='icon-saomiao' size={40}></IconFont>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// 发货列表
|
// 发货列表
|
||||||
const Delivery: FC = () => {
|
const Delivery: FC = () => {
|
||||||
const [search, setSearch] = useState({
|
const [search, setSearch] = useState<SearchData>({
|
||||||
name: null,
|
delivery_notice_order_status: 0, // 待发货
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
})
|
})
|
||||||
const [clentList, setClientlist] = useState<{ list: any[]; total: number }>({ list: [], total: 0 })
|
const [deliveryOrderList, setDeliveryOrderList] = useState<{ list: any[]; total: number }>({ list: [], total: 0 })
|
||||||
|
|
||||||
const { fetchData: clitentFetch, state: orderState } = ClientListApi()
|
const { fetchData: FetchDeliveryOrderList, state: orderState } = DeliverNoticeOrderList()
|
||||||
//数据加载状态
|
//数据加载状态
|
||||||
const statusMore = useMemo(() => {
|
const statusMore = useMemo(() => {
|
||||||
return dataLoadingStatus({ list: clentList.list, total: clentList.total, status: orderState.loading })
|
return dataLoadingStatus({ list: deliveryOrderList.list, total: deliveryOrderList.total, status: orderState.loading })
|
||||||
}, [clentList, orderState])
|
}, [deliveryOrderList, orderState])
|
||||||
|
|
||||||
const [clientObj, setclientObj] = useState({
|
// const [clientObj, setclientObj] = useState({
|
||||||
clientId: null,
|
// clientId: null,
|
||||||
clientName: '',
|
// clientName: '',
|
||||||
})
|
// })
|
||||||
|
|
||||||
//输入了搜索关键字
|
//输入搜索关键字
|
||||||
const getSearchData = useCallback((eq) => {
|
const getSearchData = useCallback((searchValue: string) => {
|
||||||
pageNum.current.page = 1
|
console.log('searchValue==>', searchValue)
|
||||||
setClientlist(() => ({ list: [], total: 0 }))
|
// pageNum.current.page = 1
|
||||||
setSearch((e) => ({ ...e, name: eq, size: 10 }))
|
// setClientlist(() => ({ list: [], total: 0 }))
|
||||||
|
// setSearch((e) => ({ ...e, name: eq, size: 10 }))
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const router = useRouter()
|
// const router = useRouter()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (search.name === '') {
|
console.log('useEffect ===> search', search)
|
||||||
setSearch((e) => ({ ...e, name: null }))
|
if (search.delivery_notice_order_no === '') {
|
||||||
|
setSearch((e) => ({ ...e, delivery_notice_order_no: undefined }))
|
||||||
}
|
}
|
||||||
if (search.name !== '') getCuss()
|
if (search.delivery_notice_order_no !== '') getData()
|
||||||
}, [search])
|
}, [search])
|
||||||
|
|
||||||
//上拉加载数据
|
//上拉加载数据
|
||||||
const pageNum = useRef({ size: search.size, page: search.page })
|
const pageNum = useRef({ size: search.size, page: search.page })
|
||||||
const getScrolltolower = useCallback(() => {
|
|
||||||
if (clentList.list.length < clentList.total) {
|
const getScrollToLower = useCallback(() => {
|
||||||
|
if (deliveryOrderList.list.length < deliveryOrderList.total) {
|
||||||
pageNum.current.page++
|
pageNum.current.page++
|
||||||
const size = pageNum.current.size * pageNum.current.page
|
const size = pageNum.current.size * pageNum.current.page
|
||||||
setSearch((e) => ({ ...e, size }))
|
setSearch((e) => ({ ...e, size }))
|
||||||
console.log(search, 11111)
|
console.log(search, 11111)
|
||||||
}
|
}
|
||||||
}, [clentList])
|
}, [deliveryOrderList])
|
||||||
|
|
||||||
//列表下拉刷新
|
//列表下拉刷新
|
||||||
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
|
const [refresherTriggeredStatus, setRefresherTriggeredStatus] = useState(false)
|
||||||
@ -67,92 +92,88 @@ const Delivery: FC = () => {
|
|||||||
setRefresherTriggeredStatus(true)
|
setRefresherTriggeredStatus(true)
|
||||||
setSearch((val) => ({ ...val, size: 10 }))
|
setSearch((val) => ({ ...val, size: 10 }))
|
||||||
}
|
}
|
||||||
const getCuss = async () => {
|
const getData = async () => {
|
||||||
let res = await clitentFetch({ name: search.name === null ? '' : search.name, page: search.page, size: search.size })
|
const res = await FetchDeliveryOrderList(getFilterData(search))
|
||||||
if (router?.params.clientId) {
|
// if (router?.params.clientId) {
|
||||||
res.data.list.map((item) => {
|
// res.data.list.map((item) => {
|
||||||
if (item.id == router?.params.clientId) {
|
// if (item.id == router?.params.clientId) {
|
||||||
item.checked = true
|
// item.checked = true
|
||||||
} else {
|
// } else {
|
||||||
item.checked = false
|
// item.checked = false
|
||||||
}
|
// }
|
||||||
return item
|
// return item
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
setClientlist((e) => ({ ...e, list: res.data?.list, total: res.data?.total }))
|
setDeliveryOrderList((e) => ({ ...e, list: res.data?.list, total: res.data?.total }))
|
||||||
setRefresherTriggeredStatus(() => false)
|
setRefresherTriggeredStatus(() => false)
|
||||||
}
|
}
|
||||||
|
|
||||||
//选择客户
|
// //选择客户
|
||||||
const selectClient = (item) => {
|
// const selectClient = (item) => {
|
||||||
clentList.list.map((it) => {
|
// clentList.list.map((it) => {
|
||||||
if (item.id === it.id) {
|
// if (item.id === it.id) {
|
||||||
it.checked = true
|
// it.checked = true
|
||||||
} else {
|
// } else {
|
||||||
it.checked = false
|
// it.checked = false
|
||||||
}
|
// }
|
||||||
return it
|
// return it
|
||||||
})
|
// })
|
||||||
setclientObj(item)
|
// setclientObj(item)
|
||||||
let pages = Taro.getCurrentPages() // 获取当前的页面栈
|
// let pages = Taro.getCurrentPages() // 获取当前的页面栈
|
||||||
let prevPage = pages[pages.length - 2]
|
// let prevPage = pages[pages.length - 2]
|
||||||
prevPage.setData({
|
// prevPage.setData({
|
||||||
//设置上一个页面的值
|
// //设置上一个页面的值
|
||||||
clientId: item.id,
|
// clientId: item.id,
|
||||||
clientName: item.name,
|
// clientName: item.name,
|
||||||
})
|
// })
|
||||||
setClientlist((e) => ({ ...e, list: clentList?.list, total: clentList?.total }))
|
// setClientlist((e) => ({ ...e, list: clentList?.list, total: clentList?.total }))
|
||||||
Taro.navigateBack({
|
// Taro.navigateBack({
|
||||||
delta: 1,
|
// delta: 1,
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
if (clientObj?.clientId !== null) {
|
// if (clientObj?.clientId !== null) {
|
||||||
setclientObj(clientObj)
|
// setclientObj(clientObj)
|
||||||
} else {
|
// } else {
|
||||||
let pages = Taro.getCurrentPages() // 获取当前的页面栈
|
// let pages = Taro.getCurrentPages() // 获取当前的页面栈
|
||||||
let prevPage = pages[pages.length - 2]
|
// let prevPage = pages[pages.length - 2]
|
||||||
prevPage.setData({
|
// prevPage.setData({
|
||||||
//设置上一个页面的值
|
// //设置上一个页面的值
|
||||||
clientId: '',
|
// clientId: '',
|
||||||
clientName: '',
|
// clientName: '',
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}, [clientObj])
|
// }, [clientObj])
|
||||||
|
|
||||||
|
const handleChangeFilterData = () => {}
|
||||||
|
|
||||||
|
const [currentStatus, setCurrentStatus] = useState('待发货')
|
||||||
|
|
||||||
|
const handleChangeStatus = ({ id: statusId, name: statusName }) => {
|
||||||
|
let fuckingBadCodeId: string | number = 0
|
||||||
|
if (statusId === 3) {
|
||||||
|
fuckingBadCodeId = 0
|
||||||
|
} else if (statusId === 4) {
|
||||||
|
fuckingBadCodeId = '1,2'
|
||||||
|
}
|
||||||
|
setCurrentStatus(statusName)
|
||||||
|
setSearch((e) => ({ ...e, delivery_notice_order_status: fuckingBadCodeId }))
|
||||||
|
getData()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAuditSuccess = () => {
|
||||||
|
getData()
|
||||||
|
}
|
||||||
|
|
||||||
|
const [showFilter, setShowFilter] = useState(false)
|
||||||
// 筛选列表
|
// 筛选列表
|
||||||
const onShowFilter = () => {}
|
const onShowFilter = () => {
|
||||||
|
setShowFilter(true)
|
||||||
const [statusList, setStatusList] = useState([
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '待发货',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: '已完成',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|
||||||
// //状态改变
|
|
||||||
const changeStatus = useCallback((e) => {
|
|
||||||
pageNum.current.page = 1
|
|
||||||
// setSearchField((value) => ({ ...value, status: e, size: 10 }))
|
|
||||||
|
|
||||||
console.log(e, '123123')
|
|
||||||
// setOrderData(() => ({ list: [], total: 0 }))
|
|
||||||
}, [])
|
|
||||||
// 扫描
|
|
||||||
const handleScan = () => {}
|
|
||||||
|
|
||||||
const scanIcon = () => {
|
|
||||||
return (
|
|
||||||
<View onClick={handleScan} className={styles.scanHandler}>
|
|
||||||
<IconFont name='icon-saomiao' size={40}></IconFont>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.delivery}>
|
<View className={styles.delivery}>
|
||||||
<View className={styles.searchBox}>
|
<View className={styles.searchBox}>
|
||||||
@ -163,36 +184,28 @@ const Delivery: FC = () => {
|
|||||||
</Search>
|
</Search>
|
||||||
</View>
|
</View>
|
||||||
{/* 状态栏 */}
|
{/* 状态栏 */}
|
||||||
<SegmentedControl list={statusList} onSelect={changeStatus} defaultId={0} />
|
<DeliveryStatusList onChangeStatus={handleChangeStatus}></DeliveryStatusList>
|
||||||
|
|
||||||
<View className={styles.listBox}>
|
<View className={styles.listBox}>
|
||||||
{/* <InfiniteScroll
|
<InfiniteScroll
|
||||||
statusMore={statusMore}
|
statusMore={statusMore}
|
||||||
selfonScrollToLower={getScrolltolower}
|
selfonScrollToLower={getScrollToLower}
|
||||||
refresherEnabled={true}
|
refresherEnabled={true}
|
||||||
refresherTriggered={refresherTriggeredStatus}
|
refresherTriggered={refresherTriggeredStatus}
|
||||||
selfOnRefresherRefresh={getRefresherRefresh}>
|
selfOnRefresherRefresh={getRefresherRefresh}>
|
||||||
{clentList.list.map((item, index) => {
|
<Text className={styles['listBox--total']}>
|
||||||
return (
|
{currentStatus}共 {deliveryOrderList.total} 单
|
||||||
<View
|
</Text>
|
||||||
className={classnames(item.checked ? styles.acticveitemBox : styles.itemBox)}
|
{deliveryOrderList.list.map((item, index) => {
|
||||||
key={index}
|
return <ItemList itemData={item} key={item.id} onSuccess={handleAuditSuccess}></ItemList>
|
||||||
onClick={() => {
|
|
||||||
selectClient(item)
|
|
||||||
}}>
|
|
||||||
<View className={styles.cussName}>{item.name}</View>
|
|
||||||
<View className={styles.phone}>{item.phone}</View>
|
|
||||||
<View className={styles.woker}>{item.sale_user_name}</View>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
})}
|
})}
|
||||||
</InfiniteScroll> */}
|
</InfiniteScroll>
|
||||||
<ItemList ></ItemList>
|
|
||||||
<ItemList ></ItemList>
|
|
||||||
<ItemList ></ItemList>
|
|
||||||
<ItemList ></ItemList>
|
|
||||||
</View>
|
</View>
|
||||||
|
<Popup show={showFilter} title='筛选列表'>
|
||||||
|
<DeliveryFilter />
|
||||||
|
</Popup>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Delivery
|
export default Delivery
|
||||||
|
|||||||
3
src/pages/deliveryDetail/index.config.ts
Normal file
3
src/pages/deliveryDetail/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default {
|
||||||
|
navigationBarTitleText: '发货详情',
|
||||||
|
}
|
||||||
3
src/pages/deliveryDetail/index.module.scss
Normal file
3
src/pages/deliveryDetail/index.module.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.deliveryDetail{
|
||||||
|
|
||||||
|
}
|
||||||
8
src/pages/deliveryDetail/index.tsx
Normal file
8
src/pages/deliveryDetail/index.tsx
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { View } from "@tarojs/components"
|
||||||
|
import { FC } from "react"
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
const DeliveryDetail: FC = () => {
|
||||||
|
return <View className={styles.deliveryDetail}>发货详情</View>
|
||||||
|
}
|
||||||
|
export default DeliveryDetail
|
||||||
@ -138,6 +138,7 @@ export default memo<PropsType>((props) => {
|
|||||||
<DrawerButton isOpen={openDetail} />
|
<DrawerButton isOpen={openDetail} />
|
||||||
</View>
|
</View>
|
||||||
</MCheckbox>
|
</MCheckbox>
|
||||||
|
{openDetail && (
|
||||||
<View className={classnames(styles.detailBox, openDetail ? styles.drawerOpen : styles.drawerClose)}>
|
<View className={classnames(styles.detailBox, openDetail ? styles.drawerOpen : styles.drawerClose)}>
|
||||||
<View className={styles.orderType}>
|
<View className={styles.orderType}>
|
||||||
<Divider customClassName={styles.line}></Divider>
|
<Divider customClassName={styles.line}></Divider>
|
||||||
@ -180,6 +181,7 @@ export default memo<PropsType>((props) => {
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.orderContainer}>{memoList}</View>
|
<View className={styles.orderContainer}>{memoList}</View>
|
||||||
</View>
|
</View>
|
||||||
|
)}
|
||||||
</LayoutBlock>
|
</LayoutBlock>
|
||||||
)
|
)
|
||||||
}, useNeedMemoCallback())
|
}, useNeedMemoCallback())
|
||||||
|
|||||||
@ -32,7 +32,7 @@ const feature: IconCardType[] = [
|
|||||||
{
|
{
|
||||||
iconName: 'icon-fahuoliebiao',
|
iconName: 'icon-fahuoliebiao',
|
||||||
name: '发货列表',
|
name: '发货列表',
|
||||||
path: '',
|
path: '/pages/delivery/index',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
iconName: 'icon-yaoqingma',
|
iconName: 'icon-yaoqingma',
|
||||||
@ -169,7 +169,7 @@ const UserInfo: FC = () => {
|
|||||||
<View className={styles.layoutTitle}>统计分析</View>
|
<View className={styles.layoutTitle}>统计分析</View>
|
||||||
<View className={styles['grid-container']}>
|
<View className={styles['grid-container']}>
|
||||||
{statisticAnalysis.map((item) => {
|
{statisticAnalysis.map((item) => {
|
||||||
return <IconCard iconName={item.iconName} title={item.name}></IconCard>
|
return <IconCard iconName={item.iconName} title={item.name} onClick={() => handleClickIconCard(item)}></IconCard>
|
||||||
})}
|
})}
|
||||||
</View>
|
</View>
|
||||||
</LayoutBlock>
|
</LayoutBlock>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
/* Project id 3619513 */
|
/* Project id 3619513 */
|
||||||
// url('/src/styles/iconfont.ttf') format('truetype');
|
// url('/src/styles/iconfont.ttf') format('truetype');
|
||||||
src:
|
src:
|
||||||
url('iconfont.ttf?t=1663556335905') format('truetype');
|
url('/src/styles/iconfont.ttf?t=1663556335905') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user