Kaynağa Gözat

Merge branch 'xbnl_20260904(应知应会区分学生/教职工)' into SCHOOL-XiBeiNongLin

dedsudiyu 1 gün önce
ebeveyn
işleme
6892af9c42

+ 4 - 4
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/studyCourses.vue

@@ -203,10 +203,10 @@
         }
 
         // 判断是否超过 100 个限制
-        if (currentTotalMin + addMinCount > 100) {
-          self.msgError(`最多只能添加 100 个子项!当前已有 ${currentTotalMin} 个,本次尝试添加 ${addMinCount} 个。`);
-          return; // 超过限制,直接终止后续操作
-        }
+        // if (currentTotalMin + addMinCount > 100) {
+        //   self.msgError(`最多只能添加 100 个子项!当前已有 ${currentTotalMin} 个,本次尝试添加 ${addMinCount} 个。`);
+        //   return; // 超过限制,直接终止后续操作
+        // }
 
         // 用于存储最终要显示的提示信息
         let toastMessage = '';

+ 56 - 26
src/views/safetyEducationExaminationNew/examManagement/examinationArrange/addPage.vue

@@ -143,7 +143,7 @@
                   </el-form-item>
                 </div>
 
-                <el-form-item label="考试范围" prop="scopeType">
+                <el-form-item label="考试范围" prop="scopeType" v-if="!yzyhTest">
                   <div class="scope-btn-group">
                     <button
                       v-for="item in scopeOptions"
@@ -241,6 +241,23 @@
                     </el-table>
                   </div>
                 </el-form-item>
+                <el-form-item label="考试范围" prop="targetUserType" v-if="yzyhTest">
+                  <div class="scope-btn-group">
+                    <button
+                      v-for="item in scopeOptionsB"
+                      :key="item.value"
+                      class="scope-btn"
+                      v-show="!showType || newData.targetUserType === item.value"
+                      :class="{ active: newData.targetUserType === item.value }"
+                      @click.prevent="newData.targetUserType = item.value"
+                    >
+                      <i v-if="newData.targetUserType === item.value" class="el-icon-check"
+                         style="color:#0183fa;margin-right:4px;"
+                      ></i>
+                      {{ item.label }}
+                    </button>
+                  </div>
+                </el-form-item>
               </div>
             </div>
             <!-- ==================== 考前配置 ==================== -->
@@ -291,7 +308,7 @@
                       <p>用户类别</p>
                       <p>学时要求配置</p>
                     </div>
-                    <div class="yzyh-input-max-box">
+                    <div v-if="this.newData.targetUserType == 2" class="yzyh-input-max-box">
                       <p class="yzyh-title-p">研究生</p>
                       <div class="yzyh-text-box">
                         <p>新生(无需进入实验室的)</p>
@@ -315,7 +332,7 @@
                         </div>
                       </div>
                     </div>
-                    <div class="yzyh-input-max-box">
+                    <div v-if="this.newData.targetUserType == 2" class="yzyh-input-max-box">
                       <p class="yzyh-title-p">本科生</p>
                       <div class="yzyh-text-box">
                         <p>非新生</p>
@@ -335,7 +352,7 @@
                         </div>
                       </div>
                     </div>
-                    <div class="yzyh-input-max-box">
+                    <div v-if="this.newData.targetUserType == 1" class="yzyh-input-max-box">
                       <p class="yzyh-title-p">教职工</p>
                       <div class="yzyh-text-box">
                         <p>新入职</p>
@@ -628,28 +645,21 @@
         }
       }
       const validateData1 = (rule, value, callback) => {
-        if (this.newData.studyHoursRequirementEnabled == 1 && !this.yzyhTest && !this.placementTest && this.newData.studyHoursRequirement == 0) {
-          callback(new Error('学时要求不能为0'))
-        }else if (this.newData.studyHoursRequirementEnabled == 1 && this.yzyhTest && this.newData.mandatoryStudyHoursConfig.freshmanNoLabHours == 0) {
-          callback(new Error('研究生-新生的学时要求不能为0'))
-        }
-        // else if (this.newData.studyHoursRequirementEnabled == 1 && this.yzyhTest && this.newData.mandatoryStudyHoursConfig.undergraduateHours == 0) {
-        //   callback(new Error('本科生的学时要求不能为0'))
-        // }
-        else if (this.newData.studyHoursRequirementEnabled == 1 && this.yzyhTest && this.newData.mandatoryStudyHoursConfig.staffNewHours == 0) {
-          callback(new Error('教职工-新入职的学时要求不能为0'))
-        }
-        // else if (this.newData.studyHoursRequirementEnabled == 1 && this.yzyhTest && this.newData.mandatoryStudyHoursConfig.staffNonNewHours == 0) {
-        //   callback(new Error('教职工-非新入职的学时要求不能为0'))
-        // }
-        else {
-          callback()
+        if(this.newData.targetUserType==2){
+          if (this.newData.studyHoursRequirementEnabled == 1 && !this.yzyhTest && !this.placementTest && this.newData.studyHoursRequirement == 0) {
+            callback(new Error('学时要求不能为0'))
+          }else if (this.newData.studyHoursRequirementEnabled == 1 && this.yzyhTest && this.newData.mandatoryStudyHoursConfig.freshmanNoLabHours == 0) {
+            callback(new Error('研究生-新生的学时要求不能为0'))
+          } else {
+            callback()
+          }
+        }else if(this.newData.targetUserType==1){
+          if (this.newData.studyHoursRequirementEnabled == 1 && this.yzyhTest && this.newData.mandatoryStudyHoursConfig.staffNewHours == 0) {
+            callback(new Error('教职工-新入职的学时要求不能为0'))
+          } else {
+            callback()
+          }
         }
-        // if (this.newData.studyHoursRequirementEnabled == 1 && this.newData.studyHoursRequirement == 0) {
-        //   callback(new Error('学时要求不能为0'))
-        // } else {
-        //   callback()
-        // }
       }
       const validateData2 = (rule, value, callback) => {
         if (this.newData.preCourseEnabled == 1 && !this.newData.preCourseId) {
@@ -723,6 +733,10 @@
           { label: '考试范围', value: 2 },
           { label: '指定考生', value: 3 }
         ],
+        scopeOptionsB: [
+          { label: '学生', value: 2 },
+          { label: '教职工', value: 1 },
+        ],
         optionListC:[],
         optionExamType: [],
         tableList: [],
@@ -756,6 +770,7 @@
           examTimeRange: null,
           answerDuration: 0,
           scopeType: 1,
+          targetUserType: 2,
           studyHoursRequirementEnabled: 0,
           studyHoursRequirement: 0,
           knowledgePointIds:[],
@@ -820,6 +835,10 @@
             { required: true, message: '请选择考试范围', trigger: 'change' },
             { validator: validateData0, trigger: 'blur' }
           ],
+          targetUserType: [
+            { required: true, message: '请选择考试范围', trigger: 'change' },
+            { validator: validateData0, trigger: 'blur' }
+          ],
           examTimeRange: [
             { required: true, message: '请选择考试时间', trigger: 'change' }
           ],
@@ -911,6 +930,7 @@
               examTimeRange: [response.data.startTime.replace("T", "0"),response.data.endTime.replace("T", "0")],
               answerDuration: response.data.answerDuration,
               scopeType:response.data.scopeType,
+              targetUserType:response.data.targetUserType?response.data.targetUserType:2,
               studyHoursRequirementEnabled: response.data.studyHoursRequirementEnabled,
               studyHoursRequirement: response.data.studyHoursRequirement,
               knowledgePointIds: response.data.knowledgePointIds,
@@ -994,11 +1014,17 @@
           endTime:this.newData.examTimeRange[1].replace(" ", "T"),
           answerDuration:this.newData.answerDuration,
           scopeType:this.newData.scopeType,
+          targetUserType:this.yzyhTest?this.newData.targetUserType:'',
           ruleScopeItems:this.newData.scopeType==2?this.scopeList:[],
           designatedCandidates:this.newData.scopeType==3?this.userList:[],
           studyHoursRequirementEnabled:this.newData.studyHoursRequirementEnabled,
           studyHoursRequirement:this.newData.studyHoursRequirementEnabled == 1&&(!this.yzyhTest&&!this.placementTest)?this.newData.studyHoursRequirement:0,
-          mandatoryStudyHoursConfig:this.newData.studyHoursRequirementEnabled == 1&&this.yzyhTest?this.newData.mandatoryStudyHoursConfig:{
+          mandatoryStudyHoursConfig:this.newData.studyHoursRequirementEnabled == 1&&this.yzyhTest?{
+            freshmanNoLabHours:this.newData.targetUserType==2?this.newData.mandatoryStudyHoursConfig.freshmanNoLabHours:0,
+            undergraduateHours:this.newData.targetUserType==2?this.newData.mandatoryStudyHoursConfig.undergraduateHours:0,
+            staffNewHours:this.newData.targetUserType==1?this.newData.mandatoryStudyHoursConfig.staffNewHours:0,
+            staffNonNewHours:this.newData.targetUserType==1?this.newData.mandatoryStudyHoursConfig.staffNonNewHours:0,
+          }:{
             freshmanNoLabHours:0,
             undergraduateHours:0,
             staffNewHours:0,
@@ -1164,6 +1190,10 @@
               }
             }
             if (self.optionExamType[i].examTypeCode == 'yzyh') {
+              self.$set(this.newData, 'scopeType', 1)
+              if(!this.newData.targetUserType){
+                self.$set(this.newData, 'targetUserType', 2)
+              }
               self.$set(this, 'yzyhTest', true)
             } else {
               self.$set(this, 'yzyhTest', false)

+ 5 - 5
src/views/safetyEducationExaminationNew/examManagement/examinationArrange/index.vue

@@ -208,7 +208,7 @@
         //时间数据
         dateRange:[],
         //列表数据
-        dataList:[{}],
+        dataList:[],
         //数据数量
         total:0,
         //组件传参
@@ -269,21 +269,21 @@
         let self = this;
         if(type == 1){
           //新增
-          this.$set(this,'pageType',2);
           this.$set(this,'propsData',{});
+          this.$set(this,'pageType',2);
         }else if(type == 2){
           //补考
-          this.$set(this,'pageType',3);
           this.$set(this,'propsData',{
             id:row.id,
             makeupExamId:row.makeupExamId,
             makeupStarted:row.makeupStarted,
           });
+          this.$set(this,'pageType',3);
         }else if(type == 3){
           //编辑
-          this.$set(this,'pageType',2);
           let obj = JSON.parse(JSON.stringify(row))
           this.$set(this,'propsData',obj);
+          this.$set(this,'pageType',2);
         }else if(type == 4){
           //复制
           this.$confirm('是否确认复制?', "提示", {
@@ -316,10 +316,10 @@
           this.getList();
         }else if(type == 7){
           //详情
-          this.$set(this,'pageType',2);
           let obj = JSON.parse(JSON.stringify(row))
           obj.showType = true;
           this.$set(this,'propsData',obj);
+          this.$set(this,'pageType',2);
         }
       },
       //查询全部专业类别

+ 13 - 13
src/views/safetyEducationExaminationNew/examManagement/examinationArrange/selectCertificate.vue

@@ -10,16 +10,16 @@
             <el-option label="不共享" value="0"/>
           </el-select>
         </el-form-item>
-        <el-form-item label="" prop="examTypeId">
-          <el-select v-model="queryParams.examTypeId" placeholder="考试类型" style="width: 140px">
-            <el-option
-              v-for="dict in optionListA"
-              :key="dict.id"
-              :label="dict.examTypeName"
-              :value="dict.id"
-            />
-          </el-select>
-        </el-form-item>
+        <!--<el-form-item label="" prop="templateType">-->
+          <!--<el-select v-model="queryParams.templateType" placeholder="考试类型" style="width: 140px">-->
+            <!--<el-option-->
+              <!--v-for="dict in optionListA"-->
+              <!--:key="dict.id"-->
+              <!--:label="dict.examTypeName"-->
+              <!--:value="dict.id"-->
+            <!--/>-->
+          <!--</el-select>-->
+        <!--</el-form-item>-->
         <el-form-item label="" prop="deptId">
           <el-cascader
             style="width: 180px"
@@ -101,12 +101,12 @@
           page:1,
           pageSize:20,
           shareStatus:null,
-          examTypeId :null,
+          templateType :1,
           deptId :null,
           searchValue :'',
         },
         //列表数据
-        dataList:[{}],
+        dataList:[],
         //数据数量
         total:0,
       }
@@ -138,7 +138,7 @@
           page:1,
           pageSize:20,
           shareStatus:null,
-          examTypeId :null,
+          templateType :1,
           deptId :null,
           searchValue :'',
         });

+ 6 - 3
src/views/safetyEducationExaminationNew/examManagement/examinationArrange/studentsTakingMakeUpExams.vue

@@ -180,7 +180,7 @@
     >
       <!--选择试卷/选择试题-->
       <selectTestPaper v-if="drawerType === 1&&drawer"></selectTestPaper>
-      <examDetails v-if="drawerType === 2&&drawer"></examDetails>
+      <examDetails v-if="drawerType === 2&&drawer" :examDetailsPropsData="examDetailsPropsData"></examDetails>
     </el-drawer>
   </div>
 </template>
@@ -248,7 +248,7 @@
         },
         //下拉列表数据
         optionListA: [],
-        optionListB: [{}],
+        optionListB: [],
         optionListC: [],
         //查询条件
         queryParams: {
@@ -269,6 +269,8 @@
         drawer: false,
         //补考是否已开始 0未开始 1开始
         makeupStarted:null,
+        //补考试卷详情数据
+        examDetailsPropsData:null,
       }
     },
     created() {
@@ -360,9 +362,10 @@
           this.$parent.tableButton(6)
         })
       },
-      lockExam(){
+      lockExam(row){
         this.$set(this, 'drawerTitle', '试卷详情')
         this.$set(this, 'drawerType', 2)
+        this.$set(this, 'examDetailsPropsData', row)
         this.$set(this, 'drawer', true)
       },
       //查询按钮

+ 10 - 10
src/views/safetyEducationExaminationNew/publicConfiguration/certificateTemplate/addPage.vue

@@ -12,13 +12,13 @@
           <el-form-item label="证书模板名称" prop="templateName" style="margin-top:20px;">
             <el-input v-model="newData.templateName" placeholder="请输入证书模板名称" maxLength="20" style="width:500px;"></el-input>
           </el-form-item>
-          <el-form-item label="适用考试类型" prop="examTypeId">
-            <el-select v-model="newData.examTypeId" placeholder="请选择考试类型" style="width: 500px">
+          <el-form-item label="适用考试类型" prop="templateType">
+            <el-select v-model="newData.templateType" placeholder="请选择证书类型" style="width: 500px">
               <el-option
                 v-for="dict in optionList"
-                :key="dict.id"
-                :label="dict.examTypeName"
-                :value="dict.id"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -102,11 +102,11 @@
           Authorization: getToken(),
         },
         upData:[],
-        optionList:[],
+        optionList:[{value:'1',label:'考试证书'},{value:'2',label:'培训证书'},],
         optionDeptList:[],
         newData:{
           templateName:'',
-          examTypeId:null,
+          templateType:null,
           deptId:null,
           templateWordPath:'',
           description:'',
@@ -117,7 +117,7 @@
             { required: true, message: "请输入证书模板名称", trigger: "blur" },
             { required: true, message: "请输入证书模板名称", validator: this.spaceJudgment, trigger: "blur" }
           ],
-          examTypeId: [
+          templateType: [
             { required: true, message: "请选择考试类型", trigger: "blur" },
             { required: true, message: "请选择考试类型", validator: this.spaceJudgment, trigger: "blur" }
           ],
@@ -144,7 +144,7 @@
     },
     mounted(){
       this.initialize();
-      this.examElExamTypeList();
+      // this.examElExamTypeList();
       this.systemDeptCurrentDept();
     },
     methods:{
@@ -153,7 +153,7 @@
           this.$set(this,'newData',{
             id:this.propsData.id,
             templateName:this.propsData.templateName,
-            examTypeId:this.propsData.examTypeId,
+            templateType:this.propsData.templateType,
             deptId:this.propsData.deptId,
             templateWordPath:this.propsData.templateWordPath,
             description:this.propsData.description,

+ 15 - 11
src/views/safetyEducationExaminationNew/publicConfiguration/certificateTemplate/index.vue

@@ -11,13 +11,13 @@
               <el-option label="不共享" value="0"/>
             </el-select>
           </el-form-item>
-          <el-form-item label="" prop="examTypeId">
-            <el-select v-model="queryParams.examTypeId" placeholder="考试类型" style="width: 200px">
+          <el-form-item label="" prop="templateType">
+            <el-select v-model="queryParams.templateType" placeholder="证书类型" style="width: 200px">
               <el-option
                 v-for="dict in optionClassList"
-                :key="dict.id"
-                :label="dict.examTypeName"
-                :value="dict.id"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
               />
             </el-select>
           </el-form-item>
@@ -59,7 +59,11 @@
         <el-table class="table-box"  border :data="dataList">
           <el-table-column label="序号" type="index" align="center" width="50"/>
           <el-table-column label="证书模板名称" prop="templateName"  show-overflow-tooltip/>
-          <el-table-column label="适用考试类型" prop="examTypeName" width="200" show-overflow-tooltip/>
+          <el-table-column label="证书类型" prop="templateType" width="200" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{scope.row.templateType==1?'考试证书':'培训证书'}}</span>
+            </template>
+          </el-table-column>
           <el-table-column label="是否共享" prop="shareStatus" width="120" show-overflow-tooltip>
             <template slot-scope="scope">
               <span style="padding:2px 10px;border:1px solid rgb(1, 131, 251);border-radius:4px;color: rgb(1, 131, 251);background-color:rgba(1, 131, 251,0.2)" v-if="scope.row.shareStatus === 1">共享</span>
@@ -123,12 +127,12 @@
         //页面状态
         pageType:1,
         //下拉列表数据
-        optionClassList:[],
+        optionClassList:[{value:'1',label:'考试证书'},{value:'2',label:'培训证书'},],
         optionList:[],
         queryParams:{
           page:1,
           pageSize:20,
-          examTypeId:null,
+          templateType:null,
           deptId:null,
           searchValue:'',
         },
@@ -144,7 +148,7 @@
 
     },
     mounted () {
-      this.examElExamTypeList();
+      // this.examElExamTypeList();
       this.systemDeptCurrentDept();
       this.getList();
     },
@@ -159,7 +163,7 @@
         this.$set(this,'queryParams',{
           page:1,
           pageSize:20,
-          examTypeId:null,
+          templateType:null,
           deptId:null,
           shareStatus:'',
           searchValue:'',
@@ -201,7 +205,7 @@
           //详情
           let obj = {
             name:row.templateName,
-            url:localStorage.getItem('fileBrowseEnvironment') +row.templateWordPath,
+            url:localStorage.getItem('fileBrowseEnvironment') +'/'+row.templateWordPath,
             type:'docx'
           }
           this.fullScreenFileLookClick(obj);

+ 1 - 0
src/views/safetyEducationExaminationNew/safetyTest/myCertificates/index.vue

@@ -24,6 +24,7 @@
               <div class="table-button-box">
                 <p class="table-button-null"></p>
                 <p class="table-button-p"
+                   v-if="scope.row.certificateStatus == 1 && scope.row.certificatePrintEnabled == 1"
                    @click="tableButton(1,scope.row)"
                 >查看下载</p>
                 <p class="table-button-null"></p>

+ 1 - 1
src/views/safetyEducationExaminationNew/workbench/UserInfoCard.vue

@@ -157,7 +157,7 @@
               </div>
             </div>
             <!--本科生选项-->
-            <div style="margin-top:20px;" v-if="userInfo.educationType == 2">
+            <div style="margin-top:20px;" v-if="userInfo.educationType == 2&&!shadeFormData.isEnter">
               <el-form-item label="" prop="reason" label-width="0">
                 <el-input
                   type="textarea"