修改
This commit is contained in:
		
							parent
							
								
									4134f04724
								
							
						
					
					
						commit
						588d432ed1
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
import { message } from "antd/lib/index";
 | 
					import { message } from "antd/lib/index";
 | 
				
			||||||
import { Button, Popconfirm, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader, Modal } from 'antd';
 | 
					import { Button, Popconfirm, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader, Modal } from 'antd';
 | 
				
			||||||
import React from 'react';
 | 
					import React from 'react';
 | 
				
			||||||
import { initFilter, extendRule, extendInclude, initFilterGroup, extendFilterGroup, extendGroupRule, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common";
 | 
					import { initFilter, extendRule, extendInclude, extendSelectField, initFilterGroup, extendFilterGroup, extendGroupRule, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common";
 | 
				
			||||||
import ReactToPrint from "react-to-print";
 | 
					import ReactToPrint from "react-to-print";
 | 
				
			||||||
import styles from '../../CustomPages/HI/StepForm.css';
 | 
					import styles from '../../CustomPages/HI/StepForm.css';
 | 
				
			||||||
import XLSX from 'xlsx';
 | 
					import XLSX from 'xlsx';
 | 
				
			||||||
@ -15,6 +15,7 @@ class SE007AllView extends React.Component {
 | 
				
			|||||||
            data: null,
 | 
					            data: null,
 | 
				
			||||||
            total: 0,
 | 
					            total: 0,
 | 
				
			||||||
            reportCount: 0,
 | 
					            reportCount: 0,
 | 
				
			||||||
 | 
					            year:new Date().getFullYear(),
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -33,27 +34,25 @@ class SE007AllView extends React.Component {
 | 
				
			|||||||
        json.Sort = 'CREATE_TIME';
 | 
					        json.Sort = 'CREATE_TIME';
 | 
				
			||||||
        json.Order = 1;
 | 
					        json.Order = 1;
 | 
				
			||||||
        let filter = initFilterGroup(true);
 | 
					        let filter = initFilterGroup(true);
 | 
				
			||||||
        let year = new Date().getFullYear();
 | 
					        extendGroupRule(filter, "CREATE_TIME", 6, `${this.state.year}-01-01`);
 | 
				
			||||||
        extendGroupRule(filter, "CREATE_TIME", 6, `${year}-01-01`);
 | 
					        extendGroupRule(filter, "CREATE_TIME", 3, `${this.state.year}-12-31`);
 | 
				
			||||||
        extendGroupRule(filter, "CREATE_TIME", 3, `${year + 1}-01-01`);
 | 
					 | 
				
			||||||
        extendFilterGroup(json, filter);
 | 
					        extendFilterGroup(json, filter);
 | 
				
			||||||
        json.OrgType = 2;
 | 
					        extendSelectField(json, 'NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_LaunchDepartment');
 | 
					        extendSelectField(json, 'LAUNCH_TIME');
 | 
				
			||||||
        extendInclude(json, 'Nav_LaunchUser');
 | 
					        extendSelectField(json, 'END_TIME');
 | 
				
			||||||
        extendInclude(json, 'Nav_Points');
 | 
					        extendSelectField(json, 'Nav_LaunchDepartment.NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_Points.Nav_Point');
 | 
					        extendSelectField(json, 'Nav_LaunchUser.NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_JoinDepartment');
 | 
					        extendSelectField(json, 'Nav_Points.Nav_Point.NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_JoinDepartment.Nav_Department');
 | 
					        extendSelectField(json, 'Nav_Demands.Nav_User.Nav_Department.NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_Demands');
 | 
					        extendSelectField(json, 'Nav_Demands.Nav_Department.NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_Demands.Nav_User');
 | 
					        extendSelectField(json, 'Nav_Demands.Nav_Items.Nav_DEMAND.NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_Demands.Nav_User.Nav_Department');
 | 
					        extendSelectField(json, 'Nav_Demands.OK');
 | 
				
			||||||
        extendInclude(json, 'Nav_Demands.Nav_Department');
 | 
					        extendSelectField(json, 'Nav_Demands.OTHER');
 | 
				
			||||||
        extendInclude(json, 'Nav_Demands.Nav_Items');
 | 
					        extendSelectField(json, 'Nav_Demands.Nav_User.NAME');
 | 
				
			||||||
        extendInclude(json, 'Nav_Demands.Nav_Items.Nav_DEMAND');
 | 
					 | 
				
			||||||
        this.props.dispatch({
 | 
					        this.props.dispatch({
 | 
				
			||||||
            type: 'app/getDataByPost',
 | 
					            type: 'app/getDataByPost',
 | 
				
			||||||
            payload: json,
 | 
					            payload: json,
 | 
				
			||||||
            url: 'SE/TrainSurvey/OrderPaged',
 | 
					            url: 'SE/SETrainSurvey/OrderPaged',
 | 
				
			||||||
            onComplete: (ret) => {
 | 
					            onComplete: (ret) => {
 | 
				
			||||||
                if (!ret)
 | 
					                if (!ret)
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
@ -88,7 +87,7 @@ class SE007AllView extends React.Component {
 | 
				
			|||||||
                    let name = it.Nav_User.Nav_Department.NAME;
 | 
					                    let name = it.Nav_User.Nav_Department.NAME;
 | 
				
			||||||
                    if (name == '宁化行洛坑钨矿有限公司') {
 | 
					                    if (name == '宁化行洛坑钨矿有限公司') {
 | 
				
			||||||
                        name = '公司领导';
 | 
					                        name = '公司领导';
 | 
				
			||||||
                    } 
 | 
					                    }
 | 
				
			||||||
                    if (ROWS[idx].department.indexOf(name) == -1) {
 | 
					                    if (ROWS[idx].department.indexOf(name) == -1) {
 | 
				
			||||||
                        ROWS[idx].department.push(name);
 | 
					                        ROWS[idx].department.push(name);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
@ -106,6 +105,11 @@ class SE007AllView extends React.Component {
 | 
				
			|||||||
            reportCount,
 | 
					            reportCount,
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    onChange = (value) => {
 | 
				
			||||||
 | 
					        this.setState({
 | 
				
			||||||
 | 
					            year: value
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    onTableBtnExport() {
 | 
					    onTableBtnExport() {
 | 
				
			||||||
        let TableWrap = document.getElementById('tableId' + this.props.data.id);
 | 
					        let TableWrap = document.getElementById('tableId' + this.props.data.id);
 | 
				
			||||||
        let Table = TableWrap.getElementsByTagName('table')[0];
 | 
					        let Table = TableWrap.getElementsByTagName('table')[0];
 | 
				
			||||||
@ -125,23 +129,23 @@ class SE007AllView extends React.Component {
 | 
				
			|||||||
                    content={() => this.componentRef}
 | 
					                    content={() => this.componentRef}
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
                <Button style={{ marginLeft: '8px' }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
 | 
					                <Button style={{ marginLeft: '8px' }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
 | 
				
			||||||
 | 
					                <Input style={{width:'100px',marginLeft:'8px'}} onChange={(evt) => this.onChange(evt.target.value)} placeholder="统计年份" value={this.state.year}/>
 | 
				
			||||||
 | 
					                <Button type={'primary'} style={{ marginLeft: '8px' }} onClick={() => this.loadData()} >查询</Button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id}>
 | 
					            <div ref={el => (this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id}>
 | 
				
			||||||
                <h1 style={{ textAlign: 'center', margin: '15px' }}>公司培训需求调查统计表</h1>
 | 
					                <h1 style={{ textAlign: 'center', margin: '15px' }}>公司培训需求调查统计表</h1>
 | 
				
			||||||
                <table style={{ width: '100%', textAlign: 'center', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
 | 
					                <table style={{ width: '100%', textAlign: 'center', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
 | 
				
			||||||
                    <tbody>
 | 
					                    <tbody>
 | 
				
			||||||
                        <tr>
 | 
					                        <tr>
 | 
				
			||||||
                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>调查年度</td>
 | 
					 | 
				
			||||||
                            <td colSpan={4} rowSpan={1}>{new Date().getFullYear()}</td>
 | 
					 | 
				
			||||||
                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>调查部门</td>
 | 
					                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>调查部门</td>
 | 
				
			||||||
                            <td colSpan={4} rowSpan={1}>{'全公司'}</td>
 | 
					                            <td colSpan={5} rowSpan={1}>{'全公司'}</td>
 | 
				
			||||||
 | 
					 | 
				
			||||||
                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>调查份数</td>
 | 
					                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>调查份数</td>
 | 
				
			||||||
                            <td colSpan={2} rowSpan={1}>{total}</td>
 | 
					                            <td colSpan={4} rowSpan={1}>{total}</td>
 | 
				
			||||||
                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>反馈份数</td>
 | 
					                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>反馈份数</td>
 | 
				
			||||||
                            <td colSpan={2} rowSpan={1}>{reportCount}</td>
 | 
					                            <td colSpan={4} rowSpan={1}>{reportCount}</td>
 | 
				
			||||||
                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>反馈比例</td>
 | 
					                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>反馈比例</td>
 | 
				
			||||||
                            <td colSpan={2} rowSpan={1}>{rate + '%'}</td>
 | 
					                            <td colSpan={3} rowSpan={1}>{rate + '%'}</td>
 | 
				
			||||||
                        </tr>
 | 
					                        </tr>
 | 
				
			||||||
                        <tr>
 | 
					                        <tr>
 | 
				
			||||||
                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>序号</td>
 | 
					                            <td colSpan={2} rowSpan={1} className={styles.fontBold}>序号</td>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user