dengzhiguo 7 years ago
parent
commit
d57a5c16f4

+ 18 - 3
js/component/manageCenter/achievement/techAchievementDesc.jsx

@@ -1025,7 +1025,8 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         techPlanUrl: this.state.techPlanUrl,
                         businessPlanUrl: this.state.businessPlanUrl,
                         auditStatus: this.state.auditStatus,                       
-                        boutique: values.boutique, 
+                        boutique: values.boutique,
+                        internationalFlag:values.internationalFlag,
                         hot: values.hot,      
                         
                     }
@@ -1120,7 +1121,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
                                     {this.props.achievementCategoryOption}
                                 </Select>
                                 )}
-                        </FormItem>                                              
+                        </FormItem>                                            
                          <FormItem className="half-item"
                                 {...formItemLayout}
                                 label="精品成果" >
@@ -1148,7 +1149,9 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         {this.state.radios==true ? <FormItem
 	                        labelCol={{ span: 4 }}
 	                        wrapperCol={{ span: 18 }}
-	                        label="首页展示图片:" >
+	                        label="首页展示图片:" 
+                         	style={{display:'block'}}
+                            >
 	                        <PicturesWall
 	                            pictureSign="achievement_cover_picture"
 	                            fileList={this.getcoverImg}	                            
@@ -1179,6 +1182,18 @@ const AchievementDetailForm = Form.create()(React.createClass({
                                 label="审核状态" >
                                 <span>{getTechAuditStatus(theData.auditStatus)}</span>
                             </FormItem>
+                             <FormItem className="half-item"
+                                {...formItemLayout}
+                                label="是否国际" >
+                                {getFieldDecorator('internationalFlag', {
+                                    initialValue: theData.internationalFlag
+                                })(
+                                    <Radio.Group>
+                                        <Radio value="0">否</Radio>
+                                        <Radio value="1">是</Radio>
+                                    </Radio.Group>
+                                    )}
+                        	</FormItem>
                         </div>
                     </div>
                     <FormItem

+ 1 - 1
js/component/manageCenter/idea/leftTab.jsx

@@ -68,7 +68,7 @@ const LeftTab = React.createClass({
                         技淘动态
                     </Menu.Item>
                     <Menu.Item key="contact">
-                        政府往来
+                        交易问题
                     </Menu.Item>
                 </SubMenu>
                 <SubMenu key="sub3" title={<span>活动圈</span>}>

+ 25 - 33
js/component/manageCenter/set/business/businessCategory.jsx

@@ -20,7 +20,7 @@ const BusinessCategory=Form.create()(React.createClass({
             method: "post",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + '/open/api/admin/Varieties/vtList',
+            url: globalConfig.context + '/api/admin/Varieties/vtList',
             data: {
                 pageNo: pageNo || 1,
                 pageSize: this.state.pagination.pageSize,
@@ -118,7 +118,7 @@ const BusinessCategory=Form.create()(React.createClass({
                 method: "get",
                 dataType: "json",
                 crossDomain: false,
-                url: globalConfig.context + "/open/api/admin/Varieties/getSuperList",
+                url: globalConfig.context + "/api/admin/Varieties/getSuperList",
                 data:{
                   
                 },
@@ -159,19 +159,19 @@ const BusinessCategory=Form.create()(React.createClass({
     	//上级组织字典
         let nameText=this.state.SuperArr
         let superText=this.state.editSuperName;
-        //let superText=(this.state.editSuperId).length<=1?nameText[parseInt(this.state.editSuperId)].name:''
-    	let superOne=this.state.editDataSource[0].editSuperId;
+        let superIdText=this.state.editSuperId;
+    	let superOne=this.state.editDataSource[0].editSuperName;
     	let isStatus=this.state.editStatus;
     	if(isStatus==1){
     		if(confirm('是否要停用该品类?')){
     			if(!(superOne==superText)){
-		    		let changeSuper=nameText[parseInt(this.state.editSuperId)].name;
+		    		let changeSuper=nameText[parseInt(this.state.editSuperName)].id;
 		    		if(confirm('上级品类已修改,是否保存?')){
 			        $.ajax({
 			            method: "post",
 			            dataType: "json",
 			            crossDomain: false,
-			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            url:globalConfig.context + '/api/admin/Varieties/editVarieties',
 			            data:{
 			            	id:this.state.editId,//品类ID
 			            	cname:this.state.editName,//品类名称
@@ -185,7 +185,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            if (!data.error.length) {
 			                message.success('保存成功!'); 
 			                this.edithandleCancel();
-			                this.loadData(); 
+			                this.selectSuperId();
 			            } else {
 			                message.warning(data.error[0].message);
 			            }
@@ -197,11 +197,11 @@ const BusinessCategory=Form.create()(React.createClass({
 			            method: "post",
 			            dataType: "json",
 			            crossDomain: false,
-			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            url:globalConfig.context + '/api/admin/Varieties/editVarieties',
 			            data:{
 			            	id:this.state.editId,//品类ID
 			            	cname:this.state.editName,//品类名称
-			            	superId:superText,//上级品类
+			            	superId:superIdText,//上级品类
 			            	status:this.state.editStatus,//品类状态 
 			            }
 			        }).done(function (data) { 
@@ -211,7 +211,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            if (!data.error.length) {
 			                message.success('保存成功!'); 
 			                this.edithandleCancel();
-			                this.loadData(); 
+			               this.selectSuperId();
 			            } else {
 			                message.warning(data.error[0].message);
 			            }
@@ -220,13 +220,13 @@ const BusinessCategory=Form.create()(React.createClass({
     		}
     	}else{
     		if(!(superOne==superText)){
-		    		let changeSuper=nameText[parseInt(this.state.editSuperId)].name;
+		    		let changeSuper=nameText[parseInt(this.state.editSuperName)].id;
 		    		if(confirm('上级组织已修改,是否保存?')){
 			        $.ajax({
 			            method: "post",
 			            dataType: "json",
 			            crossDomain: false,
-			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            url:globalConfig.context + '/api/admin/Varieties/editVarieties',
 			            data:{
 			                id:this.state.editId,//品类ID
 			            	cname:this.state.editName,//品类名称
@@ -240,7 +240,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            if (!data.error.length) {
 			                message.success('保存成功!'); 
 			                this.edithandleCancel();
-			                this.loadData(); 
+			                this.selectSuperId();
 			            } else {
 			                message.warning(data.error[0].message);
 			            }
@@ -252,11 +252,11 @@ const BusinessCategory=Form.create()(React.createClass({
 			            method: "post",
 			            dataType: "json",
 			            crossDomain: false,
-			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            url:globalConfig.context + '/api/admin/Varieties/editVarieties',
 			            data:{
 			            	id:this.state.editId,//品类ID
 			            	cname:this.state.editName,//品类名称
-			            	superId:superText,//上级品类
+			            	superId:superIdText,//上级品类
 			            	status:this.state.editStatus,//品类状态 
 			            }
 			        }).done(function (data) { 
@@ -266,7 +266,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            if (!data.error.length) {
 			                message.success('保存成功!'); 
 			                this.edithandleCancel();
-			                this.loadData(); 
+			                this.selectSuperId();
 			            } else {
 			                message.warning(data.error[0].message);
 			            }
@@ -287,7 +287,7 @@ const BusinessCategory=Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context +"/open/api/admin/Varieties/detailVarieties" ,
+            url: globalConfig.context +"/api/admin/Varieties/detailVarieties" ,
             data: {
                id: record.id
             },
@@ -315,6 +315,7 @@ const BusinessCategory=Form.create()(React.createClass({
                      editName:thisdata.cname,//品类名称
                      editStatus:thisdata.status,//品类状态 
                      editSuperName:thisdata.superName,//上级品类
+                     editSuperId:thisdata.superId,//上级品类
                      editlayer:thisdata.layer,//品类层级
                      editCid: thisdata.cid,//品类编号
                      editCreateName:thisdata.createName,//创建人
@@ -351,7 +352,7 @@ const BusinessCategory=Form.create()(React.createClass({
                     method: "get",
                     dataType: "json",
                     crossDomain: false,
-                    url:globalConfig.context + '/open/api/admin/Varieties/addVarieties',
+                    url:globalConfig.context + '/api/admin/Varieties/addVarieties',
                     data:{
                     	cname:this.state.categoryName,//组织名称
                     	superId:superText,//上级组织
@@ -363,7 +364,7 @@ const BusinessCategory=Form.create()(React.createClass({
                     if (!data.error.length) {
                         message.success('新增品类成功!'); 
                         this.handleCancel();
-                        this.loadData(); 
+                        this.selectSuperId();
                     } else {
                         message.warning(data.error[0].message);
                     }
@@ -388,7 +389,7 @@ const BusinessCategory=Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/open/api/admin/Varieties/deleteState",
+            url: globalConfig.context + "/api/admin/Varieties/deleteState",
             data: {
                 id: deletedIds
             }
@@ -401,7 +402,7 @@ const BusinessCategory=Form.create()(React.createClass({
             } else {
                 message.warning(data.error[0].message);
             };
-            this.loadData();
+            this.selectSuperId();
         }.bind(this));
     },
     //整行停用
@@ -421,7 +422,7 @@ const BusinessCategory=Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/open/api/admin/Varieties/updateStatus",
+            url: globalConfig.context + "/api/admin/Varieties/updateStatus",
             data: {
                 id: deletedIds
             }
@@ -434,7 +435,7 @@ const BusinessCategory=Form.create()(React.createClass({
             } else {
                 message.warning(data.error[0].message);
             };
-            this.loadData();
+            this.selectSuperId();
         }.bind(this));
     },
     addClick() {
@@ -538,7 +539,7 @@ const BusinessCategory=Form.create()(React.createClass({
 		                    </Select>
 	                    </div>
 	                    <Button type="primary" className="addButton" onClick={this.addClick} style={{float:'right',marginRight:'200px'}}>新增品类<Icon type="plus" /></Button>
-	                	<Button type="primary" className="addButton" onClick={this.editClick}>编辑品类<Icon type="plus" /></Button>
+	                	
 	                </div>
 	                <div className="patent-table">
 	                    <Spin spinning={this.state.loading}>
@@ -591,15 +592,6 @@ const BusinessCategory=Form.create()(React.createClass({
 	                    </Modal>
                 	 </div>
                 	 
-                	 
-                	 editId: thisdata.id,//每一条记录的ID
-                     editName:thisdata.cname,//品类名称
-                     editStatus:thisdata.status,//品类状态 
-                     editSuperName:thisdata.superName,//上级品类
-                     editlayer:thisdata.layer,//品类层级
-                     editCid: thisdata.cid,//品类编号
-                     editCreateId:thisdata.createId,//创建人
-                     editTime:thisdata.createTime,//创建时间
                 	 <div className="patent-desc">
 	                    <Modal maskClosable={false} visible={this.state.editvisible}
 	                        onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}

+ 976 - 6
js/component/manageCenter/set/business/businessProject.jsx

@@ -2,13 +2,983 @@ import React from 'react';
 import ReactDom from 'react-dom';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
-import {Form} from 'antd';
+import moment from 'moment';
+import '../content.less';
+import { citySelect,provinceList,areaSelect,provinceSelect} from '../../../NewDicProvinceList';
+import { Form,Radio, Icon, Button, Input,Tabs, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,TimePicker,Cascader } from 'antd';
+import {categoryState,industry,conditionOrganization} from '../../../dataDic.js';
+import {getCategoryState} from '../../../tools.js';
+const TabPane = Tabs.TabPane;
+//图片组件
+const PicturesWall = React.createClass({
+    getInitialState() {
+        return {
+            previewVisible: false,
+            previewImage: '',
+            fileList: [],
+        }
+    },
+    handleCancel() {
+        this.setState({ previewVisible: false })
+    },
+    handlePreview(file) {
+        this.setState({
+            previewImage: file.url || file.thumbUrl,
+            previewVisible: true,
+        });
+    },
+    handleChange(info) {
+        let fileList = info.fileList;
+        this.setState({ fileList });
+        this.props.fileList(fileList);
+    },
+    componentWillReceiveProps(nextProps) {
+        this.state.fileList = nextProps.pictureUrl; 
+    },
+    render() {
+        const { previewVisible, previewImage, fileList } = this.state;
+        const uploadButton = (
+            <div>
+                <Icon type="plus" />
+                <div className="ant-upload-text">点击上传</div>
+            </div>
+        );
+        return (
+            <div style={{display:"inline-block"}}>
+                <Upload
+                    action={globalConfig.context + "/api/admin/customer/attachmentUpload"}
+                    data={{ 'sign': this.props.pictureSign }}
+                    listType="picture-card"
+                    fileList={fileList}
+                    onPreview={this.handlePreview}
+                    onChange={this.handleChange} >
+                    {fileList.length >= 5 ? null : uploadButton}
+                </Upload>
+                <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
+                    <img alt="example" style={{ width: '100%' }} src={previewImage} />
+                </Modal>
+            </div>
+        );
+    }
+});
+//主体
 const BusinessProject=Form.create()(React.createClass({
-	render(){
-		return (
-			<div>用户管理</div>
-		)
-	}
+	//搜索功能和初始列表加载
+	loadData(pageNo, apiUrl) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        let nameText=this.state.SuperArr;
+		let superText=(this.state.superId)?nameText[parseInt(this.state.superId)].id:"";
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/open/api/admin/Varieties/vtList',
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                cname:this.state.cname, //品类名称
+                superId:superText,//上级品类编号
+                layer:this.state.layer,//组织层级
+                status:this.state.status,//品类状态
+            },
+            success: function (data) {
+                let theArr = [];
+                if (!data.data || !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.list.length; i++) {
+                    	let thisdata = data.data.list[i];
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,//品类ID
+                            cid: thisdata.cid,//品类编号
+                            cname: thisdata.cname,//品类名称
+                            layer: thisdata.layer,//品类层级
+                            superName: thisdata.superName,//上级品类
+                            status: thisdata.status,//上级品类状态
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    getInitialState() {
+        return {
+            searchMore: true,
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            columns: [
+                {
+                    title: '品类名称',
+                    dataIndex: 'cid',
+                    key: 'cid',
+                }, {
+                    title: '业务品类',
+                    dataIndex: 'cname',
+                    key: 'cname',
+                },  {
+                    title: '业务地区',
+                    dataIndex: 'layer',
+                    key: 'layer',
+                    //render: text => { return getAchievementCategory(text); }
+                }, {
+                    title: '市场价',
+                    dataIndex: 'superName',
+                    key: 'superName',
+                }, {
+                    title: '最低折扣',
+                    dataIndex: 'superName1',
+                    key: 'superName1',
+                }, {
+                    title: '会员价',
+                    dataIndex: 'superName2',
+                    key: 'superName2',
+                }, {
+                    title: '活动价',
+                    dataIndex: 'superName3',
+                    key: 'superName3',
+                }, {
+                    title: '活动生效标识',
+                    dataIndex: 'superName4',
+                    key: 'superName4',
+                },{
+                    title: '业务状态',
+                    dataIndex: 'status',
+                    key: 'status',
+                    render: text => { return getCategoryState(text) }
+                }
+            ],
+            dataSource: [],
+        };
+    },
+    componentWillMount() {
+       this.selectSuperId();
+    },
+    //获取上级品类
+    selectSuperId() {  
+    	this.state.data = []
+         $.ajax({
+                method: "get",
+                dataType: "json",
+                crossDomain: false,
+                url: globalConfig.context + "/open/api/admin/Varieties/getSuperList",
+                data:{
+                  
+                },
+                success: function (data) { 
+                		let theArr = [];
+					    let thedata=data.data;
+					    if (!thedata) {
+		                    if (data.error && data.error.length) {
+		                        message.warning(data.error[0].message);
+		                    };	
+		                    thedata = {}; 
+		              };   
+					    var contactIds=[];
+				        //for (let item in data.data) {
+				        	for(var i=0;i<data.data.length;i++){
+		                    let theData = data.data[i];
+		                    theArr.push(
+		                        <Select.Option value={i.toString()} key={theData.cname}>{theData.cname}</Select.Option>
+		                    );
+		                };
+						this.setState({	
+							SuperArr:thedata,
+		                    contactsOption: theArr, 
+		                    orderStatusOptions:data.data,
+	                    });
+	                    
+					}.bind(this),
+				}).always(function () {
+				this.loadData();
+	            this.setState({
+	                loading: false
+	            });
+	        }.bind(this));
+	},
+	//编辑部门,保存
+    edithandleSubmit(e){
+    	e.preventDefault();	
+    	//上级组织字典
+        let nameText=this.state.SuperArr
+        let superText=this.state.editSuperName;
+        let superIdText=this.state.editSuperId;
+    	let superOne=this.state.editDataSource[0].editSuperName;
+    	let isStatus=this.state.editStatus;
+    	if(isStatus==1){
+    		if(confirm('是否要停用该品类?')){
+    			if(!(superOne==superText)){
+		    		let changeSuper=nameText[parseInt(this.state.editSuperName)].id;
+		    		if(confirm('上级品类已修改,是否保存?')){
+			        $.ajax({
+			            method: "post",
+			            dataType: "json",
+			            crossDomain: false,
+			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            data:{
+			            	id:this.state.editId,//品类ID
+			            	cname:this.state.editName,//品类名称
+			            	superId:changeSuper,//上级品类
+			            	status:this.state.editStatus,//品类状态 
+			            }
+			        }).done(function (data) { 
+			            this.setState({
+			                loading: false
+			            });
+			            if (!data.error.length) {
+			                message.success('保存成功!'); 
+			                this.edithandleCancel();
+			                this.selectSuperId();
+			            } else {
+			                message.warning(data.error[0].message);
+			            }
+			        }.bind(this));
+			        return false
+		        	}
+		    	}else {
+		        	$.ajax({
+			            method: "post",
+			            dataType: "json",
+			            crossDomain: false,
+			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            data:{
+			            	id:this.state.editId,//品类ID
+			            	cname:this.state.editName,//品类名称
+			            	superId:superIdText,//上级品类
+			            	status:this.state.editStatus,//品类状态 
+			            }
+			        }).done(function (data) { 
+			            this.setState({
+			                loading: false
+			            });
+			            if (!data.error.length) {
+			                message.success('保存成功!'); 
+			                this.edithandleCancel();
+			               this.selectSuperId();
+			            } else {
+			                message.warning(data.error[0].message);
+			            }
+			        }.bind(this));
+		        } 	
+    		}
+    	}else{
+    		if(!(superOne==superText)){
+		    		let changeSuper=nameText[parseInt(this.state.editSuperName)].id;
+		    		if(confirm('上级组织已修改,是否保存?')){
+			        $.ajax({
+			            method: "post",
+			            dataType: "json",
+			            crossDomain: false,
+			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            data:{
+			                id:this.state.editId,//品类ID
+			            	cname:this.state.editName,//品类名称
+			            	superId:changeSuper,//上级品类
+			            	status:this.state.editStatus,//品类状态 
+			            }
+			        }).done(function (data) { 
+			            this.setState({
+			                loading: false
+			            });
+			            if (!data.error.length) {
+			                message.success('保存成功!'); 
+			                this.edithandleCancel();
+			                this.selectSuperId();
+			            } else {
+			                message.warning(data.error[0].message);
+			            }
+			        }.bind(this));
+			        return false
+		        	}
+		    	}else {
+		        	$.ajax({
+			            method: "post",
+			            dataType: "json",
+			            crossDomain: false,
+			            url:globalConfig.context + '/open/api/admin/Varieties/editVarieties',
+			            data:{
+			            	id:this.state.editId,//品类ID
+			            	cname:this.state.editName,//品类名称
+			            	superId:superIdText,//上级品类
+			            	status:this.state.editStatus,//品类状态 
+			            }
+			        }).done(function (data) { 
+			            this.setState({
+			                loading: false
+			            });
+			            if (!data.error.length) {
+			                message.success('保存成功!'); 
+			                this.edithandleCancel();
+			                this.selectSuperId();
+			            } else {
+			                message.warning(data.error[0].message);
+			            }
+			        }.bind(this));
+		        } 
+    	}
+    },  
+    //整行点击
+    tableRowClick(record, index) {
+    	this.selectSuperId();
+        this.state.RowData = record;
+        this.setState({
+            editvisible: true,
+            selectedRowKeys:[],
+        	rowId:record.businessId,
+        });
+         $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +"/open/api/admin/Varieties/detailVarieties" ,
+            data: {
+               id: record.id
+            },
+            success: function (data) {
+                let theArr = [];
+                let thisdata = data.data;
+                if (!data) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    theArr.push({
+                         editId: thisdata.id,//每一条记录的ID
+                         editName:thisdata.cname,//品类名称
+                         editStatus:thisdata.status,//品类状态 
+                         editSuperName:thisdata.superName,//上级品类
+                         editlayer:thisdata.layer,//品类层级
+                         editCid: thisdata.cid,//品类编号
+                         editCreateName:thisdata.createName,//创建人
+                         editTime:thisdata.createTime,//创建时间
+                    }); 
+                };
+                this.setState({
+                	 editId: thisdata.id,//每一条记录的ID
+                     editName:thisdata.cname,//品类名称
+                     editStatus:thisdata.status,//品类状态 
+                     editSuperName:thisdata.superName,//上级品类
+                     editSuperId:thisdata.superId,//上级品类
+                     editlayer:thisdata.layer,//品类层级
+                     editCid: thisdata.cid,//品类编号
+                     editCreateName:thisdata.createName,//创建人
+                     editTime:thisdata.createTime,//创建时间
+                     editDataSource: theArr,
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
+    //新增一个品类,保存
+    addhandleSubmit(e){
+    	e.preventDefault();	
+    	if(!this.state.categoryName){
+    		message.warning('请输入品类名称');
+    		return false;
+    	}
+    	if(!this.state.upCategory){
+    		message.warning('请选择上级品类');
+    		return false;
+    	}
+		this.props.form.validateFields((err, values) => {                                 
+            if (!err) {
+                this.setState({
+                    loading: true
+                }); 
+                //上级组织字典
+                let nameText=this.state.SuperArr;
+                let superText=nameText[parseInt(this.state.upCategory)].id;
+                $.ajax({
+                    method: "get",
+                    dataType: "json",
+                    crossDomain: false,
+                    url:globalConfig.context + '/open/api/admin/Varieties/addVarieties',
+                    data:{
+                    	cname:this.state.categoryName,//组织名称
+                    	superId:superText,//上级组织
+                    	}
+                }).done(function (data) { 
+                    this.setState({
+                        loading: false
+                    });
+                    if (!data.error.length) {
+                        message.success('新增品类成功!'); 
+                        this.handleCancel();
+                        this.selectSuperId();
+                    } else {
+                        message.warning(data.error[0].message);
+                    }
+                }.bind(this));
+            }
+        });
+    },
+    //整行删除
+    delectRow() {
+        let deletedIds = '';
+        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
+            let rowItem = this.state.selectedRows[idx];
+            if (rowItem.id) {
+                deletedIds=rowItem.id;
+            };
+        };
+        this.setState({
+            selectedRowKeys: [],
+            loading: deletedIds.length > 0
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/open/api/admin/Varieties/deleteState",
+            data: {
+                id: deletedIds
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('删除成功!');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.selectSuperId();
+        }.bind(this));
+    },
+    //整行停用
+    blockRow() {
+        let deletedIds = '';
+        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
+            let rowItem = this.state.selectedRows[idx];
+            if (rowItem.id) {
+                deletedIds=rowItem.id;
+            };
+        };
+        this.setState({
+            selectedRowKeys: [],
+            loading: deletedIds.length > 0
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/open/api/admin/Varieties/updateStatus",
+            data: {
+                id: deletedIds
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('该品类已成功停用!');
+                this.setState({
+                    loading: false,
+                });
+            } else {
+                message.warning(data.error[0].message);
+            };
+            this.selectSuperId();
+        }.bind(this));
+    },
+    addClick() {
+        this.state.RowData = {};
+        this.setState({
+            visible: true
+        });
+    },
+    editClick() {
+        this.state.RowData = {};
+        this.setState({
+            editvisible: true
+        });
+    },
+   	handleCancel() {
+        this.setState({ visible: false })
+    },
+    edithandleCancel() {
+        this.setState({ editvisible: false })
+    },
+    search() {
+        this.loadData();
+    },
+    reset() {
+        this.state.cname = '';//品类名称清零
+        this.state.layer = undefined;//品类层级清零
+        this.state.status = undefined;//品类状态清零
+        this.state.superId = undefined;//上级品类清零
+        this.loadData();       
+    },
+    //更多搜索的显示与否
+    searchSwitch() {
+        this.setState({
+            searchMore: !this.state.searchMore
+        });
+    },
+    //是否全国的显示与否
+    chinaSwitch() {
+        this.setState({
+            chinaMore: !this.state.chinaMore
+        });
+    },
+    tanSwitch() {
+        this.setState({
+            tanMore: !this.state.tanMore
+        });
+    },
+    render() {
+    	const FormItem = Form.Item
+        const rowSelection = {
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
+                });
+            }
+        };
+         const formItemLayout = {
+            labelCol: { span: 8 },
+            wrapperCol: { span: 14 },
+       };
+       	const { getFieldDecorator } = this.props.form;
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        const { RangePicker } = DatePicker;
+        
+        return (
+            <div className="user-content" >
+                <div className="content-title">
+	                <div className="user-search">
+	                    <Button type="primary" className="addButton" onClick={this.addClick} style={{float:'right',marginRight:'50px'}}>新增品类<Icon type="plus" /></Button>
+	                    <Input placeholder="业务项目名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
+	                        value={this.state.cname}
+	                        onChange={(e) => { this.setState({ cname: e.target.value }); }} />
+	                    <Select placeholder="业务品类"
+                            style={{ width:'200px',marginRight:'10px' }}
+                            value={this.state.superId}
+                            onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级品类列表">
+                            {this.state.contactsOption}
+		                </Select>
+	                    <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
+	                    <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
+                        <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
+						     <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
+	                   			 disabled={!hasSelected} 
+	                    		 >删除<Icon type="minus" />
+	           			     </Button>
+						</Popconfirm>
+						<Popconfirm title="是否停用?" onConfirm={this.blockRow} okText="是" cancelText="否">
+						     <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
+	                   			 disabled={!hasSelected} 
+	                    		 >停用<Icon type="minus" />
+	           			     </Button>
+						</Popconfirm>
+						<Button type="primary" className="addButton" onClick={this.editClick} style={{float:'right',marginRight:'50px'}}>编辑品类<Icon type="plus" /></Button>
+	                    <span style={{marginRight:'20px'}}>更多搜索    <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
+	                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {display: 'block'}}>
+	                    	<span style={{marginRight:'10px',marginBottom:'10px'}}>                   
+		                     	<Cascader options={citySelect()}  value={this.state.addressSearch} placeholder="选择城市"
+	    						onChange={(e,pre) => { this.setState({ addressSearch: e }) }} />	                 
+                    		</span>
+	                    	<span style={{marginRight:'10px'}}>
+		                     	<Cascader options={areaSelect()}  value={this.state.addressSearch} placeholder="选择地区"
+	    						onChange={(e,pre) => { this.setState({ addressSearch: e }) }} />	                 
+                    		</span>
+		                    <Select placeholder="活动生效标识"
+		                            style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
+		                            value={this.state.status}
+		                            onChange={(e) => { this.setState({ status: e }) }}>
+		                            <Select.Option value="0" >有效</Select.Option>
+		                            <Select.Option value="1" >无效</Select.Option>
+		                    </Select>
+		                    <Select placeholder="项目状态"
+		                            style={{width:'150px',marginRight:'10px'}}
+		                            value={this.state.status}
+		                            onChange={(e) => { this.setState({ status: e }) }}>
+		                            <Select.Option value="0" >正常</Select.Option>
+		                            <Select.Option value="1" >停用</Select.Option>
+		                    </Select>
+	                    </div>	
+	                </div>
+	                <div className="patent-table">
+	                    <Spin spinning={this.state.loading}>
+	                        <Table columns={this.state.columns}
+	                            dataSource={this.state.dataSource}
+	                            rowSelection={rowSelection}
+	                            pagination={this.state.pagination}
+	                            onRowClick={this.tableRowClick} />
+	                    </Spin>
+	                </div>
+	             
+	                 <div className="patent-desc">
+	                    <Modal maskClosable={false} visible={this.state.visible}
+	                        onOk={this.checkPatentProcess} onCancel={this.handleCancel}
+	                        width='400px'
+	                        title='新增业务项目'                       
+	                        footer=''
+	                        className="admin-desc-content">
+	                         <Form horizontal onSubmit={this.addhandleSubmit} id="demand-form">
+				                <Spin spinning={this.state.loading}>
+				                    <div className="clearfix">
+				                    	<FormItem className="half-item"
+					                            labelCol={{ span: 7 }}
+					                        	wrapperCol={{ span: 12 }}
+					                            label="业务项目名称" >
+				                    	     <Input placeholder="业务项目名称" value={this.state.categoryName} style={{width:'94%'}}
+				                                onChange={(e)=>{this.setState({categoryName:e.target.value})}} required="required"/>
+				                           		<span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
+					                    </FormItem>
+				                    </div>
+				                    <div className="clearfix">
+					                    <FormItem  
+					                    	labelCol={{ span: 7 }}
+					                        wrapperCol={{ span: 12 }}
+				                           label="业务品类"
+			                               > 
+			                                <Select placeholder="请选择业务品类" value={this.state.upCategory} onChange={(e)=>{this.setState({upCategory:e})}}
+				                                notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
+				                                {this.state.contactsOption}
+				                            </Select> 
+				                            <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
+			                   		    </FormItem>
+		                   		    </div>
+		                   		    <div className="clearfix">
+		                   		    <FormItem 
+						                    labelCol={{ span: 7 }}
+						                    wrapperCol={{ span: 12 }}
+						                    label="是否全国"
+					                        >
+		                   		    	<span style={{marginRight:'20px'}}><Switch defaultChecked={false} onChange={this.chinaSwitch} /></span>
+	                    			</FormItem>
+	                    			</div>
+	                    			<div className="search-more" style={this.state.chinaMore ? { display: 'none' } : {display: 'block'}}>
+			                   		    <div className="clearfix">
+				                   		    <FormItem className="half-item" 
+						                           labelCol={{ span: 7 }}
+						                           wrapperCol={{ span: 12 }}
+						                           label="省"
+						                          > 
+						                            <Cascader options={provinceSelect()}  value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
+													onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
+													<span style={{color:'red',marginLeft:'5px'}}>*</span>
+								            </FormItem>
+							             </div>
+							             <div className="clearfix">
+				                   		    <FormItem className="half-item" 
+						                           labelCol={{ span: 7 }}
+						                           wrapperCol={{ span: 12 }}
+						                           label="省-市"
+						                          > 
+						                            <Cascader options={citySelect()}  value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
+													onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
+													<span style={{color:'red',marginLeft:'5px'}}>*</span>
+								            </FormItem>
+							             </div>
+							             <div className="clearfix">
+				                   		    <FormItem className="half-item" 
+						                           labelCol={{ span: 7 }}
+						                           wrapperCol={{ span: 12 }}
+						                           label="省-市-区"
+						                          > 
+						                            <Cascader options={areaSelect()}  value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
+													onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
+													<span style={{color:'red',marginLeft:'5px'}}>*</span>
+								            </FormItem>
+							             </div>
+						             </div>
+				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
+				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
+				                        <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'50px'}}>取消</Button>
+				                    </FormItem> 
+				                </Spin>
+				            </Form >
+	                    </Modal>
+                	 </div>
+                	 
+            	 <div className="patent-desc">
+                 <Modal	
+				      className="customeDetails"				      
+			          title="业务项目"
+			          width='1200px'
+			          visible={this.state.editvisible}
+			          onOk={this.detailsModal}
+			          onCancel={this.detailsModal}
+			          footer=''
+			        >				    
+				     <Tabs defaultActiveKey="1" onChange={this.callback}>
+					    <TabPane tab="业务项目基本资料" key="1">
+					        <Form horizontal onSubmit={this.newSubmit} id="demand-form">
+				                <Spin spinning={this.state.loading}>
+					               	<div className="clearfix" style={{paddingLeft:'60px'}}>
+				                    	<FormItem className="half-item"
+					                            labelCol={{ span: 4 }}
+					                        	wrapperCol={{ span: 12 }}
+					                            label="业务项目名称" >
+				                    	     <Input placeholder="业务项目名称" value={this.state.categoryName} style={{width:'94%'}}
+				                                onChange={(e)=>{this.setState({categoryName:e.target.value})}} required="required"/>
+				                           		<span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
+					                    </FormItem>
+					                    <FormItem  className="half-item"
+					                    	labelCol={{ span: 4 }}
+					                        wrapperCol={{ span: 12 }}
+				                           label="业务品类"
+			                               > 
+			                                <Select placeholder="请选择业务品类" value={this.state.upCategory} onChange={(e)=>{this.setState({upCategory:e})}}
+				                                notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
+				                                {this.state.contactsOption}
+				                            </Select> 
+				                            <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
+			                   		    </FormItem>
+		                   		    </div>
+		                   		    <div className="clearfix" style={{paddingLeft:'60px'}}>
+			                   		    <FormItem 
+							                    labelCol={{ span: 4 }}
+							                    wrapperCol={{ span: 12 }}
+							                    label="是否全国"
+						                        >
+			                   		    	<span><Switch defaultChecked={false} onChange={this.tanSwitch} /></span>
+		                    			</FormItem>
+	                    			</div>
+	                    			<div className="search-more" style={this.state.tanMore ? { display: 'none' } : {display: 'block'}}>
+			                   		      <div className="clearfix" style={{paddingLeft:'60px'}}>
+				                   		     <FormItem className="half-item"
+							                           labelCol={{ span: 4 }}
+							                           wrapperCol={{ span: 12 }}
+							                           label="省"
+							                          > 
+							                            <Cascader options={provinceSelect()}  value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
+														onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
+														<span style={{color:'red',marginLeft:'5px'}}>*</span>
+									         </FormItem>
+				                   		    <FormItem className="half-item" 
+						                           labelCol={{ span: 4 }}
+						                           wrapperCol={{ span: 12 }}
+						                           label="省-市"
+						                          > 
+						                            <Cascader options={citySelect()}  value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
+													onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
+													<span style={{color:'red',marginLeft:'5px'}}>*</span>
+								            </FormItem>
+				                   		    <FormItem className="half-item" 
+						                           labelCol={{ span: 4 }}
+						                           wrapperCol={{ span: 12 }}
+						                           label="省-市-区"
+						                          > 
+						                            <Cascader options={areaSelect()}  value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
+													onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
+													<span style={{color:'red',marginLeft:'5px'}}>*</span>
+								            </FormItem>
+							             </div>
+						             </div>
+						             <div className="clearfix" style={{paddingLeft:'60px'}}>
+							             <FormItem className="half-item"
+					                    	labelCol={{ span: 4 }}
+					                        wrapperCol={{ span: 12 }}
+					                         label="市场价"
+				                            >
+			                                <Input placeholder="市场价" value={this.state.postalAddress} 
+						    				onChange={(e)=>{this.setState({postalAddress:e.target.value})}}/>
+						                 </FormItem>
+						                 <FormItem className="half-item"
+					                    	labelCol={{ span: 4 }}
+					                        wrapperCol={{ span: 12 }}
+					                         label="活动价"
+				                            >
+			                                <Input placeholder="活动价" value={this.state.postalAddress} 
+						    				onChange={(e)=>{this.setState({postalAddress:e.target.value})}}/>
+						                 </FormItem>
+						                 <FormItem className="half-item"
+					                    	labelCol={{ span: 4 }}
+					                        wrapperCol={{ span: 12 }}
+					                         label="最低折扣"
+				                            >
+			                                <Input placeholder="最低折扣" value={this.state.postalAddress} 
+						    				onChange={(e)=>{this.setState({postalAddress:e.target.value})}}/>
+						                 </FormItem>
+						                 <FormItem className="half-item"
+					                    	labelCol={{ span: 4 }}
+					                        wrapperCol={{ span: 12 }}
+					                         label="会员价"
+				                            >
+			                                <Input placeholder="会员价" value={this.state.postalAddress} 
+						    				onChange={(e)=>{this.setState({postalAddress:e.target.value})}}/>
+						                 </FormItem>
+						                 <FormItem  className="half-item"
+					                         	labelCol={{ span: 4 }}
+						                        wrapperCol={{ span: 12 }}
+					                           	label="活动生效标识"
+					                         > 
+					                          <Select placeholder="活动生效标识" value={this.state.editStatus} 
+				                                onChange={(e)=>{this.setState({editStatus:e})}}> 
+				                                {
+				                                    conditionOrganization.map(function (item) {
+				                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
+				                                    })
+				                                }
+				                              </Select>
+				                   		 </FormItem>
+				                   		  <FormItem  className="half-item"
+					                         	labelCol={{ span: 4 }}
+						                        wrapperCol={{ span: 12 }}
+					                           	label="项目状态"
+					                         > 
+					                          <Select placeholder="项目状态" value={this.state.editStatus} 
+				                                onChange={(e)=>{this.setState({editStatus:e})}}> 
+				                                {
+				                                    conditionOrganization.map(function (item) {
+				                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
+				                                    })
+				                                }
+				                              </Select>
+				                   		 </FormItem>
+				                   	</div>
+				                    <div className="clearfix" style={{paddingLeft:'60px'}}>
+					                  
+					                    
+				                   		<FormItem className="half-item"
+			                   		   		labelCol={{ span: 4 }}
+				                            wrapperCol={{ span: 18 }}
+				                            label="高新"
+				                   		    >
+					                   		 <Radio.Group value={this.state.highTechZone} onChange={(e) => {
+							                        this.setState({highTechZone:e.target.value})
+							                    }}>
+							                        <Radio value={0}>否</Radio>
+							                        <Radio value={1}>是</Radio>
+							                  </Radio.Group>
+							            </FormItem>
+				                   	     <FormItem className="half-item"
+			                   		   		labelCol={{ span: 4 }}
+				                            wrapperCol={{ span: 18 }}
+				                            label="上市"
+				                   		    >
+					                   		 <Radio.Group value={this.state.listed} onChange={(e) => {
+							                        this.setState({listed:e.target.value })
+							                    }}>
+							                        <Radio value={0}>否</Radio>
+							                        <Radio value={1}>是</Radio>
+							                  </Radio.Group>
+									     </FormItem>
+									     <FormItem className="half-item"
+			                   		   		labelCol={{ span: 4 }}
+				                            wrapperCol={{ span: 18 }}
+				                            label="国际化"
+				                   		    >
+					                   		 <Radio.Group value={this.state.international} onChange={(e) => {
+							                        this.setState({international:e.target.value })
+							                    }}>
+							                        <Radio value={0}>否</Radio>
+							                        <Radio value={1}>是</Radio>
+							                  </Radio.Group>
+									     </FormItem>
+				                   		 <FormItem className="half-item"
+						                    	labelCol={{ span: 4 }}
+						                        wrapperCol={{ span: 18 }}
+						                        label="机构代码"
+					                            >
+					                                <Input placeholder="社会同意机构代码" value={this.state.orgCode} 
+										    				onChange={(e)=>{this.setState({orgCode:e.target.value})}}/>
+					                    </FormItem>
+					                    <div className="clearfix pictures">
+					                        <FormItem
+						                        labelCol={{ span: 4 }}
+						                        wrapperCol={{ span: 18 }}
+						                        label="机构证(PIC)" >
+						                        <PicturesWall
+						                            pictureSign="customer_sys_file"
+						                            fileList={this.getOrgCodeUrl}
+						                            pictureUrl={this.state.orgCodeUrl} />
+						                            <p>图片建议:图片要清晰。</p>
+					                        </FormItem>
+					                        <FormItem
+						                        labelCol={{ span: 4 }}
+						                        wrapperCol={{ span: 18 }}
+						                        label="单位logo" > 
+						                        <PicturesWall
+						                            pictureSign="customer_sys_file"
+						                            fileList={this.getCompanyLogoUrl}
+						                            pictureUrl={this.state.companyLogoUrl} />
+						                            <p>图片建议:图片要清晰。</p>
+						                    </FormItem>
+						                </div> 
+						                <div className="clearfix">
+						                    <FormItem
+					                        labelCol={{ span: 2 }}
+					                        wrapperCol={{ span: 18 }}
+					                        label="业务范围" >
+					                            <Input type="textarea" rows={4} value={this.state.businessScope} 
+										    				onChange={(e)=>{this.setState({businessScope:e.target.value})}}/>
+						                    </FormItem>
+						                    <FormItem
+						                        labelCol={{ span: 2 }}
+						                        wrapperCol={{ span: 18 }}
+						                        label="单位简介" >
+						                            <Input type="textarea" rows={4}  value={this.state.introduction} 
+										    				onChange={(e)=>{this.setState({introduction:e.target.value})}}/>			                      
+						                    </FormItem>
+					                    </div>
+					                    <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'90px',marginBottom:'30px'}}>保存</Button>  
+				                        <Button className="set-submit" type="ghost" onClick={this.detailsModal}>取消</Button>
+				                    </div>		                	
+							    </Spin>
+							</Form>		
+						</TabPane>
+					    <TabPane tab="联系人信息" key="2">
+					        <div className="clearfix" >
+					            <Button className="ContactsList" type="primary" onClick={this.addcontact}>新增</Button> 
+					        </div>
+					       <div className="clearfix">
+                			  <Spin spinning={this.state.loading}>
+                			     <Form horizontal id="demand-form" onSubmit={this.contactSave} >
+							      <Table 
+					            	 pagination={false}
+					            	 columns={this.state.ContactsLists} 
+					            	 dataSource={this.state.contactList}
+					            	 />
+				            	    <div className="clearfix">
+							                <Button  type="primary" htmlType="submit" style={{fontSize:'16px',margin:'20px 25px 40px 120px'}}>保存</Button>  
+			                                <Button  type="ghost" onClick={this.detailsModal} style={{fontSize:'18px'}}>取消</Button>
+							            </div>
+					            	</Form> 
+							   </Spin> 
+							</div>
+					    </TabPane>
+					    </Tabs>
+                    </Modal>
+            	 </div>
+                	 
+            	</div>
+            </div>
+        );
+    }
 }));
 
 export default BusinessProject;

+ 3 - 0
js/component/manageCenter/set/content.less

@@ -58,3 +58,6 @@
     background: #ffffff;
 }
 thead>tr>.ant-table-selection-column>span .ant-checkbox-inner{display:none;}
+.half-item{    float: left;
+    width: 50%;
+    margin-bottom: 10px;}