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