Browse Source

部门统计添加时间筛选

mentoswzq 4 years ago
parent
commit
cd93809495

+ 28 - 24
js/component/manageCenter/components/checkProject/payRecord.js

@@ -459,30 +459,34 @@ class PayRecord extends Component{
                             {/* projectType 0正常 1专利 2软著 3审计*/}
                             {
                                 paymentDetails.chooseType === 2 || this.props.projectType === 1 || this.props.projectType === 2 ?
-                                    <Form.Item
-                                        {...formItemLayout}
-                                        className='formItemStyle'
-                                        label="本次申请支付数量:"
-                                    >
-                                        {getFieldDecorator('quantity', {
-                                            initialValue: paymentDetails.quantity,
-                                            rules: [{ required: true, message: '请输入本次申请支付数量!' }],
-                                        })(
-                                            <Input
-                                                type={'number'}
-                                                style={{ width: '200px' }}
-                                                disabled={this.props.isAuditPaymentGLY ? this.props.isAuditPaymentGLY : ( this.props.isAuditPayment ? this.state.paymentDetails.status !== 0 : this.state.paymentDetails.status !== 2)}
-                                                placeholder="请输入本次申请支付数量"
-                                                onChange={(e)=>{
-                                                    if(!isNaN(parseFloat(paymentDetails.initialUnitPrice))){
-                                                        this.props.form.setFieldsValue({
-                                                            applicationAmount: ((parseFloat(paymentDetails.initialUnitPrice) * 1000000) * e.target.value) / 1000000,
-                                                        })
-                                                    }
-                                                }}
-                                            />
-                                        )}
-                                    </Form.Item> : <div/>
+                                    <div style={{
+                                        marginBottom:'8px'
+                                    }}>
+                                        <Form.Item
+                                            {...formItemLayout}
+                                            className='formItemStyle'
+                                            label="本次申请支付数量:"
+                                        >
+                                            {getFieldDecorator('quantity', {
+                                                initialValue: paymentDetails.quantity,
+                                                rules: [{ required: true, message: '请输入本次申请支付数量!' }],
+                                            })(
+                                                <Input
+                                                    type={'number'}
+                                                    style={{ width: '200px' }}
+                                                    disabled={this.props.isAuditPaymentGLY ? this.props.isAuditPaymentGLY : ( this.props.isAuditPayment ? this.state.paymentDetails.status !== 0 : this.state.paymentDetails.status !== 2)}
+                                                    placeholder="请输入本次申请支付数量"
+                                                    onChange={(e)=>{
+                                                        if(!isNaN(parseFloat(paymentDetails.initialUnitPrice))){
+                                                            this.props.form.setFieldsValue({
+                                                                applicationAmount: ((parseFloat(paymentDetails.initialUnitPrice) * 1000000) * e.target.value) / 1000000,
+                                                            })
+                                                        }
+                                                    }}
+                                                />
+                                            )}
+                                        </Form.Item>
+                                    </div> : <div/>
                             }
                             <Form.Item
                                 {...formItemLayout}

+ 4 - 0
js/component/manageCenter/customer/statistics/departmentStatistics/customerDetails.jsx

@@ -67,6 +67,8 @@ class CustomerDetails extends Component{
                 pageSize:this.state.pagination.pageSize,
                 aid:this.props.aid,
                 type:this.props.type,                       //0 所有 1新增 2领取 3已签 4面谈
+                startTime:this.props.startTime,
+                endTime:this.props.endTime,
             },
             success: function(data) {
                 let theArr = [];
@@ -131,6 +133,8 @@ CustomerDetails.propTypes={
     onCancel: PropTypes.func,
     aid: PropTypes.number,      //员工ID
     type: PropTypes.number,     //列表类型 客户总数 成交客户总数 新增客户数等等
+    startTime:PropTypes.string, //开始时间
+    endTime:PropTypes.string,   //结束时间
 }
 
 CustomerDetails.defaultProps={

+ 39 - 7
js/component/manageCenter/customer/statistics/departmentStatistics/index.jsx

@@ -1,6 +1,6 @@
 import React,{Component} from 'react';
 import {
-    Button,
+    Button, DatePicker,
     Input,
     message,
     Select,
@@ -10,13 +10,17 @@ import {
 import './index.less';
 import $ from "jquery/src/ajax";
 import CustomerDetails from './customerDetails';
+import moment from "moment";
+
+const { RangePicker } = DatePicker;
 
 class DepartmentStatistics extends Component{
     constructor(props) {
         super(props);
         this.state={
-            superId:'',
+            superId:undefined,
             nameSearch: '',
+            releaseDate: [],
 
             columns: [
                 {
@@ -176,6 +180,12 @@ class DepartmentStatistics extends Component{
         if(this.state.nameSearch){
             data.aName = this.state.nameSearch;
         }
+        if(this.state.releaseDate[0]){
+            data.startTime = this.state.releaseDate[0]
+        }
+        if(this.state.releaseDate[1]){
+            data.endTime = this.state.releaseDate[1]
+        }
         $.ajax({
             method: "get",
             dataType: "json",
@@ -238,8 +248,9 @@ class DepartmentStatistics extends Component{
 
     reset(){
         this.setState({
-            superId:'',
+            superId:undefined,
             nameSearch: '',
+            releaseDate: [],
         },()=>{
             this.loadData();
         });
@@ -296,10 +307,12 @@ class DepartmentStatistics extends Component{
                 </div>
                 <div className="user-search" style={{display:'flex',alignItems:'center'}}>
                     <div>
-                        <Select placeholder="请选择部门"
-                                style={{ width:200,marginLeft:10}}
-                                value={this.state.superId}
-                                onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
+                        <Select
+                            placeholder="请选择部门"
+                            style={{ width:200,marginLeft:10}}
+                            value={this.state.superId}
+                            onChange={(e) => { this.setState({ superId: e }) }}
+                            notFoundContent="未获取到上级组织列表">
                             {this.state.contactsOption}
                         </Select>
                     </div>
@@ -311,6 +324,23 @@ class DepartmentStatistics extends Component{
                             this.setState({ nameSearch: e.target.value });
                         }}
                     />
+                    <div style={{
+                        marginTop: '10px',
+                    }}>
+                        <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 });
+                            }}
+                        />
+                    </div>
                     <Button
                         type="primary"
                         style={{ marginLeft: "10px", marginRight: 10 }}
@@ -334,6 +364,8 @@ class DepartmentStatistics extends Component{
                 {this.state.customerVisible ? <CustomerDetails
                     aid={this.state.aid}
                     type={this.state.type}
+                    startTime={this.state.releaseDate[0]}
+                    endTime={this.state.releaseDate[1]}
                     visible={this.state.customerVisible}
                     onCancel={()=>{
                         this.setState({