Commit d2d25d28 authored by XieZhiXiong's avatar XieZhiXiong

feat: 调整入库分类信息相关

parent 13cd9bca
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.select.placeholder':'Please select', 'member.management.memberPrComingClassify.drawer.form.select.placeholder':'Please select',
'member.management.memberPrComingClassify.drawer.form.classify':'Incoming classification information', 'member.management.memberPrComingClassify.drawer.form.classify':'Incoming classification information',
'member.management.memberPrComingClassify.drawer.form.classify.code':'Member Code', 'member.management.memberPrComingClassify.drawer.form.classify.code':'Member Code',
'member.management.memberPrComingClassify.drawer.form.classify.code.description-1':'The length is up to 10 digits and cannot be repeated', 'member.management.memberPrComingClassify.drawer.form.classify.code.description-1':'The length is up to 10 digits and cannot be repeated, ',
'member.management.memberPrComingClassify.drawer.form.classify.code.description-2': 'member.management.memberPrComingClassify.drawer.form.classify.code.description-2':
'Special symbols are not supported (except for English "_-"; underscore and midline)', 'Special symbols are not supported (except for English "_-"; underscore and midline)',
'member.management.memberPrComingClassify.drawer.form.classify.code.rules-legal': 'member.management.memberPrComingClassify.drawer.form.classify.code.rules-legal':
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,7 @@ export default {
'Please enter a value, up to two decimal places are supported', 'Please enter a value, up to two decimal places are supported',
'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-max':'Support up to 8 characters', 'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-max':'Support up to 8 characters',
'member.management.memberPrComingClassify.drawer.form.classify.areaCodes':'Applicable area', 'member.management.memberPrComingClassify.drawer.form.classify.areaCodes':'Applicable area',
'member.management.memberPrComingClassify.drawer.form.classify.categories':'Main category', 'member.management.memberPrComingClassify.drawer.form.classify.categories':'Settlement method and main categories',
'member.management.memberPrComingClassify.drawer.form.classify.category':'Category', 'member.management.memberPrComingClassify.drawer.form.classify.category':'Category',
'member.management.memberPrComingClassify.drawer.form.classify.paymentDay':'Payment period (days)', 'member.management.memberPrComingClassify.drawer.form.classify.paymentDay':'Payment period (days)',
'member.management.memberPrComingClassify.drawer.form.classify.paymentDay.rules-legal': 'member.management.memberPrComingClassify.drawer.form.classify.paymentDay.rules-legal':
......
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.select.placeholder': '선택하십시오.', 'member.management.memberPrComingClassify.drawer.form.select.placeholder': '선택하십시오.',
'member.management.memberPrComingClassify.drawer.form.classify': '입고 분류 정보', 'member.management.memberPrComingClassify.drawer.form.classify': '입고 분류 정보',
'member.management.memberPrComingClassify.drawer.form.classify.code': '회원 번호', 'member.management.memberPrComingClassify.drawer.form.classify.code': '회원 번호',
'member.management.memberPrComingClassify.drawer.form.classify.code.description-1': '최대 10비트 길이, 중복 불가', 'member.management.memberPrComingClassify.drawer.form.classify.code.description-1': '최대 10비트 길이, 중복 불가, ',
'member.management.memberPrComingClassify.drawer.form.classify.code.description-2': '특수 기호는 지원되지 않습니다(영문 "-", 밑줄 및 중간줄 제외).', 'member.management.memberPrComingClassify.drawer.form.classify.code.description-2': '특수 기호는 지원되지 않습니다(영문 "-", 밑줄 및 중간줄 제외).',
'member.management.memberPrComingClassify.drawer.form.classify.code.rules-legal': '숫자, 영어, -를 입력하십시오.최대 10자 지원', 'member.management.memberPrComingClassify.drawer.form.classify.code.rules-legal': '숫자, 영어, -를 입력하십시오.최대 10자 지원',
'member.management.memberPrComingClassify.drawer.form.classify.partnerType': '협력 관계', 'member.management.memberPrComingClassify.drawer.form.classify.partnerType': '협력 관계',
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-legal': '소수점 이하 두 자리까지 사용할 수 있는 값을 입력하십시오', 'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-legal': '소수점 이하 두 자리까지 사용할 수 있는 값을 입력하십시오',
'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-max': '최대 8자 지원', 'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-max': '최대 8자 지원',
'member.management.memberPrComingClassify.drawer.form.classify.areaCodes': '적용 구역', 'member.management.memberPrComingClassify.drawer.form.classify.areaCodes': '적용 구역',
'member.management.memberPrComingClassify.drawer.form.classify.categories': '주류', 'member.management.memberPrComingClassify.drawer.form.classify.categories': '결제 방법 및 주요 카테고리',
'member.management.memberPrComingClassify.drawer.form.classify.category': '종류', 'member.management.memberPrComingClassify.drawer.form.classify.category': '종류',
'member.management.memberPrComingClassify.drawer.form.classify.paymentDay': '결제 주기(일)', 'member.management.memberPrComingClassify.drawer.form.classify.paymentDay': '결제 주기(일)',
'member.management.memberPrComingClassify.drawer.form.classify.paymentDay.rules-legal': '0자릿수 또는 양의 정수(최대 8자릿수)를 입력하십시오.', 'member.management.memberPrComingClassify.drawer.form.classify.paymentDay.rules-legal': '0자릿수 또는 양의 정수(최대 8자릿수)를 입력하십시오.',
......
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.select.placeholder': '请选择', 'member.management.memberPrComingClassify.drawer.form.select.placeholder': '请选择',
'member.management.memberPrComingClassify.drawer.form.classify': '入库分类信息', 'member.management.memberPrComingClassify.drawer.form.classify': '入库分类信息',
'member.management.memberPrComingClassify.drawer.form.classify.code': '会员编码', 'member.management.memberPrComingClassify.drawer.form.classify.code': '会员编码',
'member.management.memberPrComingClassify.drawer.form.classify.code.description-1': '长度最多10位,不可重复', 'member.management.memberPrComingClassify.drawer.form.classify.code.description-1': '长度最多10位,不可重复',
'member.management.memberPrComingClassify.drawer.form.classify.code.description-2': '不支持特殊符号(除英文"_-";下划线和中划线)', 'member.management.memberPrComingClassify.drawer.form.classify.code.description-2': '不支持特殊符号(除英文"_-";下划线和中划线)',
'member.management.memberPrComingClassify.drawer.form.classify.code.rules-legal': '请输入数字、英文、_-,最多支持10个字符', 'member.management.memberPrComingClassify.drawer.form.classify.code.rules-legal': '请输入数字、英文、_-,最多支持10个字符',
'member.management.memberPrComingClassify.drawer.form.classify.partnerType': '合作关系', 'member.management.memberPrComingClassify.drawer.form.classify.partnerType': '合作关系',
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-legal': '请输入数值,最多支持小数点后两位', 'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-legal': '请输入数值,最多支持小数点后两位',
'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-max': '最多支持8个字符', 'member.management.memberPrComingClassify.drawer.form.classify.maxAmount.rules-max': '最多支持8个字符',
'member.management.memberPrComingClassify.drawer.form.classify.areaCodes': '适用区域', 'member.management.memberPrComingClassify.drawer.form.classify.areaCodes': '适用区域',
'member.management.memberPrComingClassify.drawer.form.classify.categories': '主营品类', 'member.management.memberPrComingClassify.drawer.form.classify.categories': '结算方式与主营品类',
'member.management.memberPrComingClassify.drawer.form.classify.category': '品类', 'member.management.memberPrComingClassify.drawer.form.classify.category': '品类',
'member.management.memberPrComingClassify.drawer.form.classify.paymentDay': '付款周期(天)', 'member.management.memberPrComingClassify.drawer.form.classify.paymentDay': '付款周期(天)',
'member.management.memberPrComingClassify.drawer.form.classify.paymentDay.rules-legal': '请输入0 或 正整数,最多8位数', 'member.management.memberPrComingClassify.drawer.form.classify.paymentDay.rules-legal': '请输入0 或 正整数,最多8位数',
...@@ -541,7 +541,7 @@ export default { ...@@ -541,7 +541,7 @@ export default {
'member.components.MemberDocCategory.category.invoiceTypeName': '发票类型', 'member.components.MemberDocCategory.category.invoiceTypeName': '发票类型',
'member.components.MemberDocCategory.category.taxPoint': '税点', 'member.components.MemberDocCategory.category.taxPoint': '税点',
'member.components.MemberDocCategory.title': '分类信息', 'member.components.MemberDocCategory.title': '分类信息',
'member.components.MemberDocCategory.edit': '修改', 'member.components.MemberDocCategory.edit': '编辑',
'member.components.MemberDocCategory.edit.message': '正在提交,请稍候...', 'member.components.MemberDocCategory.edit.message': '正在提交,请稍候...',
'member.components.MemberDocCategory.month': '{month}个月', 'member.components.MemberDocCategory.month': '{month}个月',
'member.components.MemberDocCategory.monthDay': '{monthDay}号', 'member.components.MemberDocCategory.monthDay': '{monthDay}号',
......
...@@ -293,7 +293,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR ...@@ -293,7 +293,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
setClassifyInfo({ setClassifyInfo({
code: res.data?.code, code: res.data?.code,
partnerType: res.data?.partnerType, partnerType: res.data?.partnerType,
maxAmount: `${parseFloat(res.data?.maxAmount)}`, maxAmount: `${res.data?.maxAmount ? parseFloat(res.data?.maxAmount) : ''}`,
areaCodes: res.data?.areaCodes, areaCodes: res.data?.areaCodes,
categories: res.data?.categories.map(({ details, payType, month, monthDay, days, taxPoint, ...rest }) => ({ categories: res.data?.categories.map(({ details, payType, month, monthDay, days, taxPoint, ...rest }) => ({
details: getCategoryAllKeys(details as unknown as CategoryType[]), details: getCategoryAllKeys(details as unknown as CategoryType[]),
......
...@@ -31,11 +31,11 @@ import MemberBasicInfo from '../MemberBasicInfo'; ...@@ -31,11 +31,11 @@ import MemberBasicInfo from '../MemberBasicInfo';
import MemberChannelInfo from '../MemberChannelInfo'; import MemberChannelInfo from '../MemberChannelInfo';
import MemberDocIncomingInfo from '../MemberDocIncomingInfo'; import MemberDocIncomingInfo from '../MemberDocIncomingInfo';
import MemberInvestigateInfo from '../MemberInvestigateInfo'; import MemberInvestigateInfo from '../MemberInvestigateInfo';
import MemberDocCategory from '../MemberDocCategory';
import MemberDocQualification from '../MemberDocQualification'; import MemberDocQualification from '../MemberDocQualification';
import MemberChannelInfoForm, { ChannelValueType, ChannelRefHandle } from '../MemberChannelInfoForm'; import MemberChannelInfoForm, { ChannelValueType, ChannelRefHandle } from '../MemberChannelInfoForm';
import MemberDocIncomingInfoForm, { DepositValueType, DepositRefHandle } from '../MemberDocIncomingInfoForm'; import MemberDocIncomingInfoForm, { DepositValueType, DepositRefHandle } from '../MemberDocIncomingInfoForm';
import MemberQualitiesForm, { QualitiesSubmitValueType, QualitiesRefHandle } from '../MemberQualitiesForm'; import MemberQualitiesForm, { QualitiesSubmitValueType, QualitiesRefHandle } from '../MemberQualitiesForm';
import MemberDocCategoryPro, { MemberDocCategoryProProps, MemberDocCategoryProRef } from '../MemberDocCategoryPro';
export * from './interface'; export * from './interface';
interface IProps { interface IProps {
...@@ -95,6 +95,18 @@ interface IProps { ...@@ -95,6 +95,18 @@ interface IProps {
* 资质证明ref * 资质证明ref
*/ */
qualitiesRef?: Ref<QualitiesRefHandle>, qualitiesRef?: Ref<QualitiesRefHandle>,
/**
* 是否可编辑分类信息,默认 false
*/
editableCategory?: boolean,
/**
* 分类信息ref
*/
categoryRef?: Ref<MemberDocCategoryProRef>,
/**
* 分类信息提交事件
*/
onCategorySubmit?: MemberDocCategoryProProps['onSubmit'],
} }
const MemberProfile: React.FC<IProps> = (props) => { const MemberProfile: React.FC<IProps> = (props) => {
...@@ -113,6 +125,9 @@ const MemberProfile: React.FC<IProps> = (props) => { ...@@ -113,6 +125,9 @@ const MemberProfile: React.FC<IProps> = (props) => {
editableQualities, editableQualities,
onQualitiesChange, onQualitiesChange,
qualitiesRef, qualitiesRef,
editableCategory,
categoryRef,
onCategorySubmit,
} = props; } = props;
const intl = useIntl(); const intl = useIntl();
...@@ -182,9 +197,11 @@ const MemberProfile: React.FC<IProps> = (props) => { ...@@ -182,9 +197,11 @@ const MemberProfile: React.FC<IProps> = (props) => {
: null : null
), ),
( (
dataSource (
&& dataSource.classification dataSource
&& dataSource.classification.code && dataSource.classification
&& dataSource.classification.code
) || editableCategory
? { ? {
key: 'classifyInfo', key: 'classifyInfo',
name: intl.formatMessage({ id: 'member.components.MemberProfile.classifyInfo' }), name: intl.formatMessage({ id: 'member.components.MemberProfile.classifyInfo' }),
...@@ -412,11 +429,28 @@ const MemberProfile: React.FC<IProps> = (props) => { ...@@ -412,11 +429,28 @@ const MemberProfile: React.FC<IProps> = (props) => {
) : null} ) : null}
{/* 分类信息 */} {/* 分类信息 */}
{dataSource && dataSource.classification && dataSource.classification.code ? ( {(
(
dataSource
&& dataSource.classification
&& dataSource.classification.code
)
|| editableCategory
) ? (
<Col span={24}> <Col span={24}>
<AnchorPage.Item itemKey="classifyInfo"> <AnchorPage.Item itemKey="classifyInfo">
<MemberDocCategory <MemberDocCategoryPro
dataSource={dataSource?.classification} value={dataSource?.classification}
editable={editableCategory}
isVerify={editableCategory ? 1 : 0}
partnerTypes={(
dataSource
&& dataSource.partnerTypes
? dataSource.partnerTypes.map((item) => ({ label: item.text, value: item.id })).filter((item) => item.value)
: []
)}
onSubmit={onCategorySubmit}
ref={categoryRef}
/> />
</AnchorPage.Item> </AnchorPage.Item>
</Col> </Col>
......
...@@ -5,10 +5,8 @@ ...@@ -5,10 +5,8 @@
* @LastEditTime: 2021-07-09 15:30:54 * @LastEditTime: 2021-07-09 15:30:54
* @Description: * @Description:
*/ */
import { BasicInfoProps } from '../MemberBasicInfo';
import { ChannelInfoProps } from '../MemberChannelInfo';
import { InvestigateInfoProps } from '../MemberInvestigateInfo'; import { InvestigateInfoProps } from '../MemberInvestigateInfo';
import { DocCategoryProps } from '../MemberDocCategory'; import { MemberDocCategoryProProps } from '../MemberDocCategoryPro';
import { ElementType } from '../../utils'; import { ElementType } from '../../utils';
export type VerifyStepsItemType = { export type VerifyStepsItemType = {
...@@ -265,7 +263,7 @@ export type DetailType = { ...@@ -265,7 +263,7 @@ export type DetailType = {
/** /**
* 分类信息 * 分类信息
*/ */
classification?: DocCategoryProps['dataSource'], classification?: MemberDocCategoryProProps['value'],
/** /**
* 内部流转记录 * 内部流转记录
*/ */
......
...@@ -5,17 +5,24 @@ ...@@ -5,17 +5,24 @@
* @LastEditTime: 2021-11-29 20:07:02 * @LastEditTime: 2021-11-29 20:07:02
* @Description: 会员档案信息 * @Description: 会员档案信息
*/ */
import React, { useContext, useEffect, useState } from 'react'; import React, { useContext, useEffect, useRef, useState } from 'react';
import { useIntl } from 'umi'; import { useIntl } from 'umi';
import { Row, Col, Spin } from 'antd'; import { Row, Col, Spin, message } from 'antd';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { getMemberAbilityMaintenanceDetailAppraisalPage, getMemberAbilityMaintenanceDetailInspectPage, getMemberAbilityMaintenanceDetailRecord, GetMemberAbilityMaintenanceDetailRecordResponse, getMemberAbilityMaintenanceDetailRectifyPage } from '@/services/MemberV2Api'; import {
getMemberAbilityMaintenanceDetailAppraisalPage,
getMemberAbilityMaintenanceDetailInspectPage,
getMemberAbilityMaintenanceDetailRecord,
GetMemberAbilityMaintenanceDetailRecordResponse,
getMemberAbilityMaintenanceDetailRectifyPage,
postMemberAbilityMaintenanceDetailRecordClassifyUpdate,
} from '@/services/MemberV2Api';
import BASE_CONFIG from '@/../config/base.config.json'; import BASE_CONFIG from '@/../config/base.config.json';
import { EditableColumns } from '@/components/PolymericTable/interface'; import { EditableColumns } from '@/components/PolymericTable/interface';
import AnchorPage from '@/components/AnchorPage'; import AnchorPage from '@/components/AnchorPage';
import { getIncomingInfoAnchorKey } from '../../utils'; import { getIncomingInfoAnchorKey } from '../../utils';
import MemberDetailsContext from '../../memberDetailsContext'; import MemberDetailsContext from '../../memberDetailsContext';
import MemberDocCategory from '../../components/MemberDocCategory'; import MemberDocCategoryPro, { MemberDocCategoryProProps, MemberDocCategoryProRef } from '../../components/MemberDocCategoryPro';
import MemberDocIncomingInfo from '../../components/MemberDocIncomingInfo'; import MemberDocIncomingInfo from '../../components/MemberDocIncomingInfo';
import MemberDocQualification from '../../components/MemberDocQualification'; import MemberDocQualification from '../../components/MemberDocQualification';
import MemberDocTableList, { ParamsType, ReponseType } from '../../components/MemberDocTableList'; import MemberDocTableList, { ParamsType, ReponseType } from '../../components/MemberDocTableList';
...@@ -108,6 +115,8 @@ const MemberArchiveInfo = () => { ...@@ -108,6 +115,8 @@ const MemberArchiveInfo = () => {
const contenxt = useContext(MemberDetailsContext); const contenxt = useContext(MemberDetailsContext);
const categoryFormRef = useRef<MemberDocCategoryProRef | null>(null);
const intl = useIntl(); const intl = useIntl();
const getArchiveInfo = () => { const getArchiveInfo = () => {
...@@ -292,20 +301,50 @@ const MemberArchiveInfo = () => { ...@@ -292,20 +301,50 @@ const MemberArchiveInfo = () => {
contenxt.onAnchorsReady(anchors); contenxt.onAnchorsReady(anchors);
}, [archiveInfo]); }, [archiveInfo]);
const handleModifyAfter = () => { const handleFinish = () => {
getArchiveInfo(); categoryFormRef.current?.submit();
}; };
const handleCategorySubmit: MemberDocCategoryProProps['onSubmit'] = (values) => (
new Promise((resolve, reject) => {
const payload = {
validateId: +validateId,
...values,
};
const msg = message.loading({
content: intl.formatMessage({ id: 'member.components.MemberDocCategory.edit.message' }),
duration: 0,
});
postMemberAbilityMaintenanceDetailRecordClassifyUpdate(payload, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
reject();
return;
}
resolve();
getArchiveInfo();
}).catch((err) => {
reject(err);
console.warn(err);
}).finally(() => {
msg();
});
})
);
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<Row gutter={[16, 16]}> <Row gutter={[16, 16]}>
{/* 分类信息 */} {/* 分类信息 */}
<Col span={24}> <Col span={24}>
<AnchorPage.Item itemKey="categoryInfo"> <AnchorPage.Item itemKey="categoryInfo">
<MemberDocCategory <MemberDocCategoryPro
dataSource={archiveInfo?.classification} value={archiveInfo?.classification as any}
validateId={validateId} validateId={validateId}
onModifyAfter={handleModifyAfter} onFinish={handleFinish}
onSubmit={handleCategorySubmit}
ref={categoryFormRef}
/> />
</AnchorPage.Item> </AnchorPage.Item>
</Col> </Col>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @LastEditTime: 2021-11-17 18:05:29 * @LastEditTime: 2021-11-17 18:05:29
* @Description: 入库分类 * @Description: 入库分类
*/ */
import React, { useState } from 'react'; import React, { useRef, useState } from 'react';
import { Button, message } from 'antd'; import { Button, message } from 'antd';
import { import {
CheckCircleOutlined, CheckCircleOutlined,
...@@ -13,26 +13,31 @@ import { ...@@ -13,26 +13,31 @@ import {
import { history, useIntl } from 'umi'; import { history, useIntl } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { postMemberDepositClassify, getMemberDepositClassifyDetail } from '@/services/MemberV2Api'; import { postMemberDepositClassify, getMemberDepositClassifyDetail } from '@/services/MemberV2Api';
import ModifyClassifyDrawer, { ValueType } from '../components/ModifyClassifyDrawer';
import fetchDetailHoc from '../common/hoc/fetchDetailHoc'; import fetchDetailHoc from '../common/hoc/fetchDetailHoc';
import MemberProfile from '../components/MemberProfile'; import MemberProfile from '../components/MemberProfile';
import { MemberDocCategoryProRef, MemberDocCategoryProProps, SubmitValueType } from '../components/MemberDocCategoryPro';
import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
const MemberPrComingClassifyVerify: React.FC<{}> = () => { const MemberPrComingClassifyVerify: React.FC<{}> = () => {
const { validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [visibleVerifyDrawer, setVisibleVerifyDrawer] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [visibleVerifyModal, setVisibleVerifyModal] = useState(false);
const categoryFormRef = useRef<MemberDocCategoryProRef | null>(null);
const categoryValue = useRef<SubmitValueType | undefined>(undefined);
const intl = useIntl(); const intl = useIntl();
const handleVisibleVerifyDrawer = (flag?) => { const handleVisibleVerifyModal = (flag?) => {
setVisibleVerifyDrawer(!!flag); setVisibleVerifyModal(!!flag);
}; };
const handleSubmit = (value: ValueType) => { const handleVerifySubmit = (value: VerifyData) => {
setSubmitLoading(true); setSubmitLoading(true);
const payload = { const payload = {
validateId, validateId,
...value, ...value,
...(categoryValue.current),
}; };
const msg = message.loading({ const msg = message.loading({
content: intl.formatMessage({ id: 'member.management.memberPrComingClassify.verify.commiting' }), content: intl.formatMessage({ id: 'member.management.memberPrComingClassify.verify.commiting' }),
...@@ -44,7 +49,6 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => { ...@@ -44,7 +49,6 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
if (res.code !== 1000) { if (res.code !== 1000) {
return; return;
} }
handleVisibleVerifyDrawer(false);
setTimeout(() => { setTimeout(() => {
history.goBack(); history.goBack();
}, 800); }, 800);
...@@ -60,33 +64,38 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => { ...@@ -60,33 +64,38 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
}), }),
}, MemberProfile); }, MemberProfile);
const handleVerify = () => {
categoryFormRef?.current.submit();
};
const handleCategorySubmit: MemberDocCategoryProProps['onSubmit'] = (values) => {
categoryValue.current = values;
handleVisibleVerifyModal(true);
};
return ( return (
<MemberProfilePro <MemberProfilePro
extra={(info) => ( extra={() => (
<> <>
<Button <Button
type="primary" type="primary"
icon={<CheckCircleOutlined />} icon={<CheckCircleOutlined />}
onClick={() => handleVisibleVerifyDrawer(true)} onClick={handleVerify}
> >
{intl.formatMessage({ id: 'member.actions.apply.verify' })} {intl.formatMessage({ id: 'member.actions.apply.verify' })}
</Button> </Button>
<ModifyClassifyDrawer <VerifyModal
visible={visibleVerifyDrawer} visible={visibleVerifyModal}
partnerTypes={( onClose={() => handleVisibleVerifyModal(false)}
info
&& info.partnerTypes
? info.partnerTypes.map((item) => ({ label: item.text, value: item.id })).filter((item) => item.value)
: []
)}
onClose={() => handleVisibleVerifyDrawer(false)}
submitLoading={submitLoading} submitLoading={submitLoading}
onSubmit={handleSubmit} onSubmit={handleVerifySubmit}
isVerify={1}
/> />
</> </>
)} )}
categoryRef={categoryFormRef}
onCategorySubmit={handleCategorySubmit}
editableCategory
/> />
); );
}; };
......
...@@ -293,7 +293,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR ...@@ -293,7 +293,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
setClassifyInfo({ setClassifyInfo({
code: res.data?.code, code: res.data?.code,
partnerType: res.data?.partnerType, partnerType: res.data?.partnerType,
maxAmount: `${parseFloat(res.data?.maxAmount)}`, maxAmount: `${res.data?.maxAmount ? parseFloat(res.data?.maxAmount) : ''}`,
areaCodes: res.data?.areaCodes, areaCodes: res.data?.areaCodes,
categories: res.data?.categories.map(({ details, payType, month, monthDay, days, taxPoint, ...rest }) => ({ categories: res.data?.categories.map(({ details, payType, month, monthDay, days, taxPoint, ...rest }) => ({
details: getCategoryAllKeys(details as unknown as CategoryType[]), details: getCategoryAllKeys(details as unknown as CategoryType[]),
......
...@@ -36,6 +36,7 @@ import MemberDocQualification from '../MemberDocQualification'; ...@@ -36,6 +36,7 @@ import MemberDocQualification from '../MemberDocQualification';
import MemberChannelInfoForm, { ChannelValueType, ChannelRefHandle } from '../MemberChannelInfoForm'; import MemberChannelInfoForm, { ChannelValueType, ChannelRefHandle } from '../MemberChannelInfoForm';
import MemberDocIncomingInfoForm, { DepositValueType, DepositRefHandle } from '../MemberDocIncomingInfoForm'; import MemberDocIncomingInfoForm, { DepositValueType, DepositRefHandle } from '../MemberDocIncomingInfoForm';
import MemberQualitiesForm, { QualitiesSubmitValueType, QualitiesRefHandle } from '../MemberQualitiesForm'; import MemberQualitiesForm, { QualitiesSubmitValueType, QualitiesRefHandle } from '../MemberQualitiesForm';
import MemberDocCategoryPro, { MemberDocCategoryProProps, MemberDocCategoryProRef } from '../MemberDocCategoryPro';
export * from './interface'; export * from './interface';
...@@ -96,6 +97,18 @@ interface IProps { ...@@ -96,6 +97,18 @@ interface IProps {
* 资质证明ref * 资质证明ref
*/ */
qualitiesRef?: Ref<QualitiesRefHandle>, qualitiesRef?: Ref<QualitiesRefHandle>,
/**
* 是否可编辑分类信息,默认 false
*/
editableCategory?: boolean,
/**
* 分类信息ref
*/
categoryRef?: Ref<MemberDocCategoryProRef>,
/**
* 分类信息提交事件
*/
onCategorySubmit?: MemberDocCategoryProProps['onSubmit'],
} }
const MemberProfile: React.FC<IProps> = (props) => { const MemberProfile: React.FC<IProps> = (props) => {
...@@ -114,6 +127,9 @@ const MemberProfile: React.FC<IProps> = (props) => { ...@@ -114,6 +127,9 @@ const MemberProfile: React.FC<IProps> = (props) => {
editableQualities, editableQualities,
onQualitiesChange, onQualitiesChange,
qualitiesRef, qualitiesRef,
editableCategory,
categoryRef,
onCategorySubmit,
} = props; } = props;
const intl = useIntl(); const intl = useIntl();
...@@ -180,9 +196,11 @@ const MemberProfile: React.FC<IProps> = (props) => { ...@@ -180,9 +196,11 @@ const MemberProfile: React.FC<IProps> = (props) => {
: null : null
), ),
( (
dataSource (
&& dataSource.classification dataSource
&& dataSource.classification.code && dataSource.classification
&& dataSource.classification.code
) || editableCategory
? { ? {
key: 'classifyInfo', key: 'classifyInfo',
name: intl.formatMessage({ id: 'member.components.MemberProfile.classifyInfo' }), name: intl.formatMessage({ id: 'member.components.MemberProfile.classifyInfo' }),
...@@ -413,11 +431,28 @@ const MemberProfile: React.FC<IProps> = (props) => { ...@@ -413,11 +431,28 @@ const MemberProfile: React.FC<IProps> = (props) => {
) : null} ) : null}
{/* 分类信息 */} {/* 分类信息 */}
{dataSource && dataSource.classification && dataSource.classification.code ? ( {(
(
dataSource
&& dataSource.classification
&& dataSource.classification.code
)
|| editableCategory
) ? (
<Col span={24}> <Col span={24}>
<AnchorPage.Item itemKey="classifyInfo"> <AnchorPage.Item itemKey="classifyInfo">
<MemberDocCategory <MemberDocCategoryPro
dataSource={dataSource?.classification} value={dataSource?.classification}
editable={editableCategory}
isVerify={editableCategory ? 1 : 0}
partnerTypes={(
dataSource
&& dataSource.partnerTypes
? dataSource.partnerTypes.map((item) => ({ label: item.text, value: item.id })).filter((item) => item.value)
: []
)}
onSubmit={onCategorySubmit}
ref={categoryRef}
/> />
</AnchorPage.Item> </AnchorPage.Item>
</Col> </Col>
......
...@@ -5,10 +5,8 @@ ...@@ -5,10 +5,8 @@
* @LastEditTime: 2021-07-09 15:30:54 * @LastEditTime: 2021-07-09 15:30:54
* @Description: * @Description:
*/ */
import { BasicInfoProps } from '../MemberBasicInfo';
import { ChannelInfoProps } from '../MemberChannelInfo';
import { InvestigateInfoProps } from '../MemberInvestigateInfo'; import { InvestigateInfoProps } from '../MemberInvestigateInfo';
import { DocCategoryProps } from '../MemberDocCategory'; import { MemberDocCategoryProProps } from '../MemberDocCategoryPro';
import { ElementType } from '../../utils'; import { ElementType } from '../../utils';
export type VerifyStepsItemType = { export type VerifyStepsItemType = {
...@@ -265,7 +263,7 @@ export type DetailType = { ...@@ -265,7 +263,7 @@ export type DetailType = {
/** /**
* 分类信息 * 分类信息
*/ */
classification?: DocCategoryProps['dataSource'], classification?: MemberDocCategoryProProps['value'],
/** /**
* 内部流转记录 * 内部流转记录
*/ */
......
...@@ -5,15 +5,22 @@ ...@@ -5,15 +5,22 @@
* @LastEditTime: 2021-11-29 20:07:02 * @LastEditTime: 2021-11-29 20:07:02
* @Description: 会员档案信息 * @Description: 会员档案信息
*/ */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { useIntl } from 'umi'; import { useIntl } from 'umi';
import { Row, Col, Spin } from 'antd'; import { Row, Col, Spin, message } from 'antd';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { getMemberAbilityMaintenanceDetailAppraisalPage, getMemberAbilityMaintenanceDetailInspectPage, getMemberAbilityMaintenanceDetailRecord, GetMemberAbilityMaintenanceDetailRecordResponse, getMemberAbilityMaintenanceDetailRectifyPage } from '@/services/MemberV2Api'; import {
getMemberAbilityMaintenanceDetailAppraisalPage,
getMemberAbilityMaintenanceDetailInspectPage,
getMemberAbilityMaintenanceDetailRecord,
GetMemberAbilityMaintenanceDetailRecordResponse,
getMemberAbilityMaintenanceDetailRectifyPage,
postMemberAbilityMaintenanceDetailRecordClassifyUpdate,
} from '@/services/MemberV2Api';
import BASE_CONFIG from '@/../config/base.config.json'; import BASE_CONFIG from '@/../config/base.config.json';
import { EditableColumns } from '@/components/PolymericTable/interface'; import { EditableColumns } from '@/components/PolymericTable/interface';
import AnchorPage from '@/components/AnchorPage'; import AnchorPage from '@/components/AnchorPage';
import MemberDocCategory from '../../components/MemberDocCategory'; import MemberDocCategoryPro, { MemberDocCategoryProProps, MemberDocCategoryProRef } from '../../components/MemberDocCategoryPro';
import MemberDocIncomingInfo from '../../components/MemberDocIncomingInfo'; import MemberDocIncomingInfo from '../../components/MemberDocIncomingInfo';
import MemberDocQualification from '../../components/MemberDocQualification'; import MemberDocQualification from '../../components/MemberDocQualification';
import MemberDocTableList, { ParamsType, ReponseType } from '../../components/MemberDocTableList'; import MemberDocTableList, { ParamsType, ReponseType } from '../../components/MemberDocTableList';
...@@ -104,6 +111,8 @@ const MemberArchiveInfo = () => { ...@@ -104,6 +111,8 @@ const MemberArchiveInfo = () => {
const [archiveInfo, setArchiveInfo] = useState<GetMemberAbilityMaintenanceDetailRecordResponse>(); const [archiveInfo, setArchiveInfo] = useState<GetMemberAbilityMaintenanceDetailRecordResponse>();
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const categoryFormRef = useRef<MemberDocCategoryProRef | null>(null);
const intl = useIntl(); const intl = useIntl();
const getArchiveInfo = () => { const getArchiveInfo = () => {
...@@ -258,16 +267,50 @@ const MemberArchiveInfo = () => { ...@@ -258,16 +267,50 @@ const MemberArchiveInfo = () => {
getArchiveInfo(); getArchiveInfo();
}; };
const handleFinish = () => {
categoryFormRef.current?.submit();
};
const handleCategorySubmit: MemberDocCategoryProProps['onSubmit'] = (values) => (
new Promise((resolve, reject) => {
const payload = {
validateId: +validateId,
...values,
};
const msg = message.loading({
content: intl.formatMessage({ id: 'member.components.MemberDocCategory.edit.message' }),
duration: 0,
});
postMemberAbilityMaintenanceDetailRecordClassifyUpdate(payload, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
reject();
return;
}
resolve();
getArchiveInfo();
}).catch((err) => {
reject(err);
console.warn(err);
}).finally(() => {
msg();
});
})
);
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<Row gutter={[16, 16]}> <Row gutter={[16, 16]}>
{/* 分类信息 */} {/* 分类信息 */}
<Col span={24}> <Col span={24}>
<AnchorPage.Item itemKey="categoryInfo"> <AnchorPage.Item itemKey="categoryInfo">
<MemberDocCategory <MemberDocCategoryPro
dataSource={archiveInfo?.classification} value={archiveInfo?.classification as any}
validateId={validateId} validateId={validateId}
onModifyAfter={handleModifyAfter} onFinish={handleFinish}
onSubmit={handleCategorySubmit}
ref={categoryFormRef}
/> />
</AnchorPage.Item> </AnchorPage.Item>
</Col> </Col>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @LastEditTime: 2021-11-17 18:05:29 * @LastEditTime: 2021-11-17 18:05:29
* @Description: 入库分类 * @Description: 入库分类
*/ */
import React, { useState } from 'react'; import React, { useRef, useState } from 'react';
import { Button, message } from 'antd'; import { Button, message } from 'antd';
import { import {
CheckCircleOutlined, CheckCircleOutlined,
...@@ -13,26 +13,32 @@ import { ...@@ -13,26 +13,32 @@ import {
import { history, useIntl } from 'umi'; import { history, useIntl } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { postMemberDepositClassify, getMemberDepositClassifyDetail } from '@/services/MemberV2Api'; import { postMemberDepositClassify, getMemberDepositClassifyDetail } from '@/services/MemberV2Api';
import ModifyClassifyDrawer, { ValueType } from '../components/ModifyClassifyDrawer';
import fetchDetailHoc from '../common/hoc/fetchDetailHoc'; import fetchDetailHoc from '../common/hoc/fetchDetailHoc';
import MemberProfile from '../components/MemberProfile'; import MemberProfile from '../components/MemberProfile';
import { MemberDocCategoryProRef, MemberDocCategoryProProps, SubmitValueType } from '../components/MemberDocCategoryPro';
import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
const MemberPrComingClassifyVerify: React.FC<{}> = () => { const MemberPrComingClassifyVerify: React.FC<{}> = () => {
const { validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [visibleVerifyDrawer, setVisibleVerifyDrawer] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [visibleVerifyModal, setVisibleVerifyModal] = useState(false);
const categoryFormRef = useRef<MemberDocCategoryProRef | null>(null);
const categoryValue = useRef<SubmitValueType | undefined>(undefined);
const intl = useIntl(); const intl = useIntl();
const handleVisibleVerifyDrawer = (flag?) => { const handleVisibleVerifyModal = (flag?) => {
setVisibleVerifyDrawer(!!flag); setVisibleVerifyModal(!!flag);
}; };
const handleSubmit = (value: ValueType) => { const handleVerifySubmit = (value: VerifyData) => {
setSubmitLoading(true); setSubmitLoading(true);
const payload = { const payload = {
validateId, validateId,
...value, ...value,
...(categoryValue.current),
}; };
const msg = message.loading({ const msg = message.loading({
content: intl.formatMessage({ id: 'member.management.memberPrComingClassify.verify.commiting' }), content: intl.formatMessage({ id: 'member.management.memberPrComingClassify.verify.commiting' }),
...@@ -44,7 +50,6 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => { ...@@ -44,7 +50,6 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
if (res.code !== 1000) { if (res.code !== 1000) {
return; return;
} }
handleVisibleVerifyDrawer(false);
setTimeout(() => { setTimeout(() => {
history.goBack(); history.goBack();
}, 800); }, 800);
...@@ -60,33 +65,38 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => { ...@@ -60,33 +65,38 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
}), }),
}, MemberProfile); }, MemberProfile);
const handleVerify = () => {
categoryFormRef?.current.submit();
};
const handleCategorySubmit: MemberDocCategoryProProps['onSubmit'] = (values) => {
categoryValue.current = values;
handleVisibleVerifyModal(true);
};
return ( return (
<MemberProfilePro <MemberProfilePro
extra={(info) => ( extra={() => (
<> <>
<Button <Button
type="primary" type="primary"
icon={<CheckCircleOutlined />} icon={<CheckCircleOutlined />}
onClick={() => handleVisibleVerifyDrawer(true)} onClick={handleVerify}
> >
{intl.formatMessage({ id: 'member.actions.apply.verify' })} {intl.formatMessage({ id: 'member.actions.apply.verify' })}
</Button> </Button>
<ModifyClassifyDrawer <VerifyModal
visible={visibleVerifyDrawer} visible={visibleVerifyModal}
partnerTypes={( onClose={() => handleVisibleVerifyModal(false)}
info
&& info.partnerTypes
? info.partnerTypes.map((item) => ({ label: item.text, value: item.id })).filter((item) => item.value)
: []
)}
onClose={() => handleVisibleVerifyDrawer(false)}
submitLoading={submitLoading} submitLoading={submitLoading}
onSubmit={handleSubmit} onSubmit={handleVerifySubmit}
isVerify={1}
/> />
</> </>
)} )}
categoryRef={categoryFormRef}
onCategorySubmit={handleCategorySubmit}
editableCategory
/> />
); );
}; };
......
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