Commit e9d2b8e7 authored by XieZhiXiong's avatar XieZhiXiong

chore: 完善逻辑

parent 64852fe1
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-21 16:10:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-07 16:49:23
* @LastEditTime: 2021-07-08 10:05:03
* @Description: 会员分类信息
*/
import React, { useState } from 'react';
......@@ -83,7 +83,8 @@ const MemberDocCategory: React.FC<IProps> = (props: IProps) => {
} = props;
const [visibleDrawer, setVisibleDrawer] = useState(false);
const [classifyInfo, setClassifyInfo] = useState<FormValueType & { partnerTypes: PartnerTypesItem[] }>();
const [classifyInfo, setClassifyInfo] = useState<FormValueType>();
const [partnerTypes, setPartnerTypes] = useState<PartnerTypesItem[]>([]);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
......@@ -111,8 +112,11 @@ const MemberDocCategory: React.FC<IProps> = (props: IProps) => {
taxPoint: +taxPoint,
...rest
})),
partnerTypes: res.data.partnerTypes,
});
setPartnerTypes(res.data.partnerTypes.map((item) => ({
value: item.id,
label: item.text,
})));
handleVisibleDrawer(true);
}
}).finally(() => {
......@@ -212,7 +216,7 @@ const MemberDocCategory: React.FC<IProps> = (props: IProps) => {
onClose={() => handleVisibleDrawer(false)}
onSubmit={handleSubmit}
submitLoading={submitLoading}
partnerTypes={classifyInfo?.partnerTypes}
partnerTypes={partnerTypes}
value={classifyInfo}
/>
</>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-07-07 15:21:00
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-07 18:12:33
* @LastEditTime: 2021-07-08 09:59:57
* @Description: 修改入库分类信息 抽屉
*/
import React, { useEffect } from 'react';
......@@ -173,6 +173,9 @@ interface IProps {
* 合作关系
*/
partnerTypes: PartnerTypesItem[],
/**
* 值
*/
value: FormValueType,
/**
* 确认按钮 loading
......@@ -193,6 +196,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
onSubmit,
onClose,
partnerTypes,
value,
submitLoading,
} = props;
......@@ -310,6 +314,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
>
<NiceForm
previewPlaceholder="' '"
initialValues={value}
components={{
ArrayCards,
CascaderFormItem,
......
......@@ -136,7 +136,7 @@ export const MEMBER_OUTER_COLUMNS: EditableColumns[] = [
dataIndex: 'outerStatusName',
align: 'center',
render: (text, record) => (
<StatusTag type={MEMBER_INNER_STATUS_BADGE_COLOR[record.outerStatus]} title={text} />
<StatusTag type={MEMBER_OUTER_STATUS_TYPE[record.outerStatus]} title={text} />
),
},
{
......
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