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