|
@@ -264,6 +264,22 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
//编辑部门,保存
|
|
|
edithandleSubmit(e){
|
|
|
e.preventDefault();
|
|
|
+ if(!this.state.name){
|
|
|
+ message.warning('请输入项目名称');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ if(this.state.categoryId>-1){
|
|
|
+ message.warning('请选择项目品类');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ if(!(this.state.ProvinceCity.length)){
|
|
|
+ message.warning('请选择省份');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ if(!(this.state.price)){
|
|
|
+ message.warning('请输入正确的市场价');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
this.setState({
|
|
|
loading:true
|
|
|
})
|
|
@@ -287,6 +303,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
});
|
|
|
maxPictureUrl = picArr.join(",");
|
|
|
};
|
|
|
+
|
|
|
$.ajax({
|
|
|
method: "post",
|
|
|
dataType: "json",
|
|
@@ -341,7 +358,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
} else {
|
|
|
let thisdata=data.data;
|
|
|
let ProvinceCityArr=[];
|
|
|
- ProvinceCityArr.push(thisdata.provice,thisdata.city)
|
|
|
+ ProvinceCityArr.push(thisdata.province,thisdata.city)
|
|
|
this.setState({
|
|
|
id:thisdata.id,//业务名称
|
|
|
name: thisdata.name,//业务名称
|
|
@@ -353,7 +370,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
offset:thisdata.offset,
|
|
|
activityPrice:thisdata.activityPrice,//活动价
|
|
|
activityFlag:thisdata.activityFlag?thisdata.activityFlag.toString():'',//活动生效标识
|
|
|
- provinceCity:ProvinceCityArr,
|
|
|
+ ProvinceCity:ProvinceCityArr,
|
|
|
introduce:thisdata.introduce,
|
|
|
createTime:thisdata.createTime?(new Date(thisdata.createTime)).toLocaleString():'',
|
|
|
value:thisdata.value,
|
|
@@ -396,7 +413,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
if(!this.state.addCid){
|
|
|
message.warning('请选择项目品类');
|
|
|
return false;
|
|
|
- }
|
|
|
+ }
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
@@ -522,7 +539,6 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
const hasSelected = this.state.selectedRowKeys.length > 0;
|
|
|
const { RangePicker } = DatePicker;
|
|
|
const categoryList = this.state.categoryList ||[];
|
|
|
-
|
|
|
return (
|
|
|
<div className="user-content" >
|
|
|
<div className="content-title">
|
|
@@ -633,36 +649,33 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
<FormItem className="half-item"
|
|
|
labelCol={{ span: 4 }}
|
|
|
wrapperCol={{ span: 12 }}
|
|
|
- label="项目名称" >
|
|
|
- <Input placeholder="项目名称" value={this.state.name} style={{width:'94%'}}
|
|
|
- onChange={(e)=>{this.setState({name:e.target.value})}} required="required"/>
|
|
|
- <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
|
|
|
+ label={<span><strong style={{color:'red'}}>*</strong>项目名称</span>} >
|
|
|
+ <Input placeholder="项目名称" value={this.state.name}
|
|
|
+ onChange={(e)=>{this.setState({name:e.target.value})}}/>
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
|
labelCol={{ span: 4 }}
|
|
|
wrapperCol={{ span: 12 }}
|
|
|
- label="业务品类"
|
|
|
+ label={<span><strong style={{color:'red'}}>*</strong>业务品类</span>}
|
|
|
>
|
|
|
<Select placeholder="请选择业务品类" value={this.state.categoryId} onChange={(e)=>{this.setState({categoryId:e})}}
|
|
|
- notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
|
|
|
+ notFoundContent="未获取到业务品类列表">
|
|
|
{
|
|
|
categoryList.map(function (item) {
|
|
|
return <Select.Option key={item.id} >{item.name}</Select.Option>
|
|
|
})
|
|
|
}
|
|
|
</Select>
|
|
|
- <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix" style={{paddingLeft:'60px'}}>
|
|
|
<FormItem className="half-item"
|
|
|
labelCol={{ span: 4 }}
|
|
|
wrapperCol={{ span: 12 }}
|
|
|
- label="省-市"
|
|
|
+ label={<span><strong style={{color:'red'}}>*</strong>省-市</span>}
|
|
|
>
|
|
|
- <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
|
|
|
+ <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市"
|
|
|
onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
|
|
|
- <span style={{color:'red',marginLeft:'5px'}}>*</span>
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
<div className="clearfix" style={{paddingLeft:'60px'}}>
|
|
@@ -672,7 +685,7 @@ const BusinessProject=Form.create()(React.createClass({
|
|
|
label={<span><strong style={{color:'red'}}>*</strong>市场价</span>}
|
|
|
>
|
|
|
<InputNumber placeholder="市场价" value={this.state.price} style={{width:120}}
|
|
|
- onChange={(e)=>{this.setState({price:e.target.value})}} required="required"/>
|
|
|
+ onChange={(e)=>{this.setState({price:e})}} required="required"/>
|
|
|
<span style={{marginLeft:10}}>万元</span>
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|