dengzhiguo 7 years ago
parent
commit
814a07d8d6

+ 95 - 3
js/component/manageCenter/set/business/businessCategory.jsx

@@ -94,6 +94,7 @@ const BusinessCategory=Form.create()(React.createClass({
                         theArr.push({
                             key: i,
                             id: thisdata.id,//品类ID
+                            sort:thisdata.sort,//品类序号
                             cid: thisdata.cid,//品类编号
                             cname: thisdata.cname,//品类名称
                             layer: thisdata.layer,//品类层级
@@ -137,6 +138,10 @@ const BusinessCategory=Form.create()(React.createClass({
             },
             columns: [
                 {
+                    title: '品类序号',
+                    dataIndex: 'sort',
+                    key: 'sort',
+                },{
                     title: '品类编号',
                     dataIndex: 'cid',
                     key: 'cid',
@@ -381,6 +386,7 @@ const BusinessCategory=Form.create()(React.createClass({
                          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') : [],
@@ -394,6 +400,7 @@ const BusinessCategory=Form.create()(React.createClass({
                      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') : [],
@@ -519,6 +526,80 @@ const BusinessCategory=Form.create()(React.createClass({
             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();
@@ -604,7 +685,7 @@ const BusinessCategory=Form.create()(React.createClass({
 	           			     </Button>
 						</Popconfirm>
 	                    <span style={{marginRight:'20px'}}>更多搜索    <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
-	                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {display: 'inline-block'}}>
+	                    <div  style={this.state.searchMore ? { display: 'none' } : {display: 'inline-block'}}>
 	                    	<Select placeholder="品类层级"
 	                            style={{ width:'150px',marginRight:'10px' }}
 	                            value={this.state.layer}
@@ -622,7 +703,9 @@ 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.downClick} style={{float:'right'}}>品类下移</Button>
+	                    <Button type="primary" className="addButton" onClick={this.upClick} style={{float:'right'}}>品类上移</Button>
+	                    
 	                </div>
 	                <div className="patent-table">
 	                    <Spin spinning={this.state.loading}>
@@ -736,12 +819,21 @@ const BusinessCategory=Form.create()(React.createClass({
 				                    	<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">
+					                <div className="clearfix">
 				                    	<FormItem 
 						                    labelCol={{ span: 7 }}
 						                    wrapperCol={{ span: 12 }}

+ 45 - 3
js/component/manageCenter/set/business/businessProject.jsx

@@ -414,8 +414,7 @@ const BusinessProject=Form.create()(React.createClass({
 		    	let pro='';
 		        let city='';
 		        let dis='';
-		        console.log(this.state.ProvinceCity);
-		       	if(this.state.ProvinceCity==undefined||this.state.ProvinceCity.length==0){
+		        if(this.state.ProvinceCity==undefined||this.state.ProvinceCity.length==0){
 		       		message.warning('请选择项目有效范围');
 		    		return false;
 		       	}else{
@@ -451,8 +450,10 @@ const BusinessProject=Form.create()(React.createClass({
 		            	minLogo:theorgCodeUrl,
 		            	maxLogo:thecompanyLogoUrl,
 		            	introduce:this.state.editIntroduce,//项目介绍 
+		            	projectUrl:this.state.editProjectUrl,//项目地址
 		            	valueEffect:this.state.editValueEffect,//项目价值及作用
 		            	clientSize:this.state.editClientSize,//项目基本条件 
+		            	boutique:this.state.editBoutique,
 		            }
 		        }).done(function (data) { 
 		            this.setState({
@@ -538,8 +539,10 @@ const BusinessProject=Form.create()(React.createClass({
                          editCreateId:thisdata.createName,//创建人
                          editTime:thisdata.createTimeFormattedDate,//创建时间
                          editIntroduce:thisdata.introduce,//服务内容
+                         editProjectUrl:thisdata.projectUrl,//项目地址
                          editValueEffect:thisdata.valueEffect,//价值及作用
                          editClientSize:thisdata.clientSize,//基本条件
+                         editBoutique:thisdata.boutique,//是否精品
                          orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
 						 cditCompanyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
 					
@@ -563,8 +566,10 @@ const BusinessProject=Form.create()(React.createClass({
                      editCreateId:thisdata.createName,//创建人
                      editTime:thisdata.createTimeFormattedDate,//创建时间
                      editIntroduce:thisdata.introduce,//服务内容
+                     editProjectUrl:thisdata.projectUrl,//项目地址
                      editValueEffect:thisdata.valueEffect,//价值及作用
                      editClientSize:thisdata.clientSize,//基本条件
+                     editBoutique:thisdata.boutique,//是否精品
                      orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
 					 companyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
 					 editDataSource: theArr,
@@ -724,6 +729,7 @@ const BusinessProject=Form.create()(React.createClass({
                     data:{
                     	bname:this.state.categoryName,//项目名称
                     	cid:superText,//品类类ID
+                    	boutique:this.state.boutique?this.state.boutique:'0',
                     	country:isCountry,//是否全国
                     	province:pro,//省
                     	city:city,//市
@@ -937,6 +943,7 @@ const BusinessProject=Form.create()(React.createClass({
     	this.state.categoryName='';//项目名称清零
     	this.state.ProvinceCity=undefined;
     	this.state.addCid=undefined;
+    	this.state.boutique='';
     },
     //规格新增清零
     formatReset() {
@@ -1087,6 +1094,20 @@ const BusinessProject=Form.create()(React.createClass({
 				                            <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
 			                   		    </FormItem>
 		                   		    </div>
+		                   		    <div className="clearfix">
+					                    <FormItem  
+					                    	labelCol={{ span: 7 }}
+					                        wrapperCol={{ span: 12 }}
+				                           label="是否精品"
+			                               > 
+			                               <Radio.Group value={this.state.boutique} onChange={(e) => {
+						                    this.setState({ boutique: e.target.value })
+						                    }}>
+						                        <Radio value={1}>精品</Radio>
+						                        <Radio value={0}>非精品</Radio>
+						                	</Radio.Group>
+			                   		    </FormItem>
+		                   		    </div>
 	                    			<div className="clearfix">
 			                   		    <FormItem 
 					                           labelCol={{ span: 7 }}
@@ -1383,7 +1404,19 @@ const BusinessProject=Form.create()(React.createClass({
 												onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
 												<span style={{color:'red',marginLeft:'5px'}}>*</span>
 							            </FormItem>
-						             </div>
+							            <FormItem  className="half-item" 
+					                    	labelCol={{ span: 4 }}
+					                        wrapperCol={{ span: 12 }}
+				                           label="是否精品"
+			                               > 
+			                               <Radio.Group value={this.state.editBoutique} onChange={(e) => {
+						                    this.setState({ editBoutique: e.target.value })
+						                    }}>
+						                        <Radio value={1}>精品</Radio>
+						                        <Radio value={0}>非精品</Radio>
+						                	</Radio.Group>
+			                   		    </FormItem>
+		                   		     </div>
 						             <div className="clearfix" style={{paddingLeft:'60px'}}>
 							             <FormItem className="half-item"
 					                    	labelCol={{ span: 4 }}
@@ -1464,6 +1497,15 @@ const BusinessProject=Form.create()(React.createClass({
 			                   		    <FormItem
 					                        labelCol={{ span: 4 }}
 					                        wrapperCol={{ span: 12 }}
+					                        label="项目地址" >					                        
+					                        <Input type="textarea" rows={1} placeholder="业务项目服务内容" value={this.state.editProjectUrl}
+	                           				 	onChange={(e) => { this.setState({ editProjectUrl: e.target.value }) }}/>					                           
+					                    </FormItem>
+					                </div> 
+				                   	<div className="clearfix">
+			                   		    <FormItem
+					                        labelCol={{ span: 4 }}
+					                        wrapperCol={{ span: 12 }}
 					                        label="业务项目服务内容" >					                        
 					                        <Input type="textarea" rows={4} placeholder="业务项目服务内容" value={this.state.editIntroduce}
 	                           				 	onChange={(e) => { this.setState({ editIntroduce: e.target.value }) }}/>