|
@@ -13,7 +13,9 @@ import {
|
|
Radio,
|
|
Radio,
|
|
Form,
|
|
Form,
|
|
Cascader,
|
|
Cascader,
|
|
|
|
+ Checkbox,
|
|
Tag,
|
|
Tag,
|
|
|
|
+ Row,Col,
|
|
InputNumber
|
|
InputNumber
|
|
} from 'antd';
|
|
} from 'antd';
|
|
import { citySelect } from '@/NewDicProvinceListAll';
|
|
import { citySelect } from '@/NewDicProvinceListAll';
|
|
@@ -151,6 +153,7 @@ const DemandDetailForm = Form.create()(
|
|
React.createClass({
|
|
React.createClass({
|
|
getInitialState() {
|
|
getInitialState() {
|
|
return {
|
|
return {
|
|
|
|
+ tagArr:[],
|
|
visible: false,
|
|
visible: false,
|
|
loading: false,
|
|
loading: false,
|
|
auditStatus: 0,
|
|
auditStatus: 0,
|
|
@@ -159,7 +162,7 @@ const DemandDetailForm = Form.create()(
|
|
pictureUrl: [],
|
|
pictureUrl: [],
|
|
orgCodeUrl: [],
|
|
orgCodeUrl: [],
|
|
companyLogoUrl: [],
|
|
companyLogoUrl: [],
|
|
- tags: []
|
|
|
|
|
|
+ tags: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//左侧图片地址
|
|
//左侧图片地址
|
|
@@ -240,11 +243,12 @@ const DemandDetailForm = Form.create()(
|
|
city: this.state.ProvinceCity ? this.state.ProvinceCity[1] : '',
|
|
city: this.state.ProvinceCity ? this.state.ProvinceCity[1] : '',
|
|
introduce: this.state.introduce,
|
|
introduce: this.state.introduce,
|
|
value: this.state.value,
|
|
value: this.state.value,
|
|
- tag:this.state.tags?this.state.tags.join(','):'',
|
|
|
|
|
|
+ // tag:this.state.tags?this.state.tags.join(','):'',
|
|
isHot: this.state.isHot,
|
|
isHot: this.state.isHot,
|
|
minImgUrl: minPictureUrl.length ? minPictureUrl : '',
|
|
minImgUrl: minPictureUrl.length ? minPictureUrl : '',
|
|
maxImgUrl: maxPictureUrl.length ? maxPictureUrl : '',
|
|
maxImgUrl: maxPictureUrl.length ? maxPictureUrl : '',
|
|
- applyConditions: this.state.applyConditions
|
|
|
|
|
|
+ applyConditions: this.state.applyConditions,
|
|
|
|
+ tags:this.state.tagArr.join(',')
|
|
}
|
|
}
|
|
}).done(
|
|
}).done(
|
|
function(data) {
|
|
function(data) {
|
|
@@ -289,11 +293,20 @@ const DemandDetailForm = Form.create()(
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ let tagFirst =thisdata.tags?thisdata.tags.split(','):[],tagTxt=[];
|
|
|
|
+ (this.props.tagList).map(item=>{
|
|
|
|
+ for(let j=0;j<tagFirst.length;j++){
|
|
|
|
+ if(item.id==tagFirst[j]){
|
|
|
|
+ tagTxt.push(item.name);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
this.setState({
|
|
this.setState({
|
|
id: thisdata.id, //业务名称
|
|
id: thisdata.id, //业务名称
|
|
name: thisdata.name, //业务名称
|
|
name: thisdata.name, //业务名称
|
|
- tags:thisdata.tag?thisdata.tag.split(','):[],
|
|
|
|
|
|
+ // tags:thisdata.tag?thisdata.tag.split(','):[],
|
|
|
|
+ tagTxt:tagTxt.join(' - '),
|
|
|
|
+ tagArr:tagFirst,
|
|
categoryId: categoryIdArr, //业务品类
|
|
categoryId: categoryIdArr, //业务品类
|
|
number: thisdata.number,
|
|
number: thisdata.number,
|
|
auditInfo:thisdata.auditInfo,
|
|
auditInfo:thisdata.auditInfo,
|
|
@@ -358,21 +371,64 @@ const DemandDetailForm = Form.create()(
|
|
this.loadData(this.props.data.id);
|
|
this.loadData(this.props.data.id);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ //标签
|
|
|
|
+ tagOk(){
|
|
|
|
+ this.setState({
|
|
|
|
+ visibleTag:false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ tagCancel(){
|
|
|
|
+ this.setState({
|
|
|
|
+ visibleTag:false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ selTag(){
|
|
|
|
+ this.setState({
|
|
|
|
+ visibleTag:true
|
|
|
|
+ })
|
|
|
|
+ this.state.tagArr=this.state.tagArr;
|
|
|
|
+ },
|
|
|
|
+ onChange(e){
|
|
|
|
+ this.setState({
|
|
|
|
+ tagArr:e
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ tagSubmit(e){
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ let tags =[];
|
|
|
|
+ (this.props.tagList).map(item=>{
|
|
|
|
+ for(let i=0;i<(this.state.tagArr).length;i++){
|
|
|
|
+ if(item.id==(this.state.tagArr[i])){
|
|
|
|
+ tags.push(item.name)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.tagCancel();
|
|
|
|
+ this.setState({
|
|
|
|
+ tagTxt:tags.join(' - ')
|
|
|
|
+ })
|
|
|
|
+ },
|
|
componentWillReceiveProps(nextProps) {
|
|
componentWillReceiveProps(nextProps) {
|
|
if (!this.props.visible && nextProps.visible) {
|
|
if (!this.props.visible && nextProps.visible) {
|
|
this.state.textFileList = [];
|
|
this.state.textFileList = [];
|
|
this.state.videoFileList = [];
|
|
this.state.videoFileList = [];
|
|
if (nextProps.data.id) {
|
|
if (nextProps.data.id) {
|
|
- this.loadData(nextProps.data.id);
|
|
|
|
|
|
+ this.loadData(nextProps.data.id);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
},
|
|
},
|
|
render() {
|
|
render() {
|
|
const FormItem = Form.Item;
|
|
const FormItem = Form.Item;
|
|
|
|
+ const formItemLayout = {
|
|
|
|
+ labelCol: { span: 6 },
|
|
|
|
+ wrapperCol: { span: 16 },
|
|
|
|
+ };
|
|
let categoryList = this.props.categoryList||[];
|
|
let categoryList = this.props.categoryList||[];
|
|
|
|
+ let plainOptions= this.props.tagList||[];
|
|
return (
|
|
return (
|
|
<div className="patent-desc">
|
|
<div className="patent-desc">
|
|
- <Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} id="demand-form">
|
|
|
|
|
|
+ <Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e)}} id="demand-form">
|
|
<Spin spinning={this.state.loading}>
|
|
<Spin spinning={this.state.loading}>
|
|
<div className="clearfix" style={{ paddingLeft: '86px' }}>
|
|
<div className="clearfix" style={{ paddingLeft: '86px' }}>
|
|
<FormItem
|
|
<FormItem
|
|
@@ -560,7 +616,7 @@ const DemandDetailForm = Form.create()(
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
- <FormItem
|
|
|
|
|
|
+ {/* <FormItem
|
|
labelCol={{ span: 4 }}
|
|
labelCol={{ span: 4 }}
|
|
wrapperCol={{ span: 18 }}
|
|
wrapperCol={{ span: 18 }}
|
|
label={<span><span></span>标签</span>} >
|
|
label={<span><span></span>标签</span>} >
|
|
@@ -568,6 +624,15 @@ const DemandDetailForm = Form.create()(
|
|
keyWordArr={this.state.tags}
|
|
keyWordArr={this.state.tags}
|
|
tagsArr={(e)=>{this.setState({tags:e})}}
|
|
tagsArr={(e)=>{this.setState({tags:e})}}
|
|
/>
|
|
/>
|
|
|
|
+ </FormItem> */}
|
|
|
|
+ <FormItem
|
|
|
|
+ labelCol={{ span: 4 }}
|
|
|
|
+ wrapperCol={{ span: 12 }}
|
|
|
|
+ label="标签">
|
|
|
|
+ <div>
|
|
|
|
+ <span style={{marginRight:10}}>{this.state.tagTxt}</span>
|
|
|
|
+ <Button onClick={this.selTag}>选择</Button>
|
|
|
|
+ </div>
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
@@ -693,6 +758,39 @@ const DemandDetailForm = Form.create()(
|
|
</Button>
|
|
</Button>
|
|
</Spin>
|
|
</Spin>
|
|
</Form>
|
|
</Form>
|
|
|
|
+ <Modal
|
|
|
|
+ maskClosable={false}
|
|
|
|
+ visible={this.state.visibleTag}
|
|
|
|
+ onOk={this.tagOk}
|
|
|
|
+ onCancel={this.tagCancel}
|
|
|
|
+ width="450px"
|
|
|
|
+ title="新建标签"
|
|
|
|
+ footer=""
|
|
|
|
+ >
|
|
|
|
+ <Form layout="horizontal" onSubmit={(e)=>{this.tagSubmit(e)}} id="demand-form">
|
|
|
|
+ <Form.Item {...formItemLayout} label={<span><strong style={{color:'#f00'}}> * </strong>标签</span>}>
|
|
|
|
+ <Checkbox.Group
|
|
|
|
+ value={this.state.tagArr}
|
|
|
|
+ onChange={this.onChange}>
|
|
|
|
+ <Row>
|
|
|
|
+ {plainOptions.map((item)=>{
|
|
|
|
+ return <Col span={8} key={item.id} ><Checkbox value={item.id}>{item.name}</Checkbox></Col>
|
|
|
|
+ })}
|
|
|
|
+ </Row>
|
|
|
|
+ </Checkbox.Group>
|
|
|
|
+ </Form.Item>
|
|
|
|
+ <div className="clearfix">
|
|
|
|
+ <Form.Item wrapperCol={{ span: 12, offset: 6 }}>
|
|
|
|
+ <Button className="set-submit" type="primary" htmlType="submit">
|
|
|
|
+ 保存
|
|
|
|
+ </Button>
|
|
|
|
+ <Button className="set-submit" type="ghost" onClick={this.tagCancel}>
|
|
|
|
+ 取消
|
|
|
|
+ </Button>
|
|
|
|
+ </Form.Item>
|
|
|
|
+ </div>
|
|
|
|
+ </Form>
|
|
|
|
+ </Modal>
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|