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

feat: 业务类型判断

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