lrf402788946 4 years ago
parent
commit
4a60513705

+ 65 - 31
src/views/teacher/index.vue

@@ -16,6 +16,9 @@
         <el-col :span="3">
         <el-col :span="3">
           <el-button size="mini" type="primary" @click="downloadTemplate">下载上传教师评分模板</el-button>
           <el-button size="mini" type="primary" @click="downloadTemplate">下载上传教师评分模板</el-button>
         </el-col>
         </el-col>
+        <el-col :span="3">
+          <el-button size="mini" type="primary" @click="selectDisplay">选择显示</el-button>
+        </el-col>
         <el-col :span="3">
         <el-col :span="3">
           <el-upload action="/files/train/score/upload" :show-file-list="false" :on-success="handleSuccess" :on-error="handleError" multiple>
           <el-upload action="/files/train/score/upload" :show-file-list="false" :on-success="handleSuccess" :on-error="handleError" multiple>
             <el-button size="mini" type="primary">点击上传教师评分</el-button>
             <el-button size="mini" type="primary">点击上传教师评分</el-button>
@@ -33,6 +36,18 @@
     <el-dialog :visible.sync="dialog" title="添加教师" @close="toClose" width="50%">
     <el-dialog :visible.sync="dialog" title="添加教师" @close="toClose" width="50%">
       <data-form :data="form" :fields="tearcherForm" :rules="rules" @save="turnSave"> </data-form>
       <data-form :data="form" :fields="tearcherForm" :rules="rules" @save="turnSave"> </data-form>
     </el-dialog>
     </el-dialog>
+    <el-dialog :visible.sync="columnDialog" title="显示列" @close="toClose" width="50%">
+      <el-row>
+        <el-checkbox-group v-model="columnSelect">
+          <el-col :span="4" v-for="(i, index) in columns" :key="index">
+            <el-checkbox :label="i.prop">{{ i.label }}</el-checkbox>
+          </el-col>
+        </el-checkbox-group>
+        <el-col :span="24">
+          <el-button type="primary" @click="changeColumns">确定</el-button>
+        </el-col>
+      </el-row>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -86,7 +101,40 @@ export default {
         },
         },
       },
       },
     ],
     ],
-    fields: [
+    fields: [],
+    list: [],
+    filFields: [
+      { label: '教师名称', model: 'name' },
+      { label: '年龄', model: 'age' },
+      {
+        label: '状态',
+        model: 'status',
+        type: 'select',
+      },
+      {
+        label: '性别',
+        model: 'gender',
+        type: 'select',
+      },
+    ],
+    total: 0,
+    // 添加教师
+    dialog: false,
+    form: {},
+    tearcherForm: [
+      { label: '教师姓名', required: true, model: 'name' },
+      { label: '手机号', required: true, model: 'phone', options: { maxLength: 11, minLength: 11 } },
+    ],
+    rules: {
+      name: [{ required: true, message: '请输入教师姓名' }],
+      phone: [
+        { required: true, message: '请输入手机号' },
+        { min: 11, max: 11, message: '请输入11位手机号 ', trigger: 'blur' },
+      ],
+    },
+    columnSelect: [],
+    columnDialog: false,
+    columns: [
       { label: '姓名', prop: 'name' },
       { label: '姓名', prop: 'name' },
       { label: '性别', prop: 'gender', options: { width: `80px` } },
       { label: '性别', prop: 'gender', options: { width: `80px` } },
       { label: '手机号', prop: 'phone' },
       { label: '手机号', prop: 'phone' },
@@ -126,38 +174,14 @@ export default {
         },
         },
       },
       },
     ],
     ],
-    list: [],
-    filFields: [
-      { label: '教师名称', model: 'name' },
-      { label: '年龄', model: 'age' },
-      {
-        label: '状态',
-        model: 'status',
-        type: 'select',
-      },
-      {
-        label: '性别',
-        model: 'gender',
-        type: 'select',
-      },
-    ],
-    total: 0,
-    // 添加教师
-    dialog: false,
-    form: {},
-    tearcherForm: [
-      { label: '教师姓名', required: true, model: 'name' },
-      { label: '手机号', required: true, model: 'phone', options: { maxLength: 11, minLength: 11 } },
-    ],
-    rules: {
-      name: [{ required: true, message: '请输入教师姓名' }],
-      phone: [
-        { required: true, message: '请输入手机号' },
-        { min: 11, max: 11, message: '请输入11位手机号 ', trigger: 'blur' },
-      ],
-    },
   }),
   }),
   created() {
   created() {
+    this.$set(this, `fields`, this.columns);
+    this.$set(
+      this,
+      'columnSelect',
+      this.columns.map(i => i.prop)
+    );
     this.search();
     this.search();
   },
   },
   computed: {},
   computed: {},
@@ -221,6 +245,16 @@ export default {
       this.from = {};
       this.from = {};
       this.dialog = false;
       this.dialog = false;
     },
     },
+    // 列显示选择
+    selectDisplay() {
+      this.columnDialog = true;
+    },
+    //改变显示列
+    changeColumns() {
+      const r = this.columns.filter(f => this.columnSelect.find(fc => fc == f.prop));
+      this.$set(this, `fields`, r);
+      this.columnDialog = false;
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 6 - 2
src/views/train-plan/parts/lesson-table.vue

@@ -20,7 +20,7 @@
         </el-form-item>
         </el-form-item>
         <el-form-item label="教师安排">
         <el-form-item label="教师安排">
           <template v-for="(i, index) in cList">
           <template v-for="(i, index) in cList">
-            <el-form-item :key="`tea${index}`" :label="`${i.class_num}班`" label-width="50px">
+            <el-form-item :key="`tea${index}`" :label="`${i.class.includes('班') ? i.class : `${i.class}班`}`" label-width="100px">
               <el-input v-model="i.name" placeholder="点击选择教师" @click.native="toChooseTeacher(i.classid)" clearable @clear="toClear(index)"></el-input>
               <el-input v-model="i.name" placeholder="点击选择教师" @click.native="toChooseTeacher(i.classid)" clearable @clear="toClear(index)"></el-input>
               <!-- :readonly="true" -->
               <!-- :readonly="true" -->
             </el-form-item>
             </el-form-item>
@@ -55,6 +55,7 @@ import _ from 'lodash';
 import teacherSelect from './teacher.vue';
 import teacherSelect from './teacher.vue';
 import dataForm from '@frame/components/form';
 import dataForm from '@frame/components/form';
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: teacher } = createNamespacedHelpers('vuex');
 export default {
 export default {
   name: 'lesson-table',
   name: 'lesson-table',
   props: {
   props: {
@@ -88,6 +89,7 @@ export default {
   },
   },
   created() {},
   created() {},
   methods: {
   methods: {
+    ...teacher(['checkArrange']),
     handleSave() {
     handleSave() {
       let dForm = _.cloneDeep(this.form);
       let dForm = _.cloneDeep(this.form);
       if (_.get(dForm, 'subid')) {
       if (_.get(dForm, 'subid')) {
@@ -108,6 +110,8 @@ export default {
     //选择教师
     //选择教师
     selTea(data) {
     selTea(data) {
       let { teaname: name, teaid: id } = data;
       let { teaname: name, teaid: id } = data;
+      const { termid } = this.defaultOption;
+      console.log(data);
       this.dialog = false;
       this.dialog = false;
       let i = this.cList.findIndex(f => f.classid == this.isChange);
       let i = this.cList.findIndex(f => f.classid == this.isChange);
       let o = this.cList.find(f => f.classid == this.isChange);
       let o = this.cList.find(f => f.classid == this.isChange);
@@ -157,7 +161,7 @@ export default {
     },
     },
   },
   },
   computed: {
   computed: {
-    ...mapState(['user']),
+    ...mapState(['user', 'defaultOption']),
     pageTitle() {
     pageTitle() {
       return `${this.$route.meta.title}`;
       return `${this.$route.meta.title}`;
     },
     },

+ 2 - 3
src/views/train-plan/parts/teacher.vue

@@ -39,6 +39,7 @@ export default {
       teaFields: [
       teaFields: [
         { label: '姓名', prop: 'name', filter: 'input' },
         { label: '姓名', prop: 'name', filter: 'input' },
         { label: '工作地点', prop: 'jobaddress' },
         { label: '工作地点', prop: 'jobaddress' },
+        { label: '学生评分', prop: 'xsscore' },
         { label: '资料评分', prop: 'zlscore' },
         { label: '资料评分', prop: 'zlscore' },
         { label: '面试评分', prop: 'msscore' },
         { label: '面试评分', prop: 'msscore' },
       ],
       ],
@@ -60,14 +61,12 @@ export default {
     ...teacher({ getTeacherList: 'query' }),
     ...teacher({ getTeacherList: 'query' }),
     ...teaPlan({ getApplyTeacherList: 'applyQuery' }),
     ...teaPlan({ getApplyTeacherList: 'applyQuery' }),
     async toGetTeacherList({ skip = 0, limit = 10, ...info } = {}) {
     async toGetTeacherList({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.getTeacherList({ skip, limit, ...info, subid: this.subjectid, status: '4' });
+      let res = await this.getTeacherList({ skip, limit, ...info });
       this.$set(this, `teacherTotal`, res.total);
       this.$set(this, `teacherTotal`, res.total);
       this.$set(this, `teacherList`, res.data);
       this.$set(this, `teacherList`, res.data);
     },
     },
     async toGetApplyList({ skip = 0, limit = 10, ...info } = {}) {
     async toGetApplyList({ skip = 0, limit = 10, ...info } = {}) {
       let res = await this.getApplyTeacherList({
       let res = await this.getApplyTeacherList({
-        skip,
-        limit,
         ...info,
         ...info,
         subid: this.subjectid,
         subid: this.subjectid,
         status: '4',
         status: '4',

+ 1 - 1
src/views/train-plan/parts/term-lesson-table.vue

@@ -14,7 +14,7 @@
         align="center"
         align="center"
         v-for="(i, index) in classList"
         v-for="(i, index) in classList"
         :key="index"
         :key="index"
-        :label="`${i.name}班`"
+        :label="`${i.name.includes('班') ? i.name : `${i.name}班`}`"
         :prop="`name_${index + 1}`"
         :prop="`name_${index + 1}`"
         :show-overflow-tooltip="true"
         :show-overflow-tooltip="true"
       >
       >

+ 5 - 3
src/views/train-plan/term-lesson.vue

@@ -134,7 +134,7 @@ export default {
   methods: {
   methods: {
     ...notice({ getNoticeList: 'query' }),
     ...notice({ getNoticeList: 'query' }),
 
 
-    ...lesson({ getLesson: 'query', plupdate: 'pluralUpdate', autoArrange: 'arrange', confirmLesson: 'confirmLesson' }),
+    ...lesson({ getLesson: 'query', plupdate: 'pluralUpdate', autoArrange: 'arrange', confirmLesson: 'confirmLesson', newArrange: 'newArrange' }),
     ...classes({ getClass: 'query', pcupdate: 'pluralUpdate' }),
     ...classes({ getClass: 'query', pcupdate: 'pluralUpdate' }),
 
 
     ...subject({ getSubject: 'query' }),
     ...subject({ getSubject: 'query' }),
@@ -676,6 +676,7 @@ export default {
     //课表模板排课
     //课表模板排课
     async toArrange(needAlert = true) {
     async toArrange(needAlert = true) {
       let planid = _.get(this.defaultOption, 'planid');
       let planid = _.get(this.defaultOption, 'planid');
+      let termid = _.get(this.defaultOption, `termid`);
       if (needAlert)
       if (needAlert)
         this.$confirm('此操作将会将默认 年度计划 下所有的班级课表重置,若您已经修改过某班的信息,请谨慎使用', '提示', {
         this.$confirm('此操作将会将默认 年度计划 下所有的班级课表重置,若您已经修改过某班的信息,请谨慎使用', '提示', {
           confirmButtonText: '按模板排课',
           confirmButtonText: '按模板排课',
@@ -683,7 +684,7 @@ export default {
           type: 'warning',
           type: 'warning',
         })
         })
           .then(async () => {
           .then(async () => {
-            let res = await this.autoArrange(planid);
+            let res = await this.newArrange({ planid, termid });
             this.$checkRes(res, '排课成功', res.errmsg || '排课失败');
             this.$checkRes(res, '排课成功', res.errmsg || '排课失败');
             this.search();
             this.search();
           })
           })
@@ -691,11 +692,12 @@ export default {
             console.log('已取消');
             console.log('已取消');
           });
           });
       else {
       else {
+        // 先暂停使用此功能,需要修改后
         let msg = this.$message({
         let msg = this.$message({
           message: '首次进入,计划未排课,正在按模板进行排课中...',
           message: '首次进入,计划未排课,正在按模板进行排课中...',
           duration: 0,
           duration: 0,
         });
         });
-        let res = await this.autoArrange(planid);
+        let res = await this.newArrange({ planid, termid });
         msg.close();
         msg.close();
         if (this.$checkRes(res, '排课成功', res.errmsg || '排课失败')) {
         if (this.$checkRes(res, '排课成功', res.errmsg || '排课失败')) {
           this.search();
           this.search();