This commit is contained in:
何美荣 2025-11-30 02:16:58 +08:00
commit 7e3de4bd37

View File

@ -54,10 +54,12 @@ class SE061PaperPage extends React.Component {
if (typeof this.props.data.onCancel != "undefined" && typeof this.props.data.onCancel == 'function')
this.props.data.onCancel();
}
getUsers = () => {
getUsers = (dataid) => {
debugger
let json = initFilter(this.props.login.OrgId);
json.OrgType = 2;
extendRule(json, 'RECORD_ID', 1, this.props.data.id);
// extendRule(json, 'RECORD_ID', 1, this.props.data.id);
extendRule(json, 'RECORD_ID', 1, dataid);
extendInclude(json, 'Nav_User');
this.state.loading = true;
this.props.dispatch({
@ -88,6 +90,12 @@ class SE061PaperPage extends React.Component {
message.warn("当前用户没有问卷");
}
}
} else {
this.setState({
SelUsrID: '',
papers: []
})
}
}
});
@ -142,10 +150,10 @@ class SE061PaperPage extends React.Component {
}
});
}
loadData = () => {
loadData = (dataid) => {
if (this.props.data.id == "")
return;
this.getUsers();
this.getUsers(dataid);
}
onSave = () => {
if (this.state.readonly) {
@ -355,127 +363,127 @@ class SE061PaperPage extends React.Component {
<div ref={el => (this.componentRef = el)} id={'tableId' + this.props.data.id}>
<h1 style={{ textAlign: 'center' }}>培训在线答题</h1>
<Spin spinning={this.state.loading}>
<table style={{ width: '100%', textAlign: 'center', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
<tbody>
<tr>
<td colSpan={4} rowSpan={1} className={styles.fontBold}>工号</td>
<td colSpan={4} rowSpan={1}>{SelUsr && SelUsr.CODE}</td>
<td colSpan={4} rowSpan={1} className={styles.fontBold}>答卷人</td>
<td colSpan={4} rowSpan={1}>{SelUsr && SelUsr.NAME}</td>
<td colSpan={4} rowSpan={1} className={styles.fontBold}>成绩</td>
<td colSpan={4} rowSpan={1}>{this.CalcScore()}</td>
</tr>
<tr>
<td colSpan={24} rowSpan={1} className={styles.fontBold}>问卷</td>
</tr>
{
papers.map((it, idx) => {
return (
<tr key={it.ID}>
<td colSpan={24} rowSpan={1}>
<table border={0} className={SEstyles.TestPaperItem}>
<tbody>
<tr>
<td colSpan={24} rowSpan={1} className={SEstyles.TestTiltle}>
<span>{idx + 1}.</span>
<span>{it.Nav_Test.NAME}</span>
<span>{this.getType(it.Nav_Test.TYPE)}</span>
</td>
</tr>
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? answer : null}>
<table style={{ width: '100%', textAlign: 'center', borderTop: '1px solid #333', borderLeft: '1px solid #333' }} className={styles.PrintForm}>
<tbody>
<tr>
<td colSpan={4} rowSpan={1} className={styles.fontBold}>工号</td>
<td colSpan={4} rowSpan={1}>{SelUsr && SelUsr.CODE}</td>
<td colSpan={4} rowSpan={1} className={styles.fontBold}>答卷人</td>
<td colSpan={4} rowSpan={1}>{SelUsr && SelUsr.NAME}</td>
<td colSpan={4} rowSpan={1} className={styles.fontBold}>成绩</td>
<td colSpan={4} rowSpan={1}>{this.CalcScore()}</td>
</tr>
<tr>
<td colSpan={24} rowSpan={1} className={styles.fontBold}>问卷</td>
</tr>
{
papers.map((it, idx) => {
return (
<tr key={it.ID}>
<td colSpan={24} rowSpan={1}>
<table border={0} className={SEstyles.TestPaperItem}>
<tbody>
<tr>
<td colSpan={24} rowSpan={1} className={SEstyles.TestTiltle}>
<span>{idx + 1}.</span>
<span>{it.Nav_Test.NAME}</span>
<span>{this.getType(it.Nav_Test.TYPE)}</span>
</td>
</tr>
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? answer : null}>
{
it.Nav_Test.TYPE === 0 ?
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
<span>正确</span>
</td>
:
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
}
<span>A.</span>
<span>{it.Nav_Test.OPTION_A}</span>
</td>
}
</tr>
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? answer : null}>
{
it.Nav_Test.TYPE === 0 ?
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
<span>错误</span>
</td>
:
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
}
<span>B.</span>
<span>{it.Nav_Test.OPTION_B}</span>
</td>
}
</tr>
{
it.Nav_Test.TYPE === 0 ?
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
<span>正确</span>
</td>
:
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
it.Nav_Test.TYPE !== 0 &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 4) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 4) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} />
}
<span>A.</span>
<span>{it.Nav_Test.OPTION_A}</span>
<span>C.</span>
<span>{it.Nav_Test.OPTION_C}</span>
</td>
</tr>
}
</tr>
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? answer : null}>
{
it.Nav_Test.TYPE === 0 ?
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
<span>错误</span>
</td>
:
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_D != "" && it.Nav_Test.OPTION_D != undefined &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} />
}
<span>B.</span>
<span>{it.Nav_Test.OPTION_B}</span>
<span>D.</span>
<span>{it.Nav_Test.OPTION_D}</span>
</td>
</tr>
}
</tr>
{
it.Nav_Test.TYPE !== 0 &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 4) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 4) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} />
}
<span>C.</span>
<span>{it.Nav_Test.OPTION_C}</span>
</td>
</tr>
}
{
it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_D != "" && it.Nav_Test.OPTION_D != undefined &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} />
}
<span>D.</span>
<span>{it.Nav_Test.OPTION_D}</span>
</td>
</tr>
}
{
it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_E != "" && it.Nav_Test.OPTION_E != undefined &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 16) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 16) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} />
}
<span>E.</span>
<span>{it.Nav_Test.OPTION_E}</span>
</td>
</tr>
}
</tbody>
</table>
</td>
</tr>
)
})
}
</tbody>
</table>
{
it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_E != "" && it.Nav_Test.OPTION_E != undefined &&
<tr style={this.state.readonly && ((it.Nav_Test.ANSWER & 16) != 0) ? answer : null}>
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 16) != 0) ? styles.answer : null}>
{
it.Nav_Test.TYPE === 1 ?
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} />
:
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} />
}
<span>E.</span>
<span>{it.Nav_Test.OPTION_E}</span>
</td>
</tr>
}
</tbody>
</table>
</td>
</tr>
)
})
}
</tbody>
</table>
</Spin>
</div>
</div>