修改bug--新版考试系统

This commit is contained in:
Vce 2024-05-23 20:28:46 +08:00
parent c642a35eae
commit af0e9c0c7a
7 changed files with 304 additions and 288 deletions

View File

@ -8,6 +8,8 @@ export const getWorkerInfoListApi = data => post('xmgl/workerInfo/selectWorkerIn
export const getDepartmentListApi = data => post('xmgl/departmentInfo/selectDepartmentDetailsList', data); // 查询项目级所有部门 export const getDepartmentListApi = data => post('xmgl/departmentInfo/selectDepartmentDetailsList', data); // 查询项目级所有部门
export const getTeamInfoListApi = data => post('xmgl/teamInfo/getProjectTeamList', data); // 查询项目级所有班组 export const getTeamInfoListApi = data => post('xmgl/teamInfo/getProjectTeamList', data); // 查询项目级所有班组
export const getEnterpriseInfoApi = data => post('xmgl/enterpriseInfo/list', data) //列表查看劳务公司 export const getEnterpriseInfoApi = data => post('xmgl/enterpriseInfo/list', data) //列表查看劳务公司
//部门班组(新)
export const getQueryDepartmentListApi = (data) => get('xmgl/departmentInfo/queryDepartmentAndTeamList', data)
// 科目管理 // 科目管理
export const addExamSubjectApi = data => post('exam/subject/add', data) //添加 export const addExamSubjectApi = data => post('exam/subject/add', data) //添加
@ -81,7 +83,7 @@ export const editPaperApi = data => post('exam/paper/edit', data) //编辑
export const getQuestionOption = data => post('exam/paper/queryQuestionById', data) //查询题目及选项 export const getQuestionOption = data => post('exam/paper/queryQuestionById', data) //查询题目及选项
export const delPaperApi = data => post('exam/paper/delete', data) //查询题目及选项 export const delPaperApi = data => post('exam/paper/delete', data) //查询题目及选项
//考试记录 //考试记录
export const getExamTrainRecordApi = data => post('exam/trainRecord/page', data) //查询题目及选项 export const getExamTrainRecordApi = data => post('exam/trainRecord/examRecordPage', data) //查询题目及选项
// 通知管理 // 通知管理
export const editConfigApi = data => post('exam/config/edit', data) //通过id查询考试通知配置信息 export const editConfigApi = data => post('exam/config/edit', data) //通过id查询考试通知配置信息

View File

@ -4,8 +4,8 @@
<!-- header --> <!-- header -->
<div class="searchBox whiteBlock"> <div class="searchBox whiteBlock">
<el-form :inline="true" size="medium" class="demo-form-inline"> <el-form :inline="true" size="medium" class="demo-form-inline">
<el-form-item label="科目" prop="subjectName"> <el-form-item label="科目" prop="name">
<el-select v-model="subjectName" placeholder="请选择" clearable> <el-select v-model="name" placeholder="请选择" clearable>
<el-option v-for="item in subjectNameList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in subjectNameList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -25,7 +25,7 @@
<!-- table --> <!-- table -->
<div class="table_wrap whiteBlock" style="height: 677px"> <div class="table_wrap whiteBlock" style="height: 677px">
<el-table class="tables" :data="listData" height="200"> <el-table class="tables" :data="listData" height="200">
<el-table-column width="200" align="center" prop="subjectName" label="考试科目"></el-table-column> <el-table-column width="200" align="center" prop="name" label="考试科目"></el-table-column>
<el-table-column align="center" prop="name" label="试题名称"></el-table-column> <el-table-column align="center" prop="name" label="试题名称"></el-table-column>
<el-table-column align="center" prop="radio" label="单选题"></el-table-column> <el-table-column align="center" prop="radio" label="单选题"></el-table-column>
<el-table-column align="center" prop="multi" label="多选题"></el-table-column> <el-table-column align="center" prop="multi" label="多选题"></el-table-column>
@ -46,10 +46,6 @@
<el-button size="mini" type="text" style="color:#ec4b52;margin-left:10px;font-size:14px" class="delete-btn" icon="el-icon-delete" @click.native.stop="removeExam(scope.row) "> <el-button size="mini" type="text" style="color:#ec4b52;margin-left:10px;font-size:14px" class="delete-btn" icon="el-icon-delete" @click.native.stop="removeExam(scope.row) ">
<span style="color:black">删除</span> <span style="color:black">删除</span>
</el-button> </el-button>
<!-- <div @click="gotoExamManage(scope.row)" style="margin-left:10px;" class="operationText">
<img src="@/assets/images/icon-setting.png" width="15px" height="15px" />
<span style="white-space: nowrap;display:flex;align-items:center">考试管理</span>
</div> -->
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -61,36 +57,37 @@
<div class="dialogContainer"> <div class="dialogContainer">
<!-- <div class="dialogLeft"> --> <!-- <div class="dialogLeft"> -->
<el-form :model="examForm" ref="examForm" :rules="examRules" label-width="100px" class="demo-ruleForm"> <el-form :model="examForm" ref="examForm" :rules="examRules" label-width="100px" class="demo-ruleForm">
<el-form-item label="考试科目" prop="subjectType" > <el-form-item label="考试科目" prop="subjectId" >
<el-select v-model="examForm.subjectType" placeholder="请选择"> <el-select v-model="examForm.subjectId" placeholder="请选择">
<el-option :label="item.name" :value="item.id" v-for="(item,i) in examSubjectList" :key="i"></el-option> <el-option :label="item.name" :value="item.id" v-for="(item,i) in examSubjectList" :key="i"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="试卷名称" prop="subjectName" > <el-form-item label="试卷名称" prop="name" >
<el-input v-model="examForm.subjectName"></el-input> <el-input v-model="examForm.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="考试时间" prop="examTime" > <el-form-item label="考试时间" prop="duration" >
<el-input-number :min="0" :controls="false" :precision="0" style="width: 190px" v-model="examForm.examTime"></el-input-number> <el-input-number :min="0" :controls="false" :precision="0" style="width: 190px" v-model="examForm.duration"></el-input-number>
<span style="margin-left: 10px;color:#a6a7b2;">分钟</span> <span style="margin-left: 10px;color:#a6a7b2;">分钟</span>
</el-form-item> </el-form-item>
<el-form-item label="及格分数线" prop="passScore" > <el-form-item label="及格分数线" prop="passLine" >
<el-input-number :min="0" :max="100" :controls="false" :precision="0" style="width: 190px" v-model="examForm.passScore"></el-input-number> <el-input-number :min="0" :max="100" :controls="false" :precision="0" style="width: 190px" v-model="examForm.passLine"></el-input-number>
<span style="margin-left: 10px;color:#a6a7b2;"></span> <span style="margin-left: 10px;color:#a6a7b2;"></span>
</el-form-item> </el-form-item>
<!-- <el-form-item label="学习周期" prop="studyCycle"> <!-- <el-form-item label="学习周期" prop="studyCycle">
<el-date-picker v-model="examForm.studyCycle" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker v-model="examForm.studyCycle" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> --> </el-form-item> -->
<el-form-item label="备注" prop="desc"> <el-form-item label="备注" prop="remark">
<el-input type="textarea" rows="3" :show-word-limit="true" v-model="examForm.desc"></el-input> <el-input type="textarea" rows="3" :show-word-limit="true" v-model="examForm.remark"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="抽题模式" prop="examMode" > <el-form-item label="抽题模式" prop="checkQuestionType" >
<el-radio-group v-model="examForm.examMode" @input="handleDialog"> <el-radio-group v-model="examForm.checkQuestionType" @input="handleDialog">
<div style="display:flex"> <div style="display:flex">
<div @click="dialogVisible2 = true"> <!-- <div @click="dialogVisible2 = true"> -->
<el-radio label="1">手动抽题</el-radio> <div @click="openDoor">
<el-radio :label="1">手动抽题</el-radio>
</div> </div>
<div style="margin-left:10px" @click="dialogVisible3 = true"> <div style="margin-left:10px" @click="dialogVisible3 = true">
<el-radio label="2">随机抽题</el-radio> <el-radio :label="2">随机抽题</el-radio>
</div> </div>
</div> </div>
</el-radio-group> </el-radio-group>
@ -118,7 +115,7 @@
@node-click="onNodeClick" @node-click="onNodeClick"
:current-node-key="currentNodekey" :current-node-key="currentNodekey"
node-key="id"> node-key="id">
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node }">
<span style="width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;" class="courseName" :title="node.label"> <span style="width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;" class="courseName" :title="node.label">
{{ node.label }} {{ node.label }}
</span> </span>
@ -170,9 +167,9 @@
<el-radio label="0">从指定科目类型中选择</el-radio> <el-radio label="0">从指定科目类型中选择</el-radio>
<el-radio label="1">从全部题库中选择</el-radio> <el-radio label="1">从全部题库中选择</el-radio>
</el-radio-group><br> </el-radio-group><br>
<el-select v-model="randomQuestion.subjectName" :disabled="isDisabled" size="mini" placeholder="请选择" style="margin-top: 5px"> <el-select v-model="randomQuestion.name" :disabled="isDisabled" size="mini" placeholder="请选择" style="margin-top: 5px">
<el-option :label="item.name" :value="item.id" v-for="(item,i) in subjectNameList" :key="i"></el-option> <el-option :label="item.name" :value="item.id" v-for="(item,i) in subjectNameList" :key="i"></el-option>
<!-- <el-option v-for="item in subjectNameList" :key="item.value" :label="item.subjectName" :value="item.value"></el-option> --> <!-- <el-option v-for="item in subjectNameList" :key="item.value" :label="item.name" :value="item.value"></el-option> -->
</el-select> </el-select>
</div> </div>
<div> <div>
@ -225,7 +222,7 @@
<div class="">基本信息</div> <div class="">基本信息</div>
</div> </div>
<div style="width:80%;display:grid;grid-gap:20px;grid-template-columns: repeat(2, 1fr);"> <div style="width:80%;display:grid;grid-gap:20px;grid-template-columns: repeat(2, 1fr);">
<p style="margin-bottom: 10px; margin-left:20px;width:50%">科目名称{{examDetailInfo.subjectName}}</p> <p style="margin-bottom: 10px; margin-left:20px;width:50%">科目名称{{examDetailInfo.name}}</p>
<p style="margin-bottom: 10px; margin-left:20px;width:50%">试题名称{{examDetailInfo.name}}</p> <p style="margin-bottom: 10px; margin-left:20px;width:50%">试题名称{{examDetailInfo.name}}</p>
<p style="margin-bottom: 10px; margin-left:20px;width:50%">考试时长{{examDetailInfo.duration}}</p> <p style="margin-bottom: 10px; margin-left:20px;width:50%">考试时长{{examDetailInfo.duration}}</p>
<p style="margin-bottom: 10px; margin-left:20px;width:50%">及格分数{{examDetailInfo.passLine}}</p> <p style="margin-bottom: 10px; margin-left:20px;width:50%">及格分数{{examDetailInfo.passLine}}</p>
@ -307,7 +304,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table class="tables" style="min-height:500px" :data="listData" height="200" max-height="530px"> <el-table class="tables" style="min-height:500px" :data="listData" height="200" max-height="530px">
<el-table-column width="200" align="center" prop="subjectName" label="科目"></el-table-column> <el-table-column width="200" align="center" prop="name" label="科目"></el-table-column>
<el-table-column align="center" prop="questionName" label="试题名称"></el-table-column> <el-table-column align="center" prop="questionName" label="试题名称"></el-table-column>
<el-table-column align="center" prop="examCycle" label="考试周期"></el-table-column> <el-table-column align="center" prop="examCycle" label="考试周期"></el-table-column>
<el-table-column align="center" prop="examPersonCount" label="考试人数"></el-table-column> <el-table-column align="center" prop="examPersonCount" label="考试人数"></el-table-column>
@ -399,10 +396,10 @@ export default {
}, },
examJudge:{}, examJudge:{},
radio:"1", radio:"1",
subjectName:"", name:"",
}, },
emActiveTab: 'examRecord', emActiveTab: 'examRecord',
examManageInfo:{examTotalScore:'100',passScore: 60,questionCount: '100', examPeriod: '2024-05-12 00:00:00-2024-06-01 00:00:00', joinCount: '100',noJoinCount: '2'}, examManageInfo:{examTotalScore:'100',passLine: 60,questionCount: '100', examPeriod: '2024-05-12 00:00:00-2024-06-01 00:00:00', joinCount: '100',noJoinCount: '2'},
isExamManage: false, // isExamManage: false, //
examInfoList: [], // examInfoList: [], //
activeTab: '1', // Tab activeTab: '1', // Tab
@ -413,14 +410,22 @@ export default {
label: "workerName", label: "workerName",
}, },
questionList: [], questionList: [],
subjectName: '', // name: '', //
questionName: '', // questionName: '', //
data: generateData(), data: generateData(),
value: [1], value: [1],
renderFunc(h, option) { renderFunc(h, option) {
return <span>{ option.key } - { option.label }</span>; return <span>{ option.key } - { option.label }</span>;
}, },
examForm: {}, examForm: {
subjectId:'',
name:'',
duration:'',
passLine:'',
remark:'',
checkQuestionType:'',
questions:[]
},
subjectNameList: [ subjectNameList: [
{ value: '选项1', label: '黄金糕' }, { value: '选项1', label: '黄金糕' },
{ value: '选项2', label: '双皮奶' }, { value: '选项2', label: '双皮奶' },
@ -463,48 +468,39 @@ export default {
{ ruleType: '', symbol: '', ruleScore: '' }, { ruleType: '', symbol: '', ruleScore: '' },
], ],
examRules:{ examRules:{
subjectType: [ subjectId: [
{
required: true,
message: '必填',
trigger: 'change',
},
],
name: [
{
required: true,
message: '必填',
trigger: 'change',
},
],
duration: [
{ {
required: true, required: true,
message: '必填', message: '必填',
trigger: 'blur', trigger: 'blur',
}, },
], ],
subjectName: [ passLine: [
{ {
required: true, required: true,
message: '必填', message: '必填',
trigger: 'blur', trigger: 'blur',
}, },
], ],
examTime: [ checkQuestionType: [
{ {
required: true, required: true,
message: '必填', message: '必填',
trigger: 'blur', trigger: 'change',
},
],
passScore: [
{
required: true,
message: '必填',
trigger: 'blur',
},
],
examMode: [
{
required: true,
message: '必填',
trigger: 'blur',
},
],
},
addEditRules: {
subdivisionProjectName: [
{
required: true,
message: this.$t('message.personnelPosition.required'),
trigger: 'blur',
}, },
], ],
}, },
@ -527,9 +523,7 @@ export default {
cpsCheckedTotal: [], // cpsCheckedTotal: [], //
addCourseForm: {}, // addCourseForm: {}, //
cpsEleRecords: [], //
studyCycle: [], // studyCycle: [], //
searchKeyWord: '', //
personType: 0, // personType: 0, //
personnelName:"", // personnelName:"", //
@ -538,7 +532,7 @@ export default {
question: { question: {
// //
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 100000,
total: 0, total: 0,
}, },
questionSubjectId:'', questionSubjectId:'',
@ -567,12 +561,12 @@ export default {
}, },
watch: { watch: {
dialogVisible(newV,oldV){ dialogVisible(newV,oldV){
if (this.title == '新增考试') { if(this.dialogVisible === false) {
this.clearDialog() // this.$refs.examForm.resetFields()
} }
if(this.title === '新增考试') {
if(newV === false){ this.$refs.examForm.resetFields()
this.clearDialog()
} }
}, },
"randomQuestion.examSingle.diffculty"(){ "randomQuestion.examSingle.diffculty"(){
@ -592,14 +586,14 @@ export default {
} }
}); });
}, },
"randomQuestion.subjectName"(){ "randomQuestion.name"(){
console.log(this.randomQuestion.subjectName); console.log(this.randomQuestion.name);
this.clearFilter(); this.clearFilter();
this.getList({ this.getList({
pageNo: 1, pageNo: 1,
pageSize: 99999, pageSize: 99999,
questionName: "", questionName: "",
questionSubjectId: this.randomQuestion.subjectName, questionSubjectId: this.randomQuestion.name,
}) })
}, },
}, },
@ -616,11 +610,11 @@ export default {
}, },
methods: { methods: {
cancel2(){ cancel2(){
this.examForm.examMode = null this.examForm.checkQuestionType = null
this.dialogVisible2 = false this.dialogVisible2 = false
}, },
cancel3(){ cancel3(){
this.examForm.examMode = null this.examForm.checkQuestionType = null
this.dialogVisible3 = false this.dialogVisible3 = false
}, },
singleChange(){ singleChange(){
@ -636,13 +630,13 @@ export default {
type:1, type:1,
number:this.randomQuestion.examSingle.count, number:this.randomQuestion.examSingle.count,
difficulty:this.randomQuestion.examSingle.diffculty, difficulty:this.randomQuestion.examSingle.diffculty,
subjectId:this.randomQuestion.examSingle.subjectName, subjectId:this.randomQuestion.examSingle.name,
} }
let multipleRandom = { let multipleRandom = {
type:2, type:2,
number:this.randomQuestion.examMultiple.count?this.randomQuestion.examMultiple.count:'', number:this.randomQuestion.examMultiple.count?this.randomQuestion.examMultiple.count:'',
difficulty:this.randomQuestion.examMultiple.diffculty?this.randomQuestion.examMultiple.diffculty:'', difficulty:this.randomQuestion.examMultiple.diffculty?this.randomQuestion.examMultiple.diffculty:'',
subjectId:this.randomQuestion.examMultiple.subjectName?this.randomQuestion.examMultiple.subjectName:'', subjectId:this.randomQuestion.examMultiple.name?this.randomQuestion.examMultiple.name:'',
} }
this.randomQueryList.push(singleRandom) this.randomQueryList.push(singleRandom)
this.randomQueryList.push(multipleRandom) this.randomQueryList.push(multipleRandom)
@ -653,7 +647,6 @@ export default {
} }
}) })
}, },
// pageQuestionBankApi
removeExam(obj){ removeExam(obj){
this.$confirm('此操作将永久删除, 是否继续?', '提示', { this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -696,6 +689,7 @@ export default {
pageSize: row ? row.pageSize : this.question.pageSize, pageSize: row ? row.pageSize : this.question.pageSize,
questionName: "", questionName: "",
subjectId: row ? row.questionSubjectId : this.questionSubjectId, subjectId: row ? row.questionSubjectId : this.questionSubjectId,
isEnable:1
}).then((result) => { }).then((result) => {
if (result.success) { if (result.success) {
console.log(result); console.log(result);
@ -752,9 +746,6 @@ export default {
this.isExamManage = true; this.isExamManage = true;
}, },
handleD4Tab(val){
this.activeTab = val
},
async examDetail(val) { async examDetail(val) {
console.log("~~~~~~~~~~~~~~",val); console.log("~~~~~~~~~~~~~~",val);
this.examDetailInfo = val; this.examDetailInfo = val;
@ -772,20 +763,6 @@ export default {
} }
}) })
}, },
cancelRule(type, val) {
if (type === 1) {
} else {
this.listData3.pop()
}
},
editRule(val) {},
addRule() {
this.listData3.push({
ruleType: '',
symbol: '',
ruleScore: '',
})
},
// //
async addExam() { // async addExam() { //
@ -793,20 +770,47 @@ export default {
this.title = "新增考试"; this.title = "新增考试";
this.dialogVisible = true this.dialogVisible = true
}, },
openDoor(){
// this.examForm.questions = this.examForm.questions.split(',')
let tempStr = this.examForm.questions.split(',')
console.log(tempStr,789)
console.log(this.questionList,789)
// this.examForm.questions = String.prototype.split(this.examForm.questions,',')
// this.$nextTick(()=>{
// this.examForm.questions = tempStr
// this.questionList.map((item,index) => {
// console.log("33333333333333333333")
// tempStr.map((item2,index2) => {
// if(item.id = item2){
// that.$refs.questionListTable.toggleRowSelection(taht.questionList[index],true)
// console.log("=======================")
// console.log(this.questionList[index])
// }
// })
// })
// })
this.dialogVisible2 = true
this.$nextTick(() => {
for(let i=0;i<this.questionList.length;i++){
for(let j = 0;j<tempStr.length;j++){
if(tempStr[j] == this.questionList[i].id){
this.$refs.questionListTable.toggleRowSelection(this.questionList[i],true)
}
}
}
})
},
//
async editExam(row) { // async editExam(row) { //
this.personType = 1 this.personType = 1
this.title = "编辑考试"; this.title = "编辑考试";
console.log(row); // console.log(row);
this.examForm = row
this.examForm.id = row.id
this.examForm.examMode = row.checkQuestionType.toString();
this.examForm.subjectName = row.name;
this.examForm.examTime = row.duration;
this.examForm.passScore = row.passLine;
this.examForm.subjectType = row.subjectId;
this.examForm.desc = row.remark;
this.editExam.questions = row.questions
// this.examForm.studyCycle = [row.beginTime,row.endTime];
console.log(this.examForm); console.log(this.examForm);
this.dialogVisible = true this.dialogVisible = true
}, },
@ -843,7 +847,7 @@ export default {
pageNo: this.pagInfo.pageNo, pageNo: this.pagInfo.pageNo,
pageSize: this.pagInfo.pageSize, pageSize: this.pagInfo.pageSize,
name: this.questionName, name: this.questionName,
subjectId:this.subjectName, subjectId:this.name,
}).then((result) => { }).then((result) => {
if (result.success) { if (result.success) {
console.log(result); console.log(result);
@ -854,35 +858,26 @@ export default {
}, },
/// ///
submitBtn() { submitBtn() {
// if(this.studyCycle.length > 0){
// console.log('==========studyCycle-submitBtn==========',this.studyCycle)
// this.addCourseForm.beginTime = this.studyCycle[0]
// this.addCourseForm.endTime = this.studyCycle[1]
// }
console.log(this.compulsoryList) console.log(this.compulsoryList)
// this.addCourseForm.projectSn = this.$store.state.projectSn;
// this.examForm.projectSn = this.projectSn
this.$refs.examForm.validate((valid) => { this.$refs.examForm.validate((valid) => {
if (valid) { if (valid) {
let examInfo = { let examInfo = {
checkQuestionType:this.examForm.examMode, checkQuestionType:this.examForm.checkQuestionType,
name:this.examForm.subjectName, name:this.examForm.name,
duration:this.examForm.examTime, duration:this.examForm.duration,
passLine:this.examForm.passScore, passLine:this.examForm.passLine,
projectSn:this.$store.state.projectSn, projectSn:this.$store.state.projectSn,
subjectId:this.examForm.subjectType, subjectId:this.examForm.subjectId,
remark:this.examForm.desc, remark:this.examForm.remark,
// beginTime: dateFormat(this.examForm.studyCycle[0], "yyyy-MM-dd"), questions:this.examForm.checkQuestionType == 1 ? this.examForm.questions.map(item => item.id).join(',') : this.randomQuestionList.map(item => item.id).join(','),
// endTime: dateFormat(this.examForm.studyCycle[1], "yyyy-MM-dd"),
questions:this.examForm.examMode == 1 ? this.examAddDetail.questions.map(item => item.id).join(',') : this.randomQuestionList.map(item => item.id).join(','),
examRecordList:this.compulsoryList.map(item => { examRecordList:this.compulsoryList.map(item => {
return { return {
id:item.id, id:item.id,
} }
}), }),
radio:this.examForm.examMode == 1 ? this.examAddDetail.questions.filter(item => item.type == 1).length : this.randomQuestion.examSingle.count, radio:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 1).length : this.randomQuestion.examSingle.count,
multi:this.examForm.examMode == 1 ? this.examAddDetail.questions.filter(item => item.type == 2).length : this.randomQuestion.examMultiple.count, multi:this.examForm.checkQuestionType == 1 ? this.examForm.questions.filter(item => item.type == 2).length : this.randomQuestion.examMultiple.count,
} }
if (this.title == '新增考试') { if (this.title == '新增考试') {
@ -908,7 +903,8 @@ export default {
}, },
// /dialog // /dialog
handleDialog(val){ handleDialog(val){
if(val === '1'){ // if(val === '1'){
if(val === 1){
this.currentNodekey = this.subjectNameList[0].id; this.currentNodekey = this.subjectNameList[0].id;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.groupTreeList.setCurrentKey(this.subjectNameList[0].id) // this.$refs.groupTreeList.setCurrentKey(this.subjectNameList[0].id) //
@ -918,7 +914,8 @@ export default {
this.dialogVisible2 = false this.dialogVisible2 = false
this.dialogVisible2 = true this.dialogVisible2 = true
} }
if(val === '2'){ // if(val === '2'){
if(val === 2){
this.dialogVisible3 = false; this.dialogVisible3 = false;
if(this.randomQuestion.radio == 1) { if(this.randomQuestion.radio == 1) {
this.getList({ this.getList({
@ -948,7 +945,14 @@ export default {
} }
}, },
clearDialog(){ clearDialog(){
this.examForm = {} this.examForm = {
subjectId:'',
name:'',
duration:'',
passLine:'',
remark:'',
checkQuestionType:'',
}
}, },
// //
sizeChange(val) { sizeChange(val) {
@ -981,7 +985,7 @@ export default {
console.log(value, direction, movedKeys); console.log(value, direction, movedKeys);
}, },
submitBtn2(){ submitBtn2(){
this.examAddDetail.questions = this.$refs.questionListTable.selection; this.examForm.questions = this.$refs.questionListTable.selection;
this.dialogVisible2 = false; this.dialogVisible2 = false;
}, },
submitBtn3(){ submitBtn3(){

View File

@ -29,7 +29,7 @@
style="display: flex;justify-content:center;word-wrap: break-word;white-space: normal; flex-wrap: wrap"> style="display: flex;justify-content:center;word-wrap: break-word;white-space: normal; flex-wrap: wrap">
<div v-for="(item,index) in JSON.parse(scope.row.fileUrl)" :key="index" class="videoBox" @click="playerVideo(item.url)"> <div v-for="(item,index) in JSON.parse(scope.row.fileUrl)" :key="index" class="videoBox" @click="playerVideo(item.url)">
<el-tooltip class="item" effect="dark" :content="item.name" placement="left"> <el-tooltip class="item" effect="dark" :content="item.name" placement="left">
<img src="@/assets/images/video-icon.png" alt="" width="50px" height="50px" style="margin-right: 120px;" class=""/> <img src="@/assets/images/video-icon.png" alt="" width="50px" height="50px" style="margin-right: 120px; cursor: pointer;" class=""/>
</el-tooltip> </el-tooltip>
</div> </div>
</span> </span>
@ -43,7 +43,7 @@
<!-- <img :preview="item ? $store.state.FILEURL + item.url : ''" <!-- <img :preview="item ? $store.state.FILEURL + item.url : ''"
:src="item ? $store.state.FILEURL + item.url : ''" alt="" width="50px" height="50px" style="margin-right: 10px;"/> --> :src="item ? $store.state.FILEURL + item.url : ''" alt="" width="50px" height="50px" style="margin-right: 10px;"/> -->
<img :preview="item.url ? item.url : ''" <img :preview="item.url ? item.url : ''"
:src="item.url ? item.url : ''" alt="" width="50px" height="50px" style="margin-right: 10px;"/> :src="item.url ? item.url : ''" alt="" width="50px" height="50px" style="margin-right: 10px;cursor:pointer"/>
</div> </div>
</span> </span>
</template> </template>
@ -84,8 +84,8 @@
<el-input v-model="addCourseForm.courseName"></el-input> <el-input v-model="addCourseForm.courseName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="课程视频" prop="fileUrl" required> <el-form-item label="课程视频" prop="fileUrl" required>
<div>单个文件不超过100M,最多可上传5个附件</div> <div>单个文件不超过100M,最多可上传1个附件</div>
<el-upload class="upload-demo" drag multiple name="files" :limit="5" :action="$store.state.UPLOADURL" <el-upload class="upload-demo" drag multiple name="files" :limit="1" :action="$store.state.UPLOADURL"
accept=".mp4" accept=".mp4"
:on-remove="(file, fileList) => materialHandleRemove(file,fileList)" :on-remove="(file, fileList) => materialHandleRemove(file,fileList)"
:on-success="(res, file) => materialHandleSuccess(res, file)" :on-success="(res, file) => materialHandleSuccess(res, file)"

View File

@ -11,7 +11,7 @@
</el-form-item> </el-form-item>
<el-form-item label="培训前" prop="examNum" :rules="[ <el-form-item label="培训前" prop="examNum" :rules="[
{ type: 'number', message: '必须为数字值', trigger: 'change'}] "> {required:true, type: 'number', message: '必须为数字值', trigger: 'change'}] ">
<div style="width: 80px"> <div style="width: 80px">
<!-- <el-input v-model.number="noticeForm.examNum" size="medium" :disabled="isDisabled" @blur="disabledFn" autocomplete="off"></el-input> --> <!-- <el-input v-model.number="noticeForm.examNum" size="medium" :disabled="isDisabled" @blur="disabledFn" autocomplete="off"></el-input> -->
<el-input v-model.number="noticeForm.examNum" size="medium" :disabled="isDisabled" autocomplete="off"></el-input> <el-input v-model.number="noticeForm.examNum" size="medium" :disabled="isDisabled" autocomplete="off"></el-input>
@ -159,6 +159,10 @@ export default {
submitNoticeForm(noticeForm) { submitNoticeForm(noticeForm) {
// this.$refs[this.noticeForm].validate((valid) => { // this.$refs[this.noticeForm].validate((valid) => {
// if (valid) { // if (valid) {
if(typeof this.noticeForm.examNum !== 'number'){
this.$message.error('请输入数字类型')
return
}
console.log(7788) console.log(7788)
editConfigApi({ editConfigApi({
id:this.noticeForm.id, id:this.noticeForm.id,
@ -168,9 +172,9 @@ export default {
projectSn: this.$store.state.projectSn, projectSn: this.$store.state.projectSn,
}).then(result => { }).then(result => {
if (result.success) { if (result.success) {
this.getConfig()
console.log('信息编辑成功', result); console.log('信息编辑成功', result);
this.$message.success(result.message); this.$message.success(result.message);
this.isDisabled = true this.isDisabled = true
this.isDisabled2 = true this.isDisabled2 = true
} }

View File

@ -15,8 +15,6 @@
<div class="table_wrap whiteBlock" style="height:677px"> <div class="table_wrap whiteBlock" style="height:677px">
<!-- <vue-scroll> --> <!-- <vue-scroll> -->
<el-table class="tables" :data="ruleList" max-height="667px"> <el-table class="tables" :data="ruleList" max-height="667px">
<el-table-column align="center" prop="dictData" label="规则类型"> <el-table-column align="center" prop="dictData" label="规则类型">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="!scope.row.isEdit"> <span v-if="!scope.row.isEdit">

View File

@ -35,45 +35,6 @@
</div> </div>
<div class="right"> <div class="right">
<div class="search_wrap"> <div class="search_wrap">
<!-- <el-upload
style="display: inline-block; margin-left: 15px;"
class="upload-demo"
name="excelFile"
:action="
$http.defaults.baseURL + 'xmgl/workerInfo/uploadExcelWorkerInfo'
"
:on-change="handleChangeE"
:on-success="handleSuccessE"
:on-error="handleErrorE"
:show-file-list="false"
:headers="headers"
:data="{ projectSn: $store.state.projectSn }"
:limit="1"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
:auto-upload="true"
>
<el-button size="medium" type="primary" plain>Excel导入</el-button>
</el-upload> -->
<!-- <el-upload
style="display: inline-block; margin-left: 15px;margin-right: auto;"
class="upload-demo"
name="excelFile"
:action="
$http.defaults.baseURL + 'xmgl/workerInfo/uploadExcelWorkerInfo'
"
:on-change="handleChangeE"
:on-success="handleSuccessE"
:on-error="handleErrorE"
:show-file-list="false"
:headers="headers"
:data="{ projectSn: $store.state.projectSn }"
:limit="1"
accept=".docx"
:auto-upload="true"
>
<el-button size="medium" type="primary" plain>word导入</el-button>
</el-upload> -->
<el-form <el-form
:model="tableParameter" :model="tableParameter"
size="medium" size="medium"
@ -94,9 +55,6 @@
<el-button type="warning" @click="refreshBtn" plain>{{ <el-button type="warning" @click="refreshBtn" plain>{{
$t("message.laborMange.refresh") $t("message.laborMange.refresh")
}}</el-button> }}</el-button>
<!-- <el-button type="primary" @click="exportFn" plain>{{
$t("message.laborMange.export")
}}</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button type="primary" size="medium" @click="addQuestionBtn" <el-button type="primary" size="medium" @click="addQuestionBtn"
@ -111,12 +69,6 @@
style="width: 100%; color: #737996" style="width: 100%; color: #737996"
@selection-change="handleCheckedCitiesChange" @selection-change="handleCheckedCitiesChange"
> >
<!-- <el-table-column
type="selection"
width="70"
align="center"
label="序号"
></el-table-column> -->
<el-table-column prop="questionName" label="试题内容"></el-table-column> <el-table-column prop="questionName" label="试题内容"></el-table-column>
<el-table-column prop="type" width="100px" label="题目类型"> <el-table-column prop="type" width="100px" label="题目类型">
<template slot-scope="scope"> <template slot-scope="scope">
@ -229,14 +181,16 @@
style="width: 75%;margin: 0 auto;" style="width: 75%;margin: 0 auto;"
:rules="questionFormRules" :rules="questionFormRules"
> >
<el-form-item label="试题内容" prop="content"> <el-form-item label="试题内容" prop="questionName">
<el-input <el-input
v-model="questionForm.content"
placeholder="请输入"
type="textarea" type="textarea"
:rows="2" v-model="questionForm.questionName"
@input="handleInputArea()" rows="2"
placeholder="请输入"
></el-input> ></el-input>
<!-- :minlength="0"
:maxlength="500"
@input="handleInputArea()" -->
</el-form-item> </el-form-item>
<el-form-item label="科目类型" prop="subjectId"> <el-form-item label="科目类型" prop="subjectId">
<el-select v-model="questionForm.subjectId" placeholder="请选择"> <el-select v-model="questionForm.subjectId" placeholder="请选择">
@ -259,9 +213,9 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="难易程度" prop="level"> <el-form-item label="难易程度" prop="difficulty">
<el-select <el-select
v-model="questionForm.level" v-model="questionForm.difficulty"
placeholder="请选择" placeholder="请选择"
style="width: 100%;" style="width: 100%;"
> >
@ -277,6 +231,7 @@
<el-form-item label="试题分数" prop="score"> <el-form-item label="试题分数" prop="score">
<el-input-number <el-input-number
:min="0" :min="0"
:max="100"
:precision="0" :precision="0"
:controls="false" :controls="false"
v-model="questionForm.score" v-model="questionForm.score"
@ -540,9 +495,18 @@ export default {
{ name: "单选题", value: 1 }, { name: "单选题", value: 1 },
{ name: "多选题", value: 2 }, { name: "多选题", value: 2 },
], ],
questionForm: {
questionName: null,
subjectId:'',
type: 1,
difficulty: 1,
score: 0,
isApplication: 1,
},
questionFormRules: { questionFormRules: {
content: [ questionName: [
{ {
required: true, required: true,
message: "请输入", message: "请输入",
@ -553,7 +517,7 @@ export default {
{ {
required: true, required: true,
message: "请选择", message: "请选择",
trigger: "blur", trigger: "change",
}, },
], ],
type: [ type: [
@ -563,18 +527,18 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
level: [ difficulty: [
{ {
required: true, required: true,
message: "请选择", message: "请选择",
trigger: "blur", trigger: "change",
}, },
], ],
isApplication: [ isApplication: [
{ {
required: true, required: true,
message: "请选择", message: "请选择",
trigger: "blur", trigger: "change",
}, },
], ],
score: [ score: [
@ -585,13 +549,6 @@ export default {
}, },
], ],
}, },
questionForm: {
content: '',
type: 1,
level: 1,
isApplication: 1,
score: 0
},
editQuestion:{}, editQuestion:{},
title: "添加试题", title: "添加试题",
previewDialogVisible: false, previewDialogVisible: false,
@ -642,6 +599,11 @@ export default {
watch:{ watch:{
previewDialogVisible(newV,oldV){ previewDialogVisible(newV,oldV){
if(newV === false) this.resetForm() if(newV === false) this.resetForm()
},
dialogVisible(newV,oldV){
if(this.title === '添加试题'){
this.$refs.questionForm.resetFields()
}
} }
}, },
methods: { methods: {
@ -695,36 +657,10 @@ export default {
this.total = result.result.total this.total = result.result.total
} }
}) })
// this.tableData = [
// {name: '1',isEnable: 1,uploadTime: '2024-04-30 00:00:00'},
// {name: '2',isEnable: 0,uploadTime: '2024-04-30 00:00:00'},
// {name: '3',isEnable: 1,uploadTime: '2024-04-30 00:00:00'},
// {name: '4',isEnable: 0,uploadTime: '2024-04-30 00:00:00'},
// {name: '5',isEnable: 1,uploadTime: '2024-04-30 00:00:00'},
// ]
}, },
multipleOption(option,options){ multipleOption(option,options){
if(options === undefined) return true if(options === undefined) return true
return options.includes(option) ? true : false return options.includes(option) ? true : false
// let isFlag = 0
// for(let i = 0;options.length;i++){
// if(option === options[i]){
// isFlag++
// }
// }
// if(isFlag === 1){
// return true
// }else{
// return false
// }
// options.split('').map(item => {
// if(option === item){
// return true
// }else{
// return false
// }
// })
// return this.questionForm.options.includes(item.optionCode) ? true : false
}, },
optionStr(index){ optionStr(index){
let str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('') let str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')
@ -735,9 +671,9 @@ export default {
}, },
resetForm(){ resetForm(){
this.questionForm = { this.questionForm = {
content: "", questionName: "",
type: 1, type: 1,
level: 1, difficulty: 1,
isApplication: 1, isApplication: 1,
score: 0 score: 0
} }
@ -790,9 +726,9 @@ export default {
console.log(this.questionForm) console.log(this.questionForm)
editQuestionBankApi({ editQuestionBankApi({
id:this.questionForm.id, id:this.questionForm.id,
questionName:this.questionForm.content, questionName:this.questionForm.questionName,
type:this.questionForm.type, type:this.questionForm.type,
difficulty:this.questionForm.level, difficulty:this.questionForm.difficulty,
isEnable:this.questionForm.isApplication, isEnable:this.questionForm.isApplication,
// optionList: this.questionForm.type == 1 ? this.questionArr.map((item,index) => { // optionList: this.questionForm.type == 1 ? this.questionArr.map((item,index) => {
// return { // return {
@ -821,13 +757,18 @@ export default {
let option = this.optionStr(this.radio) let option = this.optionStr(this.radio)
// //
let multiOptions = '' let multiOptions = ''
console.log(this.checkList,'this.checkList========================')
if(this.questionForm.type !== 1 && this.checkList.length === 0){
this.$message.warning('请选择答案')
return
}
this.checkList.map(item =>{ this.checkList.map(item =>{
multiOptions += this.optionStr(item) multiOptions += this.optionStr(item)
}) })
addQuestionBankApi({ addQuestionBankApi({
questionName:this.questionForm.content, questionName:this.questionForm.questionName,
type:this.questionForm.type, type:this.questionForm.type,
difficulty:this.questionForm.level, difficulty:this.questionForm.difficulty,
isEnable:this.questionForm.isApplication, isEnable:this.questionForm.isApplication,
// optionList: this.questionArr.type == 1 ? this.questionArr.map((item,index) => { // optionList: this.questionArr.type == 1 ? this.questionArr.map((item,index) => {
// return { // return {
@ -885,9 +826,9 @@ export default {
console.log(item); console.log(item);
this.title = "编辑试题"; this.title = "编辑试题";
this.questionForm.content = item.questionName; this.questionForm.questionName = item.questionName;
this.questionForm.type = item.type; this.questionForm.type = item.type;
this.questionForm.level = item.difficulty; this.questionForm.difficulty = item.difficulty;
this.questionForm.isApplication = item.isEnable; this.questionForm.isApplication = item.isEnable;
detailIdQuestionBankApi({ detailIdQuestionBankApi({
@ -930,7 +871,7 @@ export default {
addQuestionBtn() { addQuestionBtn() {
this.questionForm = {} this.questionForm = {}
this.title = "添加试题"; this.title = "添加试题";
this.questionForm.content = ""; // this.questionForm.questionName = "";
this.questionArr = [{ isCheck: true, questionContent: "" },{ isCheck: true, questionContent: "" },{ isCheck: true, questionContent: "" },{ isCheck: true, questionContent: "" }]; this.questionArr = [{ isCheck: true, questionContent: "" },{ isCheck: true, questionContent: "" },{ isCheck: true, questionContent: "" },{ isCheck: true, questionContent: "" }];
this.radio = 0; this.radio = 0;
this.checkList = []; this.checkList = [];
@ -938,6 +879,10 @@ export default {
}, },
// //
addQuestionAnswer() { addQuestionAnswer() {
if(!this.questionForm.type){
this.$message.warning('请选择题目类型')
return
}
this.questionArr.push({ isCheck: true , questionContent: "" }); this.questionArr.push({ isCheck: true , questionContent: "" });
}, },
// //

View File

@ -69,20 +69,22 @@
layout="total, sizes, prev, pager, next" :total="Number(pagInfo.total)" background></el-pagination> layout="total, sizes, prev, pager, next" :total="Number(pagInfo.total)" background></el-pagination>
</div> </div>
<!-- 新增 --> <!-- 新增 -->
<el-dialog :modal-append-to-body="false" destroy-on-close=true: :title="title" :visible.sync="dialogVisible" width="1000px"> <el-dialog :modal-append-to-body="false" :destroy-on-close="true" :title="title" :visible.sync="dialogVisible" width="1000px">
<el-steps :active="active" align-center> <el-steps :active="active" align-center>
<el-step title="教育信息"></el-step> <el-step title="教育信息"></el-step>
<el-step title="人员信息"></el-step> <el-step title="人员信息"></el-step>
</el-steps> </el-steps>
<div class="dialogContainer" v-show="active == 1"> <div class="dialogContainer" v-show="active == 1">
<el-form :model="addCourseForm" ref="examForm" label-width="100px" class="demo-addCourseForm"> <el-form :model="addCourseForm" ref="examForm" label-width="110px" class="demo-addCourseForm">
<div class="item-flex"> <div class="item-flex">
<el-form-item label="培训计划名称" prop="name" required> <el-form-item label="培训计划名称" prop="name"
:rules="[{required:true, message:'必填', trigger:'change'}]">
<el-input v-model="addCourseForm.name" placeholder="请输入教育主题" maxlength="50" ></el-input> <el-input v-model="addCourseForm.name" placeholder="请输入教育主题" maxlength="50" ></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="item-flex"> <div class="item-flex">
<el-form-item label="科目类型" prop="subjectId" required> <el-form-item label="科目类型" prop="subjectId"
:rules="[{required:true, message:'必填', trigger:'change'}]">
<el-select v-model="addCourseForm.subjectId" placeholder="请选择科目类型"> <el-select v-model="addCourseForm.subjectId" placeholder="请选择科目类型">
<el-option :label="item.name" :value="item.id" v-for="(item, i) in subjectNameList" <el-option :label="item.name" :value="item.id" v-for="(item, i) in subjectNameList"
:key="i"></el-option> :key="i"></el-option>
@ -90,7 +92,8 @@
</el-form-item> </el-form-item>
</div> </div>
<div class="item-flex"> <div class="item-flex">
<el-form-item label="选择课件" prop="courseId"> <el-form-item label="选择课件" prop="courseId"
:rules="[{required:true, message:'必填', trigger:'change'}]">
<el-select v-model="addCourseForm.courseId" placeholder="请选择课件"> <el-select v-model="addCourseForm.courseId" placeholder="请选择课件">
<el-option :label="item.courseName" :value="item.id" v-for="(item, i) in courseList" <el-option :label="item.courseName" :value="item.id" v-for="(item, i) in courseList"
:key="i"></el-option> :key="i"></el-option>
@ -98,7 +101,8 @@
</el-form-item> </el-form-item>
</div> </div>
<div class="item-flex"> <div class="item-flex">
<el-form-item label="选择试卷" prop="examPaperId"> <el-form-item label="选择试卷" prop="examPaperId"
:rules="[{required:true, message:'必填', trigger:'change'}]">
<el-select v-model="addCourseForm.examPaperId" placeholder="请选择试卷"> <el-select v-model="addCourseForm.examPaperId" placeholder="请选择试卷">
<el-option :label="item.name" :value="item.id" v-for="(item, i) in examPaperSubjectList" <el-option :label="item.name" :value="item.id" v-for="(item, i) in examPaperSubjectList"
:key="i"></el-option> :key="i"></el-option>
@ -106,17 +110,20 @@
</el-form-item> </el-form-item>
</div> </div>
<div class="item-flex"> <div class="item-flex">
<el-form-item label="教育主题" prop="title" required> <el-form-item label="教育主题" prop="title"
:rules="[{required:true, message:'必填', trigger:'change'}]">
<el-input v-model="addCourseForm.title" placeholder="请输入教育主题" maxlength="50" ></el-input> <el-input v-model="addCourseForm.title" placeholder="请输入教育主题" maxlength="50" ></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="item-flex"> <div class="item-flex">
<el-form-item label="培训开始时间" prop="trainBeginTime" required> <el-form-item label="培训开始时间" prop="trainBeginTime"
:rules="[{required:true, message:'必填', trigger:'change'}]">
<el-date-picker v-model="addCourseForm.trainBeginTime" type="datetime" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss" default-time="00:00:00"></el-date-picker> <el-date-picker v-model="addCourseForm.trainBeginTime" type="datetime" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss" default-time="00:00:00"></el-date-picker>
</el-form-item> </el-form-item>
</div> </div>
<div class="item-flex"> <div class="item-flex">
<el-form-item label="培训结束时间" prop="trainEndTime" required> <el-form-item label="培训结束时间" prop="trainEndTime"
:rules="[{required:true, message:'必填', trigger:'change'}]">
<el-date-picker v-model="addCourseForm.trainEndTime" type="datetime" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss" default-time="00:00:00"></el-date-picker> <el-date-picker v-model="addCourseForm.trainEndTime" type="datetime" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss" default-time="00:00:00"></el-date-picker>
</el-form-item> </el-form-item>
</div> </div>
@ -134,7 +141,11 @@
<el-table-column type="index" label="序号" align="center"></el-table-column> <el-table-column type="index" label="序号" align="center"></el-table-column>
<el-table-column align="center" prop="workerName" label="姓名"></el-table-column> <el-table-column align="center" prop="workerName" label="姓名"></el-table-column>
<el-table-column align="center" prop="idCard" label="身份证"></el-table-column> <el-table-column align="center" prop="idCard" label="身份证"></el-table-column>
<el-table-column align="center" prop="teamName" label="所在班组"></el-table-column> <el-table-column align="center" label="班组/部门">
<template slot-scope="scope">
{{scope.row.teamName}}{{scope.row.departmentName}}
</template>
</el-table-column>
<el-table-column align="center" prop="typeName" label="工种"></el-table-column> <el-table-column align="center" prop="typeName" label="工种"></el-table-column>
<!-- <el-table-column align="center" prop="jobTypeName" label="作业类别"> <!-- <el-table-column align="center" prop="jobTypeName" label="作业类别">
<template slot-scope="scope"> <template slot-scope="scope">
@ -160,7 +171,7 @@
</div> </div>
</div> </div>
<div class="dialogFooter"> <div class="dialogFooter">
<el-button @click="next" type="primary" v-if="active === 1">下一步</el-button> <el-button @click="next('examForm')" type="primary" v-if="active === 1">下一步</el-button>
<el-button @click="last" type="primary" v-if="active === 2">上一步</el-button> <el-button @click="last" type="primary" v-if="active === 2">上一步</el-button>
<el-button @click="dialogVisible = false"><i class="el-icon-circle-close"></i> </el-button> <el-button @click="dialogVisible = false"><i class="el-icon-circle-close"></i> </el-button>
<el-button type="primary" @click="submitBtn('examForm')"><i class="el-icon-circle-check"></i> <el-button type="primary" @click="submitBtn('examForm')"><i class="el-icon-circle-check"></i>
@ -176,14 +187,15 @@
<el-form :inline="true" size="medium" class="demo-form-inline"> <el-form :inline="true" size="medium" class="demo-form-inline">
<!-- <el-form-item label="选择企业" prop="enterpriseId"> --> <!-- <el-form-item label="选择企业" prop="enterpriseId"> -->
<el-form-item label="" prop="enterpriseId"> <el-form-item label="" prop="enterpriseId">
<el-select v-model="workerInfo.enterpriseId" placeholder="请选择企业" clearable=""> <el-select v-model="workerInfo.enterpriseId" placeholder="请选择企业" @change="getTeamInfoList" clearable="">
<el-option v-for="item in enterpriseInfoList" :key="item.id" :label="item.enterpriseName" :value="item.id"></el-option> <el-option v-for="item in enterpriseInfoList" :key="item.id" :label="item.enterpriseName" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="选择班组" prop="teamId"> --> <!-- <el-form-item label="选择班组" prop="teamId"> -->
<el-form-item label="" prop="teamId"> <el-form-item label="" prop="teamId">
<el-select v-model="workerInfo.teamId" placeholder="请选择班组" clearable=""> <el-select v-model="workerInfo.departmentAndTeam" placeholder="请选择班组/部门" clearable="">
<el-option v-for="item in teamInfoList" :key="item.id" :label="item.teamName" :value="item.id"></el-option> <!-- <el-option v-for="item in teamInfoList" :key="item.id" :label="item.teamName" :value="item.id"></el-option> -->
<el-option v-for="item in teamInfoList" :key="item.id" :label="item.departmentTeamName" :value="item"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="workerName"> <el-form-item prop="workerName">
@ -206,8 +218,13 @@
<el-table-column align="center" prop="workerName" label="姓名"></el-table-column> <el-table-column align="center" prop="workerName" label="姓名"></el-table-column>
<el-table-column align="center" prop="idCard" label="身份证"></el-table-column> <el-table-column align="center" prop="idCard" label="身份证"></el-table-column>
<el-table-column align="center" prop="enterpriseName" label="企业"></el-table-column> <el-table-column align="center" prop="enterpriseName" label="企业"></el-table-column>
<el-table-column align="center" prop="departmentName" label="部门"></el-table-column> <el-table-column align="center" label="班组/部门">
<el-table-column align="center" prop="teamName" label="班组"></el-table-column> <template slot-scope="scope">
{{scope.row.teamName}}{{scope.row.departmentName}}
</template>
</el-table-column>
<!-- <el-table-column align="center" prop="departmentName" label="部门"></el-table-column>
<el-table-column align="center" prop="teamName" label="班组"></el-table-column> -->
<el-table-column align="center" prop="typeName" label="工种"></el-table-column> <el-table-column align="center" prop="typeName" label="工种"></el-table-column>
<el-table-column align="center" prop="age" label="年龄"></el-table-column> <el-table-column align="center" prop="age" label="年龄"></el-table-column>
<el-table-column align="center" prop="enterDate" label="进场日期"></el-table-column> <el-table-column align="center" prop="enterDate" label="进场日期"></el-table-column>
@ -240,7 +257,6 @@
<script> <script>
import trainRecord from './trainRecord.vue' import trainRecord from './trainRecord.vue'
import { import {
addTrainApi, addTrainApi,
pagePaperApi, pagePaperApi,
@ -260,6 +276,8 @@ import {
pageQuestionBankApi, pageQuestionBankApi,
listCourseApi, listCourseApi,
getQueryDepartmentListApi,
} from '@/assets/js/api/examSystem/examSystem' } from '@/assets/js/api/examSystem/examSystem'
@ -310,11 +328,9 @@ export default {
dialogVisible2: false, // dialogVisible2: false, //
dialogVisible3: false, // dialogVisible3: false, //
workerInfo: { workerInfo: {
subdivisionProjectName: '',
children: [],
id: '', id: '',
level: 0, enterpriseId: '',
parentId: '', departmentAndTeam:{}
}, },
listData: [], listData: [],
subjectId:'', subjectId:'',
@ -324,6 +340,7 @@ export default {
], ],
addCourseForm: { addCourseForm: {
examType:2, examType:2,
name: ""
}, // }, //
personType: 0, // personType: 0, //
@ -359,9 +376,11 @@ export default {
}, },
watch: { watch: {
dialogVisible(newV, oldV) { dialogVisible(newV, oldV) {
this.clearDialog() // this.clearDialog()
if (newV === false) { if (this.dialogVisible === false) {
if(this.title = '新增'){
this.$refs.examForm.resetFields()
}
} }
}, },
// subjectId(newV,oldV){ // subjectId(newV,oldV){
@ -391,6 +410,17 @@ export default {
this.getEnterpriseInfoList(); this.getEnterpriseInfoList();
}, },
methods: { methods: {
// getTeamList(){
// // -
// let data = {
// enterpriseId: this.workerInfo.enterpriseId,
// projectSn: this.projectSn,
// };
// getTeamInfoList(data).then((res) => {
// this.teamListData = res.result.list;
// });
// },
getCourseList(){ getCourseList(){
listCourseApi({ listCourseApi({
projectSn: this.projectSn, projectSn: this.projectSn,
@ -439,18 +469,29 @@ export default {
} }
this.getWorkerInfoList(); this.getWorkerInfoList();
}, },
getWorkerInfoList (){ async getWorkerInfoList (){
// this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamId = ''
let data = { let data = {
workerName:this.workerInfo.workerName, workerName:this.workerInfo.workerName,
teamId:this.workerInfo.teamId,
projectSn: this.projectSn, projectSn: this.projectSn,
enterpriseId: this.workerInfo.enterpriseId, enterpriseId: this.workerInfo.enterpriseId,
pageNo: this.worker.pageNo, pageNo: this.worker.pageNo,
// pageSize: this.worker.pageSize, // pageSize: this.worker.pageSize,
pageSize: 999999, pageSize: 999999,
// presence: 1, // presence: 1,
departmentId:'',
teamId:'',
} }
getWorkerInfoListApi(data).then((res) => { if(this.workerInfo.departmentAndTeam){
if(this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType === 1:false) {
data.departmentId = this.workerInfo.departmentAndTeam?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamId:''
}
if(this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamType === 2:false) {
data.teamId = this.workerInfo.departmentAndTeam?this.workerInfo.departmentAndTeam.gtMaterialDepartmentTeamId:''
}
}
await getWorkerInfoListApi(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.result.records); console.log(res.result.records);
this.workerList = res.result.records; this.workerList = res.result.records;
@ -467,45 +508,65 @@ export default {
}) })
}, },
getTeamInfoList (){ getTeamInfoList (){
this.workerInfo.departmentAndTeam = ''
let data = { let data = {
projectSn: this.projectSn, projectSn: this.projectSn,
enterpriseId: this.workerInfo.enterpriseId?this.workerInfo.enterpriseId:'',
} }
getTeamInfoListApi(data).then((res)=>{ // getTeamInfoListApi(data).then((res)=>{
getQueryDepartmentListApi(data).then((res)=>{
if (res.code == 200) { if (res.code == 200) {
this.teamInfoList = res.result this.teamInfoList = res.result
console.log('==========班组列表--'+this.personType+'==========',this.teamInfoList) console.log('==========班组列表--'+this.personType+'==========',this.teamInfoList)
// this.workerInfo.departmentAndTeam = null
} }
}) })
}, },
next() { next(examForm) {
// if(this.active == 2) { // if(this.active == 2) {
// this.$message.warning(''); // this.$message.warning('');
// return // return
// }; // };
// this.active++; // this.active++;
if(!this.addCourseForm.name){
this.$message.error('请输入培训计划名称') this.$refs[examForm].validate((valid) => {
return if(valid){
} if(this.active == 1) {
if(!this.addCourseForm.subjectId){ this.active++;
this.$message.error('请选择科目类型') };
return }
} })
if(!this.addCourseForm.title){
this.$message.error('请输入教育主题') // if(!this.addCourseForm.name){
return // this.$message.error('')
} // return
if(!this.addCourseForm.trainBeginTime){ // }
this.$message.error('请选择培训开始时间') // if(!this.addCourseForm.subjectId){
return // this.$message.error('')
} // return
if(!this.addCourseForm.trainEndTime){ // }
this.$message.error('请选择培训结束时间') // if(!this.addCourseForm.courseId){
return // this.$message.error('')
} // return
if(this.active == 1) { // }
this.active++; // if(!this.addCourseForm.examPaperId){
}; // this.$message.error('')
// return
// }
// if(!this.addCourseForm.title){
// this.$message.error('')
// return
// }
// if(!this.addCourseForm.trainBeginTime){
// this.$message.error('')
// return
// }
// if(!this.addCourseForm.trainEndTime){
// this.$message.error('')
// return
// }
}, },
last() { last() {
if(this.active == 2) { if(this.active == 2) {
@ -768,6 +829,7 @@ export default {
.item-flex { .item-flex {
display: flex; display: flex;
} }
.item-flex_child{ .item-flex_child{
@ -959,13 +1021,14 @@ export default {
// justify-content: space-between; // justify-content: space-between;
width: 100%; width: 100%;
// height:575px; // height:575px;
/deep/ .el-dialog__body { /deep/ .el-dialog__body {
padding: 0 20px; padding: 0 20px;
} }
.dialogLeft { .dialogLeft {
width: 35%; width: 50%;
height: 100%; height: 100%;
// background-color: darkred; // background-color: darkred;