Commit 1b8305f1 authored by 张子雨's avatar 张子雨

Merge branch 'feat/constructionOne' into feature/20230327_public_takeaway

* feat/constructionOne:
  feat: 去掉不用代码
parents 5d3baf2e 6b94933d
...@@ -39,14 +39,7 @@ import { ...@@ -39,14 +39,7 @@ import {
import { validatePhone, validateEMail, validNumber } from '@/utils/validator'; import { validatePhone, validateEMail, validNumber } from '@/utils/validator';
import { getErrorMessage } from '@/utils/utils'; import { getErrorMessage } from '@/utils/utils';
import MapModal from '@/components/BaiduMap'; import MapModal from '@/components/BaiduMap';
import { apiCategoryList, apiEditStoreInfo, apiRecognize, apiRevision } from '../service'; import { apiCategoryList, apiEditStoreInfo, apiRecognize } from '../service';
import {
infoTypeFind,
infoTypeChecked,
infoTypeEdit,
infoTypeRevision,
infoTypeInfo,
} from '../staticdata';
const { Option } = Select; const { Option } = Select;
const { Item: FormItem } = Form; const { Item: FormItem } = Form;
...@@ -61,7 +54,6 @@ class BusinessInfo extends Component { ...@@ -61,7 +54,6 @@ class BusinessInfo extends Component {
state = { state = {
id: null, id: null,
type: infoTypeFind,
businessInfo: { businessInfo: {
customList: [], customList: [],
settlementType: 1, settlementType: 1,
...@@ -71,15 +63,9 @@ class BusinessInfo extends Component { ...@@ -71,15 +63,9 @@ class BusinessInfo extends Component {
categoryList: [], // 主要类目 categoryList: [], // 主要类目
serviceFacilitys: [], // 服务设施 serviceFacilitys: [], // 服务设施
bankList: [], // 开户行 bankList: [], // 开户行
// eslint-disable-next-line react/no-unused-state
tagVisible: false,
// eslint-disable-next-line react/no-unused-state
tagValue: '',
settlementType: 1, settlementType: 1,
loading: false, loading: false,
visibleMap: false,
visibleLoading: false, visibleLoading: false,
calculateType: [1, 1],
checkboxDisabled: false, checkboxDisabled: false,
mainCategoryId: null, mainCategoryId: null,
companyNamedis: false, // 公司名称 companyNamedis: false, // 公司名称
...@@ -111,14 +97,6 @@ class BusinessInfo extends Component { ...@@ -111,14 +97,6 @@ class BusinessInfo extends Component {
}); });
}; };
// eslint-disable-next-line react/sort-comp
getDataInfo = type => ({
key: type,
name: businessTypeDesc[type],
chargeMethod: 1,
calculateType: 1,
});
// 计费类型改变 // 计费类型改变
onChangeCalculateType = (e, i) => { onChangeCalculateType = (e, i) => {
this.setState(state => { this.setState(state => {
...@@ -159,68 +137,12 @@ class BusinessInfo extends Component { ...@@ -159,68 +137,12 @@ class BusinessInfo extends Component {
}); });
}; };
// 处理图片 // 获取主营类目
dealImgInfo = async (type, url) => { async getCategoryList(e) {
const imgType = { const data = await apiCategoryList(e);
businessLicenseImage: 2, if (!data.data) return;
idCardPortraitImage: 5, this.setState({ categoryList: data.data });
idCardEmblemImage: 4, }
};
if (!url) {
return;
}
this.setState({
visibleLoading: true,
});
const data = await apiRecognize({
imageUrl: url,
imageType: imgType[type],
});
if (data.businessCode === '0000') {
const res = data.data;
const info = {};
this.setState(state => {
if (type === 'businessLicenseImage') {
info.socialCode = res.socialCode || '';
info.companyName = res.companyName || '';
info.businessLicensePeriod = res.businessLicensePeriod
? moment(res.businessLicensePeriod)
: '';
} else if (type === 'idCardPortraitImage') {
info.legalPersonName = res.legalPersonName || '';
info.legalPersonIdCard = res.legalPersonIdCard || '';
} else if (type === 'idCardEmblemImage' && res.legalPersonPeriod) {
// 身份证有效期处理
const date = res.legalPersonPeriod.split('-') || [];
info.legalPersonStart = date[0] && moment(date[0]);
info.legalPersonEnd = date[1] && date[1] !== '长期' ? moment(date[1]) : '';
info.checked = date[1] && date[1] === '长期' ? ['长期'] : [];
const checkboxDisabled = date[1] && date[1] === '长期';
this.setState({
checkboxDisabled,
});
// info.legalPersonPeriod = res.legalPersonPeriod
// .replace(/\./g, '/')
// .split('-')
// .map(o => moment(o));
}
return {
businessInfo: Object.assign(state.businessInfo, info),
};
});
this.props.form.setFieldsValue({
...info,
});
} else {
notification.error({ message: data.msg });
}
this.setState({
visibleLoading: false,
});
};
/* eslint-disable no-return-assign */
saveInputRef = input => (this.input = input);
// 返回 // 返回
onCancel = () => { onCancel = () => {
...@@ -338,19 +260,6 @@ class BusinessInfo extends Component { ...@@ -338,19 +260,6 @@ class BusinessInfo extends Component {
} }
}; };
openMap(e, disabled) {
if (!disabled) {
this.setState({
visibleMap: e,
});
}
}
// eslint-disable-next-line class-methods-use-this
disabledDate(current) {
return current && current < moment(moment().format('YYYY-MM-DD'));
}
onChangeBusinessModel = e => { onChangeBusinessModel = e => {
this.getCategoryList(e); this.getCategoryList(e);
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
...@@ -358,12 +267,68 @@ class BusinessInfo extends Component { ...@@ -358,12 +267,68 @@ class BusinessInfo extends Component {
}); });
}; };
// 获取主营类目 /* eslint-disable no-return-assign */
async getCategoryList(e) { saveInputRef = input => (this.input = input);
const data = await apiCategoryList(e);
if (!data.data) return; // 处理图片
this.setState({ categoryList: data.data }); dealImgInfo = async (type, url) => {
} const imgType = {
businessLicenseImage: 2,
idCardPortraitImage: 5,
idCardEmblemImage: 4,
};
if (!url) {
return;
}
this.setState({
visibleLoading: true,
});
const data = await apiRecognize({
imageUrl: url,
imageType: imgType[type],
});
if (data.businessCode === '0000') {
const res = data.data;
const info = {};
this.setState(state => {
if (type === 'businessLicenseImage') {
info.socialCode = res.socialCode || '';
info.companyName = res.companyName || '';
info.businessLicensePeriod = res.businessLicensePeriod
? moment(res.businessLicensePeriod)
: '';
} else if (type === 'idCardPortraitImage') {
info.legalPersonName = res.legalPersonName || '';
info.legalPersonIdCard = res.legalPersonIdCard || '';
} else if (type === 'idCardEmblemImage' && res.legalPersonPeriod) {
// 身份证有效期处理
const date = res.legalPersonPeriod.split('-') || [];
info.legalPersonStart = date[0] && moment(date[0]);
info.legalPersonEnd = date[1] && date[1] !== '长期' ? moment(date[1]) : '';
info.checked = date[1] && date[1] === '长期' ? ['长期'] : [];
const checkboxDisabled = date[1] && date[1] === '长期';
this.setState({
checkboxDisabled,
});
// info.legalPersonPeriod = res.legalPersonPeriod
// .replace(/\./g, '/')
// .split('-')
// .map(o => moment(o));
}
return {
businessInfo: Object.assign(state.businessInfo, info),
};
});
this.props.form.setFieldsValue({
...info,
});
} else {
notification.error({ message: data.msg });
}
this.setState({
visibleLoading: false,
});
};
render() { render() {
const { const {
...@@ -1165,11 +1130,6 @@ class BusinessInfo extends Component { ...@@ -1165,11 +1130,6 @@ class BusinessInfo extends Component {
</Button> </Button>
</div> </div>
</Form> </Form>
<MapModal
visible={this.state.visibleMap}
onCancel={() => this.openMap(false)}
onSetPoint={e => this.onSetPoint(e)}
></MapModal>
{this.state.visibleLoading && ( {this.state.visibleLoading && (
<div className={styles.spinBox}> <div className={styles.spinBox}>
<div className={styles.spinBoxWrapper}> <div className={styles.spinBoxWrapper}>
......
...@@ -26,10 +26,6 @@ export const apiServiceFacility = () => ...@@ -26,10 +26,6 @@ export const apiServiceFacility = () =>
export const apiBankList = () => export const apiBankList = () =>
request.get('/api/merchants/suppliers/banks/list', { prefix: kdspApi }); request.get('/api/merchants/suppliers/banks/list', { prefix: kdspApi });
// 订正
export const apiRevision = params =>
request.post('/api/consoles/suppliers/register/revision', { prefix: kdspApi, data: params });
/** /**
* 上传文件 * 上传文件
* imageType: 1-主头图,2-营业执照,3-电子签章,4-法人身份证国徽面,5-法人身份证人像面,6-类目所需资质,7-其它证件,8-开户许可证 * imageType: 1-主头图,2-营业执照,3-电子签章,4-法人身份证国徽面,5-法人身份证人像面,6-类目所需资质,7-其它证件,8-开户许可证
......
import { Button, Popconfirm } from 'antd';
import React from 'react';
// import router from 'umi/router';
import { history } from 'umi';
// 状态:0-填写未完成,1-待审核,2-待易宝入网,3-易宝入网中,4-待易宝签约,5-待平台签约,6-完成,7-驳回
export const checkStatus = {
// 0: { text: '填写未完成' },
1: { text: '待审核' },
// 2: { text: '待易宝入网' },
3: { text: '易宝入网中' },
4: { text: '待易宝签约' },
5: { text: '待平台签约' },
// 6: { text: '完成' },
// 7: { text: '驳回' },
};
// 详情类型
export const infoTypeFind = 'find'; // 查看
export const infoTypeChecked = 'checked'; // 审核
export const infoTypeEdit = 'edit'; // 编辑
export const infoTypeRevision = 'revision'; // 订正
export const infoTypeInfo = 'info'; // 审核之后查看
export const infoTypeAdd = 'add'; // 添加
// 商户类型
export const supplierType = {
pop: { text: 'POP商户' },
供应商: { text: '供应商' },
};
export const toInfo = ({ id }, type = 'find') => {
history.push(`/BusinessInfo?id=${id}&type=${type}`);
};
export const businessTypeDesc = {
1: '到家业务',
2: '实物业务',
3: '到店业务',
};
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