Commit 5b67679d authored by Bill's avatar Bill

fix: 修改首页以及考评搜索条件

parent 3b83b937
import React, { Fragment, useMemo } from 'react';
import React, { Fragment, useEffect, useMemo } from 'react';
import styles from './center.less';
import { PublicApi } from '@/services/api'
import { Link } from 'umi'
......@@ -8,10 +8,11 @@ import useViewRequest from '../../hooks/useViewRequest';
import { GetReportMemberHomeGetPurchaseTallyResponse } from '@/services/ReportV2Api';
import { BellOutlined } from '@ant-design/icons';
import {Button} from 'antd';
import { getAuth } from '@/utils/auth';
interface Iprops {};
const { StaticsDataList } = Layout
const url = '/memberCenter/handling/assign/query';
const url = '/memberCenter/procurementAbility/purchaseInquiry/inquiry';
const KEY_TITLE = {
purchaseInquiryList: '采购询价 ',
......@@ -24,9 +25,28 @@ const KEY_TITLE = {
needPlanList: '需求计划',
purchasePlanList: '采购计划'
}
/** memberType 是否是企业会员或是企业个人会员 */
const isBusiness = [1, 2];
/** memberRoleType 是否是服务消费者 */
const isConsumer = 2;
const PurchaseCenter: React.FC<Iprops> = () => {
const { loading, responseData, filterEmptyList, isError, ref } = useViewRequest<GetReportMemberHomeGetPurchaseTallyResponse, any>(PublicApi.getReportMemberHomeGetPurchaseTally, {})
const { loading, responseData, filterEmptyList, isError, ref, inViewPort } = useViewRequest<GetReportMemberHomeGetPurchaseTallyResponse, any>(PublicApi.getReportMemberHomeGetPurchaseTally, {})
const auth = getAuth()
useEffect(() => {
if (!inViewPort || (!isBusiness.includes(auth.memberType)) || isConsumer !== auth.memberRoleType ) {
return;
}
console.log((!isBusiness.includes(auth.memberType)), isConsumer !== auth.memberRoleType)
async function findCurrMemberPurchase() {
const { data, code } = await PublicApi.getTemplateWebMemberPurchaseWebFindCurrMemberPurchase();
if (code === code) {
return data?.id
}
return null
}
findCurrMemberPurchase()
}, [inViewPort, auth])
return (
<Layout
......
......@@ -69,7 +69,7 @@ function useViewRequest<T, P>(fn: (postData: P) => Promise<ResponseDataType & {
console.log("result", result);
return result;
}, [responseData])
return { loading, isError, ref, hasRequest, refresh, responseData, filterEmptyList }
return { loading, isError, ref, hasRequest, refresh, responseData, filterEmptyList, inViewPort }
}
export default useViewRequest
......@@ -16,6 +16,8 @@ export const evaluationListSchema: ISchema = {
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
columns: 3,
},
properties: {
ctl: {
......
......@@ -27,7 +27,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
grid: true,
full: true,
autoRow: true,
columns: 3,
columns: 6,
},
properties: {
subject: {
......@@ -36,7 +36,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
placeholder: '考评主题',
allowClear: true,
style: {
width: 160,
width: 145,
},
},
},
......
......@@ -66,7 +66,7 @@ export const querySchema: ISchema = {
columns: 6,
},
properties: {
summary: {
subject: {
type: 'string',
'x-component-props': {
placeholder: '通知单摘要',
......
import { isDev } from '@/constants'
import { GetMemberLoginRegetResponse } from '@/services/memberApi'
export interface AuthInfo {
userId: number,
......@@ -11,7 +12,7 @@ export const setAuth = (info: AuthInfo) => {
window.localStorage.setItem('auth', JSON.stringify(info))
}
export const getAuth = () => {
export const getAuth = (): Partial<GetMemberLoginRegetResponse> | null => {
try {
const localAuth = window.localStorage.getItem('auth')
return localAuth ? JSON.parse(localAuth) : null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment