|
@@ -1,7 +1,8 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Modal, message, Spin, Input, Select, Button, Form ,Col} from 'antd';
|
|
|
+import { Icon, Modal, message, Spin, Input, Select, Button, Form ,Col,Cascader} from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
+import { citySelect, provinceList ,areaSelect} from '@/NewDicProvinceList';
|
|
|
import {socialAttribute,customerSource} from '@/dataDic.js';
|
|
|
const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
getInitialState() {
|
|
@@ -14,10 +15,15 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
handleSubmit(e) {
|
|
|
e.preventDefault();
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
+ console.log(values.ProvinceCity)
|
|
|
if(values.name.length>64){
|
|
|
message.warning('客户名称字数不超过64个')
|
|
|
return false;
|
|
|
};
|
|
|
+ if(!values.ProvinceCity[1]) {
|
|
|
+ message.warning('请选择地区');
|
|
|
+ return false;
|
|
|
+ };
|
|
|
if(values.content.length>32){
|
|
|
message.warning('联系人字数不超过32个')
|
|
|
return false;
|
|
@@ -41,6 +47,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
contactMobile:values.telnum,
|
|
|
societyTag:values.societyTagt,
|
|
|
source:values.customerSource,
|
|
|
+ province:(values.ProvinceCity)[0],//省
|
|
|
+ city:(values.ProvinceCity)[1],//市
|
|
|
+ area:(values.ProvinceCity)[2],//区
|
|
|
type:'1'
|
|
|
}
|
|
|
}).done(function (data) {
|
|
@@ -102,6 +111,19 @@ const AchievementDetailForm = Form.create()(React.createClass({
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="省-市-区"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('ProvinceCity', {
|
|
|
+ rules: [{ required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: this.state.ProvinceCity
|
|
|
+ })(
|
|
|
+ <Cascader options={areaSelect()} placeholder="选择城市" />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
<FormItem className="mid-item"
|
|
|
{...formItemLayout}
|
|
|
label="联系人" >
|
|
@@ -191,6 +213,10 @@ const AddPerson = Form.create()(React.createClass({
|
|
|
message.warning('联系人字数不超过64个')
|
|
|
return false;
|
|
|
};
|
|
|
+ if(!values.ProvinceCity[1]) {
|
|
|
+ message.warning('请选择地区');
|
|
|
+ return false;
|
|
|
+ };
|
|
|
if(values.telnums.length>13){
|
|
|
message.warning('电话号码字数不超过13个')
|
|
|
return false;
|
|
@@ -210,6 +236,9 @@ const AddPerson = Form.create()(React.createClass({
|
|
|
name: values.companyNamet,
|
|
|
contactMobile: values.telnums,
|
|
|
source:values.customerSource,
|
|
|
+ province:(values.ProvinceCity)[0],//省
|
|
|
+ city:(values.ProvinceCity)[1],//市
|
|
|
+ area:(values.ProvinceCity)[2],//区
|
|
|
type:'0'
|
|
|
}
|
|
|
}).done(function (data) {
|
|
@@ -269,6 +298,19 @@ const AddPerson = Form.create()(React.createClass({
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="省-市-区"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('ProvinceCity', {
|
|
|
+ rules: [{ required: true, message: '此项为必填项!' }],
|
|
|
+ initialValue: this.state.ProvinceCity
|
|
|
+ })(
|
|
|
+ <Cascader options={areaSelect()} placeholder="选择城市" />
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div className="clearfix">
|
|
|
<FormItem className="mid-item"
|
|
|
{...formItemLayout}
|
|
|
label="联系电话" >
|