Commit 79830807 authored by guang.wu's avatar guang.wu

feat: 商家信息添加pop归属字段

parent 1ffd5540
...@@ -39,6 +39,9 @@ export const businessModel = [ ...@@ -39,6 +39,9 @@ export const businessModel = [
{ label: '到店业务(服务类业务)', value: 3 }, { label: '到店业务(服务类业务)', value: 3 },
]; ];
// POP归属
export const POPModel = [{ label: '自营店铺', value: 1 }, { label: '大兴吉石', value: 2 }];
export const signDateTypeList = [{ label: '自商品售卖起默认一年', value: 1 }]; export const signDateTypeList = [{ label: '自商品售卖起默认一年', value: 1 }];
export const legalPersonList = [{ label: '长期', value: '长期' }]; export const legalPersonList = [{ label: '长期', value: '长期' }];
......
...@@ -34,16 +34,14 @@ import { ...@@ -34,16 +34,14 @@ import {
businessTypeDesc, businessTypeDesc,
signDateTypeList, signDateTypeList,
legalPersonList, legalPersonList,
POPModel,
} from './data'; } from './data';
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 { apiCategoryList, apiEditStoreInfo, apiRecognize } from '../service'; import { apiCategoryList, apiEditStoreInfo, apiRecognize } from '../service';
const { Option } = Select; const { Option } = Select;
const { Item: FormItem } = Form; const { Item: FormItem } = Form;
const { RangePicker } = DatePicker;
const { TabPane } = Tabs;
const carID = 301008; // 汽车类商家 const carID = 301008; // 汽车类商家
const fileterBrandOptions = (input, options) => options.children.includes(input); const fileterBrandOptions = (input, options) => options.children.includes(input);
class BusinessInfo extends Component { class BusinessInfo extends Component {
...@@ -275,6 +273,24 @@ class BusinessInfo extends Component { ...@@ -275,6 +273,24 @@ class BusinessInfo extends Component {
}); });
}; };
// 切换POP归属
onChangePOPModel = e => {
this.setState(state => {
const { businessInfo } = state;
if (e && e.length < 2) {
businessInfo.channelId = e;
} else {
businessInfo.channelId = e.filter(item => !(businessInfo.channelId || []).includes(item));
}
this.props.form.setFieldsValue({
channelId: businessInfo.channelId,
});
return {
businessInfo,
};
});
};
/* eslint-disable no-return-assign */ /* eslint-disable no-return-assign */
saveInputRef = input => (this.input = input); saveInputRef = input => (this.input = input);
...@@ -380,6 +396,20 @@ class BusinessInfo extends Component { ...@@ -380,6 +396,20 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
<Col span={24}>
<FormItem label="POP归属" labelCol={{ span: 4 }}>
{getFieldDecorator('channelId', {
rules: [{ required: true, message: '请选择POP归属!' }],
initialValue: businessInfo.channelId,
})(
<Checkbox.Group
options={POPModel}
onChange={e => this.onChangePOPModel(e)}
disabled={+mainCategoryId === carID || disabled}
/>,
)}
</FormItem>
</Col>
<Col span={24}> <Col span={24}>
<FormItem label="主营类目" labelCol={{ span: 4 }}> <FormItem label="主营类目" labelCol={{ span: 4 }}>
{getFieldDecorator('mainCategoryId', { {getFieldDecorator('mainCategoryId', {
......
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