dengzhiguo 6 years ago
parent
commit
de06ceb791

+ 86 - 55
js/component/manageCenter/project/project/projectAssignment.jsx

@@ -53,6 +53,7 @@ const PaiDan = React.createClass({
 	                         financeName:thisdata.financeName,//财务名称
 	                         consultantName:thisdata.consultantName,//项目负责人
 	                         createDate:thisdata.createDate,//下单时间
+	                         settlementAmount:thisdata.settlementAmount,//已交款项
                         });
                     };
                 }
@@ -145,6 +146,20 @@ const PaiDan = React.createClass({
                     dataIndex: 'processStatus',
                     key: 'processStatus',
                     render: text => { return text==5||text==6?getProcessStatus(text):'未分配'}
+                },
+                {
+                    title:'操作',
+                    dataIndex: 'caozuo',
+                    key: 'caouzo',
+                    render:(text,record)=>{
+                    	console.log(record.settlementAmount);
+                    	console.log(record.processStatus);
+                        return <div>
+                        	{record.settlementAmount==0&&record.processStatus<5?
+                            <Button type="primary" style={{margin:'0 10px'}} onClick={(e)=>{e.stopPropagation(),this.examNo(record)}}>驳回</Button>
+                        	:''}
+                        </div>
+                    }
                 }
             ],
             dataSource: [],
@@ -204,24 +219,6 @@ const PaiDan = React.createClass({
                 }
 			],
 			dataSourceX: [],
-			ContactsLists: [{
-					title: '催款科目',
-					dataIndex: 'dunSubject',
-					key: 'dunSubject',
-					render: text=>{return getjiedian(text)}
-				},{
-					title: '金额(万)',
-					dataIndex: 'money',
-					key: 'money',
-				}, {
-					title: '催款状态',
-					dataIndex: 'dunStatus',
-					key: 'dunStatus',
-					render: (text) => {
-						return text?'已完成':'催款中'
-					}
-				},
-			],
         }
     },
     /* 分派 */
@@ -244,6 +241,53 @@ const PaiDan = React.createClass({
 		this.xiangmu(record.orderNo);
 		this.jiedian(record.orderNo);
     },
+    //审核不通过
+	examOks(){
+		$.ajax({
+			method: "post",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context +"/api/admin/newOrder/technicianBackOrder",
+			data: {
+				orderNo:this.state.orderNo,
+				reason:this.state.reason,
+			},
+			success: function(data) {
+				if(data.error.length || data.data == "") {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+				} else {
+					message.success("该订单已被驳回~");
+					this.setState({
+						visible:false,
+						noVisible:false,
+						reason:'',
+					});
+					this.reset();
+				};
+				
+			}.bind(this),
+		}).always(function() {
+			this.setState({
+				loading: false
+			});
+		}.bind(this));
+	},
+	//点击拒绝
+	examNo(record){
+		this.setState({
+			noVisible:true,
+			orderNo:record.orderNo
+		})
+	},
+	//关闭输入理由框
+	noCancel(){
+		this.setState({
+			noVisible:false,
+			reason:'',
+		})
+	},
     //订单详情
 	xiangqing(orderNos) {
 		$.ajax({
@@ -587,25 +631,6 @@ const PaiDan = React.createClass({
 							        	 <span>{this.state.orderRemarks}</span>
 								        </FormItem>
 							        </div>
-				                    <div className='clearfix'>
-							            <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} label="合同扫描件">
-				                            <Upload className="demandDetailShow-upload"
-				                                listType="picture-card"
-				                                fileList={this.state.orgCodeUrl}                               
-				                                onPreview={(file) => {
-				                                    this.setState({
-				                                        previewImage: file.url || file.thumbUrl,
-				                                        previewVisible: true,
-				                                    });
-				                                }} >
-				                            </Upload>
-				                            <Modal maskClosable={false} footer={null}
-				                                visible={this.state.previewVisible}
-				                                onCancel={() => { this.setState({ previewVisible: false }) }}>
-				                                <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
-				                            </Modal>
-				                        </FormItem>
-							        </div>
 							        <div className='clearfix'>
 			                    		<FormItem className="half-item"
 				                            {...formItemLayout}
@@ -630,24 +655,6 @@ const PaiDan = React.createClass({
                             				<span>{this.state.financeMobile}</span>
 			                    		</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>:""}
@@ -665,6 +672,30 @@ const PaiDan = React.createClass({
 				            </Spin>
 				        </Form>
 			        </Modal>
+			        <Modal maskClosable={false} visible={this.state.noVisible}
+                        onOk={this.noCancel} onCancel={this.noCancel}
+                        width='400px'
+                        title={'驳回理由'}                     
+                        footer=''
+                        className="admin-desc-content">
+			            <Form layout="horizontal"  id="demand-form">
+			                <Spin spinning={this.state.loading}>
+				                    <div className='clearfix'>
+				                    	<FormItem
+								            labelCol={{ span: 4 }}
+								            wrapperCol={{ span: 16 }}
+								            label="拒绝理由" >
+								                <Input type="textarea" placeholder="请输入拒绝理由" rows={4}  value={this.state.reason} 
+									    				onChange={(e)=>{this.setState({reason:e.target.value})}}/>	
+								        </FormItem>
+				                    </div>	
+				                     <div className='clearfix'>
+						                   <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>
+			            </Form >
+			        </Modal>
         </div> )
     }
 })

+ 2 - 2
js/component/manageCenter/project/task/taskAssignment.jsx

@@ -6,7 +6,7 @@ import '@/manageCenter/financialManage/distribute/public.less';
 import { Icon, Button,Form, Input, Select, Upload,Col,Spin, Table, Switch, message, DatePicker, Modal } from 'antd';
 import OrderDesc from '@/manageCenter/financialManage/orderDetail/orderDesc'
 import Assign from '@/manageCenter/publicComponent/assign';
-import {getProcessStatus,getApproval,getTaskStatus,getLiquidationStatus,getApprovedState,getProjectState,splitUrl} from '@/tools';
+import {getProcessStatus,getApproval,getTaskStatus,getLiquidationStatus,getApprovedState,getProjectState,splitUrl,getProjectStatus} from '@/tools';
 const FormItem =Form.Item;
 
 const Task = React.createClass({
@@ -129,7 +129,7 @@ const Task = React.createClass({
                     title: '项目状态',
                     dataIndex: 'projectStatus',
                     key: 'projectStatus',
-                    render: text => { return getProjectState(text)}
+                    render: text => { return getProjectStatus(text)}
                 },
                 {
                     title: '分配时间',

+ 364 - 12
js/component/manageCenter/project/task/taskCount.jsx

@@ -1,12 +1,364 @@
-import React,{Component} from 'react';
-class Task extends React.Component {
-    constructor(props) {
-        super(props);
-        this.state = {  }
-    }
-    render() { 
-        return (<div>任务统计</div>  );
-    }
-}
- 
-export default Task;
+import React from 'react';
+import { Radio, Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Popconfirm, Table, Switch, message,Calendar , DatePicker, Upload, Form ,Modal,Tabs,Card ,Col} from 'antd';
+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 { getLiquidationStatus,getApprovedState,getProcessStatus,splitUrl,getjiedian,getboutique,getNewOrderStatus,getProjectStatus} from '@/tools.js';
+const TabPane = Tabs.TabPane;
+const Dragger = Upload.Dragger;
+//图片组件
+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;
+		this.state.pojectApplicationUrl = undefined;
+	},
+	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/uploadCustomerImg"}
+                    data={{ 'sign': '' }}
+                    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 IntentionCustomer = Form.create()(React.createClass({
+	loadData(pageNo, apiUrl) {
+		this.setState({
+			visitModul:false,
+			loading: true,
+			ispage:pageNo,
+			modalVisible:false
+		});
+		$.ajax({
+			method: "get",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context +"/api/admin/orderProject/taskHoursList",
+			data: {
+				pageNo: pageNo || 1,
+				pageSize: this.state.pagination.pageSize,
+				name: this.state.customerName,//名称
+				taskId: this.state.orderNo,//订单编号
+			},
+			success: function(data) {
+				let theArr = [];
+				if(data.error.length || 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
+							 orderNo: thisdata.orderNo,//订单编号
+	                         taskName:thisdata.taskName,//任务名称
+	                         userName:thisdata.userName,//客户名称
+	                         cname:thisdata.cname,//项目品类
+	                         taskStatus:thisdata.taskStatus,//任务状态
+	                         receiverName:thisdata.receiverName,//负责人
+	                         hours:thisdata.hours,//任务工时
+						});
+					};
+				    this.state.pagination.total = data.data.totalCount;
+				};
+				if(data.data&&data.data.list&&!data.data.list.length){
+					this.state.pagination.total=0
+				}
+				this.setState({
+					dataSource: theArr,
+					pageNo: pageNo,
+					pagination: this.state.pagination,
+					selectedRowKeys:[]
+				});
+			}.bind(this),
+		}).always(function() {
+			this.setState({
+				loading: false
+			});
+		}.bind(this));
+	},
+	
+	getInitialState() {
+		return {
+			page:1,
+			releaseDate: [],
+			selectedRowKeys: [],
+			orgCodeUrl:[],
+			paginations: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: 'id',
+                    key: 'id'
+                },{
+                    title: '任务名称',
+                    dataIndex: 'taskName',
+                    key: 'taskName'
+                },{
+                    title: '订单编号',
+                    dataIndex: 'orderNo',
+                    key: 'orderNo'
+                }, {
+                    title: '业务类别',
+                    dataIndex: 'cname',
+                    key: 'cname'
+                },{
+                    title: '客户名称',
+                    dataIndex: 'userName',
+                    key: 'userName',
+                    render:(text)=>{
+                    	return (text&&text.length>9?text.substr(0,9)+'...':text)
+                    }
+                },{
+                    title: '任务负责人',
+                    dataIndex: 'receiverName',
+                    key: 'receiverName'
+                },{
+                    title: '任务状态',
+                    dataIndex: 'taskStatus',
+                    key: 'taskStatus',
+                    render:text=>{return getNewOrderStatus(text)}
+                }, {
+                    title: '工时',
+                    dataIndex: 'hours',
+                    key: 'hours'
+                }
+			],
+			data: [],
+			dataSource: [],
+			columnsX: [
+				{
+                    title: '催款人',
+                    dataIndex: 'dumBy',
+                    key: 'dumBy'
+                }, {
+                    title: '催款时间',
+                    dataIndex: 'dumTime',
+                    key: 'dumTime',
+                    
+                },{
+                    title: '催款情况',
+                    dataIndex: 'remarks',
+                    key: 'remarks'
+                }
+			],
+			dataSources: [],
+			
+		}
+	},
+	
+	//页面加载函数
+	componentWillMount() {
+		this.loadData();
+	},
+//	//整行点击
+	tableRowClick(record, index) {
+		this.setState({
+			visibles:true,
+		});
+		this.loadDatas(record.id);
+	},	
+	
+    
+	
+	
+	
+	
+	//关闭输入理由框
+	noCancel(){
+		this.setState({
+			noVisible:false
+		})
+	},
+	//搜索
+	search() {
+    	this.setState({
+    		//signBillVisible:false
+    	})
+        this.loadData();
+    },
+    //重置
+    reset() {
+    	this.setState({
+    		signBillVisible:false
+    	})
+    	this.state.orderNo='';
+    	this.state.customerName='';
+    	this.state.releaseDate[0] = undefined;
+		this.state.releaseDate[1] = undefined;
+        this.loadData();       
+    },
+    resets(){
+    	this.state.orderNo='';
+    	this.state.customerName='';
+    	this.state.releaseDate[0] = undefined;
+		this.state.releaseDate[1] = undefined;
+    },
+	getOrgCodeUrl(e) {
+        this.setState({ orgCodeUrl: e });
+    },
+	//关闭详情
+	visitCancel(e){
+		this.setState({
+			visible:false
+		})
+		this.resets();
+	},
+	visitOk(e){
+		this.setState({
+			visible:false
+		})
+		this.resets();
+	},
+	//关闭详情
+	visitCancels(e){
+		this.setState({
+			visibles:false
+		})
+		this.resets();
+	},
+	//导出
+    exportExec(){
+        var data = {
+            name: this.state.customerName?this.state.customerName:undefined,//订单负责人
+            taskId: this.state.orderNo?this.state.orderNo:undefined,//订单编号
+            startTime: this.state.releaseDate[0]?this.state.releaseDate[0]:undefined,
+            endTime: this.state.releaseDate[1]?this.state.releaseDate[1]:undefined,
+        }
+        window.location.href=(globalConfig.context+'/api/admin/orderProject/exportTaskHoursListData?'+$.param(data));
+    },
+	visitOks(e){
+		this.setState({
+			visibles:false
+		})
+		this.resets();
+	},
+	render() {
+		const formItemLayout = {
+			labelCol: { span: 8 },
+			wrapperCol: { span: 14 },
+		};
+		const FormItem = Form.Item;
+		const { RangePicker } = DatePicker;
+		const rowSelection = {
+			selectedRowKeys: this.state.selectedRowKeys,
+			onChange: (selectedRowKeys, selectedRows) => {
+				this.setState({
+					modalVisible:false,
+					selectedRows: selectedRows.slice(-1),
+					selectedRowKeys: selectedRowKeys.slice(-1)
+				});
+			},
+			onSelect: (recordt, selected, selectedRows) => {
+				this.setState({
+					modalVisible:false,
+					recordt: recordt.id
+				})
+			},
+		};
+		const hasSelected = this.state.selectedRowKeys.length > 0;
+		return(
+			<div className="user-content">
+				<div className="content-title">                  
+                    <span>工时数据统计</span>
+                </div>
+               	<div className="user-search">             
+               		<Button type="primary" onClick={this.exportExec} style={{float:'right'}}>导出工时数据</Button>
+                   <Input placeholder="客户名称" style={{width:'150px',marginBottom:'10px'}}
+	                        value={this.state.customerName}
+	                        onChange={(e) => { this.setState({ customerName: e.target.value }); }} />
+                    <Input placeholder="任务编号" style={{width:'150px'}}
+                        value={this.state.orderNo}
+                        onChange={(e) => { this.setState({ orderNo: e.target.value }); }} />
+                    <span style={{marginRight:"10px"}}>合同签订时间 :</span>
+                    <RangePicker
+                        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} style={{marginLeft:'10px'}}>搜索</Button>
+                    <Button onClick={this.reset}>重置</Button> 
+                   	<div className="patent-table">
+	                    <Spin spinning={this.state.loading}>
+	                        <Table columns={this.state.columns}
+	                            dataSource={this.state.dataSource}    
+	                            rowSelection={rowSelection}
+	                            pagination={this.state.pagination} 
+	                           />
+	                    </Spin>
+               		 </div> 
+               	</div>  
+            </div>
+			);
+	}
+}));
+export default IntentionCustomer;
+
+
+
+
+
+

+ 1 - 1
js/component/manageCenter/project/task/taskQuery.jsx

@@ -20,7 +20,7 @@ const Task = React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/orderProject/orderTaskList",
+            url: globalConfig.context + "/api/admin/orderProject/selectTaskList",
             data: {
                 pageNo: pageNo || 1,
                 pageSize: this.state.pagination.pageSize,