Commit 151286eb authored by XieZhiXiong's avatar XieZhiXiong

chore: 完善代码逻辑

parent 0957b219
......@@ -73,7 +73,7 @@ const columns = (target = '/memberCenter/memberAbility/manage/memberPrSubmit/det
title: '内部状态',
dataIndex: 'innerStatusName',
align: 'center',
render: (text, record) => <Badge color={MEMBER_INNER_STATUS_BADGE_COLOR[record.innerStatus]} text={text} />,
render: (text, record) => <Badge color={MEMBER_INNER_STATUS_BADGE_COLOR[record.innerStatus] || '#606266'} text={text} />,
},
]);
......
......@@ -24,10 +24,7 @@ const verifyComingSchema: ISchema = {
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
'x-component': 'ControllerBtns',
},
name: {
type: 'string',
......
......@@ -12,29 +12,77 @@ import {
import CustomizeColumn, { IProps as CustomizeColumnProps } from '@/components/CustomizeColumn';
import styles from './index.less';
interface IProps extends Omit<CustomizeColumnProps, 'data' | 'columns'> {}
interface IProps extends Omit<CustomizeColumnProps, 'data' | 'columns'> {
/**
* 数据源
*/
dataSource: {
/**
* 会员编码
*/
code: string,
/**
* 合作关系名称
*/
partnerTypeName: string,
/**
* 单次合作金额
*/
maxAmount: string,
/**
* 适用区域
*/
classifyAreas: string[],
/**
* 主营品类
*/
categories: {
/**
* 数据id
*/
id: number,
/**
* 品类名称
*/
name: string,
/**
* 付款周期(天)
*/
paymentDay: number,
/**
* 发票类型名称
*/
invoiceTypeName: string,
/**
* 税点,百分比的分子部分
*/
taxPoint: string,
}[],
}
}
const MemberDocCategory: React.FC<IProps> = (props: IProps) => {
const {
dataSource,
...rest
} = props;
const data = [
{
title: '会员编号',
value: 'GD00001',
value: dataSource?.code || '',
},
{
title: '单次合作金额',
value: '¥ 900,000.00',
value: dataSource && dataSource.maxAmount ? ${dataSource.maxAmount}` : '',
},
{
title: '适用区域',
value: '广东省/广州市;江西省',
value: dataSource && dataSource.classifyAreas ? dataSource.classifyAreas.join(';') : '',
},
{
title: '会员关系',
value: '战略型',
value: dataSource?.partnerTypeName || '',
columnProps: {
span: 3,
},
......@@ -43,22 +91,16 @@ const MemberDocCategory: React.FC<IProps> = (props: IProps) => {
title: '主营品类',
value: (
<ul className={styles['category-list']}>
<li className={styles['category-list-item']}>
<Descriptions column={1}>
<Descriptions.Item label="品类">广告行业</Descriptions.Item>
<Descriptions.Item label="付款周期(天)">30</Descriptions.Item>
<Descriptions.Item label="发票类型">增值税专用发票</Descriptions.Item>
<Descriptions.Item label="税点">30%</Descriptions.Item>
</Descriptions>
</li>
<li className={styles['category-list-item']}>
<Descriptions column={1}>
<Descriptions.Item label="品类">广告行业</Descriptions.Item>
<Descriptions.Item label="付款周期(天)">30</Descriptions.Item>
<Descriptions.Item label="发票类型">增值税专用发票</Descriptions.Item>
<Descriptions.Item label="税点">30%</Descriptions.Item>
</Descriptions>
</li>
{dataSource?.categories.map((item) => (
<li className={styles['category-list-item']} key={item.id}>
<Descriptions column={1}>
<Descriptions.Item label="品类">{item.name}</Descriptions.Item>
<Descriptions.Item label="付款周期(天)">{item.paymentDay}</Descriptions.Item>
<Descriptions.Item label="发票类型">{item.invoiceTypeName}</Descriptions.Item>
<Descriptions.Item label="税点">{item.taxPoint}%</Descriptions.Item>
</Descriptions>
</li>
))}
</ul>
),
columnProps: {
......
......@@ -2,104 +2,73 @@
* @Author: XieZhiXiong
* @Date: 2021-05-21 17:14:39
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-26 11:19:51
* @LastEditTime: 2021-06-03 10:34:49
* @Description: 会员入库信息
*/
import React from 'react';
import { Tooltip } from 'antd';
import CustomizeColumn, { IProps as CustomizeColumnProps } from '@/components/CustomizeColumn';
import CustomizeColumn, { IProps as CustomizeColumnProps, DataItem } from '@/components/CustomizeColumn';
import styles from './index.less';
interface IProps extends Omit<CustomizeColumnProps, 'data' | 'columns'> {}
interface IProps extends Omit<CustomizeColumnProps, 'data' | 'columns'> {
/**
* 数据
*/
dataSource: {
/**
* 分组名
*/
groupName: string,
/**
*
*/
elements: {
/**
* 分组内的字段顺序
*/
fieldOrder?: number,
/**
* 字段中文名称
*/
fieldLocalName?: string,
/**
* 字段值
*/
fieldValue?: string,
/**
* 修改之前的值,如果没有为空字符串
*/
lastValue?: string,
}[],
}[],
}
const MemberDocIncomingInfo: React.FC<IProps> = (props: IProps) => {
const {
dataSource = [],
...rest
} = props;
const data = [
{
title: '商业模式',
value: (
<div className={styles.changed}>
生产商
<Tooltip title={`变更前:${'加工商'}`}>
<span className={styles.new}>NEW</span>
</Tooltip>
</div>
),
},
{
title: '工厂数量',
value: (
<div className={styles.changed}>
3
<Tooltip title={`变更前:${'加工商'}`}>
<span className={styles.new}>NEW</span>
</Tooltip>
</div>
),
},
{
title: '主要合作伙伴',
value: (
<div className={styles.changed}>
安踏
<Tooltip title={`变更前:${'Nike'}`}>
<span className={styles.new}>NEW</span>
</Tooltip>
</div>
),
},
{
title: '主营行业',
value: '制造行业;批发和零售业',
},
{
title: '生产厂地',
value: '中国浙江省温州市',
},
{
title: '代表性合作项目',
value: '安踏',
},
{
title: '主营品类',
value: '服装鞋帽;纸质批发;农副产品',
},
{
title: '设备数量',
value: '100',
},
{
title: '代理品牌',
value: '安踏',
},
{
title: '公司规模',
value: '中小企业',
},
{
title: '是否一般纳税人',
value: '是',
},
{
title: '优势资源',
value: '安踏',
},
{
title: '工厂面积',
value: '500平方米',
},
{
title: '公司简介',
value: '一家集研发、生产、销售和服务于一体的专业标牌生产厂家。注册资金…',
},
{
title: '其他',
value: '安踏',
},
];
const data: DataItem[] = [];
dataSource.forEach((item) => {
item.elements.forEach((ele) => {
data.push({
title: ele.fieldLocalName,
value: (
<div className={styles.changed}>
{ele.fieldValue}
{ele.lastValue && (
<Tooltip title={`变更前:${ele.lastValue}`}>
<span className={styles.new}>NEW</span>
</Tooltip>
)}
</div>
),
});
});
});
return (
<CustomizeColumn
title="入库信息"
......
......@@ -27,6 +27,7 @@
transform: translate(-50%, 0);
color: @text-color-secondary;
font-size: @font-size-sm;
white-space: nowrap;
> span {
color: @text-color;
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 14:59:38
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 15:38:37
* @LastEditTime: 2021-06-03 11:09:46
* @Description: 会员考察信息
*/
import React from 'react';
......@@ -13,16 +13,76 @@ import {
Progress,
Upload,
} from 'antd';
import { normalizeFiledata } from '@/utils';
import MellowCard, { MellowCardProps } from '@/components/MellowCard';
import UploadFiles from '@/components/UploadFiles/UploadFiles';
import styles from './index.less';
interface IProps extends MellowCardProps {}
interface IProps extends MellowCardProps {
/**
* 数据
*/
dataSource: {
/**
* 考察日期
*/
inspectDay: string,
/**
* 考察评分
*/
score: string,
/**
* 考察结果
*/
result: string,
/**
* 考察结果
*/
reports: {
/**
* 文件名
*/
name: string,
/**
* 文件Url
*/
url: string,
}[],
},
}
const MemberInvestigateInfo: React.FC<IProps> = (props: IProps) => {
const {
dataSource,
...rest
} = props;
const strokeColor = (score: string) => {
const numScore = +score;
if (numScore >= 0 && numScore <= 39) {
return {
'0%': '#D32F2F',
'100%': '#F18E8E',
};
}
if (40 >= 0 && numScore <= 59) {
return {
'0%': '#EA8000',
'100%': '#EBBD86',
};
}
if (60 >= 0 && numScore <= 79) {
return {
'0%': '#2266EE',
'100%': '#83A5E8',
};
}
return {
'0%': '#00B37A',
'100%': '#82DFC1',
};
};
return (
<MellowCard
title="考察信息"
......@@ -38,15 +98,12 @@ const MemberInvestigateInfo: React.FC<IProps> = (props: IProps) => {
type="dashboard"
percent={100}
gapDegree={150}
strokeColor={{
'0%': '#00B37A',
'100%': '#82DFC1',
}}
strokeColor={strokeColor(dataSource?.score)}
width={80}
showInfo={false}
/>
<div className={styles['investigate-info-progress-text']}>
<span>80</span>
<span>{dataSource?.score}</span>
</div>
</div>
......@@ -56,17 +113,20 @@ const MemberInvestigateInfo: React.FC<IProps> = (props: IProps) => {
<Col span={8}>
<Descriptions column={1}>
<Descriptions.Item label="考察日期" labelStyle={{ width: 106 }}>
2020-02-19
{dataSource?.inspectDay}
</Descriptions.Item>
<Descriptions.Item label="考察结果" labelStyle={{ width: 106 }} style={{ paddingBottom: 0 }}>
入库考察合格
{dataSource?.result}
</Descriptions.Item>
</Descriptions>
</Col>
<Col span={8}>
<Descriptions column={1}>
<Descriptions.Item label="考察报告" labelStyle={{ width: 106 }}>
<Upload fileList={[]} />
<UploadFiles
fileList={dataSource && dataSource.reports ? dataSource.reports.map((item) => normalizeFiledata(item.url)) : []}
disable
/>
</Descriptions.Item>
</Descriptions>
</Col>
......
......@@ -93,7 +93,6 @@ const MemberRoleFormItem = (props) => {
};
const handleConfirm = () => {
console.log('RowCtlRowCtlRowCtl', RowCtl);
if (!RowCtl.selectRow.length) {
message.warning('请选择会员角色');
}
......
......@@ -248,7 +248,7 @@ const MemberMaintain: React.FC<[]> = () => {
return {};
};
const controllerBtns = (
const ControllerBtns = () => (
<>
{/* {(userInfo && userInfo.memberRoleType === MEMBER_ROLE_TYPE_SERVICE_PROVIDER) && (
<Space>
......@@ -306,8 +306,8 @@ const MemberMaintain: React.FC<[]> = () => {
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
components={{
ControllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
......
......@@ -17,10 +17,7 @@ export const importSchema: ISchema = {
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
'x-component': 'ControllerBtns',
},
name: {
type: 'string',
......
/*
* @Author: XieZhiXiong
* @Date: 2021-06-03 14:43:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-03 15:02:18
* @Description: 级联选择器
*/
import React from 'react';
import { Cascader } from 'antd';
import { CascaderValueType } from 'antd/lib/cascader';
const CascaderFormItem = (props) => {
const {
value,
mutators,
editable,
} = props;
const handleChange = (next: CascaderValueType) => {
mutators.change(next);
};
return (
<Cascader
disabled={!editable}
{...(props.props['x-component-props'] || {})}
value={value}
onChange={handleChange}
/>
);
};
CascaderFormItem.isFieldComponent = true;
export default CascaderFormItem;
......@@ -2,10 +2,10 @@
* @Author: XieZhiXiong
* @Date: 2021-05-24 17:47:32
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-26 10:06:37
* @LastEditTime: 2021-06-03 16:31:52
* @Description: 审核Form抽屉
*/
import React from 'react';
import React, { useEffect } from 'react';
import {
Drawer,
Button,
......@@ -13,13 +13,151 @@ import {
import NiceForm from '@/components/NiceForm';
import {
createFormActions,
createAsyncFormActions,
FormEffectHooks,
FormPath,
} from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { ArrayCards } from '@formily/antd-components';
import {
schema,
} from './schema';
import { schema } from './schema';
import CascaderFormItem from '../CascaderFormItem';
import styles from './index.less';
type CategoriesType = {
/**
* 品类名称
*/
name: string,
/**
* 付款周期(天)
*/
paymentDay: number,
/**
* 发票类型名称
*/
invoiceTypeName: string,
/**
* 税点,只要百分比的分子部分,不要转换为小数
*/
taxPoint: number,
}
export type ValueType = {
/**
* 合作关系类型枚举
*/
partnerType: number,
/**
* 单次合作金额
*/
maxAmount: number,
/**
* 适用区域编码列表
*/
areaCodes: {
/**
* 省编码
*/
provinceCode: string,
/**
* 市编码
*/
cityCode: string,
}[],
/**
* 主营品类列表
*/
categories: CategoriesType[],
}
interface FormValueType extends Omit<ValueType, ('maxAmount' | 'categories')> {
/**
* 单次合作金额
*/
maxAmount: string,
/**
* 主营品类列表
*/
categories: {
/**
* 已选品类
*/
category: string[],
/**
* 付款周期(天)
*/
paymentDay: string,
/**
* 发票类型名称
*/
invoiceTypeName: string,
/**
* 税点,只要百分比的分子部分,不要转换为小数
*/
taxPoint: number,
}[],
}
interface CategoryItem {
/**
* 数据id
*/
id: string,
/**
* 父级id
*/
parentId: string,
/**
* 标题
*/
title: string,
/**
* 是否选中
*/
checked: boolean,
/**
* 图片url路径
*/
imageUrl: string,
/**
* 子元素
*/
children: CategoryItem[],
}
type CategoryType = {
/**
* label
*/
label: string,
/**
* 值
*/
value: string,
/**
* 子元素
*/
children: CategoryType[],
}
function recursionCategoryData(dataSource: CategoryItem[]): CategoryType[] {
const ret: CategoryType[] = [];
dataSource.forEach((item) => {
const ele: CategoryType = {
label: item.title,
value: item.id,
children: null,
};
if (item.children && item.children.length) {
ele.children = recursionCategoryData(item.children);
}
ret.push(ele);
});
return ret;
};
interface IProps {
/**
* 是否可见
......@@ -28,31 +166,74 @@ interface IProps {
/**
* Form 确认事件
*/
onSubmit: (values: any) => void,
onSubmit: (values: ValueType) => void,
/**
* 抽屉关闭事件
*/
onClose: () => void,
/**
* 合作关系
*/
partnerTypes: {
/**
* label
*/
label: string,
/**
* value
*/
value: number,
}[],
/**
* 确认按钮 loading
*/
submitLoading: boolean,
}
const formActions = createFormActions();
const formActions = createAsyncFormActions();
const {
onFormInit$,
onFieldValueChange$,
onFieldInputChange$,
} = FormEffectHooks;
const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
const {
visible,
onSubmit,
onClose,
partnerTypes,
submitLoading,
} = props;
useEffect(() => {
if (partnerTypes && partnerTypes.length) {
formActions.setFieldState('partnerType', state => {
FormPath.setIn(state, 'props.enum', partnerTypes);
});
}
}, [partnerTypes]);
const handleClose = () => {
if (onClose) {
onClose();
}
};
const handleSubmit = (values: any) => {
const handleSubmit = (values: FormValueType) => {
if (onSubmit) {
onSubmit(values);
const { maxAmount, categories, ...rest } = values;
const formated = categories.map((item) => ({
name: item.category.join('-'),
paymentDay: +item.paymentDay,
invoiceTypeName: item.invoiceTypeName,
taxPoint: +item.taxPoint,
}));
onSubmit({
maxAmount: +maxAmount,
categories: formated,
...rest,
});
}
};
......@@ -69,6 +250,49 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
</div>
);
const useBusinessEffects = () => {
// 省级改变时,,请求出对应的市级数据
onFieldInputChange$('areaCodes.*.provinceCode').subscribe(fieldState => {
formActions.setFieldState(
FormPath.transform(fieldState.name, /\d/, $1 => `areaCodes.${$1}.cityCode`),
state => {
FormPath.setIn(state, 'value', undefined);
}
);
});
// 省级改变时,,请求出对应的市级数据
onFieldValueChange$('areaCodes.*.provinceCode').subscribe((fieldState) => {
if (fieldState.value === undefined) {
return;
}
formActions.setFieldState(
FormPath.transform(fieldState.name, /\d/, $1 => `areaCodes.${$1}.cityCode`),
state => {
FormPath.setIn(state, 'props.x-props.hasFeedback', true);
FormPath.setIn(state, 'loading', true);
}
);
PublicApi.getMemberDepositClassifyCity({
provinceCode: fieldState.value,
}).then(res => {
if (res.code === 1000) {
const { data = [] } = res;
const options = data.map(item => ({ label: item.name, value: item.code }));
formActions.setFieldState(
FormPath.transform(fieldState.name, /\d/, $1 => `areaCodes.${$1}.cityCode`),
state => {
FormPath.setIn(state, 'props.enum', options);
FormPath.setIn(state, 'loading', false);
}
);
}
});
});
}
return (
<Drawer
title="入库分类信息"
......@@ -84,7 +308,11 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
<Button onClick={handleClose} style={{ marginRight: 16 }}>
取 消
</Button>
<Button onClick={() => formActions.submit()} type="primary">
<Button
onClick={() => formActions.submit()}
type="primary"
loading={submitLoading}
>
确 定
</Button>
</div>
......@@ -94,13 +322,48 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
previewPlaceholder="' '"
components={{
ArrayCards,
CascaderFormItem,
}}
expressionScope={{
MemberCodeDescription,
MemberCypher,
}}
effects={() => {
effects={($, { setFieldState }) => {
useBusinessEffects();
onFormInit$().subscribe(() => {
// 请求省级数据
PublicApi.getMemberDepositClassifyProvince().then(res => {
if (res.code === 1000) {
const { data = [] } = res;
const options = data.map(item => ({ label: item.name, value: item.code }));
formActions.setFieldState('areaCodes.*.provinceCode', state => {
FormPath.setIn(state, 'props.enum', options);
});
}
});
// 请求会员品类数据
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
if (res.code === 1000) {
const { data = [] } = res;
formActions.setFieldState('categories.*.category', state => {
FormPath.setIn(state, 'props.x-component-props.options', data);
});
}
});
});
onFieldValueChange$('agree').subscribe(fieldState => {
setFieldState('reason', state => {
state.title = fieldState.value === 0 ? '不通过原因' : '通过原因';
state.rules = fieldState.value === 0 ? [...state.rules, { required: true }] : [];
state.required = fieldState.value === 0;
setTimeout(() => {
formActions.validate('reason');
}, 0);
});
});
}}
actions={formActions}
schema={schema}
......
......@@ -2,10 +2,24 @@
* @Author: XieZhiXiong
* @Date: 2021-05-24 18:00:52
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 17:36:13
* @LastEditTime: 2021-06-03 16:49:52
* @Description:
*/
import { ISchema } from '@formily/antd';
import {
MEMBER_INVOICE_TYPE_1,
MEMBER_INVOICE_TYPE_2,
MEMBER_INVOICE_TYPE_3,
MEMBER_INVOICE_TYPE_4,
MEMBER_INVOICE_TYPE_5,
MEMBER_INVOICE_TYPE,
MEMBER_TAX_POINT_1,
MEMBER_TAX_POINT_2,
MEMBER_TAX_POINT_3,
MEMBER_TAX_POINT_4,
MEMBER_TAX_POINT_5,
MEMBER_TAX_POINT,
} from '@/constants/member';
export const schema: ISchema = {
type: 'object',
......@@ -26,19 +40,22 @@ export const schema: ISchema = {
labelAlign: 'left',
},
properties: {
channelLevel: {
code: {
type: 'string',
title: '会员编码',
required: true,
description: '{{MemberCodeDescription}}',
},
channelTypeId: {
partnerType: {
type: 'string',
enum: [],
title: '合作关系',
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
channelLevel2: {
maxAmount: {
type: 'string',
title: '单次合作金额',
required: true,
......@@ -47,7 +64,7 @@ export const schema: ISchema = {
},
description: '{{MemberCypher}}',
},
areas: {
areaCodes: {
type: 'array',
title: '适用区域',
required: true,
......@@ -56,14 +73,14 @@ export const schema: ISchema = {
items: {
type: 'object',
properties: {
pcode: {
provinceCode: {
type: 'string',
enum: [],
'x-component-props': {
allowClear: true,
},
},
ccode: {
cityCode: {
type: 'string',
enum: [],
'x-component-props': {
......@@ -73,7 +90,7 @@ export const schema: ISchema = {
}
}
},
managementCategory: {
categories: {
type: 'array',
title: '主营品类',
required: true,
......@@ -90,58 +107,116 @@ export const schema: ISchema = {
wrapperCol: 19,
},
properties: {
CATEGORY_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
category: {
type: 'string',
title: '品类',
'x-component': 'CascaderFormItem',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 3,
label: '品类',
},
properties: {
provinceId: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
cityId: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
areaId: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
fieldNames: { label: 'title', value: 'title', children: 'children' },
},
required: true,
},
cycle: {
// CATEGORY_LAYOUT: {
// type: 'object',
// 'x-component': 'Mega-Layout',
// 'x-component-props': {
// grid: true,
// full: true,
// autoRow: true,
// columns: 3,
// label: '品类',
// },
// properties: {
// aaa: {
// type: 'string',
// 'x-component': 'CascaderFormItem',
// 'x-component-props': {
// },
// },
// provinceId: {
// type: 'string',
// enum: [],
// 'x-component-props': {
// placeholder: '请选择',
// },
// required: true,
// },
// cityId: {
// type: 'string',
// enum: [],
// 'x-component-props': {
// placeholder: '请选择',
// },
// required: true,
// },
// areaId: {
// type: 'string',
// enum: [],
// 'x-component-props': {
// placeholder: '请选择',
// },
// required: true,
// },
// },
// },
paymentDay: {
type: 'string',
enum: [],
title: '付款周期(天)',
required: true,
},
invoiceType: {
invoiceTypeName: {
type: 'string',
enum: [],
enum: [
{
label: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_1],
value: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_1],
},
{
label: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_2],
value: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_2],
},
{
label: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_3],
value: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_3],
},
{
label: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_4],
value: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_4],
},
{
label: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_5],
value: MEMBER_INVOICE_TYPE[MEMBER_INVOICE_TYPE_5],
},
],
title: '发票类型',
required: true,
},
taxPoint: {
type: 'string',
title: '税点',
enum: [
{
label: MEMBER_TAX_POINT[MEMBER_TAX_POINT_1],
value: MEMBER_TAX_POINT_1,
},
{
label: MEMBER_TAX_POINT[MEMBER_TAX_POINT_2],
value: MEMBER_TAX_POINT_2,
},
{
label: MEMBER_TAX_POINT[MEMBER_TAX_POINT_3],
value: MEMBER_TAX_POINT_3,
},
{
label: MEMBER_TAX_POINT[MEMBER_TAX_POINT_4],
value: MEMBER_TAX_POINT_4,
},
{
label: MEMBER_TAX_POINT[MEMBER_TAX_POINT_5],
value: MEMBER_TAX_POINT_5,
},
],
required: true,
},
},
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 14:35:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 15:55:52
* @LastEditTime: 2021-06-03 10:52:22
* @Description: 待入库分类详情
*/
import React, { useState, useEffect } from 'react';
......@@ -13,7 +13,7 @@ import {
} from 'antd';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import { GetMemberAbilityMaintenanceDetailBasicResponse } from '@/services/MemberApi';
import { GetMemberDepositClassifyDetailResponse } from '@/services/MemberV2Api';
import {
MEMBER_TYPE_CHANNEL_CORPORATE,
MEMBER_TYPE_CHANNEL_INDIVIDUAL,
......@@ -35,17 +35,16 @@ import MemberInvestigateInfo from '../components/MemberInvestigateInfo';
import PicWrap from '../components/PicWrap';
const MemberPrComingClassify: React.FC<{}> = () => {
const { id, validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null);
const { validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberDepositClassifyDetailResponse>(null);
const [infoLoading, setInfoLoaading] = useState(false);
const getBasicInfo = () => {
if (!id || !validateId) {
if (!validateId) {
return;
}
setInfoLoaading(true);
PublicApi.getMemberAbilityMaintenanceDetailBasic({
memberId: id,
PublicApi.getMemberDepositClassifyDetail({
validateId,
}).then(res => {
if (res.code === 1000) {
......@@ -79,8 +78,8 @@ const MemberPrComingClassify: React.FC<{}> = () => {
: null
),
...(
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => ({
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => ({
key: `group${index}`,
name: item.groupName,
}))
......@@ -141,7 +140,7 @@ const MemberPrComingClassify: React.FC<{}> = () => {
outerStatusName: memberInfo?.outerStatusName,
levelTag: memberInfo?.levelTag,
email: memberInfo?.email,
createTime: memberInfo?.createTime,
createTime: memberInfo?.registerTime,
}}
id="basicInfo"
/>
......@@ -169,14 +168,14 @@ const MemberPrComingClassify: React.FC<{}> = () => {
{/* 其他注册信息 */}
{
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => (
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => (
<Col span={24} key={`group${index}`}>
<CustomizeColumn
title={item.groupName}
data={(
item.elements.map((ele) => ({
title: ele.fieldCNName,
title: ele.fieldLocalName,
value: (
ele.fieldType !== 'upload'
? ele.fieldValue
......@@ -198,6 +197,7 @@ const MemberPrComingClassify: React.FC<{}> = () => {
{/* 入库信息 */}
<Col span={24}>
<MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo"
/>
</Col>
......@@ -205,6 +205,7 @@ const MemberPrComingClassify: React.FC<{}> = () => {
{/* 考察信息 */}
<Col span={24}>
<MemberInvestigateInfo
dataSource={memberInfo?.inspection}
id="investigateInfo"
/>
</Col>
......
......@@ -2,13 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 14:34:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 18:05:07
* @LastEditTime: 2021-06-03 10:05:21
* @Description: 待入库分类
*/
import React, { useState, useRef } from 'react';
import React, { useRef } from 'react';
import { history } from 'umi';
import { Card, Space, Button, Modal, message } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Card, Button } from 'antd';
import { StandardTable } from 'god';
import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -22,15 +21,13 @@ import useSpliceArray from '@/hooks/useSpliceArray';
import comingSchema from '../common/schames/comingSchema';
import verifyComingColumn from '../common/columns/verifyComingColumn';
const { confirm } = Modal;
const formActions = createFormActions();
const MemberPrComingClassify: React.FC<{}> = props => {
const ref = useRef<any>({});
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrComingClassify/verify?id=${record.memberId}&validateId=${record.validateId}`);
history.push(`/memberCenter/memberAbility/manage/memberPrComingClassify/verify?validateId=${record.validateId}`);
};
const defaultColumns = verifyComingColumn('/memberCenter/memberAbility/manage/memberPrComingClassify/detail').concat([
......@@ -62,7 +59,7 @@ const MemberPrComingClassify: React.FC<{}> = props => {
payload.endDate = moment(+endDate).format('YYYY-MM-DD');
}
const res = await PublicApi.getMemberAbilityMaintenancePage(payload);
const res = await PublicApi.getMemberDepositClassifyPage(payload);
if (res.code === 1000) {
return res.data;
......@@ -72,7 +69,7 @@ const MemberPrComingClassify: React.FC<{}> = props => {
// 初始化高级筛选选项
const fetchSearchItems = async () => {
const res = await PublicApi.getMemberAbilityValidateCommitPageitems();
const res = await PublicApi.getMemberDepositPageConditions();
if (res.code === 1000) {
const { data = {} }: any = res;
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 14:36:14
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 19:44:28
* @LastEditTime: 2021-06-03 17:07:31
* @Description: 入库分类
*/
import React, { useState, useEffect } from 'react';
......@@ -11,13 +11,15 @@ import {
Col,
Spin,
Button,
message,
} from 'antd';
import {
CheckCircleOutlined,
} from '@ant-design/icons';
import { history } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import { GetMemberAbilityMaintenanceDetailBasicResponse } from '@/services/MemberApi';
import { GetMemberDepositClassifyDetailResponse } from '@/services/MemberV2Api';
import {
MEMBER_TYPE_CHANNEL_CORPORATE,
MEMBER_TYPE_CHANNEL_INDIVIDUAL,
......@@ -37,21 +39,21 @@ import MemberChannelInfo from '../components/MemberChannelInfo';
import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo';
import MemberInvestigateInfo from '../components/MemberInvestigateInfo';
import PicWrap from '../components/PicWrap';
import ComingClassifyDrawer from './components/ComingClassifyDrawer';
import ComingClassifyDrawer, { ValueType } from './components/ComingClassifyDrawer';
const MemberPrComingClassifyVerify: React.FC<{}> = () => {
const { id, validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null);
const { validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberDepositClassifyDetailResponse>(null);
const [infoLoading, setInfoLoaading] = useState(false);
const [visibleVerifyDrawer, setVisibleVerifyDrawer] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const getBasicInfo = () => {
if (!id || !validateId) {
if (!validateId) {
return;
}
setInfoLoaading(true);
PublicApi.getMemberAbilityMaintenanceDetailBasic({
memberId: id,
PublicApi.getMemberDepositClassifyDetail({
validateId,
}).then(res => {
if (res.code === 1000) {
......@@ -70,11 +72,32 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
setVisibleVerifyDrawer(!!flag);
};
const handleSubmit = () => {
console.log('表单提交')
const handleSubmit = (value: ValueType) => {
setSubmitLoading(true);
const payload = {
validateId,
...value,
};
const msg = message.loading({
content: '正在提交,请稍候...',
duration: 0,
});
PublicApi.postMemberDepositClassify(payload, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
return;
}
handleVisibleVerifyDrawer(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
msg();
setSubmitLoading(false);
});
};
const anchorsArr = [
{
key: 'verifySteps',
......@@ -94,8 +117,8 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
: null
),
...(
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => ({
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => ({
key: `group${index}`,
name: item.groupName,
}))
......@@ -165,7 +188,7 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
outerStatusName: memberInfo?.outerStatusName,
levelTag: memberInfo?.levelTag,
email: memberInfo?.email,
createTime: memberInfo?.createTime,
createTime: memberInfo?.registerTime,
}}
id="basicInfo"
/>
......@@ -193,14 +216,14 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
{/* 其他注册信息 */}
{
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => (
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => (
<Col span={24} key={`group${index}`}>
<CustomizeColumn
title={item.groupName}
data={(
item.elements.map((ele) => ({
title: ele.fieldCNName,
title: ele.fieldLocalName,
value: (
ele.fieldType !== 'upload'
? ele.fieldValue
......@@ -222,6 +245,7 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
{/* 入库信息 */}
<Col span={24}>
<MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo"
/>
</Col>
......@@ -229,6 +253,7 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
{/* 考察信息 */}
<Col span={24}>
<MemberInvestigateInfo
dataSource={memberInfo?.inspection}
id="investigateInfo"
/>
</Col>
......@@ -249,7 +274,14 @@ const MemberPrComingClassifyVerify: React.FC<{}> = () => {
<ComingClassifyDrawer
visible={visibleVerifyDrawer}
partnerTypes={(
memberInfo
&& memberInfo.partnerTypes
? memberInfo.partnerTypes.map((item) => ({ label: item.text, value: item.id })).filter((item) => item.value)
: []
)}
onClose={() => handleVisibleVerifyDrawer(false)}
submitLoading={submitLoading}
onSubmit={handleSubmit}
/>
</Spin>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-02 20:10:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 20:28:11
* @LastEditTime: 2021-06-03 10:38:03
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -53,14 +53,11 @@ export const schema: ISchema = {
},
'x-rules': [
{
required: true,
message: '请输入考察评分',
},
{
pattern: PATTERN_MAPS.money,
message: '请输入两位小数',
},
],
required: true,
},
result: {
type: 'string',
......@@ -76,6 +73,7 @@ export const schema: ISchema = {
maxByte: 120,
}
],
required: true,
},
reports: {
type: 'string',
......
......@@ -30,6 +30,7 @@ import {
} from '../constant';
import MemberBasicInfo from '../components/MemberBasicInfo';
import MemberChannelInfo from '../components/MemberChannelInfo';
import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo';
import PicWrap from '../components/PicWrap';
const MemberPrComingInvestigate: React.FC<{}> = () => {
......@@ -84,6 +85,10 @@ const MemberPrComingInvestigate: React.FC<{}> = () => {
: []
),
{
key: 'incomingInfo',
name: '入库信息',
},
{
key: 'flowRecords',
name: '流转记录',
},
......@@ -184,6 +189,14 @@ const MemberPrComingInvestigate: React.FC<{}> = () => {
: null
}
{/* 入库信息 */}
<Col span={24}>
<MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo"
/>
</Col>
{/* 流转记录 */}
<Col span={24}>
<FlowRecords
......
......@@ -2,13 +2,12 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 10:12:48
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 14:23:36
* @LastEditTime: 2021-06-03 20:46:28
* @Description: 待审核入库考察
*/
import React, { useState, useRef } from 'react';
import React, { useRef } from 'react';
import { history } from 'umi';
import { Card, Space, Button, Modal, message } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Card, Button } from 'antd';
import { StandardTable } from 'god';
import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -22,8 +21,6 @@ import useSpliceArray from '@/hooks/useSpliceArray';
import comingSchema from '../common/schames/comingSchema';
import verifyComingColumn from '../common/columns/verifyComingColumn';
const { confirm } = Modal;
const formActions = createFormActions();
const MemberPrComingInvestigate: React.FC<{}> = props => {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 14:03:05
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 20:21:48
* @LastEditTime: 2021-06-03 10:32:00
* @Description:
*/
import React, { useState, useEffect } from 'react';
......@@ -31,8 +31,9 @@ import {
MEMBER_INNER_COLUMNS,
} from '../constant';
import MemberBasicInfo from '../components/MemberBasicInfo';
import PicWrap from '../components/PicWrap';
import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo';
import VerifyComingInvestigateDrawer, { ValueType } from './components/VerifyComingInvestigateDrawer';
import PicWrap from '../components/PicWrap';
const MemberPrComingInvestigate: React.FC<{}> = () => {
const { validateId } = usePageStatus();
......@@ -113,6 +114,10 @@ const MemberPrComingInvestigate: React.FC<{}> = () => {
: []
),
{
key: 'incomingInfo',
name: '入库信息',
},
{
key: 'flowRecords',
name: '流转记录',
},
......@@ -202,6 +207,14 @@ const MemberPrComingInvestigate: React.FC<{}> = () => {
: null
}
{/* 入库信息 */}
<Col span={24}>
<MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo"
/>
</Col>
{/* 流转记录 */}
<Col span={24}>
<FlowRecords
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-24 10:27:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 18:05:58
* @LastEditTime: 2021-06-03 20:42:19
* @Description: 待审核入库资料
*/
import React, { useState, useRef } from 'react';
......@@ -145,7 +145,7 @@ const MemberPrVerifyComingData: React.FC<{}> = props => {
return {};
};
const controllerBtns = (
const ControllerBtns = () => (
<Space>
<Button onClick={handleBatch}>
批量审核通过
......@@ -167,8 +167,8 @@ const MemberPrVerifyComingData: React.FC<{}> = props => {
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
components={{
ControllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
......
......@@ -30,6 +30,7 @@ import {
} from '../constant';
import MemberBasicInfo from '../components/MemberBasicInfo';
import MemberChannelInfo from '../components/MemberChannelInfo';
import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo';
import PicWrap from '../components/PicWrap';
const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
......@@ -84,6 +85,10 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
: []
),
{
key: 'incomingInfo',
name: '入库信息',
},
{
key: 'flowRecords',
name: '流转记录',
},
......@@ -184,6 +189,14 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
: null
}
{/* 入库信息 */}
<Col span={24}>
<MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo"
/>
</Col>
{/* 流转记录 */}
<Col span={24}>
<FlowRecords
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 10:11:54
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 18:25:48
* @LastEditTime: 2021-06-03 20:42:47
* @Description: 待审核入库资质
*/
import React, { useState, useRef } from 'react';
......@@ -145,7 +145,7 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
return {};
};
const controllerBtns = (
const ControllerBtns = () => (
<Space>
<Button onClick={handleBatch}>
批量审核通过
......@@ -167,8 +167,8 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
components={{
ControllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 11:40:27
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 18:33:14
* @LastEditTime: 2021-06-03 10:32:53
* @Description: 审核入库资质
*/
import React, { useState, useEffect } from 'react';
......@@ -35,6 +35,7 @@ import {
} from '../constant';
import MemberBasicInfo from '../components/MemberBasicInfo';
import MemberChannelInfo from '../components/MemberChannelInfo';
import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo';
import PicWrap from '../components/PicWrap';
import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
......@@ -117,6 +118,10 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
: []
),
{
key: 'incomingInfo',
name: '入库信息',
},
{
key: 'flowRecords',
name: '流转记录',
},
......@@ -225,6 +230,14 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
))
: null
}
{/* 入库信息 */}
<Col span={24}>
<MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo"
/>
</Col>
{/* 流转记录 */}
<Col span={24}>
......
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