dengzhiguo 6 years ago
parent
commit
98dc44b5b8
1 changed files with 131 additions and 68 deletions
  1. 131 68
      js/component/manageCenter/order/orderNew/reject.jsx

+ 131 - 68
js/component/manageCenter/order/orderNew/reject.jsx

@@ -4,7 +4,7 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import Jquery from 'jquery/dist/jquery.js';
 import moment from 'moment';
-import {boutique } from '@/dataDic.js';
+import {boutique ,tepi} from '@/dataDic.js';
 import { getLiquidationStatus,getApprovedState,getProcessStatus,splitUrl,getjiedian,getboutique} from '@/tools.js';
 import './customer.less';
 const TabPane = Tabs.TabPane;
@@ -117,6 +117,10 @@ const IntentionCustomer = Form.create()(React.createClass({
 	                         salesmanName:thisdata.salesmanName,//营销员名称
 	                         financeName:thisdata.financeName,//财务名称
 	                         createDate:thisdata.createDate,//下单时间
+	                         initiateName:thisdata.initiateName,//驳回人
+	                         reason:thisdata.reason,//驳回信息
+	                         backDate:thisdata.backDate,//驳回日期
+	                         backId:thisdata.backId,//驳回编号
 						});
 					};
 					this.state.pagination.current = data.data.pageNo;
@@ -475,15 +479,50 @@ const IntentionCustomer = Form.create()(React.createClass({
 	},
 	//审核通过
 	examOks(){
+		if(!this.state.contacts){
+        	message.warning('企业负责人不能为空');
+        	this.refs.signFirstPayment.focus()
+        	return false;
+        };
+        if(!this.state.contactMobile){
+        	message.warning('企业负责人电话不能为空');
+        	this.refs.signFirstPayment.focus()
+        	return false;
+        };
+        if(!this.state.totalAmount){
+        	message.warning('签单金额不能为空');
+        	this.refs.signFirstPayment.focus()
+        	return false;
+        };
+        if(!this.state.firstAmount){
+        	message.warning('首付金额不能为空');
+        	this.refs.signFirstPayment.focus()
+        	return false;
+        };
+        if(!theorgCodeUrl){
+        	message.warning('企业负责人不能为空');
+        	this.refs.signFirstPayment.focus()
+        	return false;
+        };
 		$.ajax({
 			method: "post",
 			dataType: "json",
 			crossDomain: false,
-			url: globalConfig.context +"/open/api/admin/newOrder/auditOrderNew",
+			url: globalConfig.context +"/open/api/admin/newOrder/updateServiceOrderNew",
 			data: {
-				orderNo:this.state.orderNo,
-				orderStatus:3,
-				reason:this.state.reason,
+				orderNo: this.state.orderNo,//订单编号
+				totalAmount: this.state.totalAmount,//总金额
+				firstAmount: this.state.firstAmount,//首付
+				signDate: this.state.signDate,//签单日期
+				contacts: this.state.contacts,//企业负责人
+				contactMobile: this.state.contactMobile,//负责人联系方式
+				legalPerson: this.state.legalPerson,//企业法人
+				legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
+				approval: this.state.approval,//特批状态
+				contractNo: this.state.contractNo,//合同编号
+				orderRemarks: this.state.orderRemarks,//订单备注
+				contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
+					
 			},
 			success: function(data) {
 				if(data.error.length || data.data.list == "") {
@@ -491,7 +530,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 						message.warning(data.error[0].message);
 					};
 				} else {
-					message.success("该订单已被拒绝~");
+					message.success("重新提交成功~");
 					this.setState({
 						visible:false,
 						noVisible:false
@@ -569,7 +608,7 @@ const IntentionCustomer = Form.create()(React.createClass({
                     <span>订单审核</span>
                 </div>
                	<div className="user-search">                    
-                   <Input placeholder="客户名称" style={{width:'150px'}}
+                   <Input placeholder="客户名称" style={{width:'150px',marginBottom:'10px'}}
 	                        value={this.state.customerName}
 	                        onChange={(e) => { this.setState({ customerName: e.target.value }); }} />
                     <Input placeholder="订单编号" style={{width:'150px'}}
@@ -580,7 +619,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 	                        value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
 	                        this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
 	                        onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
-                    <Button type="primary" onClick={this.search}>搜索</Button>
+                    <Button type="primary" onClick={this.search} style={{marginLeft:'10px'}}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button> 
                    	<div className="patent-table">
 	                    <Spin spinning={this.state.loading}>
@@ -612,18 +651,15 @@ const IntentionCustomer = Form.create()(React.createClass({
 		                    		<FormItem className="half-item"
 			                            {...formItemLayout}
 			                            label="合同编号" >  
-			                            <span>{this.state.contractNo}</span>
+			                             <Input placeholder="请输入合同编号" value={this.state.contractNo}
+							                onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />
 				                    </FormItem>
 		                    		<FormItem className="half-item"
 			                            {...formItemLayout}
 			                            label="客户名称" >  
 			                            <span>{this.state.userName}</span>
 		                    		</FormItem>
-		                    		<FormItem className="half-item"
-			                            {...formItemLayout}
-			                            label="合同签订时间" >   
-			                            <span>{this.state.signDate}</span>
-		                    		</FormItem>
+		                    		
 		                    		<FormItem className="half-item"
 			                            {...formItemLayout}
 			                            label="流程状态" >  
@@ -636,53 +672,71 @@ const IntentionCustomer = Form.create()(React.createClass({
 		                    		</FormItem>
 		                    		<FormItem className="half-item"
 			                            {...formItemLayout}
+			                            label="已收款项(万元)" >  
+			                            <span>{this.state.settlementAmount}</span>
+		                    		</FormItem>
+		                    		<FormItem className="half-item"
+			                            {...formItemLayout}
 			                            label="企业联系人" >                             
-		                                <span>{this.state.contacts}</span>
+		                                 <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
+								            <span className="mandatory">*</span>
 				                    </FormItem>
 				                     <FormItem className="half-item"
 			                            {...formItemLayout}
 			                            label="联系人电话" >                             
-		                                <span>{this.state.contactMobile}</span>
+		                                <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
+								            <span className="mandatory">*</span>
 				                    </FormItem>
 				                    <FormItem className="half-item"
 			                            {...formItemLayout}
 			                            label="企业法人" >                             
-		                                <span>{this.state.legalPerson}</span>
-		                            </FormItem>
+		                                    <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
+				                    </FormItem>
 				                     <FormItem className="half-item"
 			                            {...formItemLayout}
-			                            label="法人电话" >  
-			                             <span>{this.state.legalPersonTel}</span>
+			                            label="法人电话" >                             
+		                                    <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
 				                    </FormItem>
-				                    <FormItem className="half-item"
+				                     <FormItem className="half-item"
 			                            {...formItemLayout}
 			                            label="签单金额(万元)" >                             
-		                                 <span>{this.state.firstAmount}</span>
+		                                    <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
+				                   			<span className="mandatory">*</span>
 				                    </FormItem>
 				                    <FormItem className="half-item"
-			                            {...formItemLayout}
-			                            label="首付金额(万元)" >                             
-		                                <span>{this.state.totalAmount}</span>
+				                            {...formItemLayout}
+				                            label="首付金额(万元)" >                             
+			                                    <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
+				                    		<span className="mandatory">*</span>
 				                    </FormItem>
 		                    		<FormItem className="half-item"
 			                            {...formItemLayout}
 			                            label="特批立项" >  
-			                            <span>{getApprovedState(this.state.approval)}</span>
+			                            <Select placeholder="请选择客户所属类型"
+				                            style={{ width:'240px'}}
+				                            value={this.state.approval}
+				                            onChange={(e)=>{this.setState({approval:e})}}>
+				                            {
+			                                    tepi.map(function (item) {
+			                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
+			                                    })
+			                                }
+				                     </Select>
 		                    		</FormItem>
-		                    		<FormItem className="half-item"
+				                    <FormItem className="half-item"
 			                            {...formItemLayout}
-			                            label="已收款项(万元)" >  
-			                            <span>{this.state.settlementAmount}</span>
+			                            label="合同签订时间" >   
+			                            <DatePicker
+			                              style={{marginTop:"2px",width: '240px',height:"32px" }}
+									      showTime
+									      format="YYYY-MM-DD"
+									      placeholder="合同签订时间"
+									      value={this.state.signDate}
+									      onChange={(e,time)=>{this.selTime(e,time)}}
+									    />
+									    <span className="mandatory">*</span>
 		                    		</FormItem>
 				                    <div className='clearfix'>
-							        	<FormItem
-								            labelCol={{ span: 4 }}
-								            wrapperCol={{ span: 16 }}
-								            label="订单留言" >
-							        	 <span>{this.state.orderRemarks}</span>
-								        </FormItem>
-							        </div>
-				                    <div className='clearfix'>
 							            <FormItem
 							                labelCol={{ span: 4 }}
 							                wrapperCol={{ span: 18 }}
@@ -700,6 +754,15 @@ const IntentionCustomer = Form.create()(React.createClass({
 							            </FormItem>
 							        </div>
 							        <div className='clearfix'>
+							        	<FormItem
+								            labelCol={{ span: 4 }}
+								            wrapperCol={{ span: 16 }}
+								            label="订单留言" >
+								                <Input type="textarea" placeholder="请输入订单留言" rows={4}  value={this.state.orderRemarks} 
+									    				onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>			                      
+								        </FormItem>
+							        </div>
+							        <div className='clearfix'>
 			                    		<FormItem className="half-item"
 				                            {...formItemLayout}
 				                            label="订单负责人" >  
@@ -724,36 +787,36 @@ const IntentionCustomer = Form.create()(React.createClass({
 			                    		</FormItem>
 			                    	</div>
 			                    	<div>
-								                	<span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
-								                	{this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
-								                </div>
-								                <div className="clearfix">
-								    			  <Spin spinning={this.state.loading}>
-								    			        <Form layout="horizontal" id="demand-form"  >
-													      	<Table 
-											            	 pagination={false}
-											            	 columns={this.state.ContactsLists} 
-											            	 dataSource={this.state.contactList}
-											            	 />
-									            	        <Col span={24} offset={9} style={{marginTop:'15px'}}>
-												                 
-												            </Col>
-										            	</Form> 
-												   </Spin> 
-												</div>
-									            <div>
-								                	<span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
-								                	{this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
-								                </div>
-								                <div className="patent-table">
-								                    <Spin spinning={this.state.loading}>
-								                        <Table columns={this.state.columnsX}
-								                            dataSource={this.state.dataSourceX}
-								                            pagination={this.state.pagination}
-								                            onRowClick={this.tableRowClickX} 
-								                            />
-								                    </Spin>
-									            </div>
+					                	<span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
+					                	{this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
+					                </div>
+					                <div className="clearfix">
+					    			  <Spin spinning={this.state.loading}>
+					    			        <Form layout="horizontal" id="demand-form"  >
+										      	<Table 
+								            	 pagination={false}
+								            	 columns={this.state.ContactsLists} 
+								            	 dataSource={this.state.contactList}
+								            	 />
+						            	        <Col span={24} offset={9} style={{marginTop:'15px'}}>
+									                 
+									            </Col>
+							            	</Form> 
+									   </Spin> 
+									</div>
+						            <div>
+					                	<span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
+					                	{this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
+					                </div>
+					                <div className="patent-table">
+					                    <Spin spinning={this.state.loading}>
+					                        <Table columns={this.state.columnsX}
+					                            dataSource={this.state.dataSourceX}
+					                            pagination={this.state.pagination}
+					                            onRowClick={this.tableRowClickX} 
+					                            />
+					                    </Spin>
+						            </div>
 					                <div className='addSave' style={{marginTop:'15px'}}>
 					                   <Button className="cancel" type="primary" onClick={this.examOk} style={{marginLeft:"200px"}} htmlType="submit">通过</Button>
 					                   <Button className="cancel" type="primary" onClick={this.examNo} style={{marginLeft:"50px"}} htmlType="submit">拒绝</Button>
@@ -822,7 +885,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 								        </FormItem>
 				                    </div>	
 				                     <div className='clearfix'>
-						                   <Button className="cancel" type="primary" onClick={this.examOks} style={{marginLeft:"50px"}} htmlType="submit">确定</Button>
+						                   <Button className="cancel" type="primary" onClick={this.examOks} style={{marginLeft:"50px"}} htmlType="submit">重新提交</Button>
 			                               <Button className="cancel" type="ghost" onClick={this.noCancel} style={{marginLeft:"50px"}}>取消</Button>
 	                            	</div>
 			                </Spin>