| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879 | 
							- import React from 'react';
 
- import ReactDom from 'react-dom';
 
- import ajax from 'jquery/src/ajax/xhr.js';
 
- import $ from 'jquery/src/ajax';
 
- import moment from 'moment';
 
- import '../content.less';
 
- import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,TimePicker } from 'antd';
 
- import {categoryState} from '../../../dataDic.js';
 
- import {getCategoryState,splitUrl} from '../../../tools.js';
 
- //图片组件
 
- 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/Varieties/uploadPicture"}
 
-                     data={{ 'sign': this.props.pictureSign }}
 
-                     listType="picture-card"
 
-                     fileList={fileList}
 
-                     onPreview={this.handlePreview}
 
-                     onChange={this.handleChange} >
 
-                     {fileList.length >= 1 ? null : uploadButton}
 
-                 </Upload>
 
-                 <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
 
-                     <img alt="example" style={{ width: '100%' }} src={previewImage} />
 
-                 </Modal>
 
-             </div>
 
-         );
 
-     }
 
- });
 
- const BusinessCategory=Form.create()(React.createClass({
 
- 	//搜索功能和初始列表加载
 
- 	loadData(pageNo, apiUrl) {
 
-         this.state.data = [];
 
-         this.setState({
 
-             loading: true,
 
-             ispage:pageNo,
 
-         });
 
-         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 + '/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
 
-                             sort:thisdata.sort,//品类序号
 
-                             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,
 
-             orgCodeUrl: [],
 
- 			companyLogoUrl: [],
 
-             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: 'sort',
 
-                     key: 'sort',
 
-                 },{
 
-                     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: '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 + "/api/admin/Varieties/getSuperList",
 
-                 data:{
 
-                   flag:1,
 
-                 },
 
-                 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.state.ispage);
 
- 	            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;
 
-     	let theorgCodeUrl = [];
 
- 			if(this.state.orgCodeUrl.length) {
 
- 				let picArr = [];
 
- 				this.state.orgCodeUrl.map(function(item) {
 
- 					picArr.push(item.response.data);
 
- 				});
 
- 				theorgCodeUrl = picArr.join(",");
 
- 			};
 
- 			let thecompanyLogoUrl = [];
 
- 			if(this.state.companyLogoUrl.length) {
 
- 				let picArr = [];
 
- 				this.state.companyLogoUrl.map(function(item) {
 
- 					picArr.push(item.response.data);
 
- 				});
 
- 				thecompanyLogoUrl = picArr.join(",");
 
- 			};
 
-     	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 + '/api/admin/Varieties/editVarieties',
 
- 			            data:{
 
- 			            	id:this.state.editId,//品类ID
 
- 			            	cname:this.state.editName,//品类名称
 
- 			            	superId:changeSuper,//上级品类
 
- 			            	status:this.state.editStatus,//品类状态 
 
- 			            	varietiesLogo:theorgCodeUrl,
 
- 			            }
 
- 			        }).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 + '/api/admin/Varieties/editVarieties',
 
- 			            data:{
 
- 			            	id:this.state.editId,//品类ID
 
- 			            	cname:this.state.editName,//品类名称
 
- 			            	superId:superIdText,//上级品类
 
- 			            	status:this.state.editStatus,//品类状态 
 
- 			            	varietiesLogo:theorgCodeUrl,
 
- 			            }
 
- 			        }).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 + '/api/admin/Varieties/editVarieties',
 
- 			            data:{
 
- 			                id:this.state.editId,//品类ID
 
- 			            	cname:this.state.editName,//品类名称
 
- 			            	superId:changeSuper,//上级品类
 
- 			            	status:this.state.editStatus,//品类状态 
 
- 			            	varietiesLogo:theorgCodeUrl,
 
- 			            }
 
- 			        }).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 + '/api/admin/Varieties/editVarieties',
 
- 			            data:{
 
- 			            	id:this.state.editId,//品类ID
 
- 			            	cname:this.state.editName,//品类名称
 
- 			            	superId:superIdText,//上级品类
 
- 			            	status:this.state.editStatus,//品类状态 
 
- 			            	varietiesLogo:theorgCodeUrl,
 
- 			            }
 
- 			        }).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 +"/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,//品类编号
 
-                          editSort: thisdata.sort,//品类序号
 
-                          editCreateName:thisdata.createName,//创建人
 
-                          editTime:thisdata.createTimeFormattedDate,//创建时间
 
-                          orgCodeUrl: thisdata.varietiesLogo ? splitUrl(thisdata.varietiesLogo, ',', globalConfig.avatarHost + '/upload') : [],
 
-                     }); 
 
-                 };
 
-                 this.setState({
 
-                 	 editId: thisdata.id,//每一条记录的ID
 
-                      editName:thisdata.cname,//品类名称
 
-                      editStatus:thisdata.status,//品类状态 
 
-                      editSuperName:thisdata.superName,//上级品类
 
-                      editSuperId:thisdata.superId,//上级品类
 
-                      editlayer:thisdata.layer,//品类层级
 
-                      editCid: thisdata.cid,//品类编号
 
-                      editSort: thisdata.sort,//品类序号
 
-                      editCreateName:thisdata.createName,//创建人
 
-                      editTime:thisdata.createTimeFormattedDate,//创建时间
 
-                      orgCodeUrl: thisdata.varietiesLogo ? splitUrl(thisdata.varietiesLogo, ',', globalConfig.avatarHost + '/upload') : [],
 
-                      editDataSource: theArr,
 
-                 });
 
-             }.bind(this),
 
-         }).always(function () {
 
-             this.setState({
 
-                 loading: false
 
-             });
 
-         }.bind(this));
 
-     },
 
-     //左侧图片地址
 
-     getOrgCodeUrl(e) {
 
- 		this.setState({ orgCodeUrl: e });
 
- 	},
 
-     //新增一个品类,保存
 
-     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 + '/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 + "/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 + "/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));
 
-     },
 
-     //品类上移
 
-     upClick() {
 
-         let deletedIds = '';
 
-         let upSort = '';
 
-         for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
 
-             let rowItem = this.state.selectedRows[idx];
 
-             if (rowItem.id) {
 
-                 deletedIds=rowItem.id;
 
-                 upSort=rowItem.sort;
 
-             };
 
-         };
 
-         this.setState({
 
-             selectedRowKeys: [],
 
-             loading: deletedIds.length > 0
 
-         });
 
-         $.ajax({
 
-             method: "get",
 
-             dataType: "json",
 
-             crossDomain: false,
 
-             url: globalConfig.context + "/api/admin/Varieties/locationChange",
 
-             data: {
 
-                 id: deletedIds,
 
-                 sort:upSort,
 
-                 flag:'1',
 
-             }
 
-         }).done(function (data) {
 
-             if (!data.error.length) {
 
-                 message.success('该品类已成功上移!');
 
-                 this.setState({
 
-                     loading: false,
 
-                 });
 
-             } else {
 
-                 message.warning(data.error[0].message);
 
-             };
 
-             this.selectSuperId();
 
-         }.bind(this));
 
-     },
 
-     //品类下移
 
-     downClick() {
 
-         let deletedIds = '';
 
-         let upSort = '';
 
-         for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
 
-             let rowItem = this.state.selectedRows[idx];
 
-             if (rowItem.id) {
 
-                 deletedIds=rowItem.id;
 
-                 upSort=rowItem.sort;
 
-             };
 
-         };
 
-         this.setState({
 
-             selectedRowKeys: [],
 
-             loading: deletedIds.length > 0
 
-         });
 
-         $.ajax({
 
-             method: "get",
 
-             dataType: "json",
 
-             crossDomain: false,
 
-             url: globalConfig.context + "/api/admin/Varieties/locationChange",
 
-             data: {
 
-                 id: deletedIds,
 
-                 sort:upSort,
 
-                 flag:'0',
 
-             }
 
-         }).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.addReset();
 
-         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();       
 
-     },
 
-     addReset() {
 
-         this.state.categoryName = '';//品类名称清零
 
-         this.state.upCategory = undefined;//上级品类清零      
 
-     },
 
-     searchSwitch() {
 
-         this.setState({
 
-             searchMore: !this.state.searchMore
 
-         });
 
-     },
 
-     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">
 
- 	                    <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',display:'none'}}
 
- 	                   			 disabled={!hasSelected} 
 
- 	                    		 >停用<Icon type="minus" />
 
- 	           			     </Button>
 
- 						</Popconfirm>
 
- 	                    <span style={{marginRight:'20px'}}>更多搜索    <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
 
- 	                    <div  style={this.state.searchMore ? { display: 'none' } : {display: 'inline-block'}}>
 
- 	                    	<Select placeholder="品类层级"
 
- 	                            style={{ width:'150px',marginRight:'10px' }}
 
- 	                            value={this.state.layer}
 
- 	                            onChange={(e) => { this.setState({ layer: e }) }}>
 
- 	                            <Select.Option value="1" >一级</Select.Option>
 
- 	                            <Select.Option value="2" >二级</Select.Option>
 
- 	                            <Select.Option value="3" >三级</Select.Option>
 
- 		                	</Select>
 
- 		                    <Select placeholder="品类状态"
 
- 		                            style={{width:'150px',marginRight:'50px'}}
 
- 		                            value={this.state.status}
 
- 		                            onChange={(e) => { this.setState({ status: e }) }}>
 
- 		                            <Select.Option value="0" >正常</Select.Option>
 
- 		                            <Select.Option value="1" >停用</Select.Option>
 
- 		                    </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.downClick} style={{float:'right'}} disabled={!hasSelected}>品类下移</Button>
 
- 	                    <Button type="primary" className="addButton" onClick={this.upClick} style={{float:'right'}} disabled={!hasSelected}>品类上移</Button>
 
- 	                    
 
- 	                </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
 
- 					                            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>
 
- 				                    <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:'15px'}}>取消</Button>
 
- 				                    </FormItem> 
 
- 				                </Spin>
 
- 				            </Form >
 
- 	                    </Modal>
 
-                 	 </div>
 
-                 	 
 
-                 	 <div className="patent-desc">
 
- 	                    <Modal maskClosable={false} visible={this.state.editvisible}
 
- 	                        onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}
 
- 	                        width='600px'
 
- 	                        title='编辑品类'                       
 
- 	                        footer=''
 
- 	                        className="admin-desc-content">
 
- 	                         <Form horizontal onSubmit={this.edithandleSubmit} id="demand-form">
 
- 				                <Spin spinning={this.state.loading}>
 
- 				                    <div className="clearfix">
 
- 				                    	<FormItem 
 
- 					                            labelCol={{ span: 7 }}
 
- 					                        	wrapperCol={{ span: 12 }}
 
- 					                            label="品类名称" >
 
- 				                                <Input placeholder="组织名称" value={this.state.editName} 
 
- 				                                onChange={(e)=>{this.setState({editName:e.target.value})}}/>
 
- 					                    </FormItem>
 
- 				                    </div> 
 
- 				                    <div className="clearfix">
 
- 				                    	<FormItem 
 
- 				                         	labelCol={{ span: 7 }}
 
- 					                        wrapperCol={{ span: 12 }}
 
- 				                           	label="品类状态"
 
- 				                         > 
 
- 					                        <Select placeholder="品类状态" value={this.state.editStatus} 
 
- 				                                onChange={(e)=>{this.setState({editStatus:e})}}> 
 
- 				                                {
 
- 				                                    categoryState.map(function (item) {
 
- 				                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
 
- 				                                    })
 
- 				                                }
 
- 				                              </Select>
 
- 				                   		 </FormItem>
 
- 				                    </div>
 
- 				                    <div className="clearfix">
 
- 					                    <FormItem  
 
- 					                    	labelCol={{ span: 7 }}
 
- 					                        wrapperCol={{ span: 12 }}
 
- 				                           label="上级品类"
 
- 			                               > 
 
- 			                               <Select placeholder="请选择上级组织" value={this.state.editSuperName} onChange={(e)=>{this.setState({editSuperName:e})}}
 
- 				                                notFoundContent="未获取到上级组织列表">
 
- 				                                {this.state.contactsOption}
 
- 				                            </Select> 
 
- 			                   		    </FormItem>
 
- 		                   		    </div>
 
- 		                   		    <div className="clearfix">
 
- 					                    <FormItem 
 
- 					                        labelCol={{ span: 7 }}
 
- 					                        wrapperCol={{ span: 12 }}
 
- 					                        label="业务品类图标" >
 
- 					                        <PicturesWall
 
- 					                            pictureSign="varieties_picture"
 
- 					                            fileList={this.getOrgCodeUrl}
 
- 					                            pictureUrl={this.state.orgCodeUrl} />
 
- 					                    </FormItem>
 
- 		                   		    </div>
 
- 		                   		    <div className="clearfix">
 
- 				                    	<FormItem 
 
- 						                    labelCol={{ span: 7 }}
 
- 						                    wrapperCol={{ span: 12 }}
 
- 						                    label="品类序号"
 
- 					                        >
 
- 					                        <span>{this.state.editSort}</span>
 
- 					                    </FormItem>
 
- 					                </div>
 
- 		                   		    <div className="clearfix">
 
- 				                    	<FormItem 
 
- 						                    labelCol={{ span: 7 }}
 
- 						                    wrapperCol={{ span: 12 }}
 
- 						                    label="品类层级"
 
- 					                        >
 
- 					                        <span>{this.state.editlayer}</span>
 
- 					                    </FormItem>
 
- 					                </div>
 
- 					                <div className="clearfix">
 
- 				                    	<FormItem 
 
- 						                    labelCol={{ span: 7 }}
 
- 						                    wrapperCol={{ span: 12 }}
 
- 						                    label="品类编号"
 
- 					                        >
 
- 					                        <span>{this.state.editCid}</span>
 
- 					                    </FormItem>
 
- 					                </div>
 
- 					                <div className="clearfix" >
 
- 				                    	<FormItem 
 
- 						                    labelCol={{ span: 7 }}
 
- 						                    wrapperCol={{ span: 12 }}
 
- 						                    label="创建人"
 
- 					                        >
 
- 					                        <span>{this.state.editCreateName}</span>
 
- 					                    </FormItem>
 
- 					                </div>
 
- 					                <div className="clearfix">
 
- 				                    	<FormItem 
 
- 						                    labelCol={{ span: 7 }}
 
- 						                    wrapperCol={{ span: 12 }}
 
- 						                    label="创建时间"
 
- 					                        >
 
- 					                        <span>{this.state.editTime}</span>
 
- 					                    </FormItem>
 
- 					                </div>
 
- 				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
 
- 				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
 
- 				                        <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px'}}>取消</Button>
 
- 				                    </FormItem> 
 
- 				                </Spin>
 
- 				            </Form >
 
- 	                    </Modal>
 
-                 	 </div>
 
-                 	 
 
-             	</div>
 
-             </div>
 
-         );
 
-     }
 
- }));
 
- export default BusinessCategory;
 
 
  |