培训 分数显示修改
This commit is contained in:
parent
5b0b309aab
commit
4a8f302ed8
@ -1,5 +1,5 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import {Button, Popconfirm, Row, Col,Checkbox,Radio, Form, Input, Select, Table,Upload, Icon, PageHeader,Modal,Spin } from 'antd';
|
||||
import { Button, Popconfirm, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader, Modal, Spin } from 'antd';
|
||||
import React from 'react';
|
||||
import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common";
|
||||
import ReactToPrint from "react-to-print";
|
||||
@ -32,9 +32,9 @@ class SE005ReportEdit extends React.Component {
|
||||
};
|
||||
};
|
||||
componentDidMount() {
|
||||
if (this.state.ALL){
|
||||
if (this.state.ALL) {
|
||||
this.loadList();
|
||||
}else{
|
||||
} else {
|
||||
this.loadData();
|
||||
}
|
||||
}
|
||||
@ -45,21 +45,21 @@ class SE005ReportEdit extends React.Component {
|
||||
loadList = () => {
|
||||
let json = initFilter(this.props.login.OrgId);
|
||||
json.OrgType = 2;
|
||||
this.setState({loading: true})
|
||||
this.setState({ loading: true })
|
||||
this.props.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
payload: json,
|
||||
url: 'SE/SESafeSurvey/GetReportList',
|
||||
onComplete: (ret) => {
|
||||
this.setState({loading: false})
|
||||
this.setState({ loading: false })
|
||||
if (!ret)
|
||||
return;
|
||||
if (ret.length == 0){
|
||||
if (ret.length == 0) {
|
||||
message.warn("当年未查到有效的公司调查问卷报表");
|
||||
return;
|
||||
}
|
||||
let taskid = this.props.data.id;
|
||||
if (!ret.find(it => it.Key === taskid)){
|
||||
if (!ret.find(it => it.Key === taskid)) {
|
||||
taskid = ret[0].Key;
|
||||
}
|
||||
|
||||
@ -76,16 +76,16 @@ class SE005ReportEdit extends React.Component {
|
||||
let json = initFilter(this.props.login.OrgId);
|
||||
json.OrgType = 2;
|
||||
json.Parameter3 = this.state.type;
|
||||
if (this.state.ALL){
|
||||
if (this.state.ALL) {
|
||||
if (!this.state.taskid)
|
||||
return;
|
||||
json.Parameter2 = this.state.taskid;
|
||||
}else{
|
||||
} else {
|
||||
if (!this.state.surveyid)
|
||||
return;
|
||||
json.Parameter1 = this.state.surveyid;
|
||||
}
|
||||
this.setState( {
|
||||
this.setState({
|
||||
data: null,
|
||||
loading: true
|
||||
});
|
||||
@ -94,16 +94,16 @@ class SE005ReportEdit extends React.Component {
|
||||
payload: json,
|
||||
url: 'SE/SESafeSurvey/GetReport',
|
||||
onComplete: (ret) => {
|
||||
this.setState({loading: false})
|
||||
if (!ret){
|
||||
this.setState({ loading: false })
|
||||
if (!ret) {
|
||||
return;
|
||||
}
|
||||
this.setState({data: ret})
|
||||
this.setState({ data: ret })
|
||||
}
|
||||
});
|
||||
}
|
||||
onApprove = ()=>{
|
||||
const { ALL,data } = this.state;
|
||||
onApprove = () => {
|
||||
const { ALL, data } = this.state;
|
||||
let json = {
|
||||
Parameter1: data.SURVEY[0].ID,
|
||||
Parameter2: this.props.data.TaskID,
|
||||
@ -118,7 +118,7 @@ class SE005ReportEdit extends React.Component {
|
||||
}
|
||||
});
|
||||
}
|
||||
fmtEnum(name,value){
|
||||
fmtEnum(name, value) {
|
||||
const enums = this.props.app.enums;
|
||||
if (!enums || !enums[name]) return '';
|
||||
return enums[name].enums[value] || '';
|
||||
@ -131,13 +131,13 @@ class SE005ReportEdit extends React.Component {
|
||||
name += '.xlsx';
|
||||
XLSX.writeFile(wb, name)
|
||||
}
|
||||
getJoinDepartment(depart){
|
||||
getJoinDepartment(depart) {
|
||||
let arr = [];
|
||||
for(let it of depart){
|
||||
if (it.Nav_Department){
|
||||
if (it.Nav_Department.NAME == "宁化行洛坑钨矿有限公司"){
|
||||
for (let it of depart) {
|
||||
if (it.Nav_Department) {
|
||||
if (it.Nav_Department.NAME == "宁化行洛坑钨矿有限公司") {
|
||||
arr.push("公司领导")
|
||||
}else{
|
||||
} else {
|
||||
arr.push(it.Nav_Department.NAME)
|
||||
}
|
||||
}
|
||||
@ -145,10 +145,10 @@ class SE005ReportEdit extends React.Component {
|
||||
return arr;
|
||||
}
|
||||
render() {
|
||||
const { ALL,data,list,loading } = this.state;
|
||||
const { ALL, data, list, loading } = this.state;
|
||||
const count = data && data.ROWS && data.ROWS.length > 0 && data.ROWS[0].length || 1;
|
||||
const SPAN = Math.floor(24 / count) || 1;
|
||||
const TITLE_SPAN = Math.max(24 - count * SPAN,0) + SPAN;
|
||||
const TITLE_SPAN = Math.max(24 - count * SPAN, 0) + SPAN;
|
||||
const canApprove = this.props.data.tableKey == "1"
|
||||
return <div>
|
||||
<div style={{ padding: '10px' }}>
|
||||
@ -160,16 +160,16 @@ class SE005ReportEdit extends React.Component {
|
||||
<Button style={{ marginLeft: '8px' }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
|
||||
{
|
||||
ALL &&
|
||||
<Select style={{ fontSize: 14, width: "100px",marginLeft: '8px' }}
|
||||
<Select style={{ fontSize: 14, width: "100px", marginLeft: '8px' }}
|
||||
showSearch
|
||||
value={this.state.taskid}
|
||||
onChange={val => {
|
||||
this.setState({taskid: val})
|
||||
this.setState({ taskid: val })
|
||||
this.loadData();
|
||||
} }
|
||||
}}
|
||||
>
|
||||
{
|
||||
list && list.map( it => {
|
||||
list && list.map(it => {
|
||||
return <Option key={it.Key} value={it.Key}>{it.Value}</Option>
|
||||
}
|
||||
)
|
||||
@ -182,7 +182,7 @@ class SE005ReportEdit extends React.Component {
|
||||
onChange={val => {
|
||||
this.state.type = val;
|
||||
this.loadData();
|
||||
} }
|
||||
}}
|
||||
>
|
||||
<Option value={"部门"}>{"部门"}</Option>
|
||||
<Option value={"人员"}>{"人员"}</Option>
|
||||
@ -193,18 +193,18 @@ class SE005ReportEdit extends React.Component {
|
||||
}
|
||||
</div>
|
||||
<div ref={el => (this.componentRef = el)} id={'tableId' + this.props.data.id} style={{ padding: '20px' }}>
|
||||
<h1 style={{ textAlign: 'center'}}>{this.state.ALL ? '安全意识调查问卷公司报表' : '安全意识调查问卷部门报表'}</h1>
|
||||
<h1 style={{ textAlign: 'center' }}>{this.state.ALL ? '安全意识调查问卷公司报表' : '安全意识调查问卷部门报表'}</h1>
|
||||
<Spin spinning={this.state.loading}>
|
||||
{
|
||||
data && <>
|
||||
<table style={{ width: '100%', textAlign: 'center', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
|
||||
<tbody>
|
||||
{
|
||||
data.SURVEY && data.SURVEY.map(SURVEY =>{
|
||||
data.SURVEY && data.SURVEY.map(SURVEY => {
|
||||
return <>
|
||||
<tr>
|
||||
<td colSpan={4} rowSpan={1} className={styles.fontBold}>调查名称</td>
|
||||
<td colSpan={20} rowSpan={1}>{SURVEY.NAME }</td>
|
||||
<td colSpan={20} rowSpan={1}>{SURVEY.NAME}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colSpan={3} rowSpan={1} className={styles.fontBold}>发起时间</td>
|
||||
@ -222,7 +222,7 @@ class SE005ReportEdit extends React.Component {
|
||||
</tr>
|
||||
<tr>
|
||||
<td colSpan={4} rowSpan={1} className={styles.fontBold}>调查内容</td>
|
||||
<td colSpan={20} rowSpan={1}>{ SURVEY.Nav_Points && SURVEY.Nav_Points.map(it => it.Nav_Point.NAME).join('、')}</td>
|
||||
<td colSpan={20} rowSpan={1}>{SURVEY.Nav_Points && SURVEY.Nav_Points.map(it => it.Nav_Point.NAME).join('、')}</td>
|
||||
</tr>
|
||||
</>
|
||||
})
|
||||
@ -231,10 +231,10 @@ class SE005ReportEdit extends React.Component {
|
||||
<td colSpan={24} rowSpan={1} className={styles.fontBold}>答案正确率(百分比)</td>
|
||||
</tr>
|
||||
{
|
||||
data.ROWS && data.ROWS.map((row,ridx) =>{
|
||||
data.ROWS && data.ROWS.map((row, ridx) => {
|
||||
return <tr>
|
||||
{
|
||||
row.map((col,cidx) =>{
|
||||
row.map((col, cidx) => {
|
||||
return <td colSpan={cidx == 0 ? TITLE_SPAN : SPAN} rowSpan={1} className={ridx == 0 || cidx == 0 ? styles.fontBold : null}>{col}{ridx == 0 || cidx == 0 ? null : "%"}</td>
|
||||
})
|
||||
}
|
||||
@ -246,7 +246,7 @@ class SE005ReportEdit extends React.Component {
|
||||
</>
|
||||
}
|
||||
{
|
||||
!data && !loading && <div style={{ width: '100%', textAlign: 'center'}}> 暂未查到有效数据 </div>
|
||||
!data && !loading && <div style={{ width: '100%', textAlign: 'center' }}> 暂未查到有效数据 </div>
|
||||
}
|
||||
</Spin>
|
||||
|
||||
|
||||
@ -159,7 +159,8 @@ class SE062ShowPrint extends React.Component {
|
||||
<Descriptions.Item label="部门">{data && data.Nav_Department ? data.Nav_Department.NAME : ''}</Descriptions.Item>
|
||||
<Descriptions.Item label="岗位">{data && data.Nav_Post ? data.Nav_Post.NAME : ''}</Descriptions.Item>
|
||||
<Descriptions.Item label="分数">{data ? data.SCORE : null}</Descriptions.Item>
|
||||
<Descriptions.Item label="考核结果">{data ? data.EXAMINATION_RESULTS == 1 ? "合格" : "不合格" : null}</Descriptions.Item>
|
||||
{/* <Descriptions.Item label="考核结果">{data ? data.EXAMINATION_RESULTS == 1 ? "合格" : "不合格" : null}</Descriptions.Item> */}
|
||||
<Descriptions.Item label="考核结果">{(data && data.EXAMINATION_RESULTS && data.SCORE) ? enums.SEExaminationResultsEnum.enums[data.EXAMINATION_RESULTS] : ""}</Descriptions.Item>
|
||||
<Descriptions.Item label="培训形式">{data ? this.returnModel(data.Nav_NewUser.TRAIN_MODEL) : null}</Descriptions.Item>
|
||||
<Descriptions.Item label="附件">{showFiles(data.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user