diff --git a/src/api/newCollection.ts b/src/api/newCollection.ts index 182a2e9..01d5c20 100644 --- a/src/api/newCollection.ts +++ b/src/api/newCollection.ts @@ -27,4 +27,11 @@ export const mpcashManagementOrderpost = () => { url: `/v1/mp/cashManagementOrder`, method: "post", }) -} \ No newline at end of file +} +//扫描获取应收单的客户信息 +export const mpshouldCollectOrderpurchaser = () => { + return useRequest({ + url: `/v2/mp/shouldCollectOrder/purchaser`, + method: "get", + }) +} diff --git a/src/common/common.ts b/src/common/common.ts index ee7e45e..c67e5d8 100644 --- a/src/common/common.ts +++ b/src/common/common.ts @@ -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); +}; \ No newline at end of file diff --git a/src/components/uploadImage/index.tsx b/src/components/uploadImage/index.tsx index f27220f..d3a4cd0 100644 --- a/src/components/uploadImage/index.tsx +++ b/src/components/uploadImage/index.tsx @@ -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(({ onChange, defaultList, onlyRead = false {imageList?.map((item, index) => ( - {!onlyRead && delImage(index)} className={classnames(styles.miconfont_close, 'iconfont icon-guanbi')}>} + {!onlyRead && delImage(index)}> + + } ))} {!onlyRead && ( - + + {/* */} {/* 上传照片 */} )} diff --git a/src/pages/addCollection/components/form/index.module.scss b/src/pages/addCollection/components/form/index.module.scss index f35606f..a3f9148 100644 --- a/src/pages/addCollection/components/form/index.module.scss +++ b/src/pages/addCollection/components/form/index.module.scss @@ -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%; } } diff --git a/src/pages/addCollection/components/form/index.tsx b/src/pages/addCollection/components/form/index.tsx index 1544633..792f9f7 100644 --- a/src/pages/addCollection/components/form/index.tsx +++ b/src/pages/addCollection/components/form/index.tsx @@ -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 ( - - + { + pros.isOpen && + - - {pros.title} - { - pros.require && * - } - - { - pros.showSizeFont && 展示大小写 - } - - { - pros.showPic && - - - - } - { - !pros.showPic && pros.navTo?.()} - style={{ - justifyContent: `${!pros.showSizeFont ? 'space-between' : ''}`, alignItems: `${!pros.showSizeFont ? 'center' : ''}`, - display: `${!pros.showSizeFont ? 'flex' : ''}` - }} - > - + > + + {pros.title} + { + pros.require && * + } + { - pros.isInput && pros.getInput?.(e.detail.value)} - > + pros.showSizeFont && 展示大小写 } - - { - pros.showMore && - - + pros.showPic && + + + } { - pros.showScan && + !pros.showPic && pros.navTo?.()} + style={{ + justifyContent: `${!pros.showSizeFont ? 'space-between' : ''}`, alignItems: `${!pros.showSizeFont ? 'center' : ''}`, + display: `${!pros.showSizeFont ? 'flex' : ''}` + }} + > + + { + pros.isInput && pros.getInput?.(e.detail.value)} + > + } + - } - { - pros.showScan && pros.getScan?.(e)}> + {/* */} + { + pros.showMore && + } + { + pros.showScan && + } + { + pros.showScan && pros.getScan?.(e)}> + } + { + pros.showSizeFont && {pros.bigMoney} + } + } - { - pros.showSizeFont && {pros.bigMoney} - } + } - - + ) }) \ No newline at end of file diff --git a/src/pages/addCollection/index.module.scss b/src/pages/addCollection/index.module.scss index 4ea8f68..d38445a 100644 --- a/src/pages/addCollection/index.module.scss +++ b/src/pages/addCollection/index.module.scss @@ -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; + } } \ No newline at end of file diff --git a/src/pages/addCollection/index.tsx b/src/pages/addCollection/index.tsx index ea20ef5..6a16d17 100644 --- a/src/pages/addCollection/index.tsx +++ b/src/pages/addCollection/index.tsx @@ -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 ( <>
{ showSizeFont={false} >
{ bigMoney={smallToBig(typeof (Query.money) == 'undefined' ? 0 : Query.money)} >
{ showSizeFont={false} >
{ navTo={() => navTo(2)} showSizeFont={false} >
- - 备注信息 - - - {`${typeof (Query.nums) == 'undefined' ? 0 : Query.nums}/64`} + { + IsOpen && + 备注信息 + + + {`${typeof (Query.nums) == 'undefined' ? 0 : Query.nums}/64`} + + } + handOpen()}> + {openFont} + { + !IsOpen && + } + { + IsOpen && + } - - diff --git a/src/pages/collectionDetail/index.module.scss b/src/pages/collectionDetail/index.module.scss index ccbc580..affc068 100644 --- a/src/pages/collectionDetail/index.module.scss +++ b/src/pages/collectionDetail/index.module.scss @@ -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; + } } \ No newline at end of file diff --git a/src/pages/collectionDetail/index.tsx b/src/pages/collectionDetail/index.tsx index 5f936a2..4ec0561 100644 --- a/src/pages/collectionDetail/index.tsx +++ b/src/pages/collectionDetail/index.tsx @@ -57,7 +57,19 @@ export default () => { return ( <> + + 收款金额(元) + {money} + {smallToBig(typeof (money) == 'undefined' ? 0 : money)} + + + 订单编号 + + {Query.order_no} + {Query.auditor_status_name} + +
{ showPic={false} showSizeFont={false} >
-
{ showPic={false} showSizeFont={true} bigMoney={smallToBig(typeof (money) == 'undefined' ? 0 : money)} - >
+ > */}
{ 时间默认14天内 - 金额汇总:{formatPriceDiv(orderData.summary.receipt_amount)} + 金额汇总:{formatPriceDiv(orderData?.summary?.receipt_amount)} { const { removeToken, removeUserInfo, userInfo } = useUserInfo() @@ -123,6 +145,23 @@ const UserInfo: FC = () => { goLink(item.path, {}, 'navigateTo') } + + const [Features, setFeatures] = useState([]) + const [Coloring, setColoring] = useState([]) + const [Statistics, setStatistics] = useState([]) + 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 ( <> @@ -148,30 +187,37 @@ const UserInfo: FC = () => { IT-开发总监 - - 功能特色 - - {feature.map(item => { - return handleClickIconCard(item)}> - })} - - - - 布料取色 - - {fabric.map(item => { - return handleClickIconCard(item)}> - })} - - - - 统计分析 - - {statisticAnalysis.map(item => { - return handleClickIconCard(item)}> - })} - - + { + !!Features.length && + 功能特色 + + {Features.map(item => { + return handleClickIconCard(item)}> + })} + + + } + { + !!Coloring.length && + 布料取色 + + {Coloring.map(item => { + return handleClickIconCard(item)}> + })} + + + } + { + !!Statistics.length && + 统计分析 + + {Statistics.map(item => { + return handleClickIconCard(item)}> + })} + + + } + ) }