Просмотр исходного кода

task-6079 考试管理添加部门

tianxinyu 5 дней назад
Родитель
Сommit
79d543742d

+ 3 - 1
src/views/platform/examination/constants.js

@@ -151,12 +151,14 @@ const qualifiedType = [
 ]
 
 export const basicColumn = [
+    { prop: 'buMen', label: '部门', width: 100, slotName: 'position' },
     { prop: 'examName', label: '考试名称', minWidth: 200 },
     { prop: 'examType', label: '考试类型', width: 90 },
     { prop: 'bankName', label: '考试题库', width: 160 },
     { prop: 'trainId', label: '关联培训', width: 160 },
     { prop: 'examState', label: '状态', width: 80, tags: statusOption },
-    { prop: 'totalScore', label: '总分', width: 65 }
+    { prop: 'totalScore', label: '总分', width: 65 },
+   
 ]
 
 export const infoColumn = [

+ 44 - 4
src/views/platform/examination/exam/edit.vue

@@ -210,6 +210,32 @@
                     :picker-options="pickerOptions"
                 />
             </el-form-item>
+            <el-form-item prop="suo_shu_fan_wei_" class="inline-item">
+    <template slot="label">
+        所属范围
+        <el-tooltip effect="dark" content="设置考试的所属范围,组级则需要选择具体的专业组。" placement="top">
+            <i class="el-icon-question question-icon">:</i>
+        </el-tooltip>
+    </template>
+    <el-radio-group v-model="form.suo_shu_fan_wei_">
+        <el-radio label="科级">科级</el-radio>
+        <el-radio label="组级">组级</el-radio>
+    </el-radio-group>
+    <el-select
+        v-if="form.suo_shu_fan_wei_ === '组级'"
+        v-model="form.bu_men_"
+        width="100%"
+        :disabled="isDisabled"
+        placeholder="请选择专业组"
+    >
+        <el-option
+            v-for="item in deptList"
+            :key="item.positionId"
+            :label="item.positionName"
+            :value="item.positionId"
+        />
+    </el-select>
+</el-form-item>
             <el-form-item label="选择参考人员配置:">
               <ibps-custom-dialog
                   v-model="fenZu"
@@ -528,7 +554,9 @@ export default {
                 minutes: 30,
                 chou_ti_fang_shi_: '1',
                 ping_fen_ren_: '',
-                fen_zu_id_: ''
+                fen_zu_id_: '',
+                suo_shu_fan_wei_: '',
+                bu_men_: ''
             },
             pickerOptions: {
                 disabledDate (time) {
@@ -567,7 +595,13 @@ export default {
                 ],
                 da_biao_zhan_bi_: [
                     { required: true, message: this.$t('validate.required') }
-                ]
+                ],
+                bu_men_: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                suo_shu_fan_wei_: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
             }
         }
     },
@@ -794,6 +828,12 @@ export default {
                     if (this.allQuestionsNumber.tiKuNumber + this.allQuestionsNumber.handQuestionsNumber === 0) {
                         return this.$message.warning('请先选择题目!')
                     }
+                    if(this.form.suo_shu_fan_wei_ == '组级' && !this.form.bu_men_){
+                      return this.$message.warning('请选择专业组!')
+                    }
+                    if(this.form.suo_shu_fan_wei_ == '科级'){
+                      this.form.bu_men_ = ''
+                    }
                     this.form.sui_ji_ti_shu_ = []
                     this.form.chou_ti_zong_fen_ = 0
                     this.form.ti_mu_zong_shu_ = 0
@@ -876,14 +916,14 @@ export default {
                     bian_zhi_ren_: this.userId,
                     bian_zhi_shi_jian: this.$common.getDateNow(19),
                     ti_ku_fen_lei_: '专业组考试',
-                    suo_shu_fan_wei_: '科级',
+                    suo_shu_fan_wei_: this.form.suo_shu_fan_wei_,
                     ti_ku_zhuang_tai_: '可用',
                     xian_kao_ci_shu_: this.form.xian_kao_ci_shu_,
                     da_biao_zhan_bi_: this.form.da_biao_zhan_bi_,
                     miao_shu_: this.form.kao_shi_miao_shu_,
                     ping_fen_ren_: '',
                     di_dian_: this.level,
-                    bian_zhi_bu_men_: '',
+                    bian_zhi_bu_men_: this.form.suo_shu_fan_wei_ == '组级' ? this.form.bu_men_ : '',
                     kao_shi_shi_chang: this.form.kao_shi_shi_chang,
                     ti_shu_: this.curQuestions.length,
                     zong_fen_: this.curQuestions.reduce((sum, item) => sum + parseInt(item.fen_zhi_), 0)

+ 34 - 4
src/views/platform/examination/exam/list.vue

@@ -44,6 +44,27 @@
             <template slot="examTime" slot-scope="{row}">
                 <div>{{ transformTime(row.duration) }}</div>
             </template>
+            <template slot="position" slot-scope="{row}">
+              <ibps-user-selector
+                :value="row.buMen"
+                type="position"
+                readonly-text="text"
+                :multiple="false"
+                size="mini"
+                :disabled="true"
+              />
+            </template>
+            <template slot="pos">
+              <ibps-user-selector
+                v-model="searchParams.buMen"
+                type="position"
+                readonly-text="text"
+                :multiple="true"
+                size="mini"
+                :temp-search="true"
+                filterable
+              />
+            </template>
             <template slot="user">
                 <ibps-user-selector
                     v-model="searchParams.createBy"
@@ -158,7 +179,8 @@ export default {
             examBankId: '',
             showTable: true,
             searchParams: {
-                createBy: ''
+                createBy: '',
+                buMen: ''
             },
             listConfig: {
                 toolbars: [
@@ -171,6 +193,7 @@ export default {
                 ],
                 searchForm: {
                     forms: [
+                        { prop: 'buMen', label: '部门', fieldType: 'slot', slotName: 'pos' },
                         { prop: 'kaoShiMingChen', label: '考试名称', itemWidth: 150 },
                         { prop: 'kaoShiLeiXing', label: '考试类型', itemWidth: 150, fieldType: 'select', multiple: 'Y', options: examTypeOptions },
                         { prop: 'tiKuId', label: '考试题库', fieldType: 'slot', slotName: 'examBankId', itemWidth: 150 },
@@ -303,16 +326,22 @@ export default {
         getSearchParams () {
             const { parameters, requestPage, sorts } = this.getSearchFormData() || {}
             const { pageNo = 1, limit = 20 } = requestPage || {}
+            console.log('parameters', this.getSearchFormData())
             const param = mapValues(keyBy(parameters, 'key'), 'value')
             const sort = fromPairs(sorts.map(({ field, order }) => [sortField[field], order]))
             if (this.examBankId) {
                 param.tiKuId = this.examBankId.split(',')
             }
-
-            const { createBy } = this.searchParams
+// 
+            const { createBy, buMen } = this.searchParams
+            console.log('his.searchParams',this.searchParams)
             if (this.$utils.isNotEmpty(createBy)) {
                 param[`createBy`] = createBy.split(',')
             }
+
+            if (this.$utils.isNotEmpty(buMen)) {
+                param[`buMen`] = buMen.split(',')
+            }
             return {
                 pageNo,
                 // 获取全部数据处理后前端自行分页
@@ -371,7 +400,8 @@ export default {
                         totalScore: item.isRand === '1' ? parseFloat(item.randScore) : parseFloat(item.totalScore),
                         paperList: [temp],
                         scoreList: [parseFloat(item.score || -1)],
-                        statusList: [item.paperState]
+                        statusList: [item.paperState],
+                        buMen: item.buMen || '',
                     })
                 } else {
                     archiveData[examIndex].scoreList.push(parseFloat(item.score || -1))