Commit 12de4132 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents d8519ddc 9f3f3cf8
...@@ -69,6 +69,7 @@ public class TEnterpriseSystemController extends BaseController ...@@ -69,6 +69,7 @@ public class TEnterpriseSystemController extends BaseController
/** /**
* 新增企业制度管理 * 新增企业制度管理
*/ */
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:add')")
@Log(title = "企业制度管理", businessType = BusinessType.INSERT) @Log(title = "企业制度管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TEnterpriseSystem tEnterpriseSystem) public AjaxResult add(@RequestBody TEnterpriseSystem tEnterpriseSystem)
...@@ -79,6 +80,7 @@ public class TEnterpriseSystemController extends BaseController ...@@ -79,6 +80,7 @@ public class TEnterpriseSystemController extends BaseController
/** /**
* 修改企业制度管理 * 修改企业制度管理
*/ */
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:edit')")
@Log(title = "企业制度管理", businessType = BusinessType.UPDATE) @Log(title = "企业制度管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TEnterpriseSystem tEnterpriseSystem) public AjaxResult edit(@RequestBody TEnterpriseSystem tEnterpriseSystem)
...@@ -89,6 +91,7 @@ public class TEnterpriseSystemController extends BaseController ...@@ -89,6 +91,7 @@ public class TEnterpriseSystemController extends BaseController
/** /**
* 删除企业制度管理 * 删除企业制度管理
*/ */
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:remove')")
@Log(title = "企业制度管理", businessType = BusinessType.DELETE) @Log(title = "企业制度管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{systemIds}") @DeleteMapping("/{systemIds}")
public AjaxResult remove(@PathVariable Long[] systemIds) public AjaxResult remove(@PathVariable Long[] systemIds)
......
...@@ -12,6 +12,7 @@ import com.zehong.common.utils.ServletUtils; ...@@ -12,6 +12,7 @@ import com.zehong.common.utils.ServletUtils;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.framework.web.service.TokenService; import com.zehong.framework.web.service.TokenService;
import com.zehong.system.domain.StatisticsTrainCourse; import com.zehong.system.domain.StatisticsTrainCourse;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TTrainCourse; import com.zehong.system.domain.TTrainCourse;
import com.zehong.system.domain.TTrainUserCourse; import com.zehong.system.domain.TTrainUserCourse;
import com.zehong.system.domain.vo.UserCourseVo; import com.zehong.system.domain.vo.UserCourseVo;
...@@ -193,4 +194,16 @@ public class TTrainCourseController extends BaseController ...@@ -193,4 +194,16 @@ public class TTrainCourseController extends BaseController
List<TTrainUserCourse> persons = tTrainCourseService.testPersonDetailByCourseId(courseId); List<TTrainUserCourse> persons = tTrainCourseService.testPersonDetailByCourseId(courseId);
return getDataTable(persons); return getDataTable(persons);
} }
/**
* 导出所有考试详细数据项
*/
@Log(title = "设备信息管理", businessType = BusinessType.EXPORT)
@GetMapping("/examDetails")
public AjaxResult examDetails(@RequestParam(value = "courseId") Long courseId)
{
List<TTrainUserCourse> persons = tTrainCourseService.examDetails(courseId);
ExcelUtil<TTrainUserCourse> util = new ExcelUtil<TTrainUserCourse>(TTrainUserCourse.class);
return util.exportExcel(persons, "考试详细数据");
}
} }
...@@ -21,42 +21,60 @@ public class TTrainUserCourse extends BaseEntity ...@@ -21,42 +21,60 @@ public class TTrainUserCourse extends BaseEntity
private Long userCourseId; private Long userCourseId;
/** 用户id */ /** 用户id */
@Excel(name = "用户id")
private Long userId; private Long userId;
/** 课程id */ /** 课程id */
@Excel(name = "课程id")
private Long courseId; private Long courseId;
/** 0未学习 1未通过 2已通过 */
@Excel(name = "0未学习 1未通过 2已通过") /**人员名称**/
private Integer state; @Excel(name = "考试人员")
private String staffName;
/** 创建人 */
private String createUser;
/**人员部门**/
@Excel(name = "所属部门")
private String deptName;
/** 最后一次考试时间 */ /** 最后一次考试时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后一次考试时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "考试时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date examinationTime; private Date examinationTime;
/** 最后一次考试结果(答对数量) */ /** 最后一次考试结果(答对数量) */
@Excel(name = "最后一次考试结果", readConverterExp = "答=对数量") @Excel(name = "得分")
private Integer examinationResult; private Integer examinationResult;
/** 创建人 */
@Excel(name = "创建人")
private String createUser;
/**人员名称**/ /** 0未学习 1未通过 2已通过 */
private String staffName; private Integer state;
/**人员部门**/ /** 0未学习 1未通过 2已通过 */
private String deptName; @Excel(name = "考试结果")
private String states;
private Integer personnelType; private Integer personnelType;
private Integer finishDuration; private Integer finishDuration;
private Integer trainState; private Integer trainState;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getStates() {
return states;
}
public void setStates(String states) {
this.states = states;
}
public Integer getFinishDuration() { public Integer getFinishDuration() {
return finishDuration; return finishDuration;
} }
...@@ -163,15 +181,20 @@ public class TTrainUserCourse extends BaseEntity ...@@ -163,15 +181,20 @@ public class TTrainUserCourse extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "TTrainUserCourse{" +
.append("userCourseId", getUserCourseId()) "userCourseId=" + userCourseId +
.append("userId", getUserId()) ", userId=" + userId +
.append("courseId", getCourseId()) ", courseId=" + courseId +
.append("state", getState()) ", staffName='" + staffName + '\'' +
.append("examinationTime", getExaminationTime()) ", createUser='" + createUser + '\'' +
.append("examinationResult", getExaminationResult()) ", deptName='" + deptName + '\'' +
.append("createTime", getCreateTime()) ", examinationTime=" + examinationTime +
.append("createUser", getCreateUser()) ", examinationResult=" + examinationResult +
.toString(); ", state=" + state +
", states='" + states + '\'' +
", personnelType=" + personnelType +
", finishDuration=" + finishDuration +
", trainState=" + trainState +
'}';
} }
} }
...@@ -65,4 +65,11 @@ public interface TTrainUserCourseMapper ...@@ -65,4 +65,11 @@ public interface TTrainUserCourseMapper
* @return List<TTrainUserCourse> * @return List<TTrainUserCourse>
*/ */
List<TTrainUserCourse> testPersonDetailByCourseId(Long courseId); List<TTrainUserCourse> testPersonDetailByCourseId(Long courseId);
/**
* 导出所有考试详细数据项
* @param courseId
* @return
*/
List<TTrainUserCourse> examDetails(Long courseId);
} }
...@@ -107,5 +107,12 @@ public interface ITTrainCourseService ...@@ -107,5 +107,12 @@ public interface ITTrainCourseService
* @return List<TTrainUserCourse> * @return List<TTrainUserCourse>
*/ */
List<TTrainUserCourse> testPersonDetailByCourseId(Long courseId); List<TTrainUserCourse> testPersonDetailByCourseId(Long courseId);
/**
* 导出所有考试详细数据项
* @param courseId
* @return
*/
List<TTrainUserCourse> examDetails(Long courseId);
} }
...@@ -336,6 +336,16 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -336,6 +336,16 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
return tTrainUserCourseMapper.testPersonDetailByCourseId(courseId); return tTrainUserCourseMapper.testPersonDetailByCourseId(courseId);
} }
/**
* 导出所有考试详细数据项
* @param courseId
* @return
*/
@Override
public List<TTrainUserCourse> examDetails(Long courseId) {
return tTrainUserCourseMapper.examDetails(courseId);
}
@Override @Override
public TTrainUserCourse getUserCourse(Long userCourseId){ public TTrainUserCourse getUserCourse(Long userCourseId){
TTrainUserCourse userCourse = tTrainUserCourseMapper.selectTTrainUserCourseById(userCourseId); TTrainUserCourse userCourse = tTrainUserCourseMapper.selectTTrainUserCourseById(userCourseId);
......
...@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deptName" column="dept_name"/> <result property="deptName" column="dept_name"/>
<result property="finishDuration" column="finish_duration"/> <result property="finishDuration" column="finish_duration"/>
<result property="trainState" column="train_state"/> <result property="trainState" column="train_state"/>
<result property="states" column="states"/>
</resultMap> </resultMap>
<sql id="selectTTrainUserCourseVo"> <sql id="selectTTrainUserCourseVo">
...@@ -102,7 +103,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -102,7 +103,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sys.staff_name, sys.staff_name,
d.dept_name, d.dept_name,
train.examination_result, train.examination_result,
train.state,train.examination_time train.state,
train.examination_time
FROM
t_train_user_course train
LEFT JOIN sys_user sys ON train.user_id = sys.user_id
left join sys_dept d on sys.dept_id = d.dept_id
WHERE train.course_id = #{courseId}
</select>
<!--导出所有考试详细数据项-->
<select id="examDetails" parameterType="Long" resultMap="TTrainUserCourseResult">
SELECT
sys.staff_name,
d.dept_name,
train.examination_result,
train.examination_result,
CASE
WHEN train.state = 0 THEN
'未考试'
WHEN train.state = 1 THEN
'未通过'
WHEN train.state = 2 THEN
'已通过'
END AS states ,
train.examination_time
FROM FROM
t_train_user_course train t_train_user_course train
LEFT JOIN sys_user sys ON train.user_id = sys.user_id LEFT JOIN sys_user sys ON train.user_id = sys.user_id
......
...@@ -193,3 +193,12 @@ export function bachAddTopicGuest(data) { ...@@ -193,3 +193,12 @@ export function bachAddTopicGuest(data) {
data: data data: data
}) })
} }
export function exportDeviceInfo(query) {
return request({
url: '/system/course/examDetails',
method: 'get',
params: query
})
}
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
> >
<div class="top flex"> <div class="top flex">
<el-form-item label="课程标题" prop="courseName"> <el-form-item label="课程标题" prop="courseName">
<el-input style="width: 400px" v-model="form.courseName" :disabled="checkLock"></el-input> <el-input style="width: 568px" v-model="form.courseName" :disabled="checkLock"></el-input>
</el-form-item> </el-form-item>
<!--<el-form-item label="培训计划" prop="courseType">--> <!--<el-form-item label="培训计划" prop="courseType">-->
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
clearable clearable
size="small" size="small"
:disabled="checkLock" :disabled="checkLock"
style="width:215px"
> >
<el-option <el-option
v-for="course in courseOptions" v-for="course in courseOptions"
...@@ -59,12 +60,15 @@ ...@@ -59,12 +60,15 @@
style="margin-left: 55px" style="margin-left: 55px"
> >
<el-input <el-input
style="width: 220px" style="width: 180px"
placeholder="分钟" placeholder="分钟"
type="number" type="number"
v-model="form.duration" v-model="form.duration"
:disabled="checkLock" :disabled="checkLock"
></el-input> ></el-input>
<el-label>
(分钟)
</el-label>
</el-form-item> </el-form-item>
</div> </div>
<div class="flex"> <div class="flex">
...@@ -219,6 +223,7 @@ export default { ...@@ -219,6 +223,7 @@ export default {
getLessonById() { getLessonById() {
getLessonById(this.courseId).then((res) => { getLessonById(this.courseId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
res.data.duration=res.data.duration/60;
const data = res.data; const data = res.data;
const { const {
courseName, courseName,
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
......
...@@ -132,11 +132,21 @@ ...@@ -132,11 +132,21 @@
width="180" width="180"
> >
<template v-slot="{ row: { topicNum, courseId, status } }"> <template v-slot="{ row: { topicNum, courseId, status } }">
<span @click="checkQuestion(courseId, status)" class="timuNum"> <span>
<span v-if="topicNum > 0"> <span
class="timuNum"
@click="checkQuestion(courseId, status)"
v-if="topicNum > 0"
>
{{ status == 0 ? `已录入${topicNum}题` : "查看" }} {{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</span> </span>
<span v-else>未录入</span> <span v-else-if="status === 1 && topicNum == 0"> - </span>
<span
class="timuNum"
@click="checkQuestion(courseId, status)"
v-else
>未录入</span
>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -145,7 +155,9 @@ ...@@ -145,7 +155,9 @@
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template v-slot="{ row: { status, courseId } }"> <template
v-slot="{ row: { courseName, courseType, status, courseId } }"
>
<!-- <div>{{status}}</div> --> <!-- <div>{{status}}</div> -->
<el-button <el-button
v-if="status == 0" v-if="status == 0"
...@@ -175,7 +187,7 @@ ...@@ -175,7 +187,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="issueDilog(courseId)" @click="issueDilog(courseId, courseName, courseType)"
>发布</el-button >发布</el-button
> >
</template> </template>
...@@ -196,7 +208,18 @@ ...@@ -196,7 +208,18 @@
:checkLock.sync="checkLock" :checkLock.sync="checkLock"
:visible.sync="dilogFlag" :visible.sync="dilogFlag"
/> />
<el-dialog title="发布详情" :visible.sync="issueVisible" width="60%"> <el-dialog
class="lessons-program"
title="培训考试发布详情"
:visible.sync="issueVisible"
width="60%"
>
<span class="dialogName"
>培训名称: <span class="a">{{ dilogName }}</span>
</span>
<span class="dialogName"
>培训计划: <span class="a">{{ dilogType }}</span></span
>
<div class="detail flex"> <div class="detail flex">
<div class="detail-item"> <div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span 单选题<span>{{ bottomFrom.singleChoiceScore }}</span
...@@ -213,20 +236,19 @@ ...@@ -213,20 +236,19 @@
}}</span }}</span
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
> >
</div> </div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div> </div>
<div class="detail">
<div class="detail-item"> <div class="detail-item">
<span>{{ danxs + duoxs + pds }}</span <span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{ >道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore + danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore + duoxs * bottomFrom.multipleChoiceScore +
...@@ -235,6 +257,12 @@ ...@@ -235,6 +257,12 @@
> >
</div> </div>
</div> </div>
<div class="detail">
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button> <el-button @click="issueVisible = false"> </el-button>
...@@ -289,6 +317,8 @@ export default { ...@@ -289,6 +317,8 @@ export default {
dilogFlag: false, dilogFlag: false,
// 发布弹框 // 发布弹框
issueVisible: false, issueVisible: false,
dilogName: "",
dilogType: null,
bottomFrom: { bottomFrom: {
singleChoiceScore: 0, singleChoiceScore: 0,
multipleChoiceScore: 0, multipleChoiceScore: 0,
...@@ -307,13 +337,13 @@ export default { ...@@ -307,13 +337,13 @@ export default {
computed: { computed: {
...mapGetters(["courseOptions"]), ...mapGetters(["courseOptions"]),
danxs() { danxs() {
return this.questionList.filter((item) => item.topicType === 1).length; return this.questionList.filter((item) => item.topicType === 1).length || 0;
}, },
duoxs() { duoxs() {
return this.questionList.filter((item) => item.topicType === 2).length; return this.questionList.filter((item) => item.topicType === 2).length || 0;
}, },
pds() { pds() {
return this.questionList.filter((item) => item.topicType === 3).length; return this.questionList.filter((item) => item.topicType === 3).length || 0;
}, },
}, },
created() { created() {
...@@ -426,8 +456,8 @@ export default { ...@@ -426,8 +456,8 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
// 发布弹框 // 发布弹框
issueDilog(courseId) { issueDilog(courseId, name, type) {
getQuestion({courseId}) getQuestion({ courseId })
.then((res) => { .then((res) => {
this.questionList = res.rows.map((item) => { this.questionList = res.rows.map((item) => {
return { return {
...@@ -442,13 +472,19 @@ export default { ...@@ -442,13 +472,19 @@ export default {
}) })
.then((res) => { .then((res) => {
this.bottomFrom = { this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore, singleChoiceScore: res.data.singleChoiceScore || 0,
multipleChoiceScore: res.data.multipleChoiceScore, multipleChoiceScore: res.data.multipleChoiceScore || 0,
judgmentScore: res.data.judgmentScore, judgmentScore: res.data.judgmentScore || 0,
qualifiedNum: res.data.qualifiedNum, qualifiedNum: res.data.qualifiedNum || 0,
}; };
}) })
.then((res) => { .then((res) => {
this.dilogName = name;
this.dilogType =
type &&
this.courseOptions.filter((item) => item.planId == type)[0] &&
this.courseOptions.filter((item) => item.planId == type)[0]
.planName;
this.issueVisible = true; this.issueVisible = true;
this.issueCourseId = courseId; this.issueCourseId = courseId;
}); });
...@@ -457,15 +493,16 @@ export default { ...@@ -457,15 +493,16 @@ export default {
}, },
// 发布 // 发布
issueLesson(courseId) { issueLesson(courseId) {
this.$confirm("确定要发布吗", { // this.$confirm("确定要发布吗", {
confirmButtonText: "确定", // confirmButtonText: "确定",
cancelButtonText: "取消", // cancelButtonText: "取消",
type: "warning", // type: "warning",
}) // })
.then(() => { // .then(() => {
// 判断是否录入答题合格数 // // 判断是否录入答题合格数
return getLessonById(courseId); // return getLessonById(courseId);
}) // })
getLessonById(courseId)
.then((res) => { .then((res) => {
// if ( // if (
// res.data.singleChoiceScore >= 0 && // res.data.singleChoiceScore >= 0 &&
...@@ -592,12 +629,21 @@ export default { ...@@ -592,12 +629,21 @@ export default {
width: 100%; width: 100%;
} }
::v-deep .el-dialog { ::v-deep .el-dialog {
margin-top: 15vh !important; margin-top: 10vh !important;
}
::v-deep .el-dialog .el-dialog__body {
padding-top: 5px;
}
.dialogName {
margin-right: 50px;
// color: #ccc;
font-size: 16px;
} }
.detail { .detail {
// position: absolute; // position: absolute;
// bottom: -20px; // bottom: -20px;
// left: 10px; // left: 10px;
margin-top: 20px;
.textC { .textC {
font-weight: 800; font-weight: 800;
font-size: 18px; font-size: 18px;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 20:14:18 * @Date: 2022-09-20 20:14:18
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-05 09:38:13 * @LastEditTime: 2023-02-03 15:59:38
* @FilePath: /danger-manage-web/src/views/myLessons/CheckLesson.vue * @FilePath: /danger-manage-web/src/views/myLessons/CheckLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
</div> </div>
<div class="btn-wrapper flex"> <div class="btn-wrapper flex">
<el-button v-if="this.finish" @click="againQuesstion" type="primary">{{ <!-- topicNum>0代表有考试题,没考试题不需要考试 -->
<el-button v-if="this.finish &&lessonData.topicNum>0 " @click="againQuesstion" type="primary">{{
state == 2 || state == 1 ? "重新考试" : "开始考试" state == 2 || state == 1 ? "重新考试" : "开始考试"
}}</el-button> }}</el-button>
<el-button @click="$router.back()" type="primary" plain>取消</el-button> <el-button @click="$router.back()" type="primary" plain>取消</el-button>
......
...@@ -60,22 +60,22 @@ ...@@ -60,22 +60,22 @@
<el-table-column label="应参加人数" align="center" prop="count"/> <el-table-column label="应参加人数" align="center" prop="count"/>
<el-table-column label="实际考试人数" align="center" prop="test"/> <el-table-column label="实际考试人数" align="center" prop="test"/>
<el-table-column label="合格人数" align="center" prop="pass"/> <el-table-column label="合格人数" align="center" prop="pass"/>
<el-table-column label="合格率" align="center" prop="rate"> <!-- <el-table-column label="合格率" align="center" prop="rate">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
{{scope.row.rate}}% <!-- {{scope.row.rate}}%-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template v-slot="{ row: { courseId } }"> <template v-slot="{ row: { courseId ,courseName}}">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="courseDetail(courseId)" @click="courseDetail(courseId,courseName)"
>查看详情</el-button> >查看详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -89,13 +89,33 @@ ...@@ -89,13 +89,33 @@
/> />
<!--考试详情 --> <!--考试详情 -->
<el-dialog title="考试详情" :visible.sync="testStatDetailOpen" append-to-body :close-on-click-modal="false"> <el-dialog :title="'考试详情:'+courseName" :visible.sync="testStatDetailOpen" append-to-body :close-on-click-modal="false">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
style="position: relative;left: 16px;top: -17px;"
>导出</el-button>
<el-table v-loading="loading" :data="testStatDetailData"> <el-table v-loading="loading" :data="testStatDetailData">
<el-table-column label="序号" width='100' align="center" prop="detailNum"/> <el-table-column label="序号" width='100' align="center" prop="detailNum"/>
<el-table-column label="考试人员" align="center" prop="staffName"/> <el-table-column label="考试人员" align="center" prop="staffName"/>
<el-table-column label="所属部门" align="center" prop="deptName"/> <el-table-column label="所属部门" align="center" prop="deptName">
<el-table-column label="考试时间" align="center" prop="examinationTime"/> <span slot-scope="scope" v-if="scope.row.deptName">{{scope.row.deptName}}</span>
<el-table-column label="答对个数" align="center" prop="examinationResult"/> <span v-else>-</span>
</el-table-column>
<el-table-column label="考试时间" align="center" prop="examinationTime">
<span slot-scope="scope" v-if="scope.row.examinationTime">{{scope.row.examinationTime}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="得分" align="center" prop="examinationResult">
<span slot-scope="scope" v-if="scope.row.examinationResult">{{scope.row.examinationResult}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="考试结果" align="center" prop="state"> <el-table-column label="考试结果" align="center" prop="state">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.state == 0">未考试</span> <span v-if="scope.row.state == 0">未考试</span>
...@@ -104,6 +124,7 @@ ...@@ -104,6 +124,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="totalDetail > 0" v-show="totalDetail > 0"
:total="totalDetail" :total="totalDetail"
...@@ -116,7 +137,7 @@ ...@@ -116,7 +137,7 @@
</template> </template>
<script> <script>
import {statisticsTrainCourse,testPersonDetailByCourseId} from "@/api/educationPlanExam/lessonsProgram.js"; import {statisticsTrainCourse,testPersonDetailByCourseId,exportDeviceInfo} from "@/api/educationPlanExam/lessonsProgram.js";
export default { export default {
name: "testStat", name: "testStat",
data(){ data(){
...@@ -126,6 +147,7 @@ ...@@ -126,6 +147,7 @@
// 总条数 // 总条数
total: 0, total: 0,
releaseTime: "", releaseTime: "",
courseName:"",
queryParams:{ queryParams:{
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
...@@ -134,6 +156,8 @@ ...@@ -134,6 +156,8 @@
releaseTimeBegin: "", releaseTimeBegin: "",
releaseTimeEnd: "" releaseTimeEnd: ""
}, },
// 导出遮罩层
exportLoading: false,
testStatData:[], testStatData:[],
testStatDetailOpen: false, testStatDetailOpen: false,
testStatDetailData: [], testStatDetailData: [],
...@@ -141,7 +165,7 @@ ...@@ -141,7 +165,7 @@
queryDetailParams:{ queryDetailParams:{
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
courseId: "" courseId: 0
} }
} }
}, },
...@@ -149,6 +173,20 @@ ...@@ -149,6 +173,20 @@
this.getTestList(); this.getTestList();
}, },
methods: { methods: {
/** 导出按钮操作 */
handleExport() {
this.$confirm('是否确认导出所有考试详细数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportDeviceInfo(this.queryDetailParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
getTestList(){ getTestList(){
console.log("this.queryParams:",this.queryParams) console.log("this.queryParams:",this.queryParams)
statisticsTrainCourse(this.queryParams).then(res=>{ statisticsTrainCourse(this.queryParams).then(res=>{
...@@ -185,8 +223,10 @@ ...@@ -185,8 +223,10 @@
}; };
this.getTestList(); this.getTestList();
}, },
courseDetail(courseId){ courseDetail(courseId,courseName){
this.testStatDetailOpen = true; this.testStatDetailOpen = true;
this.courseName=courseName;
this.queryDetailParams.courseId=courseId;
this.getTestStatDetails(courseId); this.getTestStatDetails(courseId);
}, },
getTestStatDetails(courseId){ getTestStatDetails(courseId){
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<el-table v-loading="loading" :data="lessonsList"> <el-table v-loading="loading" :data="lessonsList">
<el-table-column label="序号" align="center" prop="bankNum" width="55" /> <el-table-column label="序号" align="center" prop="bankNum" width="55" />
<el-table-column label="课程标题" align="center" prop="courseName" /> <el-table-column label="考试名称" align="center" prop="courseName" />
<el-table-column <el-table-column
label="开始时间" label="开始时间"
align="center" align="center"
...@@ -102,7 +102,11 @@ ...@@ -102,7 +102,11 @@
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template v-slot="{ row: { status, courseId, qualifiedNum } }"> <template
v-slot="{
row: { courseName, topicNum, status, courseId,testStartTime,testEndTime },
}"
>
<!-- <div>{{status}}</div> --> <!-- <div>{{status}}</div> -->
<!-- <el-button <!-- <el-button
v-if="status == 0" v-if="status == 0"
...@@ -140,7 +144,7 @@ ...@@ -140,7 +144,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="issueDilog(courseId)" @click="issueDilog(courseId, courseName, topicNum,testStartTime,testEndTime)"
>发布</el-button >发布</el-button
> >
</template> </template>
...@@ -161,7 +165,29 @@ ...@@ -161,7 +165,29 @@
:checkLock.sync="checkLock" :checkLock.sync="checkLock"
:visible.sync="dilogFlag" :visible.sync="dilogFlag"
/> />
<el-dialog title="发布详情" :visible.sync="issueVisible" width="60%"> <el-dialog
class="lessons-program"
title="试卷考试发布详情"
:visible.sync="issueVisible"
width="60%"
>
<div>
<span class="dialogName"
>考试名称: <span class="a">{{ dilogName }}</span>
</span>
</div>
<div style="margin-top:20px">
<span class="dialogName"
>开始时间: <span class="a">{{ dilogStartTime }}</span>
</span>
<span class="dialogName"
>结束时间: <span class="a">{{ dilogEndTime }}</span>
</span>
</div>
<!-- <span class="dialogName"
>培训计划: <span class="a">{{ dilogType }}</span></span
> -->
<div class="detail flex"> <div class="detail flex">
<div class="detail-item"> <div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span 单选题<span>{{ bottomFrom.singleChoiceScore }}</span
...@@ -178,20 +204,19 @@ ...@@ -178,20 +204,19 @@
}}</span }}</span
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
> >
</div> </div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div> </div>
<div class="detail">
<div class="detail-item"> <div class="detail-item">
<span>{{ danxs + duoxs + pds }}</span <span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{ >道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore + danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore + duoxs * bottomFrom.multipleChoiceScore +
...@@ -200,6 +225,12 @@ ...@@ -200,6 +225,12 @@
> >
</div> </div>
</div> </div>
<div class="detail">
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button> <el-button @click="issueVisible = false"> </el-button>
...@@ -255,6 +286,11 @@ export default { ...@@ -255,6 +286,11 @@ export default {
dilogFlag: false, dilogFlag: false,
// 发布 // 发布
issueVisible: false, issueVisible: false,
dilogName: "",
dilogTopicNum: 0,
dilogStartTime:0,
dilogEndTime:0,
// dilogType: null,
bottomFrom: { bottomFrom: {
singleChoiceScore: 0, singleChoiceScore: 0,
multipleChoiceScore: 0, multipleChoiceScore: 0,
...@@ -404,12 +440,18 @@ export default { ...@@ -404,12 +440,18 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
// 发布 // 发布
issueDilog(courseId) { issueDilog(courseId, name, num,startTime,endTime) {
getQuestion({courseId}) if (num === 0) {
this.$message({
message: "请至少录入一道考题在发布",
type: "warning",
});
return;
}
getQuestion({ courseId })
.then((res) => { .then((res) => {
console.log(res) console.log(res);
this.questionList = res.rows.map((item) => { this.questionList = res.rows.map((item) => {
return { return {
topicType: item.topicType, topicType: item.topicType,
topicId: item.topicId, topicId: item.topicId,
...@@ -422,13 +464,17 @@ export default { ...@@ -422,13 +464,17 @@ export default {
}) })
.then((res) => { .then((res) => {
this.bottomFrom = { this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore ||0, singleChoiceScore: res.data.singleChoiceScore || 0,
multipleChoiceScore: res.data.multipleChoiceScore||0, multipleChoiceScore: res.data.multipleChoiceScore || 0,
judgmentScore: res.data.judgmentScore||0, judgmentScore: res.data.judgmentScore || 0,
qualifiedNum: res.data.qualifiedNum||0, qualifiedNum: res.data.qualifiedNum || 0,
}; };
}) })
.then((res) => { .then((res) => {
// 名称
this.dilogName = name;
this.dilogStartTime=startTime;
this.dilogEndTime=endTime;
this.issueVisible = true; this.issueVisible = true;
this.issueCourseId = courseId; this.issueCourseId = courseId;
}); });
...@@ -436,15 +482,17 @@ export default { ...@@ -436,15 +482,17 @@ export default {
// //
}, },
issueLesson(courseId) { issueLesson(courseId) {
this.$confirm("确定要发布吗", { // this.$confirm("确定要发布吗", {
confirmButtonText: "确定", // confirmButtonText: "确定",
cancelButtonText: "取消", // cancelButtonText: "取消",
type: "warning", // type: "warning",
}) // })
.then(() => { // .then(() => {
// 判断是否录入答题合格数 // // 判断是否录入答题合格数
return getLessonById(courseId); // return getLessonById(courseId);
}) // })
getLessonById(courseId)
.then((res) => { .then((res) => {
// if ( // if (
// res.data.singleChoiceScore > 0 && // res.data.singleChoiceScore > 0 &&
...@@ -500,12 +548,21 @@ export default { ...@@ -500,12 +548,21 @@ export default {
width: 100%; width: 100%;
} }
::v-deep .el-dialog { ::v-deep .el-dialog {
margin-top: 15vh !important; margin-top: 10vh !important;
}
::v-deep .el-dialog .el-dialog__body {
padding-top: 5px;
}
.dialogName {
margin-right: 50px;
// color: #ccc;
font-size: 16px;
} }
.detail { .detail {
// position: absolute; // position: absolute;
// bottom: -20px; // bottom: -20px;
// left: 10px; // left: 10px;
margin-top: 20px;
.textC { .textC {
font-weight: 800; font-weight: 800;
font-size: 18px; font-size: 18px;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
......
...@@ -62,11 +62,11 @@ ...@@ -62,11 +62,11 @@
<span>{{ parseTime(scope.row.testEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.testEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="正确率" align="center" prop="score">--> <el-table-column label="答题得分" align="center" prop="score">
<!-- <template slot-scope="scope">--> <template slot-scope="scope">
<!-- <span>{{Math.round(scope.row.score/topicNum* 100)}}%</span>--> <span>{{scope.row.score}}</span>
<!-- </template>--> </template>
<!-- </el-table-column>--> </el-table-column>
<el-table-column label="是否合格" align="center" prop="isQualified"> <el-table-column label="是否合格" align="center" prop="isQualified">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.isQualified == '0'">合格</span> <span v-if="scope.row.isQualified == '0'">合格</span>
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['safetyManagement:enterpriseSystem:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -77,18 +78,24 @@ ...@@ -77,18 +78,24 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" /> <!-- <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />-->
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button
v-if="scope.row.status == '0'" v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
...@@ -108,13 +115,13 @@ ...@@ -108,13 +115,13 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleInvalid(scope.row)" @click="handleInvalid(scope.row)"
>作废</el-button> >作废</el-button>-->
<el-button <el-button
v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -169,10 +176,10 @@ ...@@ -169,10 +176,10 @@
</span> </span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
<el-form-item v-show="operate" label="审批" prop="status"> <!--<el-form-item v-show="operate" label="审批" prop="status">
<el-radio v-model="form.status" label="2">通过</el-radio> <el-radio v-model="form.status" label="2">通过</el-radio>
<el-radio v-model="form.status" label="0">驳回</el-radio> <el-radio v-model="form.status" label="0">驳回</el-radio>
</el-form-item> </el-form-item>-->
</div> </div>
<div style="width: 58%;margin-left: 2%"> <div style="width: 58%;margin-left: 2%">
<div class="dialogTitle">制度内容</div> <div class="dialogTitle">制度内容</div>
...@@ -180,7 +187,7 @@ ...@@ -180,7 +187,7 @@
</div> </div>
</div> </div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer" v-show="!readOnly">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
...@@ -339,6 +346,20 @@ export default { ...@@ -339,6 +346,20 @@ export default {
} }
}); });
}, },
/** 详情按钮操作 */
handleDetail(row) {
this.readOnly=true;
this.reset();
const systemId = row.systemId || this.ids
getEnterpriseSystem(systemId).then(response => {
this.form = response.data;
this.open = true;
this.title = "企业制度信息详情";
if(this.form.fileUrl!=null||this.form.fileUrl==""){
this.fileList = [{name: this.form.fileName, url: uploadfile}];
}
});
},
/** 审批按钮操作 */ /** 审批按钮操作 */
handleApproval(row) { handleApproval(row) {
this.readOnly = true; this.readOnly = true;
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['safetyManagement:enterpriseSystem:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -92,7 +93,14 @@ ...@@ -92,7 +93,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>修改</el-button> >修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button <!--<el-button
v-if="scope.row.status == '0'" v-if="scope.row.status == '0'"
size="mini" size="mini"
...@@ -119,6 +127,7 @@ ...@@ -119,6 +127,7 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -200,7 +209,7 @@ ...@@ -200,7 +209,7 @@
</div> </div>
</div> </div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer" v-show="!readOnly">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
...@@ -357,6 +366,20 @@ export default { ...@@ -357,6 +366,20 @@ export default {
} }
}); });
}, },
/** 详情按钮操作*/
handleDetail(row) {
this.readOnly=true;
this.reset();
const systemId = row.systemId || this.ids
getEnterpriseSystem(systemId).then(response => {
this.form = response.data;
this.open = true;
this.title = "法律法规信息详情";
if(this.form.fileUrl!=null||this.form.fileUrl==""){
this.fileList = [{name: this.form.fileName, url: uploadfile}];
}
});
},
/** 审批按钮操作 */ /** 审批按钮操作 */
handleApproval(row) { handleApproval(row) {
this.readOnly = true; this.readOnly = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment