Commit 7f82f7a0 authored by 前端-许冠华's avatar 前端-许冠华

Merge branch 'jinfa-0518' into 'jinfa-0518'

fix: 修改审核入库分类——修改分类信息付款条件、付款方式数据格式 See merge request project/jinfa-platform!123
parents 30a0e8a4 8a157a56
......@@ -73,31 +73,31 @@ type CategoriesBasicValueItem = {
/**
* 发票类型
*/
invoiceType?: number,
invoiceType: number,
/**
* 税点,只要百分比的分子部分,不要转换为小数
*/
taxPoint?: number,
taxPoint: number,
/**
* 预付款
*/
advanceCharge?: number,
advanceCharge: number,
/**
* 结算单据
*/
settlementDocuments?: number,
settlementDocuments: number,
/**
* 付款方式
*/
paymentType?: number,
paymentType: number,
/**
* 品类明细
*/
details?: string[],
details: string[],
/**
* 付款条件
*/
paymentClauseType?: number,
paymentClauseType: number,
}
type CategoriesValueItemType = CategoriesBasicValueItem & {
......@@ -111,27 +111,27 @@ export type FormSubmitBasicValueType = {
/**
* 会员编码
*/
code?: string,
code: string,
/**
* 合作关系类型枚举
*/
partnerType?: number,
partnerType: number,
/**
* 币别
*/
currencyType?: number,
currencyType: number,
/**
* 备注
*/
remark?: string,
remark: string,
/**
* 开发原由
*/
developType?: number,
developType: number,
/**
* 业务分类
*/
businessType?: number,
businessType: number,
}
export type AreaCodesItemType = {
......@@ -149,15 +149,15 @@ export type FormSubmitValueType = FormSubmitBasicValueType & {
/**
* 单次合作金额
*/
maxAmount?: string,
maxAmount: string,
/**
* 适用区域编码列表
*/
areaCodes?: AreaCodesItemType[],
areaCodes: AreaCodesItemType[],
/**
* 主营品类列表
*/
categories?: CategoriesValueItemType[],
categories: CategoriesValueItemType[],
/**
* 适用区域
*/
......@@ -165,7 +165,7 @@ export type FormSubmitValueType = FormSubmitBasicValueType & {
}
type SubmitCategoriesValueType = Omit<CategoriesBasicValueItem, 'details'> & {
payType: number,
payType?: number,
month: number,
monthDay: number,
days: number,
......@@ -235,9 +235,26 @@ export interface MemberDocCategoryProProps extends Omit<MellowCardProps, 'onSubm
/**
* 上级同步支付方式和支付条件
*/
businessCategoryVOS?: any[]
businessCategoryVO?: BusinessCategoryVOType
}
export type BusinessCategoryVOType = {
/**
* 付款条件code
*/
paymentClauseType?: number
/**
* 付款条件名称
*/
paymentClauseTypeName?: string
/**
* 付款方式code
*/
paymentType?: number
/**
* 付款方式名称
*/
paymentTypeName?: string
}
export type MemberDocCategoryProRef = {
/**
* 触发表单 submit 事件
......@@ -254,7 +271,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
onFinish,
editable,
partnerTypes,
businessCategoryVOS = [],
businessCategoryVO = {},
...rest
} = props;
const [classifyInfo, setClassifyInfo] = useState<FormSubmitValueType>();
......@@ -270,9 +287,8 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
useEffect(() => {
// 入库分类时才需要,初始设置付款条件、付款方式值
if (!value && businessCategoryVOS && businessCategoryVOS.length) {
const first = businessCategoryVOS[0];
const { paymentClauseType, paymentType } = first;
if (!value && businessCategoryVO) {
const { paymentClauseType, paymentType } = businessCategoryVO;
formActions.setFieldState('categories.*.paymentClauseType', state => {
FormPath.setIn(state, 'value', paymentClauseType);
});
......@@ -280,7 +296,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
FormPath.setIn(state, 'value', paymentType);
});
}
}, [businessCategoryVOS, value]);
}, [businessCategoryVO, value]);
useEffect(() => {
if ('value' in props && value) {
......@@ -662,7 +678,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
})));
});
/* 付款条件 */
if(paymentClauseTypes?.length > 0) {
if (paymentClauseTypes?.length > 0) {
formActions.setFieldState('categories.*.paymentClauseType', state => {
FormPath.setIn(state, 'props.enum', paymentClauseTypes.map((item) => ({
label: item.paymentClauseTypeName,
......@@ -671,7 +687,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
});
}
/* 开发原由 */
if(developTypes?.length > 0) {
if (developTypes?.length > 0) {
formActions.setFieldState('developType', state => {
FormPath.setIn(state, 'props.enum', developTypes.map((item) => ({
label: item.developTypeName,
......@@ -680,7 +696,7 @@ const MemberDocCategoryPro: React.ForwardRefRenderFunction<MemberDocCategoryProR
});
}
/* 业务分类 */
if(businessTypes?.length > 0) {
if (businessTypes?.length > 0) {
formActions.setFieldState('businessType', state => {
FormPath.setIn(state, 'props.enum', businessTypes.map((item) => ({
label: item.businessTypeName,
......
......@@ -448,7 +448,7 @@ const MemberProfile: React.FC<IProps> = (props) => {
)}
onSubmit={onCategorySubmit}
ref={categoryRef}
businessCategoryVOS={dataSource?.businessCategoryVOS || []}
businessCategoryVO={dataSource?.businessCategoryVO || {}}
/>
</AnchorPage.Item>
......
......@@ -354,10 +354,22 @@ export type DetailType = {
/**
* 上级同步支付方式和支付条件
*/
businessCategoryVOS?: {
paymentClauseType?: number,
paymentClauseTypeName?: string,
paymentType?: number,
paymentTypeName?: string
}[]
businessCategoryVO?: {
/**
* 付款条件code
*/
paymentClauseType?: number
/**
* 付款条件名称
*/
paymentClauseTypeName?: string
/**
* 付款方式code
*/
paymentType?: number
/**
* 付款方式名称
*/
paymentTypeName?: string
}
};
\ No newline at end of file
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