|
@@ -52,33 +52,31 @@ const AchievementDetailForm = Form.create()(
|
|
|
message.warning("请选择渠道类别");
|
|
|
return false;
|
|
|
}
|
|
|
- if (values.channelType != 1) {
|
|
|
- if (!values.ProvinceCity[1]) {
|
|
|
- message.warning("请选择地区");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (/.*[\u4e00-\u9fa5]+.*$/.test(values.contacts)) {
|
|
|
- } else {
|
|
|
- message.error("请填写正确的联系人,且至少包含一个汉字");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (values.contacts.length > 32) {
|
|
|
- message.warning("联系人字数不超过32个");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (/.*[\u4e00-\u9fa5]+.*$/.test(values.position)) {
|
|
|
- } else {
|
|
|
- message.error("请填写正确的职位,且至少包含一个汉字");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (values.contactMobile.length > 13) {
|
|
|
- message.warning("联系电话字数不超过13个");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (values.introduction.length === 0) {
|
|
|
- message.warning("请填写渠道简介");
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if (!values.ProvinceCity[1]) {
|
|
|
+ message.warning("请选择地区");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (/.*[\u4e00-\u9fa5]+.*$/.test(values.contacts)) {
|
|
|
+ } else {
|
|
|
+ message.error("请填写正确的联系人,且至少包含一个汉字");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (values.contacts.length > 32) {
|
|
|
+ message.warning("联系人字数不超过32个");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (/.*[\u4e00-\u9fa5]+.*$/.test(values.position)) {
|
|
|
+ } else {
|
|
|
+ message.error("请填写正确的职位,且至少包含一个汉字");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (values.contactMobile.length > 13) {
|
|
|
+ message.warning("请填写正确的联系电话");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (values.introduction.length === 0) {
|
|
|
+ message.warning("请填写渠道简介");
|
|
|
+ return false;
|
|
|
}
|
|
|
// let arr = [];
|
|
|
// for (let i of this.state.selectCooperationProjects) {
|
|
@@ -88,22 +86,18 @@ const AchievementDetailForm = Form.create()(
|
|
|
this.setState({
|
|
|
loading: true,
|
|
|
});
|
|
|
- let info = values.channelType != 1 ?
|
|
|
- {
|
|
|
- name: values.name,
|
|
|
- channelType: values.channelType,
|
|
|
- province: values.ProvinceCity[0], //省
|
|
|
- city: values.ProvinceCity[1], //市
|
|
|
- area: values.ProvinceCity[2], //区
|
|
|
- contacts: values.contacts,
|
|
|
- position: values.position,
|
|
|
- contactMobile: values.contactMobile,
|
|
|
- introduction: values.introduction,
|
|
|
- } :
|
|
|
- {
|
|
|
- name: values.name,
|
|
|
- channelType: values.channelType,
|
|
|
- }
|
|
|
+ let info =
|
|
|
+ {
|
|
|
+ name: values.name,
|
|
|
+ channelType: values.channelType,
|
|
|
+ province: values.ProvinceCity[0], //省
|
|
|
+ city: values.ProvinceCity[1], //市
|
|
|
+ area: values.ProvinceCity[2], //区
|
|
|
+ contacts: values.contacts,
|
|
|
+ position: values.position,
|
|
|
+ contactMobile: values.contactMobile,
|
|
|
+ introduction: values.introduction,
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
@@ -363,7 +357,7 @@ const AchievementDetailForm = Form.create()(
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
{
|
|
|
- !!getFieldsValue().channelType && getFieldsValue().channelType != 1 &&
|
|
|
+ !!getFieldsValue().channelType &&
|
|
|
<div className="clearfix">
|
|
|
<FormItem {...formItemLayout} label="省-市-区">
|
|
|
{getFieldDecorator("ProvinceCity", {
|
|
@@ -376,7 +370,7 @@ const AchievementDetailForm = Form.create()(
|
|
|
</div>
|
|
|
}
|
|
|
{
|
|
|
- !!getFieldsValue().channelType && getFieldsValue().channelType != 1 &&
|
|
|
+ !!getFieldsValue().channelType &&
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|
|
|
className="mid-item"
|
|
@@ -391,7 +385,7 @@ const AchievementDetailForm = Form.create()(
|
|
|
</div>
|
|
|
}
|
|
|
{
|
|
|
- !!getFieldsValue().channelType && getFieldsValue().channelType != 1 &&
|
|
|
+ !!getFieldsValue().channelType &&
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|
|
|
className="mid-item"
|
|
@@ -406,7 +400,7 @@ const AchievementDetailForm = Form.create()(
|
|
|
</div>
|
|
|
}
|
|
|
{
|
|
|
- !!getFieldsValue().channelType && getFieldsValue().channelType != 1 &&
|
|
|
+ !!getFieldsValue().channelType &&
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|
|
|
className="mid-item"
|
|
@@ -423,7 +417,7 @@ const AchievementDetailForm = Form.create()(
|
|
|
</div>
|
|
|
}
|
|
|
{
|
|
|
- !!getFieldsValue().channelType && getFieldsValue().channelType != 1 &&
|
|
|
+ !!getFieldsValue().channelType &&
|
|
|
<div className="clearfix">
|
|
|
<FormItem
|
|
|
className="mid-item"
|