✨ feat:小程序角色权限控制
This commit is contained in:
parent
3f01990a35
commit
3111f211ae
@ -27,4 +27,11 @@ export const mpcashManagementOrderpost = () => {
|
||||
url: `/v1/mp/cashManagementOrder`,
|
||||
method: "post",
|
||||
})
|
||||
}
|
||||
}
|
||||
//扫描获取应收单的客户信息
|
||||
export const mpshouldCollectOrderpurchaser = () => {
|
||||
return useRequest({
|
||||
url: `/v2/mp/shouldCollectOrder/purchaser`,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
@ -142,3 +142,14 @@ export const formatKbPrice = (number: string) => {
|
||||
}, [])
|
||||
return ret.reverse().join('')
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证权限
|
||||
* @param {权限key} key
|
||||
* @returns
|
||||
*/
|
||||
export const checkKey = (key = "") => {
|
||||
let getUser = JSON.parse(Taro.getStorageSync("userInfo"));
|
||||
return getUser.mp_role_access_list?.includes(key);
|
||||
};
|
@ -6,7 +6,7 @@ import { formatImgUrl } from '@/common/format'
|
||||
import classnames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
import Popup from '@/components/popup'
|
||||
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
//图片列表
|
||||
type ImageParam = {
|
||||
onChange?: (val: string[]) => void
|
||||
@ -89,12 +89,15 @@ const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false
|
||||
{imageList?.map((item, index) => (
|
||||
<View className={styles.ImgItem}>
|
||||
<Image mode='aspectFill' src={formatImgUrl(item)} onClick={showImage}></Image>
|
||||
{!onlyRead && <View onClick={() => delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-guanbi')}></View>}
|
||||
{!onlyRead && <View onClick={() => delImage(index)}>
|
||||
<IconFont name={'icon-guanbi'} size={30} customClassName={styles['miconfont_close']} color={'#ffffff'}></IconFont>
|
||||
</View>}
|
||||
</View>
|
||||
))}
|
||||
{!onlyRead && (
|
||||
<View className={styles.uploadImg} onClick={uploadImage}>
|
||||
<Text className={classnames(styles.miconfont, 'iconfont icon-xinzeng')}></Text>
|
||||
<IconFont name={'icon-xinzeng'} size={100} color={'#d8d8d8'}></IconFont>
|
||||
{/* <Text className={classnames(styles.miconfont, 'iconfont icon-xinzeng')}></Text> */}
|
||||
{/* <Text className={styles.uploadText}>上传照片</Text> */}
|
||||
</View>
|
||||
)}
|
||||
|
@ -56,10 +56,11 @@
|
||||
}
|
||||
|
||||
.rightFlex {
|
||||
width: 50%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
|
||||
// overflow: hidden;
|
||||
// white-space: nowrap;
|
||||
// text-overflow: ellipsis;
|
||||
.placeholderStyle {
|
||||
color: #f7f7f7;
|
||||
font-size: 28px;
|
||||
@ -70,7 +71,7 @@
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
width: 100%;
|
||||
// width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,75 +27,77 @@ interface Params {
|
||||
getScan?: (any) => void, // 扫描
|
||||
navTo?: () => void, //跳转选择
|
||||
showSizeFont?: boolean, //展示金额的大写
|
||||
bigMoney?: any //展示的大写金额
|
||||
bigMoney?: any, //展示的大写金额,
|
||||
isOpen?: boolean //是否展开状态
|
||||
}
|
||||
|
||||
export default memo((pros: Params) => {
|
||||
|
||||
|
||||
return (
|
||||
<View className={styles.itemBox}
|
||||
style={{ justifyContent: `${pros.styleNone ? 'space-between' : ''}`, alignItems: `${pros.styleNone ? 'center' : ''}` }}>
|
||||
<View className={styles.itemLeft}
|
||||
<>
|
||||
{
|
||||
pros.isOpen && <View className={styles.itemBox}
|
||||
style={{ justifyContent: `${pros.styleNone ? 'space-between' : ''}`, alignItems: `${pros.styleNone ? 'center' : ''}` }}>
|
||||
<View className={styles.itemLeft}
|
||||
|
||||
>
|
||||
<View className={styles.finkFlex}>
|
||||
<View className={styles.itemTitle}>{pros.title}</View>
|
||||
{
|
||||
pros.require && <Text className={styles.xing}>*</Text>
|
||||
}
|
||||
</View>
|
||||
{
|
||||
pros.showSizeFont && <View className={styles.finkFont}>展示大小写</View>
|
||||
}
|
||||
</View>
|
||||
{
|
||||
pros.showPic &&
|
||||
<View className={styles.bigPic}>
|
||||
<UploadImage onChange={pros.getImageList} defaultList={pros.PicList} onlyRead={pros.onlyRead} />
|
||||
</View>
|
||||
}
|
||||
{
|
||||
!pros.showPic && <View className={styles.itemRight} onClick={() => pros.navTo?.()}
|
||||
style={{
|
||||
justifyContent: `${!pros.showSizeFont ? 'space-between' : ''}`, alignItems: `${!pros.showSizeFont ? 'center' : ''}`,
|
||||
display: `${!pros.showSizeFont ? 'flex' : ''}`
|
||||
}}
|
||||
>
|
||||
<View className={styles.rightFlex}>
|
||||
>
|
||||
<View className={styles.finkFlex}>
|
||||
<View className={styles.itemTitle}>{pros.title}</View>
|
||||
{
|
||||
pros.require && <Text className={styles.xing}>*</Text>
|
||||
}
|
||||
</View>
|
||||
{
|
||||
pros.isInput && <Input
|
||||
disabled={pros.disabled}
|
||||
placeholder={pros.placeholderFont}
|
||||
value={pros.inputValue}
|
||||
className={styles.inputStyle}
|
||||
type={pros.inputType}
|
||||
placeholderStyle={styles.placeholderStyle}
|
||||
onBlur={(e) => pros.getInput?.(e.detail.value)}
|
||||
></Input>
|
||||
pros.showSizeFont && <View className={styles.finkFont}>展示大小写</View>
|
||||
}
|
||||
</View>
|
||||
|
||||
<View className={styles.iconFlex}></View>
|
||||
{
|
||||
pros.showMore && <IconFont name={'icon-chakanquanbukehu'} size={50} color={'#000000'}></IconFont>
|
||||
|
||||
|
||||
pros.showPic &&
|
||||
<View className={styles.bigPic}>
|
||||
<UploadImage onChange={pros.getImageList} defaultList={pros.PicList} onlyRead={pros.onlyRead} />
|
||||
</View>
|
||||
}
|
||||
{
|
||||
pros.showScan && <View className={styles.shu}></View>
|
||||
!pros.showPic && <View className={styles.itemRight} onClick={() => pros.navTo?.()}
|
||||
style={{
|
||||
justifyContent: `${!pros.showSizeFont ? 'space-between' : ''}`, alignItems: `${!pros.showSizeFont ? 'center' : ''}`,
|
||||
display: `${!pros.showSizeFont ? 'flex' : ''}`
|
||||
}}
|
||||
>
|
||||
<View className={styles.rightFlex}>
|
||||
{
|
||||
pros.isInput && <Input
|
||||
disabled={pros.disabled}
|
||||
placeholder={pros.placeholderFont}
|
||||
value={pros.inputValue}
|
||||
className={styles.inputStyle}
|
||||
type={pros.inputType}
|
||||
placeholderStyle={styles.placeholderStyle}
|
||||
onBlur={(e) => pros.getInput?.(e.detail.value)}
|
||||
></Input>
|
||||
}
|
||||
</View>
|
||||
|
||||
}
|
||||
{
|
||||
pros.showScan && <View onClick={(e) => pros.getScan?.(e)}><IconFont name={'icon-saomiao'} size={50} color={'#337FFF'}></IconFont></View>
|
||||
{/* <View className={styles.iconFlex}></View> */}
|
||||
{
|
||||
pros.showMore && <IconFont name={'icon-chakanquanbukehu'} size={50} color={'#000000'}></IconFont>
|
||||
|
||||
}
|
||||
{
|
||||
pros.showScan && <View className={styles.shu}></View>
|
||||
}
|
||||
{
|
||||
pros.showScan && <View onClick={(e) => pros.getScan?.(e)}><IconFont name={'icon-saomiao'} size={50} color={'#337FFF'}></IconFont></View>
|
||||
}
|
||||
{
|
||||
pros.showSizeFont && <View className={styles.assginFont}>{pros.bigMoney}</View>
|
||||
}
|
||||
</View>
|
||||
}
|
||||
{
|
||||
pros.showSizeFont && <View className={styles.assginFont}>{pros.bigMoney}</View>
|
||||
}
|
||||
|
||||
</View>
|
||||
}
|
||||
|
||||
</View>
|
||||
</>
|
||||
)
|
||||
})
|
@ -6,6 +6,14 @@
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.addBox:hover {
|
||||
margin: 24px;
|
||||
padding: 0px 32px 40px 32px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16px 16px 0px 0px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.textAreaBox {
|
||||
margin-top: 40px;
|
||||
display: flex;
|
||||
@ -93,4 +101,19 @@
|
||||
.safeBox {
|
||||
height: 160px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.openBox {
|
||||
height: 82px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 82px;
|
||||
|
||||
.openFont {
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
color: #337FFF;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
@ -10,12 +10,14 @@ import Taro, { faceVerifyForPay, useDidShow } from '@tarojs/taro'
|
||||
import Form from './components/form'
|
||||
import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from '@/common/format'
|
||||
import {
|
||||
mpcashManagementOrderpost
|
||||
mpcashManagementOrderpost, mpshouldCollectOrderpurchaser
|
||||
} from "@/api/newCollection"
|
||||
import TimePicker from "@/components/timePicker"
|
||||
import dayjs from 'dayjs'
|
||||
import { alert } from "@/common/common"
|
||||
import smallToBig from '@/common/money'
|
||||
import IconFont from '@/components/iconfont/iconfont'
|
||||
import { mpcashManagementOrderaccount } from '@/api/newCollection'
|
||||
|
||||
export default () => {
|
||||
//获取选择的客户
|
||||
@ -26,10 +28,10 @@ export default () => {
|
||||
|
||||
setQuery((e) => ({
|
||||
...e,
|
||||
purchaser_id: currPage.data?.clientId ? currPage.data?.clientId : '',
|
||||
clientName: currPage.data?.clientName ? currPage.data?.clientName : '',
|
||||
bankId: currPage.data?.bankId ? currPage.data?.bankId : '',
|
||||
bankName: currPage.data?.bankName ? currPage.data?.bankName : '',
|
||||
purchaser_id: currPage.data?.clientId ? currPage.data?.clientId : Query.purchaser_id,
|
||||
clientName: currPage.data?.clientName ? currPage.data?.clientName : Query.clientName,
|
||||
bankId: currPage.data?.bankId ? currPage.data?.bankId : Query.bankId,
|
||||
bankName: currPage.data?.bankName ? currPage.data?.bankName : Query.bankName,
|
||||
}))
|
||||
})
|
||||
|
||||
@ -39,17 +41,33 @@ export default () => {
|
||||
const picUrl = useRef([])
|
||||
const getImageList = useCallback((list) => {
|
||||
picUrl.current = list
|
||||
console.log(picUrl.current, 'picUrl.current')
|
||||
setQuery((val) => ({ ...val, picList: list }))
|
||||
}, [])
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
getCuss()
|
||||
}, [])
|
||||
|
||||
//获取首个银行账号
|
||||
const { fetchData: clitentFetch } = mpcashManagementOrderaccount()
|
||||
const getCuss = async () => {
|
||||
let res = await clitentFetch({ page: 1, size: 10 })
|
||||
if (res.data) {
|
||||
setQuery((val) => ({ ...val, bankId: res.data.list[0].receiving_account_id, bankName: res.data.list[0].company_account }))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const { fetchData: scanFetch } = mpshouldCollectOrderpurchaser()
|
||||
//扫描
|
||||
const handScan = (e) => {
|
||||
e.stopPropagation()
|
||||
Taro.scanCode({
|
||||
success(res) {
|
||||
// setQuery({...Query})
|
||||
// setsearchObj((e) => ({ ...e, orderNo: res.result }))
|
||||
success: async function (res) {
|
||||
const restult = await scanFetch({ order_no: res.result })
|
||||
setQuery((val) => ({ ...val, purchaser_id: restult.data.purchaser_id, clientName: restult.data.purchaser_name }))
|
||||
},
|
||||
fail(res) {
|
||||
console.log(res);
|
||||
@ -78,13 +96,13 @@ export default () => {
|
||||
const isDisabled = useMemo(() => {
|
||||
if (Query.clientName == '' ||
|
||||
Query.money == '' ||
|
||||
picUrl.current.length == 0
|
||||
Query.picList?.length == 0
|
||||
) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}, [Query, picUrl])
|
||||
}, [Query])
|
||||
|
||||
//收款金额回调
|
||||
const getInput = (e) => {
|
||||
@ -95,11 +113,11 @@ export default () => {
|
||||
setQuery(Query)
|
||||
}, [Query])
|
||||
|
||||
useEffect(() => {
|
||||
if (currPage.data?.clientId && (currPage.data?.clientId != Query.purchaser_id)) {
|
||||
setQuery({ ...Query, bankId: '', bankName: '' })
|
||||
}
|
||||
}, [Query])
|
||||
// useEffect(() => {
|
||||
// if (currPage.data?.clientId && (currPage.data?.clientId != Query.purchaser_id)) {
|
||||
// setQuery({ ...Query, bankId: '', bankName: '' })
|
||||
// }
|
||||
// }, [Query])
|
||||
|
||||
|
||||
//备注信息
|
||||
@ -156,10 +174,28 @@ export default () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const [IsOpen, setIsOpen] = useState(false)
|
||||
const handOpen = () => {
|
||||
if (IsOpen) {
|
||||
setIsOpen(false)
|
||||
} else {
|
||||
setIsOpen(true)
|
||||
}
|
||||
}
|
||||
|
||||
const openFont = useMemo(() => {
|
||||
if (IsOpen) {
|
||||
return '收起'
|
||||
} else {
|
||||
return '展开'
|
||||
}
|
||||
}, [IsOpen])
|
||||
return (
|
||||
<>
|
||||
<View className={styles.addBox}>
|
||||
<Form
|
||||
isOpen={true}
|
||||
title={'客户名称'}
|
||||
require={true}
|
||||
isInput={true}
|
||||
@ -175,6 +211,7 @@ export default () => {
|
||||
showSizeFont={false}
|
||||
></Form>
|
||||
<Form
|
||||
isOpen={true}
|
||||
title={'收款金额'}
|
||||
require={true}
|
||||
isInput={true}
|
||||
@ -191,6 +228,7 @@ export default () => {
|
||||
bigMoney={smallToBig(typeof (Query.money) == 'undefined' ? 0 : Query.money)}
|
||||
></Form>
|
||||
<Form
|
||||
isOpen={true}
|
||||
styleNone={false}
|
||||
title={'收款凭证'}
|
||||
require={true}
|
||||
@ -202,6 +240,7 @@ export default () => {
|
||||
showSizeFont={false}
|
||||
></Form>
|
||||
<Form
|
||||
isOpen={IsOpen}
|
||||
title={'收款账户'}
|
||||
require={false}
|
||||
isInput={true}
|
||||
@ -215,22 +254,31 @@ export default () => {
|
||||
navTo={() => navTo(2)}
|
||||
showSizeFont={false}
|
||||
></Form>
|
||||
<View className={styles.textAreaBox}>
|
||||
<View className={styles.textAreaLeft}>备注信息</View>
|
||||
<View className={styles.textAreaRight}>
|
||||
<Textarea
|
||||
style={{ width: '70%' }}
|
||||
onInput={(e) => getDesc(e.detail.value)}
|
||||
value={TextareaValue}
|
||||
placeholderStyle='font-size: 28rpx;font-weight: 400;'
|
||||
maxlength={64}
|
||||
placeholder={'请填写备注信息'}
|
||||
></Textarea>
|
||||
<View className={styles.numsTotal}>{`${typeof (Query.nums) == 'undefined' ? 0 : Query.nums}/64`}</View>
|
||||
{
|
||||
IsOpen && <View className={styles.textAreaBox}>
|
||||
<View className={styles.textAreaLeft}>备注信息</View>
|
||||
<View className={styles.textAreaRight}>
|
||||
<Textarea
|
||||
style={{ width: '70%' }}
|
||||
onInput={(e) => getDesc(e.detail.value)}
|
||||
value={TextareaValue}
|
||||
placeholderStyle='font-size: 28rpx;font-weight: 400;'
|
||||
maxlength={64}
|
||||
placeholder={'请填写备注信息'}
|
||||
></Textarea>
|
||||
<View className={styles.numsTotal}>{`${typeof (Query.nums) == 'undefined' ? 0 : Query.nums}/64`}</View>
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
<View className={styles.openBox} onClick={() => handOpen()}>
|
||||
<View className={styles.openFont}>{openFont}</View>
|
||||
{
|
||||
!IsOpen && <IconFont name={'icon-zhankai'} size={30} color={'#337FFF'} ></IconFont>
|
||||
}
|
||||
{
|
||||
IsOpen && <IconFont name={'icon-shouqi'} size={30} color={'#337FFF'} ></IconFont>
|
||||
}
|
||||
</View>
|
||||
|
||||
|
||||
</View >
|
||||
<View className={styles.safeBox}> </View>
|
||||
<View className={styles.bottomBox}>
|
||||
|
@ -56,6 +56,7 @@
|
||||
width: 70%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.msgName {
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
@ -68,4 +69,37 @@
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.topBox {
|
||||
background: #FFFFFF;
|
||||
margin: 24px;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
.topFont {
|
||||
margin-top: 32px;
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.topMon {
|
||||
font-size: 64px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
letter-spacing: 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.topBigMon {
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
letter-spacing: 11px;
|
||||
margin-bottom: 38px;
|
||||
}
|
||||
}
|
@ -57,7 +57,19 @@ export default () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<View className={styles.topBox}>
|
||||
<View className={styles.topFont}>收款金额(元)</View>
|
||||
<View className={styles.topMon}>{money}</View>
|
||||
<View className={styles.topBigMon}>{smallToBig(typeof (money) == 'undefined' ? 0 : money)}</View>
|
||||
</View>
|
||||
<View className={styles.addBox}>
|
||||
<View className={styles.msgBox}>
|
||||
<View className={styles.msgLeft}>订单编号</View>
|
||||
<View className={styles.msgFlex}>
|
||||
<View className={styles.msgName}>{Query.order_no}</View>
|
||||
<View className={styles.msgTime} style={{ color: '#E42945' }}>{Query.auditor_status_name}</View>
|
||||
</View>
|
||||
</View>
|
||||
<Form
|
||||
title={'客户名称'}
|
||||
require={false}
|
||||
@ -70,7 +82,7 @@ export default () => {
|
||||
showPic={false}
|
||||
showSizeFont={false}
|
||||
></Form>
|
||||
<Form
|
||||
{/* <Form
|
||||
title={'收款金额'}
|
||||
require={false}
|
||||
isInput={true}
|
||||
@ -83,7 +95,7 @@ export default () => {
|
||||
showPic={false}
|
||||
showSizeFont={true}
|
||||
bigMoney={smallToBig(typeof (money) == 'undefined' ? 0 : money)}
|
||||
></Form>
|
||||
></Form> */}
|
||||
<Form
|
||||
styleNone={false}
|
||||
title={'收款凭证'}
|
||||
|
@ -240,7 +240,7 @@ export default () => {
|
||||
</View>
|
||||
<View className={styles.pageTop}>
|
||||
<View className={styles.pageTopLeft}>时间默认14天内</View>
|
||||
<View className={styles.pageTopRight}>金额汇总:{formatPriceDiv(orderData.summary.receipt_amount)}</View>
|
||||
<View className={styles.pageTopRight}>金额汇总:{formatPriceDiv(orderData?.summary?.receipt_amount)}</View>
|
||||
</View>
|
||||
<View className={styles.order_list}>
|
||||
<InfiniteScroll
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { View, Image, Text } from '@tarojs/components'
|
||||
import { FC, useState } from 'react'
|
||||
import { FC, useEffect, useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
import defaultAvatar from '../../styles/image/defaultAvatar.png'
|
||||
import NormalButton from '@/components/normalButton'
|
||||
@ -10,97 +10,119 @@ import IconCard from '@/components/iconCard'
|
||||
import { IconNames } from '@/components/iconfont/iconfont'
|
||||
import useUserInfo from '@/use/useUserInfo'
|
||||
import { goLink } from '@/common/common'
|
||||
|
||||
import { checkKey } from "@/common/common"
|
||||
import { useDidShow } from '@tarojs/taro'
|
||||
type IconCardType = {
|
||||
jurisdiction?: string //权限key值
|
||||
iconName: IconNames
|
||||
name: string
|
||||
path: string
|
||||
}
|
||||
|
||||
const feature: IconCardType[] = [
|
||||
|
||||
|
||||
let feature: IconCardType[] = [
|
||||
{
|
||||
iconName: 'icon-lingquseka',
|
||||
name: '领取色卡',
|
||||
path: '',
|
||||
jurisdiction: 'receive_color_card_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-pandiansaoma',
|
||||
name: '盘点扫码',
|
||||
path: '',
|
||||
jurisdiction: 'counting_scanning_code_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-fahuoliebiao',
|
||||
name: '发货列表',
|
||||
path: '/pages/delivery/index',
|
||||
jurisdiction: 'shipping_list_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-yaoqingma',
|
||||
name: '邀请码',
|
||||
path: '',
|
||||
jurisdiction: 'invitation_code_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-tihuoliebiao',
|
||||
name: '提货列表',
|
||||
path: '/pages/takeDelivery/index',
|
||||
jurisdiction: 'picking_list_module_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-shouhouzhongxin',
|
||||
name: '退货退款',
|
||||
path: '/pages/refundPage/index',
|
||||
jurisdiction: 'return_and_refund_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-shoukuanliebiao',
|
||||
name: '收款列表',
|
||||
path: '/pages/newCollection/index',
|
||||
jurisdiction: 'collection_list_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-kehuxinxi',
|
||||
name: '客户列表',
|
||||
path: '',
|
||||
jurisdiction: 'customer_list_page'
|
||||
},
|
||||
]
|
||||
|
||||
const fabric: IconCardType[] = [
|
||||
let fabric: IconCardType[] = [
|
||||
{
|
||||
iconName: 'icon-yansequyang',
|
||||
name: '颜色取样',
|
||||
path: '/pages/colorRelated/takeColor/index',
|
||||
jurisdiction: 'color_sampling_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-qusechazhao',
|
||||
name: '取色查找',
|
||||
path: '/pages/colorRelated/findColor/index',
|
||||
jurisdiction: 'color_search_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-yangpinduibi',
|
||||
name: '样品对比',
|
||||
path: '/pages/colorRelated/sampleComparison/index',
|
||||
jurisdiction: 'sample_comparison_page'
|
||||
},
|
||||
]
|
||||
|
||||
const statisticAnalysis: IconCardType[] = [
|
||||
let statisticAnalysis: IconCardType[] = [
|
||||
{
|
||||
iconName: 'icon-xiaoshou',
|
||||
name: '销售',
|
||||
path: '/pages/saleStatistic/index',
|
||||
jurisdiction: 'sales_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-duizhang',
|
||||
name: '对账',
|
||||
path: '',
|
||||
jurisdiction: 'reconciliation_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-yuncangkucun',
|
||||
name: '云仓库存',
|
||||
path: '',
|
||||
jurisdiction: 'cloud_warehouse_inventory_page'
|
||||
},
|
||||
{
|
||||
iconName: 'icon-qianzhicangkucun',
|
||||
name: '前置仓库存',
|
||||
path: '',
|
||||
jurisdiction: 'front_warehouse_page'
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
// 用户信息
|
||||
const UserInfo: FC = () => {
|
||||
const { removeToken, removeUserInfo, userInfo } = useUserInfo()
|
||||
@ -123,6 +145,23 @@ const UserInfo: FC = () => {
|
||||
goLink(item.path, {}, 'navigateTo')
|
||||
}
|
||||
|
||||
|
||||
const [Features, setFeatures] = useState<any[]>([])
|
||||
const [Coloring, setColoring] = useState<any[]>([])
|
||||
const [Statistics, setStatistics] = useState<any[]>([])
|
||||
useDidShow(() => {
|
||||
let arr: any[] = []
|
||||
let arrOne: any[] = []
|
||||
let arrTwo: any[] = []
|
||||
arr = feature.filter((item) => checkKey(item.jurisdiction));
|
||||
arrOne = fabric.filter((item) => checkKey(item.jurisdiction));
|
||||
arrTwo = statisticAnalysis.filter((item) => checkKey(item.jurisdiction));
|
||||
setFeatures([...arr])
|
||||
setColoring([...arrOne])
|
||||
setStatistics([...arrTwo])
|
||||
})
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<LayoutBlock circle>
|
||||
@ -148,30 +187,37 @@ const UserInfo: FC = () => {
|
||||
<Text className={styles.userTitle}>IT-开发总监</Text>
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
<LayoutBlock circle>
|
||||
<View className={styles.layoutTitle}>功能特色</View>
|
||||
<View className={styles['grid-container']}>
|
||||
{feature.map(item => {
|
||||
return <IconCard iconName={item.iconName} title={item.name} onClick={() => handleClickIconCard(item)}></IconCard>
|
||||
})}
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
<LayoutBlock circle>
|
||||
<View className={styles.layoutTitle}>布料取色</View>
|
||||
<View className={styles['grid-container']}>
|
||||
{fabric.map(item => {
|
||||
return <IconCard iconName={item.iconName} title={item.name} onClick={() => handleClickIconCard(item)}></IconCard>
|
||||
})}
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
<LayoutBlock circle>
|
||||
<View className={styles.layoutTitle}>统计分析</View>
|
||||
<View className={styles['grid-container']}>
|
||||
{statisticAnalysis.map(item => {
|
||||
return <IconCard iconName={item.iconName} title={item.name} onClick={() => handleClickIconCard(item)}></IconCard>
|
||||
})}
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
{
|
||||
!!Features.length && <LayoutBlock circle>
|
||||
<View className={styles.layoutTitle}>功能特色</View>
|
||||
<View className={styles['grid-container']}>
|
||||
{Features.map(item => {
|
||||
return <IconCard iconName={item.iconName} title={item.name} onClick={() => handleClickIconCard(item)}></IconCard>
|
||||
})}
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
}
|
||||
{
|
||||
!!Coloring.length && <LayoutBlock circle>
|
||||
<View className={styles.layoutTitle}>布料取色</View>
|
||||
<View className={styles['grid-container']}>
|
||||
{Coloring.map(item => {
|
||||
return <IconCard iconName={item.iconName} title={item.name} onClick={() => handleClickIconCard(item)}></IconCard>
|
||||
})}
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
}
|
||||
{
|
||||
!!Statistics.length && <LayoutBlock circle>
|
||||
<View className={styles.layoutTitle}>统计分析</View>
|
||||
<View className={styles['grid-container']}>
|
||||
{Statistics.map(item => {
|
||||
return <IconCard iconName={item.iconName} title={item.name} onClick={() => handleClickIconCard(item)}></IconCard>
|
||||
})}
|
||||
</View>
|
||||
</LayoutBlock>
|
||||
}
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user