Commit 4ffa6725 authored by 张子雨's avatar 张子雨

feat: 业务类型判断

parent b9cb10e6
......@@ -119,6 +119,7 @@ export async function getInfo() {
companyNamedis,
categoryList,
mainCategoryId: res.mainCategoryId,
companyType: res.companyType,
});
}
......
......@@ -82,6 +82,7 @@ class BusinessInfo extends Component {
checkboxDisabled: false,
mainCategoryId: null,
companyNamedis: false, // 公司名称
companyType: null, // 企业类型
};
async componentDidMount() {
......@@ -135,10 +136,28 @@ class BusinessInfo extends Component {
// 帐号类型切换
onChangeSettlType(e) {
this.setState({
settlementType: e.target.value,
settlementType: e,
});
}
// 切换企业类型
onChangeCompanyType = e => {
const { value } = e.target;
this.setState({
companyType: value,
});
let type = null;
if ([1, 3].includes(value)) {
type = 1;
} else {
type = 2;
}
this.onChangeSettlType(type);
this.props.form.setFieldsValue({
settlementType: type,
});
};
// 处理图片
dealImgInfo = async (type, url) => {
const imgType = {
......@@ -274,14 +293,11 @@ class BusinessInfo extends Component {
obj.socialCode = obj.socialCode?.toLocaleUpperCase() || '';
obj.id = this.state.id;
obj.headImage = obj.primaryImage;
// this.setState({
// loading: true,
// });
console.log('obj :>>提交 ', obj);
this.setState({
loading: true,
});
const data = await apiEditStoreInfo(obj);
console.log(data, '.........');
if (data.businessCode === '0000') {
// const msg = this.state.type === infoTypeChecked ? '审核完成' : '保存成功';
notification.success({ message: `${data.msg}!~` });
}
this.setState({
......@@ -347,7 +363,14 @@ class BusinessInfo extends Component {
const {
form: { getFieldDecorator },
} = this.props;
const { businessInfo, type, checkboxDisabled, mainCategoryId, companyNamedis } = this.state;
const {
businessInfo,
type,
checkboxDisabled,
mainCategoryId,
companyNamedis,
companyType,
} = this.state;
return (
<div className={styles.infoBox}>
<Form className="login-form" onSubmit={this.handleSubmit} {...formItemLayout}>
......@@ -367,6 +390,29 @@ class BusinessInfo extends Component {
)}
</FormItem>
</Col>
<Col span={24}>
<FormItem label="主营类目" labelCol={{ span: 4 }}>
{getFieldDecorator('mainCategoryId', {
rules: [{ required: true, message: '请选择主营类目!' }],
initialValue: businessInfo.mainCategoryId,
})(
<Select
onChange={e => this.onMainCategory(e)}
showSearch
filterOption={(input, option) =>
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
disabled={+businessInfo.mainCategoryId === 301008}
>
{this.state.categoryList.map(item => (
<Option value={item.id} key={item.id}>
{item.name}
</Option>
))}
</Select>,
)}
</FormItem>
</Col>
<Col span={24}>
<FormItem label="商户名称" labelCol={{ span: 4 }}>
{getFieldDecorator('name', {
......@@ -494,29 +540,6 @@ class BusinessInfo extends Component {
</Card>
<Card title="证照信息录入区">
<Row gutter={24}>
<Col span={24}>
<FormItem label="主营类目" labelCol={{ span: 4 }}>
{getFieldDecorator('mainCategoryId', {
rules: [{ required: true, message: '请选择主营类目!' }],
initialValue: businessInfo.mainCategoryId,
})(
<Select
onChange={e => this.onMainCategory(e)}
showSearch
filterOption={(input, option) =>
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
disabled={+businessInfo.mainCategoryId === 301008}
>
{this.state.categoryList.map(item => (
<Option value={item.id} key={item.id}>
{item.name}
</Option>
))}
</Select>,
)}
</FormItem>
</Col>
{+mainCategoryId !== carID && (
<Col span={24}>
<FormItem label="企业类型" labelCol={{ span: 4 }}>
......@@ -524,7 +547,10 @@ class BusinessInfo extends Component {
rules: [{ required: true, message: '请选择企业类型!' }],
initialValue: businessInfo.companyType,
})(
<Radio.Group disabled={businessInfo.companyType}>
<Radio.Group
onChange={this.onChangeCompanyType}
disabled={businessInfo.companyType}
>
<Radio value={1}>一般纳税人</Radio>
<Radio value={2}>小规模</Radio>
<Radio value={3}>个体工商</Radio>
......@@ -862,9 +888,13 @@ class BusinessInfo extends Component {
rules: [{ required: true, message: '请选择账户类型!' }],
initialValue: businessInfo.settlementType,
})(
<Radio.Group onChange={e => this.onChangeSettlType(e)}>
<Radio value={1}>对公</Radio>
<Radio value={2}>对私(小微商户)</Radio>
<Radio.Group onChange={e => this.onChangeSettlType(e?.target?.value)}>
<Radio value={1} disabled={[2].includes(companyType)}>
对公
</Radio>
<Radio value={2} disabled={[1, 3].includes(companyType)}>
对私(小微商户)
</Radio>
</Radio.Group>,
)}
</FormItem>
......
......@@ -39,9 +39,9 @@ const ContractView = () => {
align: 'center',
hideInSearch: true,
render: (val, data) => {
if (val?.length) {
if (data.signDate && data?.signDate.length) {
let date = '';
val.forEach((item, index) => {
data.signDate.forEach((item, index) => {
if (item && item.toString().length === 1) {
item = `0${item}`;
}
......
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