Commit a07ded6e authored by 张子雨's avatar 张子雨

feat: 新增商家资料和合同

parent 978bf3d6
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'xyqb'; const environment = 'sc1';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`, kdspOpApi: `https://sc-merchant-api-${environment}.liangkebang.net`,
......
...@@ -2,13 +2,11 @@ import React from 'react'; ...@@ -2,13 +2,11 @@ import React from 'react';
import moment from 'moment'; import moment from 'moment';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { notification, Tag, Tooltip, Input } from 'antd'; import { notification, Tag, Tooltip, Input } from 'antd';
// import { reject } from 'lodash-es';
import { import {
uploadFile, uploadFile,
apiCategoryList, apiCategoryList,
apiAddrArea, apiAddrArea,
apiServiceFacility, apiServiceFacility,
apiApplyDetail,
apiBusinessDetail, apiBusinessDetail,
apiBankList, apiBankList,
} from '../service'; } from '../service';
...@@ -42,24 +40,38 @@ export const businessModel = [ ...@@ -42,24 +40,38 @@ export const businessModel = [
]; ];
// 获取申请信息 // 获取申请信息
export async function getInfo(id, type) { export async function getInfo() {
let api = apiApplyDetail; const data = await apiBusinessDetail();
if (['info', 'edit', 'revision'].includes(type)) {
api = apiBusinessDetail;
}
const [res] = await api(id);
let settlementType = 1; let settlementType = 1;
const res = data.data;
if (res) { if (res) {
if (res.facilities) { if (res.facilities) {
res.customList = res.facilities.customList || []; res.customList = res.facilities.customList || [];
res.selfList = res.facilities.selfList || []; res.selfList = res.facilities.selfList || [];
} }
res.accountOpenPermitImage = [{ uid: 0, url: res.accountOpenPermitImage }]; res.accountOpenPermitImage = res.accountOpenPermitImage
res.businessLicenseImage = [{ uid: 0, url: res.businessLicenseImage }]; ? [{ uid: 0, url: res.accountOpenPermitImage }]
res.idCardEmblemImage = [{ uid: 0, url: res.idCardEmblemImage }]; : [];
res.idCardPortraitImage = [{ uid: 0, url: res.idCardPortraitImage }]; res.businessLicenseImage = res.businessLicenseImage
res.primaryImage = [{ uid: 0, url: res.primaryImage }]; ? [{ uid: 0, url: res.businessLicenseImage }]
res.sealImage = [{ uid: 0, url: res.sealImage }]; : [];
res.idCardEmblemImage = res.idCardEmblemImage ? [{ uid: 0, url: res.idCardEmblemImage }] : [];
res.idCardPortraitImage = res.idCardPortraitImage
? [{ uid: 0, url: res.idCardPortraitImage }]
: [];
res.primaryImage = res.primaryImage ? [{ uid: 0, url: res.primaryImage }] : [];
res.sealImage = res.sealImage ? [{ uid: 0, url: res.sealImage }] : [];
res.brandCertificate = res.brandCertificate ? [{ uid: 0, url: res.brandCertificate }] : [];
// 非同名结算授权文件
res.differentNameAuthorizationImage = res.differentNameAuthorizationImage
? [{ uid: 0, url: res.brandCertificate }]
: [];
// 户口本本人页
res.householdRegisterImage = res.householdRegisterImage
? [{ uid: 0, url: res.householdRegisterImage }]
: [];
// 工商局
res.icbProofImage = res.icbProofImage ? [{ uid: 0, url: res.icbProofImage }] : [];
if (res.categoryQualificateImage) { if (res.categoryQualificateImage) {
res.categoryQualificateImage = [{ uid: 0, url: res.categoryQualificateImage }]; res.categoryQualificateImage = [{ uid: 0, url: res.categoryQualificateImage }];
} }
...@@ -75,11 +87,18 @@ export async function getInfo(id, type) { ...@@ -75,11 +87,18 @@ export async function getInfo(id, type) {
} }
settlementType = +res.settlementType; settlementType = +res.settlementType;
} }
res.legalPersonPeriod = res.legalPersonPeriod.split('-').map(item => moment(item)); res.checked = res.legalPersonPeriod === '长期';
res.businessLicensePeriod = moment(res.businessLicensePeriod); res.legalPerson =
res.legalPersonPeriod &&
res.legalPersonPeriod !== '长期' &&
res.legalPersonPeriod.split('-').map(item => moment(item));
res.businessLicensePeriod = res.businessLicensePeriod && moment(res.businessLicensePeriod);
const companyNamedis = !!res.companyName;
this.setState({ this.setState({
settlementType, settlementType,
businessInfo: res, businessInfo: res,
checkboxDisabled: res.checked,
companyNamedis,
}); });
} }
...@@ -92,6 +111,7 @@ function delImg(keyName, e) { ...@@ -92,6 +111,7 @@ function delImg(keyName, e) {
}; };
}); });
} }
// 上传图片 // 上传图片
export function uploadPropsFn( export function uploadPropsFn(
{ keyName, limit = 1, maxSize = 1024 * 1024 * 5, maxSizeMsg = '文件大小不能超过5M!', type = 0 }, { keyName, limit = 1, maxSize = 1024 * 1024 * 5, maxSizeMsg = '文件大小不能超过5M!', type = 0 },
...@@ -247,16 +267,6 @@ export function renderServiceTags() { ...@@ -247,16 +267,6 @@ export function renderServiceTags() {
} }
/** **** 自定义服务设施 end ***************************** */ /** **** 自定义服务设施 end ***************************** */
// 获取主营类目
export async function getCategoryList() {
const [res] = await apiCategoryList();
if (res) {
this.setState({
categoryList: res,
});
}
}
// 获取服务设施 // 获取服务设施
export async function getServiceFacility() { export async function getServiceFacility() {
const res = await apiServiceFacility(); const res = await apiServiceFacility();
...@@ -288,6 +298,7 @@ export async function getAreaAddr() { ...@@ -288,6 +298,7 @@ export async function getAreaAddr() {
label: item.addrName, label: item.addrName,
value: item.addrId, value: item.addrId,
})); }));
console.log(this.state.businessInfo, '......');
// 编辑时 回显 市、区、街道 // 编辑时 回显 市、区、街道
if (this.state.businessInfo.provinceId) { if (this.state.businessInfo.provinceId) {
const pros = res.filter(item => +item.value === +this.state.businessInfo.provinceId); const pros = res.filter(item => +item.value === +this.state.businessInfo.provinceId);
......
...@@ -25,7 +25,6 @@ import { ...@@ -25,7 +25,6 @@ import {
wrapperCol, wrapperCol,
uploadPropsFn, uploadPropsFn,
formItemLayout, formItemLayout,
getCategoryList,
renderServiceTags, renderServiceTags,
loadData, loadData,
getAreaAddr, getAreaAddr,
...@@ -38,7 +37,7 @@ import { ...@@ -38,7 +37,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 { apiNewStoreInfo, apiEditStoreInfo, apiRecognize, apiRevision } from '../service'; import { apiCategoryList, apiEditStoreInfo, apiRecognize, apiRevision } from '../service';
import { import {
infoTypeFind, infoTypeFind,
infoTypeChecked, infoTypeChecked,
...@@ -52,11 +51,6 @@ const { Item: FormItem } = Form; ...@@ -52,11 +51,6 @@ const { Item: FormItem } = Form;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { TabPane } = Tabs; const { TabPane } = Tabs;
const applyTypeDesc = {
1: '用户提交申请:',
3: '易宝驳回:',
};
class BusinessInfo extends Component { class BusinessInfo extends Component {
getFieldDecorator = this.props?.form?.getFieldDecorator; getFieldDecorator = this.props?.form?.getFieldDecorator;
...@@ -83,78 +77,36 @@ class BusinessInfo extends Component { ...@@ -83,78 +77,36 @@ class BusinessInfo extends Component {
visibleMap: false, visibleMap: false,
visibleLoading: false, visibleLoading: false,
calculateType: [1, 1], calculateType: [1, 1],
defaultType: '1', checkboxDisabled: false,
visibleCalculate: false, mainCategoryId: null,
companyNamedis: false, // 公司名称
bankAccounts: false,
}; };
async componentDidMount() { async componentDidMount() {
const { id, type } = this.props.location.query;
const info = {};
let businessType = [];
if (id) {
info.id = id;
info.type = type || infoTypeFind;
await getInfo.call(this, id, type);
businessType = this.state.businessInfo.productBusiness.map(item => this.getDataInfo(item));
}
// find 查看 checked审核 edit修改 info审核之后查看
if (id && [infoTypeFind, infoTypeInfo, infoTypeRevision].includes(type)) {
info.disabled = !0;
} else if (type === infoTypeRevision) {
// 订正 除了邮箱其他都禁止修改
info.disabled = !0;
info.emailDisabled = false;
}
this.setState(state => {
const businessInfo = Object.assign(
{
businessType,
},
state.businessInfo,
);
return {
...info,
businessInfo,
};
});
getAreaAddr.call(this); getAreaAddr.call(this);
// getCategoryList.call(this); getInfo.call(this);
getServiceFacility.call(this); getServiceFacility.call(this);
getBankList.call(this); getBankList.call(this);
if (this.state.businessInfo.productBusiness) {
this.getCategoryList(this.state.businessInfo.productBusiness);
} }
// 审核的时候 切换业务模式 更改服务费率配置
onChangeBusinessModel = e => {
if (this.state.type !== infoTypeChecked) {
return false;
}
const arr = [];
e.forEach(item => {
if (item === 1 || item === 3) {
arr.push(item);
} }
});
const businessType = arr.map(item => this.getDataInfo(item));
this.setState(state => {
const { businessInfo } = state;
businessInfo.businessType = businessType;
return {
businessInfo,
};
});
return console.log('.');
};
// 切换审核结果 - 显示/隐藏费率 // 主营类目
onChangeAuditResult = e => { onMainCategory(e) {
this.setState({ this.setState({
visibleCalculate: e.target.value, mainCategoryId: e,
}); });
}; }
onTabChange = e => { // 长期
oncheckedChange = e => {
this.setState({ this.setState({
defaultType: e, checkboxDisabled: e.target.checked,
});
this.props.form.setFieldsValue({
legalPerson: '',
}); });
}; };
...@@ -237,38 +189,13 @@ class BusinessInfo extends Component { ...@@ -237,38 +189,13 @@ class BusinessInfo extends Component {
}); });
}; };
// 订正 - 修改邮箱
onRevision = () => {
const email = this.props.form.getFieldValue('contactEmail');
const contactPhone = this.props.form.getFieldValue('contactPhone');
if (email) {
validateEMail('', email, async e => {
if (!e) {
const [res, error] = await apiRevision({
id: this.state.id,
contactPhone,
contactEmail: email,
});
console.log('res :>> ', res);
if (!error) {
notification.success({ message: '订正完成!~' });
this.onCancel();
}
} else {
notification.warning({ message: '请输入正确的邮箱地址' });
}
});
} else {
notification.warning({ message: '请输入邮箱地址' });
}
};
/* eslint-disable no-return-assign */ /* eslint-disable no-return-assign */
saveInputRef = input => (this.input = input); saveInputRef = input => (this.input = input);
// 返回 // 返回
onCancel = () => { onCancel = () => {
window.history.back(); // window.history.back();
getInfo.call(this);
}; };
// 提交 // 提交
...@@ -279,9 +206,13 @@ class BusinessInfo extends Component { ...@@ -279,9 +206,13 @@ class BusinessInfo extends Component {
if (!err) { if (!err) {
const imgs = this.state.businessInfo; const imgs = this.state.businessInfo;
obj.businessLicensePeriod = moment(obj.businessLicensePeriod).format('YYYY-MM-DD'); obj.businessLicensePeriod = moment(obj.businessLicensePeriod).format('YYYY-MM-DD');
obj.legalPersonPeriod = obj.legalPersonPeriod if (this.state.checkboxDisabled) {
obj.legalPersonPeriod = '长期';
} else {
obj.legalPersonPeriod = obj.legalPerson
.map(o => moment(o).format('YYYY/MM/DD')) .map(o => moment(o).format('YYYY/MM/DD'))
.join('-'); .join('-');
}
obj.facilities = { obj.facilities = {
customList: this.state.businessInfo.customList, customList: this.state.businessInfo.customList,
selfList: obj.selfList, selfList: obj.selfList,
...@@ -307,7 +238,16 @@ class BusinessInfo extends Component { ...@@ -307,7 +238,16 @@ class BusinessInfo extends Component {
obj.idCardPortraitImage = imgs.idCardPortraitImage[0].url; obj.idCardPortraitImage = imgs.idCardPortraitImage[0].url;
obj.primaryImage = imgs.primaryImage[0].url; obj.primaryImage = imgs.primaryImage[0].url;
obj.sealImage = imgs.sealImage[0].url; obj.sealImage = imgs.sealImage[0].url;
obj.differentNameAuthorizationImage =
imgs.differentNameAuthorizationImage?.length &&
imgs.differentNameAuthorizationImage[0].url;
obj.householdRegisterImage =
imgs.householdRegisterImage?.length && imgs.householdRegisterImage[0].url;
obj.icbProofImage = imgs.icbProofImage?.length && imgs.icbProofImage[0].url;
obj.applySource = 1; obj.applySource = 1;
obj.signDateType = 1;
if (imgs.otherImage && imgs.otherImage.length) { if (imgs.otherImage && imgs.otherImage.length) {
obj.otherImage = imgs.otherImage.map(item => item.url); obj.otherImage = imgs.otherImage.map(item => item.url);
} else { } else {
...@@ -321,21 +261,14 @@ class BusinessInfo extends Component { ...@@ -321,21 +261,14 @@ class BusinessInfo extends Component {
obj.legalPersonIdCard = obj.legalPersonIdCard?.toLocaleUpperCase() || ''; obj.legalPersonIdCard = obj.legalPersonIdCard?.toLocaleUpperCase() || '';
obj.bankAccountLicenseNum = obj.bankAccountLicenseNum?.toLocaleUpperCase() || ''; obj.bankAccountLicenseNum = obj.bankAccountLicenseNum?.toLocaleUpperCase() || '';
obj.socialCode = obj.socialCode?.toLocaleUpperCase() || ''; obj.socialCode = obj.socialCode?.toLocaleUpperCase() || '';
let api = apiNewStoreInfo;
if (this.state.id) {
obj.id = this.state.id; obj.id = this.state.id;
if (this.state.type === infoTypeEdit) {
obj.headImage = obj.primaryImage; obj.headImage = obj.primaryImage;
api = apiEditStoreInfo; // this.setState({
} // loading: true,
} else { // });
obj.completed = !0;
}
this.setState({
loading: true,
});
console.log('obj :>>提交 ', obj); console.log('obj :>>提交 ', obj);
const data = await api(obj); const data = await apiEditStoreInfo(obj);
console.log(data, '.........');
if (data.businessCode === '0000') { if (data.businessCode === '0000') {
// const msg = this.state.type === infoTypeChecked ? '审核完成' : '保存成功'; // const msg = this.state.type === infoTypeChecked ? '审核完成' : '保存成功';
notification.success({ message: `${data.msg}!~` }); notification.success({ message: `${data.msg}!~` });
...@@ -357,6 +290,22 @@ class BusinessInfo extends Component { ...@@ -357,6 +290,22 @@ class BusinessInfo extends Component {
}); });
}; };
// 修改公司名称
setCompanyName = () => {
const val = this.state.companyNamedis;
this.setState({
companyNamedis: !val,
});
};
// 修改银行账号
setBankAccount = () => {
const val = this.state.bankAccounts;
this.setState({
bankAccounts: !val,
});
};
openMap(e, disabled) { openMap(e, disabled) {
if (!disabled) { if (!disabled) {
this.setState({ this.setState({
...@@ -370,15 +319,33 @@ class BusinessInfo extends Component { ...@@ -370,15 +319,33 @@ class BusinessInfo extends Component {
return current && current < moment(moment().format('YYYY-MM-DD')); return current && current < moment(moment().format('YYYY-MM-DD'));
} }
onChangeBusinessModel = e => {
this.getCategoryList(e);
};
// 获取主营类目
async getCategoryList(e) {
const data = await apiCategoryList(e);
if (!data.data) return;
this.setState({ categoryList: data.data });
}
render() { render() {
const { const {
form: { getFieldDecorator }, form: { getFieldDecorator },
} = this.props; } = this.props;
const { businessInfo, type } = this.state; const {
businessInfo,
type,
checkboxDisabled,
mainCategoryId,
companyNamedis,
bankAccounts,
} = 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}>
<Card title="基本信息"> <Card title="店铺基本信息">
<Row gutter={24}> <Row gutter={24}>
<Col span={24}> <Col span={24}>
<FormItem label="业务模式" labelCol={{ span: 4 }}> <FormItem label="业务模式" labelCol={{ span: 4 }}>
...@@ -461,7 +428,17 @@ class BusinessInfo extends Component { ...@@ -461,7 +428,17 @@ class BusinessInfo extends Component {
})(<Input maxLength={11} />)} })(<Input maxLength={11} />)}
</FormItem> </FormItem>
</Col> </Col>
<Col span={24}>
<FormItem label="签约日期" labelCol={{ span: 4 }}>
{getFieldDecorator('signDateType', {
rules: [{ required: true, message: '请选择签约日期' }],
initialValue: businessInfo.signDateType,
})(<Checkbox>自商品售卖起默认一年</Checkbox>)}
</FormItem>
</Col>
</Row>
</Card>
<Card title="店铺营业信息">
<Col span={12} className={styles.imgList}> <Col span={12} className={styles.imgList}>
<FormItem label="商户头图" labelCol={{ span: 8 }} wrapperCol={wrapperCol}> <FormItem label="商户头图" labelCol={{ span: 8 }} wrapperCol={wrapperCol}>
{getFieldDecorator('primaryImage', { {getFieldDecorator('primaryImage', {
...@@ -500,20 +477,25 @@ class BusinessInfo extends Component { ...@@ -500,20 +477,25 @@ class BusinessInfo extends Component {
})(renderServiceTags.call(this))} })(renderServiceTags.call(this))}
</FormItem> </FormItem>
</Col> </Col>
</Row>
</Card> </Card>
<Card title="证照信息录入区"> <Card title="证照信息录入区">
<Row gutter={24}> <Row gutter={24}>
<Col span={24}> <Col span={24}>
<FormItem label="主营类目" labelCol={{ span: 4 }}> <FormItem label="主营类目" labelCol={{ span: 4 }}>
{getFieldDecorator('mainCategoryId', { {getFieldDecorator('mainCategoryId', {
// rules: [{ required: true, message: '请选择主营类目!' }], rules: [{ required: true, message: '请选择主营类目!' }],
initialValue: businessInfo.mainCategoryId, initialValue: businessInfo.mainCategoryId,
})( })(
<Select> <Select
onChange={e => this.onMainCategory(e)}
showSearch
filterOption={(input, option) =>
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
{this.state.categoryList.map(item => ( {this.state.categoryList.map(item => (
<Option value={item.categoryId} key={item.categoryId}> <Option value={item.id} key={item.id}>
{item.categoryName} {item.name}
</Option> </Option>
))} ))}
</Select>, </Select>,
...@@ -526,7 +508,7 @@ class BusinessInfo extends Component { ...@@ -526,7 +508,7 @@ class BusinessInfo extends Component {
rules: [{ required: true, message: '请选择企业类型!' }], rules: [{ required: true, message: '请选择企业类型!' }],
initialValue: businessInfo.companyType, initialValue: businessInfo.companyType,
})( })(
<Radio.Group> <Radio.Group 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>
...@@ -553,14 +535,23 @@ class BusinessInfo extends Component { ...@@ -553,14 +535,23 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
<Col span={12}>
<Row>
<Col span={4} style={{ marginTop: '4px' }}>
{businessInfo.companyName && (
<Button onClick={this.setCompanyName}>修改</Button>
)}
</Col>
<Col span={12}> <Col span={12}>
<FormItem label="公司名称" labelCol={{ span: 8 }}> <FormItem label="公司名称" labelCol={{ span: 8 }}>
{getFieldDecorator('companyName', { {getFieldDecorator('companyName', {
rules: [{ required: true, message: '请输入公司名称!' }], rules: [{ required: true, message: '请输入公司名称!' }],
initialValue: businessInfo.companyName, initialValue: businessInfo.companyName,
})(<Input maxLength={50} />)} })(<Input maxLength={50} disabled={companyNamedis} />)}
</FormItem> </FormItem>
</Col> </Col>
</Row>
</Col>
<Col span={12}> <Col span={12}>
<FormItem label="统一社会信用代码" labelCol={{ span: 8 }}> <FormItem label="统一社会信用代码" labelCol={{ span: 8 }}>
{getFieldDecorator('socialCode', { {getFieldDecorator('socialCode', {
...@@ -569,6 +560,80 @@ class BusinessInfo extends Component { ...@@ -569,6 +560,80 @@ class BusinessInfo extends Component {
})(<Input maxLength={32} />)} })(<Input maxLength={32} />)}
</FormItem> </FormItem>
</Col> </Col>
{!companyNamedis && businessInfo.companyType && businessInfo.companyType !== 2 && (
<Col span={12}>
<FormItem label="工商局变更证明" labelCol={{ span: 8 }} wrapperCol={wrapperCol}>
{getFieldDecorator('icbProofImage', {
rules: [{ required: true, message: '请上传工商局变更证明!' }],
initialValue: businessInfo.icbProofImage,
})(
<Upload
{...uploadPropsFn.call(this, {
keyName: 'icbProofImage',
type: 3,
maxSize: 1024 * 200,
maxSizeMsg: '文件大小不能超过200K',
limit: 1,
})}
fileList={businessInfo.icbProofImage}
>
<UploadOutlined /> 上传文件
</Upload>,
)}
</FormItem>
</Col>
)}
{!companyNamedis && businessInfo.companyType && businessInfo.companyType === 2 && (
<Col span={12}>
<FormItem label="户口本本人页" labelCol={{ span: 8 }} wrapperCol={wrapperCol}>
{getFieldDecorator('householdRegisterImage', {
rules: [{ required: true, message: '请上传户口本本人页!' }],
initialValue: businessInfo.householdRegisterImage,
})(
<Upload
{...uploadPropsFn.call(this, {
keyName: 'householdRegisterImage',
type: 3,
maxSize: 1024 * 200,
maxSizeMsg: '文件大小不能超过200K',
limit: 1,
})}
fileList={businessInfo.householdRegisterImage}
>
<UploadOutlined /> 上传文件
</Upload>,
)}
</FormItem>
</Col>
)}
{((businessInfo.differentNameAuthorizationImage &&
businessInfo.differentNameAuthorizationImage.length) ||
!companyNamedis) && (
<Col span={24}>
<FormItem
label="非同名结算授权文件"
labelCol={{ span: 4 }}
wrapperCol={wrapperCol}
>
{getFieldDecorator('differentNameAuthorizationImage', {
initialValue: businessInfo.differentNameAuthorizationImage,
})(
<Upload
{...uploadPropsFn.call(this, {
keyName: 'differentNameAuthorizationImage',
type: 3,
maxSize: 1024 * 200,
maxSizeMsg: '文件大小不能超过200K',
limit: 1,
})}
fileList={businessInfo.differentNameAuthorizationImage}
>
<UploadOutlined /> 上传文件
</Upload>,
)}
</FormItem>
</Col>
)}
<Col span={24}> <Col span={24}>
<FormItem label="营业执照有效期" labelCol={{ span: 4 }}> <FormItem label="营业执照有效期" labelCol={{ span: 4 }}>
{getFieldDecorator('businessLicensePeriod', { {getFieldDecorator('businessLicensePeriod', {
...@@ -615,6 +680,39 @@ class BusinessInfo extends Component { ...@@ -615,6 +680,39 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
{+mainCategoryId === 301008 && (
<div>
<Col span={24}>
<FormItem label="授权品牌" labelCol={{ span: 4 }}>
{getFieldDecorator('brand', {
initialValue: businessInfo.brand,
})(<Input maxLength={32} />)}
</FormItem>
</Col>
<Col span={24}>
<FormItem
label="品牌经销商授权书"
labelCol={{ span: 4 }}
wrapperCol={wrapperCol}
>
{getFieldDecorator('brandCertificate', {
initialValue: businessInfo.brandCertificate,
})(
<Upload
{...uploadPropsFn.call(this, {
keyName: 'brandCertificate',
type: 3,
limit: 1,
})}
fileList={businessInfo.brandCertificate}
>
<UploadOutlined /> 上传文件
</Upload>,
)}
</FormItem>
</Col>
</div>
)}
</Row> </Row>
</Card> </Card>
<Card title="法人信息录入区"> <Card title="法人信息录入区">
...@@ -677,13 +775,29 @@ class BusinessInfo extends Component { ...@@ -677,13 +775,29 @@ class BusinessInfo extends Component {
</FormItem> </FormItem>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Row gutter={24}>
<Col span={18}>
<FormItem label="身份证有效期" labelCol={{ span: 8 }}> <FormItem label="身份证有效期" labelCol={{ span: 8 }}>
{getFieldDecorator('legalPerson', {
rules: [{ required: !checkboxDisabled, message: '请输入身份证有效期!' }],
initialValue: businessInfo.legalPerson,
})(<RangePicker disabled={checkboxDisabled} />)}
</FormItem>
</Col>
<Col span={6}>
<FormItem labelCol={{ span: 8 }}>
{getFieldDecorator('legalPersonPeriod', { {getFieldDecorator('legalPersonPeriod', {
rules: [{ required: true, message: '请输入身份证有效期!' }], initialValue: businessInfo.checked,
initialValue: businessInfo.legalPersonPeriod, })(
})(<RangePicker />)} <Checkbox Group className={styles.radio} onChange={this.oncheckedChange}>
长期
</Checkbox>,
)}
</FormItem> </FormItem>
</Col> </Col>
</Row>
</Col>
<Col span={12}> <Col span={12}>
<FormItem label="手机号" labelCol={{ span: 8 }}> <FormItem label="手机号" labelCol={{ span: 8 }}>
{getFieldDecorator('legalPersonPhone', { {getFieldDecorator('legalPersonPhone', {
...@@ -785,12 +899,19 @@ class BusinessInfo extends Component { ...@@ -785,12 +899,19 @@ class BusinessInfo extends Component {
</FormItem> </FormItem>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Row>
<Col span={4} style={{ marginTop: '4px' }}>
{businessInfo.companyName && (
<Button onClick={this.setBankAccount}>修改</Button>
)}
</Col>
<FormItem label="银行帐号" labelCol={{ span: 8 }}> <FormItem label="银行帐号" labelCol={{ span: 8 }}>
{getFieldDecorator('bankAccount', { {getFieldDecorator('bankAccount', {
rules: [{ required: true, message: '请输入银行帐号!' }], rules: [{ required: true, message: '请输入银行帐号!' }],
initialValue: businessInfo.bankAccount, initialValue: businessInfo.bankAccount,
})(<Input maxLength={20} />)} })(<Input maxLength={20} disabled={!bankAccounts} />)}
</FormItem> </FormItem>
</Row>
</Col> </Col>
<Col span={12}> <Col span={12}>
<FormItem label="联行号" labelCol={{ span: 8 }}> <FormItem label="联行号" labelCol={{ span: 8 }}>
...@@ -799,6 +920,34 @@ class BusinessInfo extends Component { ...@@ -799,6 +920,34 @@ class BusinessInfo extends Component {
})(<Input maxLength={50} />)} })(<Input maxLength={50} />)}
</FormItem> </FormItem>
</Col> </Col>
{((businessInfo.differentNameAuthorizationImage &&
businessInfo.differentNameAuthorizationImage.length) ||
bankAccounts) && (
<Col span={24}>
<FormItem
label="非同名结算授权文件"
labelCol={{ span: 4 }}
wrapperCol={wrapperCol}
>
{getFieldDecorator('differentNameAuthorizationImage', {
initialValue: businessInfo.differentNameAuthorizationImage,
})(
<Upload
{...uploadPropsFn.call(this, {
keyName: 'differentNameAuthorizationImage',
type: 3,
maxSize: 1024 * 200,
maxSizeMsg: '文件大小不能超过200K',
limit: 1,
})}
fileList={businessInfo.differentNameAuthorizationImage}
>
<UploadOutlined /> 上传文件
</Upload>,
)}
</FormItem>
</Col>
)}
</Row> </Row>
)} )}
{this.state.settlementType === 2 && ( {this.state.settlementType === 2 && (
...@@ -857,12 +1006,14 @@ class BusinessInfo extends Component { ...@@ -857,12 +1006,14 @@ class BusinessInfo extends Component {
</Row> </Row>
)} )}
</Card> </Card>
{/* 汽车301008 */}
{+mainCategoryId === 301008 && (
<Card title="其他信息"> <Card title="其他信息">
<Row gutter={24}> <Row gutter={24}>
<Col span={24}> <Col span={24}>
<FormItem label="礼包内容" labelCol={{ span: 4 }}> <FormItem label="礼包内容" labelCol={{ span: 4 }}>
{getFieldDecorator('giftPackageContent', { {getFieldDecorator('giftPackageContent', {
// rules: [{ required: true, message: '请输入礼包内容!' }], rules: [{ required: true, message: '请输入礼包内容!' }],
initialValue: businessInfo.giftPackageContent, initialValue: businessInfo.giftPackageContent,
})(<Input style={{ width: '50%' }} />)} })(<Input style={{ width: '50%' }} />)}
</FormItem> </FormItem>
...@@ -870,172 +1021,23 @@ class BusinessInfo extends Component { ...@@ -870,172 +1021,23 @@ class BusinessInfo extends Component {
<Col span={24}> <Col span={24}>
<FormItem label="邀请码" labelCol={{ span: 4 }}> <FormItem label="邀请码" labelCol={{ span: 4 }}>
{getFieldDecorator('invitationCode', { {getFieldDecorator('invitationCode', {
// rules: [{ required: true, message: '请输入礼包内容!' }], rules: [{ required: true, message: '请输入邀请码!' }],
initialValue: businessInfo.invitationCode, initialValue: businessInfo.invitationCode,
})(<Input style={{ width: '50%' }} />)} })(<Input style={{ width: '50%' }} />)}
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Card> </Card>
{this.state.type === infoTypeChecked && [
<Card title="信息审核区" key="checked">
<Row gutter={24}>
{businessInfo.applyType && (
<Col span={24}>
<FormItem label="上级节点" labelCol={{ span: 4 }} wrapperCol={wrapperCol}>
{applyTypeDesc[businessInfo.applyType] || ''}
{businessInfo.remark}
</FormItem>
</Col>
)}
<Col span={24}>
<FormItem label="审核结果" labelCol={{ span: 4 }} wrapperCol={wrapperCol}>
{getFieldDecorator('auditResult', {
rules: [{ required: true, message: '请选择审核结果!' }],
initialValue: businessInfo.auditResult,
})(
<Radio.Group onChange={this.onChangeAuditResult}>
<Radio value>通过</Radio>
<Radio value={false}>驳回</Radio>
</Radio.Group>,
)}
</FormItem>
</Col>
<Col span={24}>
<FormItem label="审核结果" labelCol={{ span: 4 }}>
{getFieldDecorator('auditRemark', {
rules: [{ required: true, message: '请输入审核结果!' }],
initialValue: businessInfo.auditRemark,
})(<Input maxLength={500} />)}
</FormItem>
</Col>
</Row>
</Card>,
this.state.visibleCalculate && (
<Card title="商户服务费率配置" key="set">
<Tabs defaultActiveKey={this.state.defaultType} onChange={this.onTabChange}>
{businessInfo.businessType.map((item, i) => (
<TabPane tab={item.name} key={item.key}>
<Row gutter={24}>
<Col span={12}>
<Form.Item label="商户编码">
<span>{businessInfo.id}</span>
</Form.Item>
<Form.Item label="商户类型" hidden>
{getFieldDecorator(`supplierRateDTOList[${i}]['businessType']`, {
initialValue: item.key,
})(<Input />)}
</Form.Item>
{/* <Form.Item label="供应商ID" hidden>
{getFieldDecorator(`supplierRateDTOList[${i}]['supplierId']`, {
initialValue: businessInfo.businessType[i].supplierId,
})(<Input />)}
</Form.Item>
<Form.Item label="费率ID" hidden>
{getFieldDecorator(`supplierRateDTOList[${i}]['id']`, {
initialValue: businessInfo.businessType[i].id,
})(<Input />)}
</Form.Item> */}
</Col>
<Col span={12}>
<Form.Item label="商户名称">
<span>{businessInfo.name}</span>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="计费类型">
{getFieldDecorator(`supplierRateDTOList[${i}]['calculateType']`, {
initialValue: businessInfo.businessType[i].calculateType,
rules: [{ required: true, message: '请选择计费类型!' }],
})(
<Select
placeholder="请选择"
disabled={!!item.id}
onChange={e => this.onChangeCalculateType(e, i)}
>
<Option value={1}>单笔百分比</Option>
{/* <Option value={2}>单笔固定值</Option> */}
</Select>,
)} )}
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label={this.state.calculateType[i] === 1 ? '百分比' : ''}>
{getFieldDecorator(`supplierRateDTOList[${i}]['calculateValue']`, {
initialValue: businessInfo.businessType[i].calculateValue,
rules: [
{ required: true, message: '请输入百分比!' },
// { min: 0, message: '最小0' },
// { max: 0.9999, message: '最大输入0.9999' },
{ validator: validNumber, message: '请输入0~0.9999之间的小数' },
],
})(
<Input
maxLength={6}
placeholder={
this.state.calculateType[i] === 1
? '0.1=10%,直接写小数形式即可'
: ''
}
/>,
)}
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="收取方式">
{getFieldDecorator(`supplierRateDTOList[${i}]['chargeMethod']`, {
initialValue: businessInfo.businessType[i].chargeMethod,
rules: [{ required: true, message: '请选择收取方式!' }],
})(
<Select placeholder="请选择" disabled={!!item.id}>
<Option value={1}>坐扣</Option>
</Select>,
)}
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="有效期">
{getFieldDecorator(`supplierRateDTOList[${i}]['ratedate']`, {
initialValue: businessInfo.businessType[i].ratedate,
rules: [{ required: true, message: '请选择有效期!' }],
})(
<RangePicker format="YYYY/MM/DD" disabledDate={this.disabledDate} />,
)}
</Form.Item>
</Col>
</Row>
</TabPane>
))}
</Tabs>
</Card>
),
]}
<div className={styles.formBtns}> <div className={styles.formBtns}>
<Row gutter={24}> <Row gutter={24}>
<Col span={4}></Col> <Col span={8}>
<Col span={20}> <Button type="primary" size="large" htmlType="submit" loading={this.state.loading}>
{!this.state.id || [infoTypeEdit, infoTypeChecked].includes(this.state.type) ? ( 修改并提交
<Button
type="primary"
size="large"
htmlType="submit"
loading={this.state.loading}
>
保存
</Button>
) : (
''
)}
{type === infoTypeRevision && (
<Button
type="primary"
size="large"
onClick={this.onRevision}
loading={this.state.loading}
>
保存
</Button> </Button>
)} </Col>
<Col span={12}>
<Button size="large" onClick={this.onCancel}> <Button size="large" onClick={this.onCancel}>
取消 取消
</Button> </Button>
......
...@@ -4,20 +4,20 @@ import config from '../../../config/env.config'; ...@@ -4,20 +4,20 @@ import config from '../../../config/env.config';
import qs from 'qs'; import qs from 'qs';
import { da } from 'date-fns/locale'; import { da } from 'date-fns/locale';
const { kdspApi } = config; const { kdspApi, goodsApi } = config;
// 获取地址 // 获取地址
export const apiAddrArea = params => export const apiAddrArea = params =>
request.post('/api/merchants/addresses/list', { request.get(`/api/merchants/addresses/list?${qs.stringify(params)}`, {
prefix: kdspApi, prefix: kdspApi,
data: params,
emulateJSON: true,
}); });
// 主营类目 // 主营类目
export const apiCategoryList = params => export async function apiCategoryList(param) {
request.post('/product/category/list', { prefix: kdspApi, params }); return request.post('/api/merchants/suppliers/main-category/list', {
data: param,
prefix: goodsApi,
});
}
// 服务设施 // 服务设施
export const apiServiceFacility = () => export const apiServiceFacility = () =>
request.get('/api/merchants/suppliers/facilities/list', { prefix: kdspApi }); request.get('/api/merchants/suppliers/facilities/list', { prefix: kdspApi });
...@@ -48,22 +48,14 @@ export async function uploadFile(files, imageType = 0) { ...@@ -48,22 +48,14 @@ export async function uploadFile(files, imageType = 0) {
return data; return data;
} }
// 新增商家端入驻申请
export const apiNewStoreInfo = params =>
request.post(`${kdspApi}/api/merchants/suppliers/register`, { prefix: kdspApi, data: params });
// 图片内容识别 // 图片内容识别
export const apiRecognize = params => export const apiRecognize = params =>
request.get(`/api/merchants/images/recognize?${qs.stringify(params)}`, { prefix: kdspApi }); request.get(`/api/merchants/images/recognize?${qs.stringify(params)}`, { prefix: kdspApi });
// 编辑商户信息 // 编辑商户信息
export const apiEditStoreInfo = params => export const apiEditStoreInfo = params =>
request.post(`${kdspApi}/api/merchants/suppliers/pops/edit`, { prefix: kdspApi, data: params }); request.post('/api/merchants/suppliers/edit', { prefix: kdspApi, data: params });
// 查询申请详情
export const apiApplyDetail = applyId =>
request.get(`${kdspApi}/api/merchants/suppliers/register/detail?applyId=${applyId}`);
// 查询商户详情 // 查询商户详情
export const apiBusinessDetail = businessId => export const apiBusinessDetail = businessId =>
request.get(`${kdspApi}/api/merchants/suppliers/pops/detail/${businessId}`); request.get('/api/merchants/suppliers/pops/detail', { prefix: kdspApi });
...@@ -4,7 +4,7 @@ import moment from 'moment'; ...@@ -4,7 +4,7 @@ import moment from 'moment';
import { PlusSquareFilled, MinusSquareFilled } from '@ant-design/icons'; import { PlusSquareFilled, MinusSquareFilled } from '@ant-design/icons';
import { Modal, Input, TimePicker, Checkbox, Cascader, Radio, notification } from 'antd'; import { Modal, Input, TimePicker, Checkbox, Cascader, Radio, notification } from 'antd';
import { apiAddrArea, apiCreatStore, apiEditStore } from '../services'; import { apiAddrArea, apiCreatStore, apiEditStore } from '../services';
import { weekOptions, weekDefault, layout } from '../data'; import { weekOptions, weekDefault, layout, businessModel } from '../data';
import MapModal from '@/components/GaoDeMap'; import MapModal from '@/components/GaoDeMap';
import style from './style.less'; import style from './style.less';
import { isCheckNumberLine } from '@/utils/validator'; import { isCheckNumberLine } from '@/utils/validator';
...@@ -19,6 +19,7 @@ const StoreModal = props => { ...@@ -19,6 +19,7 @@ const StoreModal = props => {
form: { getFieldDecorator, setFieldsValue, getFieldsValue, validateFields, resetFields }, form: { getFieldDecorator, setFieldsValue, getFieldsValue, validateFields, resetFields },
formInfo, formInfo,
status, status,
productBusiness,
} = props; } = props;
const [areaAddr, setAreaAddr] = useState([]); const [areaAddr, setAreaAddr] = useState([]);
const [visibleMap, setVisibleMap] = useState(false); const [visibleMap, setVisibleMap] = useState(false);
...@@ -29,12 +30,21 @@ const StoreModal = props => { ...@@ -29,12 +30,21 @@ const StoreModal = props => {
address: '', address: '',
}); });
const [disabled, setDisabled] = useState(false); const [disabled, setDisabled] = useState(false);
const [isDisabled, setIsDisabled] = useState(true);
const divDom = useRef(); const divDom = useRef();
useEffect(() => { useEffect(() => {
setDisabled(props.status); setDisabled(props.status);
}, [props.status]); }, [props.status]);
useEffect(() => {
if (props.productBusiness.length) {
const val = props.productBusiness.includes(2) || props.productBusiness.includes(3);
setIsDisabled(val);
}
}, [props.productBusiness]);
const handleCancel = isSuccess => { const handleCancel = isSuccess => {
resetFields(); resetFields();
onCancel(isSuccess); onCancel(isSuccess);
...@@ -49,6 +59,10 @@ const StoreModal = props => { ...@@ -49,6 +59,10 @@ const StoreModal = props => {
params[areaArr[i]] = item; params[areaArr[i]] = item;
}); });
} }
if (params.shopHeadImage.length) {
// eslint-disable-next-line prefer-destructuring
params.shopHeadImage = params.shopHeadImage[0];
}
if (params.lnglat) { if (params.lnglat) {
const arr = params.lnglat.split(','); const arr = params.lnglat.split(',');
if (arr.length === 2) { if (arr.length === 2) {
...@@ -223,9 +237,11 @@ const StoreModal = props => { ...@@ -223,9 +237,11 @@ const StoreModal = props => {
} }
info.lnglat = `${info.longitude},${info.latitude}`; info.lnglat = `${info.longitude},${info.latitude}`;
info.addr = [info.provinceId, info.cityId, info.countyId]; info.addr = [info.provinceId, info.cityId, info.countyId];
info.shopHeadImage = [info.shopHeadImage] || [];
if (info.townId) { if (info.townId) {
info.addr.push(info.townId); info.addr.push(info.townId);
} }
console.log(info);
setTimes(harr); setTimes(harr);
setFormData(info); setFormData(info);
getLazyAddr(info); getLazyAddr(info);
...@@ -242,21 +258,28 @@ const StoreModal = props => { ...@@ -242,21 +258,28 @@ const StoreModal = props => {
<Modal <Modal
title="门店信息" title="门店信息"
visible={visible} visible={visible}
width="800px" width="1000px"
destroyOnClose destroyOnClose
maskClosable={false} maskClosable={false}
onOk={() => onSubmit()} onOk={() => onSubmit()}
onCancel={() => handleCancel()} onCancel={() => handleCancel()}
> >
<Form {...layout} name="formData"> <Form {...layout} name="formData">
<FormItem label="业务模式">
{getFieldDecorator('productBusiness', {
initialValue: productBusiness,
})(<Checkbox.Group disabled options={businessModel} />)}
</FormItem>
{isDisabled && (
<FormItem label="门店头像"> <FormItem label="门店头像">
{getFieldDecorator('supplement', { {getFieldDecorator('shopHeadImage', {
rules: [{ required: true, message: '请上传门店头像' }], rules: [{ required: true, message: '请上传门店头像' }],
initialValue: formData.shopHeadImage || [], initialValue: formData.shopHeadImage || [],
valuePropName: 'fileList', valuePropName: 'fileList',
getValueFromEvent: normFile, getValueFromEvent: normFile,
})(<Upload max={1} accept=".jpg,.png,.jpeg" disabled={disabled} />)} })(<Upload max={1} accept=".jpg,.png,.jpeg" disabled={disabled} />)}
</FormItem> </FormItem>
)}
<FormItem <FormItem
label="门店名称" label="门店名称"
name="name" name="name"
...@@ -366,11 +389,13 @@ const StoreModal = props => { ...@@ -366,11 +389,13 @@ const StoreModal = props => {
</Radio.Group>, </Radio.Group>,
)} )}
</FormItem> </FormItem>
{isDisabled && (
<FormItem label="门店公告"> <FormItem label="门店公告">
{getFieldDecorator('publicNotice', { {getFieldDecorator('publicNotice', {
initialValue: formData.publicNotice, initialValue: formData.publicNotice,
})(<Input placeholder="请输入门店公告" maxLength={120} disabled={disabled} />)} })(<Input placeholder="请输入门店公告" maxLength={120} disabled={disabled} />)}
</FormItem> </FormItem>
)}
</Form> </Form>
<MapModal <MapModal
visible={visibleMap} visible={visibleMap}
......
...@@ -17,3 +17,10 @@ export const layout = { ...@@ -17,3 +17,10 @@ export const layout = {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
}; };
// 业务模式
export const businessModel = [
{ label: '到家外卖业务(外卖配送业务)', value: 1 },
{ label: '实物商品业务员', value: 2 },
{ label: '到店业务(服务类业务)', value: 3 },
];
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
} from 'antd'; } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { el } from 'date-fns/locale'; import { el } from 'date-fns/locale';
import { searchList, apiEnableStore, apiAddrArea } from './services'; import { searchList, apiEnableStore, apiAddrArea, apiproductBusiness } from './services';
import { stateDesc, weeks, layout } from './data'; import { stateDesc, weeks, layout } from './data';
import StoreModal from './components/storeModal'; import StoreModal from './components/storeModal';
import style from './style.less'; import style from './style.less';
...@@ -28,18 +28,26 @@ export default () => { ...@@ -28,18 +28,26 @@ export default () => {
const [pageNo, setPageNo] = useState(1); const [pageNo, setPageNo] = useState(1);
const [totalNum, setTotalNum] = useState(0); const [totalNum, setTotalNum] = useState(0);
const [pageSize, setPageSize] = useState(20); const [pageSize, setPageSize] = useState(20);
const [productBusiness, setProductBusiness] = useState([]);
const refSearch = useRef(); const refSearch = useRef();
const divDom = useRef(); const divDom = useRef();
// 获取业务模式
const getBusiness = async () => {
const res = await apiproductBusiness();
setProductBusiness(res);
};
const onCreate = () => { const onCreate = () => {
setStoreInfo({}); setStoreInfo({});
setVisible(true); setVisible(true);
getBusiness();
}; };
const onShowInfo = (info, val) => { const onShowInfo = (info, val) => {
setStoreInfo(info); setStoreInfo(info);
const value = val !== 'edit'; const value = val !== 'edit';
console.log(value);
setStatus(value); setStatus(value);
setVisible(true); setVisible(true);
getBusiness();
}; };
// 获取市区街道 // 获取市区街道
...@@ -115,6 +123,7 @@ export default () => { ...@@ -115,6 +123,7 @@ export default () => {
if (isReload) { if (isReload) {
onSearch(refSearch.current?.getFieldValue?.() || {}); onSearch(refSearch.current?.getFieldValue?.() || {});
} }
setStatus(false);
setStoreInfo({}); setStoreInfo({});
setVisible(false); setVisible(false);
}; };
...@@ -336,7 +345,13 @@ export default () => { ...@@ -336,7 +345,13 @@ export default () => {
/> />
</div> </div>
) : null} ) : null}
<StoreModal visible={visible} onCancel={closeModal} formInfo={storeInfo} status={status} /> <StoreModal
visible={visible}
onCancel={closeModal}
formInfo={storeInfo}
status={status}
productBusiness={productBusiness}
/>
</div> </div>
); );
}; };
...@@ -65,3 +65,11 @@ export async function apiEditStore(params) { ...@@ -65,3 +65,11 @@ export async function apiEditStore(params) {
}); });
return data.businessCode; return data.businessCode;
} }
// 获取商户业务模式
export async function apiproductBusiness() {
const data = await request.get('/api/merchants/suppliers/product-business/list', {
prefix: kdspApi,
});
return data.data;
}
...@@ -29,13 +29,14 @@ class PicturesWall extends React.Component { ...@@ -29,13 +29,14 @@ class PicturesWall extends React.Component {
token = await qiniuToken(); token = await qiniuToken();
} }
componentWillReceiveProps(nextProps) { static getDerivedStateFromProps(nextProps) {
this.initFileList(nextProps.fileList || []); new PicturesWall(nextProps).initFileList();
return null;
} }
initFileList = fileList => { initFileList = fileList => {
const fileLists = const fileLists =
fileList.map((item, index) => ({ fileList?.map((item, index) => ({
url: item, url: item,
name: '', name: '',
uid: index, uid: index,
......
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { notification, Button } from 'antd'; import { notification, Button, Modal, Image } from 'antd';
import { query } from './services'; import { query } from './services';
const ContractView = () => { const ContractView = () => {
const [visible, setVisible] = useState(false);
const url =
'https://contract-test.q-gp.com/621-621T18364B279E2null.pdf?Expires=1679994655&OSSAccessKeyId=LTAI5tGV1jdSEBjuKDUYZVHY&Signature=nVC2YgG8t5DWZl6sMyRmCzeRYLw%3D';
// 查看 // 查看
const onLook = ({ contractPdfUrl }) => { const onLook = ({ contractPdfUrl }) => {
console.log(contractPdfUrl); setVisible(true);
// window.open(url)
}; };
// 下载 // 下载
const ondown = ({ contractPdfUrl }) => { const ondown = ({ contractPdfUrl }) => {
console.log(contractPdfUrl); window.open(url);
}; };
const columns = [ const columns = [
{ {
...@@ -76,6 +80,9 @@ const ContractView = () => { ...@@ -76,6 +80,9 @@ const ContractView = () => {
toolBarRender={false} toolBarRender={false}
scroll={{ x: '100%', y: 400 }} scroll={{ x: '100%', y: 400 }}
/> />
<Modal visible={visible} width="1000px" onCancel={() => setVisible(false)}>
<iframe src={url} height="500" width="95%" title="合同"></iframe>
</Modal>
</PageHeaderWrapper> </PageHeaderWrapper>
); );
}; };
......
...@@ -8,20 +8,20 @@ const { goodsApi } = config; ...@@ -8,20 +8,20 @@ const { goodsApi } = config;
// 分页查询所有数据 // 分页查询所有数据
export async function query(params) { export async function query(params) {
const param = { const param = {
pageNo: params.current || 1, ...params,
pageIndex: params.current,
pageSize: params.pageSize || 20, pageSize: params.pageSize || 20,
}; };
const data = await request.post('/api/kdsp/template/page', { const data = await request.post('/api/merchants/suppliers/contract/list', {
prefix: goodsApi, prefix: goodsApi,
data: stringify(_.omitBy(param, v => !v)), data: param,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/json;charset=UTF-8',
}, },
}); });
if (data.data) { if (data.data) {
return { return {
total: data.data.total, data: data.data,
data: data.data.forbiddenAreaTemplateList,
}; };
} }
return { return {
...@@ -29,41 +29,3 @@ export async function query(params) { ...@@ -29,41 +29,3 @@ export async function query(params) {
data: [], data: [],
}; };
} }
// 添加区域受限模板
export async function getAddTemplate(param) {
const data = await request.post('/api/kdsp/add/template', {
prefix: goodsApi,
data: param,
});
return data;
}
// 获取区域地址
export async function areaList(params) {
const { data } = await request.get('/api/merchants/addresses/list', {
prefix: goodsApi,
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
});
return data;
}
// 根据模板id查询受限区域
export async function forbiddenAddress(params) {
const data = await request.post('/api/kdsp/edit/template', {
prefix: goodsApi,
data: params,
});
return data;
}
// 根据模板id查询受限区域
export async function addressTree(params) {
const data = await request.post('/api/kdsp/forbidden/address', {
prefix: goodsApi,
params,
});
return data;
}
/* eslint-disable prefer-destructuring */
import { parse } from 'querystring'; import { parse } from 'querystring';
import pathRegexp from 'path-to-regexp'; import pathRegexp from 'path-to-regexp';
import moment from 'moment'; import moment from 'moment';
...@@ -131,6 +132,7 @@ export const getObjectType = v => Object.prototype.toString.call(v).replace(/\[o ...@@ -131,6 +132,7 @@ export const getObjectType = v => Object.prototype.toString.call(v).replace(/\[o
// 获取长表单错误提示 // 获取长表单错误提示
export const getErrorMessage = err => { export const getErrorMessage = err => {
const message = '请检查表单数据!'; const message = '请检查表单数据!';
// eslint-disable-next-line wrap-iife
// (function getMsg(v) { // (function getMsg(v) {
// if (Array.isArray(v)) { // if (Array.isArray(v)) {
// getMsg(v[0]); // getMsg(v[0]);
......
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