1、培训签到 隐藏分数查看(0分很奇怪,合格率计算方式修改 有签到的人计算) 2、试卷查看时 只有待办进去才能看到提交试卷的按钮 3、选择培训开始时间,签到时间默认 提前5分钟 4、培训记录刷新时,判断给考核成绩添加默认值、是否签到 、签到时间
This commit is contained in:
parent
3ce5307907
commit
9f3b783207
@ -79,7 +79,8 @@ class SE018EditPage extends React.Component {
|
||||
updateData(data) {
|
||||
let isApprove = false;
|
||||
// if (data.Nav_Notify.Nav_TrainCheckType.NAME == "笔试") {
|
||||
if (data.Nav_Notify.CHECKTYPE == 51 || data.Nav_Notify.CHECKTYPE == 56 || data.Nav_Notify.CHECKTYPE == 81) {
|
||||
if ((data.Nav_Notify.CHECKTYPE == 51 || data.Nav_Notify.CHECKTYPE == 56 || data.Nav_Notify.CHECKTYPE == 81) && data.STATUS > 1) {
|
||||
//data.STATUS > 1 签到的时候 看到分数为0 怪怪的
|
||||
this.state.isExam = true;
|
||||
this.state.isShow = "table-cell";
|
||||
}
|
||||
@ -88,8 +89,11 @@ class SE018EditPage extends React.Component {
|
||||
data.Nav_Users = data.Nav_Users.filter(item => item.STATUS == 0);
|
||||
|
||||
var passRateThis = 0
|
||||
var userAll = data.Nav_Users.filter(e => e.STATUS == 0 && e.ENABLE_STATUS == 0 && e.EXAMINATION_RESULTS != null)
|
||||
var userPass = data.Nav_Users.filter(e => e.STATUS == 0 && e.ENABLE_STATUS == 0 && e.EXAMINATION_RESULTS != null && e.EXAMINATION_RESULTS == 1)
|
||||
// var userAll = data.Nav_Users.filter(e => e.STATUS == 0 && e.ENABLE_STATUS == 0 && e.EXAMINATION_RESULTS != null)
|
||||
// var userPass = data.Nav_Users.filter(e => e.STATUS == 0 && e.ENABLE_STATUS == 0 && e.EXAMINATION_RESULTS != null && e.EXAMINATION_RESULTS == 1)
|
||||
var userAll = data.Nav_Users.filter(e => e.OK)
|
||||
var userPass = data.Nav_Users.filter(e => e.OK && e.EXAMINATION_RESULTS == 1)
|
||||
|
||||
if (userAll && userAll.length > 0 && userPass && userPass.length > 0) {
|
||||
passRateThis = (userPass.length / userAll.length).toFixed(4) * 100;
|
||||
}
|
||||
@ -226,7 +230,7 @@ class SE018EditPage extends React.Component {
|
||||
{
|
||||
this.state.isView && <>
|
||||
<ReactToPrint
|
||||
trigger={() => <Button type={'primary'} icon={'printer'} >打印</Button>}
|
||||
trigger={() => <Button type={'primary'} style={{ marginLeft: '8px' }} icon={'printer'} >打印</Button>}
|
||||
content={() => this.componentRef}
|
||||
/>
|
||||
<Button style={{ marginLeft: '8px' }} onClick={() => this.onTableBtnExport()} icon="export" >导出</Button>
|
||||
@ -385,8 +389,8 @@ class SE018EditPage extends React.Component {
|
||||
{
|
||||
!signable && (
|
||||
this.state.isShow && data.Nav_Notify.CHECKTYPE ? (
|
||||
data.Nav_Notify.CHECKTYPE == 51 ? <td colSpan={4} rowSpan={1} ><div onClick={() => this.showDetailModal(it.RECORD_ID, it.USER_ID)}><Icon type="eye" style={{ color: "#005b9b", cursor: "pointer" }} /></div></td>
|
||||
: <td colSpan={4} rowSpan={1} > {showFiles(it?.Nav_Files, config.picServerHost, this, false)}</td>
|
||||
data.Nav_Notify.CHECKTYPE == 51 ? <td colSpan={4} rowSpan={1} style={{ display: this.state.isShow }} ><div onClick={() => this.showDetailModal(it.RECORD_ID, it.USER_ID)}><Icon type="eye" style={{ color: "#005b9b", cursor: "pointer" }} /></div></td>
|
||||
: <td colSpan={4} rowSpan={1} style={{ display: this.state.isShow }} > {showFiles(it?.Nav_Files, config.picServerHost, this, false)}</td>
|
||||
)
|
||||
: <td colSpan={4} rowSpan={1} style={{ display: this.state.isShow }}><div onClick={() => this.showDetailModal(it.RECORD_ID, it.USER_ID)}><Icon type="eye" style={{ color: "#005b9b", cursor: "pointer" }} /></div></td>
|
||||
)}
|
||||
|
||||
@ -218,7 +218,11 @@ class SE018PaperPage extends React.Component {
|
||||
hasAnswered = false
|
||||
else
|
||||
hasAnswered = true
|
||||
|
||||
if (!hasAnswered) {
|
||||
if (this.props.data.tableKey == null || this.props.data.tableKey == '2') {
|
||||
hasAnswered = true
|
||||
}
|
||||
}
|
||||
var perPaper = []
|
||||
if (isCourEdit == false)
|
||||
perPaper = papers //提供显示
|
||||
@ -641,16 +645,10 @@ class SE018PaperPage extends React.Component {
|
||||
}, () => {
|
||||
this.getPapers();
|
||||
})
|
||||
|
||||
}}
|
||||
filterOption={(input, option) =>
|
||||
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
>
|
||||
filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} >
|
||||
{
|
||||
this.state.UserList.map(usr =>
|
||||
<Option key={usr.ID} value={usr.ID}>{usr.NAME}</Option>
|
||||
)
|
||||
this.state.UserList.map(usr => <Option key={usr.ID} value={usr.ID}>{usr.NAME}</Option>)
|
||||
}
|
||||
</Select>
|
||||
}
|
||||
|
||||
@ -17,11 +17,12 @@ export default {
|
||||
let minutes = (Date.parse(stateData.TRAIN_END_TIME) - Date.parse(stateData.TRAIN_START_TIME)) / 1000 / 60 / 45;
|
||||
temps.push({ field: 'HOURS', value: minutes.toFixed(1) }) // setFieldValue("HOURS", minutes.toFixed(1));
|
||||
}
|
||||
// if (colInfo.FIELD_NAME == 'TRAIN_START_TIME' && stateData.TRAIN_START_TIME) {
|
||||
// //默认自动处理 开始培训前5分钟开始签到
|
||||
// var TRAIN_END_TIME = new Date(stateData.TRAIN_START_TIME);
|
||||
// temps.push({ field: 'DT_START_SIGN', value: new Date(TRAIN_END_TIME.setMinutes(TRAIN_END_TIME.getMinutes() - 5)) })
|
||||
// }
|
||||
if (colInfo.FIELD_NAME == 'TRAIN_START_TIME' && stateData.TRAIN_START_TIME) {
|
||||
//默认自动处理 开始培训前5分钟开始签到
|
||||
var TRAIN_END_TIME = new Date(stateData.TRAIN_START_TIME);
|
||||
stateData.DT_START_SIGN = new Date(TRAIN_END_TIME.setMinutes(TRAIN_END_TIME.getMinutes() - 5))
|
||||
temps.push({ field: 'DT_START_SIGN', value: stateData.DT_START_SIGN.Format('yyyy-MM-dd HH:mm:ss') })
|
||||
}
|
||||
if (temps && temps.length > 0)
|
||||
setFieldValueByBatch(temps);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { message } from "antd/lib/index";
|
||||
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, empty } from "../../utils/common";
|
||||
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, initFilterGroup, extendGroupRule, extendFilterGroup, empty } from "../../utils/common";
|
||||
import { connect } from 'dva';
|
||||
/**
|
||||
* @return {string}
|
||||
@ -23,9 +23,35 @@ export default {
|
||||
|
||||
if (stateData.Nav_Users && stateData.Nav_Users.length > 0) {
|
||||
stateData.Nav_Users.forEach(e => {
|
||||
if (e.STATUS == 0 && e.EXAMINATION_RESULTS == undefined)
|
||||
e.EXAMINATION_RESULTS = 1
|
||||
if (e.STATUS == 0 && e.EXAMINATION_RESULTS == undefined && e.DT_SIGN != null && stateData.Nav_Notify && stateData.Nav_Notify.CHECKTYPE == 56) {
|
||||
e.EXAMINATION_RESULTS = 1 //默认合格 不考试 Nav_Notify.CHECKTYPE 56
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
btnRefresh: (params) => {//params
|
||||
let json = initFilter(params.login.OrgId);
|
||||
extendRule(json, 'RECORD_ID', 1, params.stateData.ID);
|
||||
params.dispatch({
|
||||
type: 'app/getDataByPost',
|
||||
url: 'SE/TrainRecordUser/Entities',
|
||||
payload: json,
|
||||
onComplete: (ret) => {
|
||||
if (ret && ret.length > 0) {
|
||||
params.stateData.Nav_Users.forEach(e => {
|
||||
let r = ret.find(x => x.ID == e.ID)
|
||||
if (e.DT_SIGN != r.DT_SIGN) {
|
||||
e.DT_SIGN = r.DT_SIGN
|
||||
e.OK = r.OK
|
||||
e.EXAMINATION_RESULTS = r.EXAMINATION_RESULTS
|
||||
if (e.DT_SIGN != null && e.EXAMINATION_RESULTS == null && params.stateData.Nav_Notify && params.stateData.Nav_Notify.CHECKTYPE == 56) {
|
||||
e.EXAMINATION_RESULTS = 1 //有签到 默认 考核通过 不考试 Nav_Notify.CHECKTYPE 56
|
||||
}
|
||||
}
|
||||
})
|
||||
params.setState({ data: params.stateData });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user