lrf402788946 há 4 anos atrás
pai
commit
27b130c4fb
1 ficheiros alterados com 47 adições e 5 exclusões
  1. 47 5
      src/views/new-plan/teacher-lesson.vue

+ 47 - 5
src/views/new-plan/teacher-lesson.vue

@@ -40,7 +40,7 @@
           </el-radio-group>
         </el-col>
         <el-col :span="2" style="text-align:right">
-          <el-button type="primary" size="mini" @click="toArrrange">安排教师</el-button>
+          <el-button type="primary" size="mini" @click="toArrrangeDialog">安排教师</el-button>
         </el-col>
         <el-col :span="2" style="text-align:right">
           <el-button type="primary" size="mini" @click="toSendDialog">发送通知</el-button>
@@ -86,6 +86,31 @@
           <el-button type="primary" @click="toUpdate">确 定</el-button>
         </span>
       </el-dialog>
+      <el-dialog title="安排教师" width="40%" :visible.sync="arrDialog" center :destroy-on-close="true" @close="toClose">
+        <el-row style="text-align:center" class="msgrow">
+          <el-col :span="24">请选择需要安排教师期数</el-col>
+          <el-checkbox-group v-model="termForm">
+            <el-col :span="6" v-for="(i, index) in termList" :key="index">
+              <el-checkbox :label="i.id">第{{ i.term }}期</el-checkbox>
+            </el-col>
+          </el-checkbox-group>
+        </el-row>
+        <el-row style="text-align:center" class="msgrow">
+          <el-col :span="24">请选择班级类型</el-col>
+          <el-radio-group v-model="ctselect">
+            <el-col :span="8">
+              <el-radio border size="small" :label="undefined">全部</el-radio>
+            </el-col>
+            <el-col :span="8" v-for="(i, index) in ctList" :key="index">
+              <el-radio :label="i.code" border size="small">{{ i.name }}</el-radio>
+            </el-col>
+          </el-radio-group>
+        </el-row>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="arrDialog = false">取 消</el-button>
+          <el-button type="primary" @click="toArrrange">确 定</el-button>
+        </span>
+      </el-dialog>
       <el-dialog title="发送通知" width="40%" :visible.sync="msgDialog" center :destroy-on-close="true" @close="toClose">
         <el-row style="text-align:center" class="msgrow">
           <el-col :span="24">请选择期数,系统将会对教师发送通知(发送通知并不代表确定安排)</el-col>
@@ -120,6 +145,17 @@
             </el-col>
           </el-checkbox-group>
         </el-row>
+        <el-row style="text-align:center" class="msgrow">
+          <el-col :span="24">请选择班级类型</el-col>
+          <el-radio-group v-model="ctselect">
+            <el-col :span="8">
+              <el-radio border size="small" :label="undefined">全部</el-radio>
+            </el-col>
+            <el-col :span="8" v-for="(i, index) in ctList" :key="index">
+              <el-radio :label="i.code" border size="small">{{ i.name }}</el-radio>
+            </el-col>
+          </el-radio-group>
+        </el-row>
         <span slot="footer" class="dialog-footer">
           <el-button @click="conDialog = false">取 消</el-button>
           <el-button type="primary" @click="toConfirm">确 定</el-button>
@@ -151,9 +187,11 @@ export default {
       dialog: false,
       msgDialog: false,
       conDialog: false,
+      arrDialog: false,
       form: {
         range: [],
       },
+      termForm: [],
       msgForm: [],
       conForm: [],
       ctselect: undefined,
@@ -256,7 +294,6 @@ export default {
       const msg = this.$message({ duration: 0, message: '正在发送通知...' });
       const { planid } = this.options;
       const dup = _.cloneDeep(this.msgForm);
-      console.log(this.ctselect);
       const res = await this.sendMsg({ planid, ids: dup, classtype: this.ctselect });
       this.toClose();
       msg.close();
@@ -267,7 +304,8 @@ export default {
       let msg = this.$message({ message: '正在处理,请稍后...', duration: 0 });
       const { planid } = this.defaultOption;
       const dup = _.cloneDeep(this.conForm);
-      const res = await this.confirmPlan({ planid, ids: dup });
+      console.log(this.ctselect);
+      const res = await this.confirmPlan({ planid, ids: dup, classtype: this.ctselect });
       msg.close();
       if (this.$checkRes(res, '教师安排确认成功', '教师安排确认失败')) {
         this.getInfo('reload');
@@ -389,16 +427,21 @@ export default {
       this.info = {};
       this.msgForm = [];
       this.conForm = [];
+      this.ctselect = undefined;
     },
     selectTeacher(teaid) {
       let r = this.applyList.find(f => f.teacherid == teaid);
       if (r) this.info.teaname = r.teaname;
       else this.$set(this, `info`, _.omit(this.info, ['teaid', 'teaname']));
     },
+    toArrrangeDialog() {
+      this.arrDialog = true;
+    },
     async toArrrange() {
       let msg = this.$message({ message: '正在处理,请稍后...', duration: 0 });
       const { planid } = this.defaultOption;
-      const res = await this.toArrrangeTeacher({ planid });
+      const dup = _.cloneDeep(this.termForm);
+      const res = await this.toArrrangeTeacher({ planid, ids: dup, classtype: this.ctselect });
       msg.close();
       if (this.$checkRes(res, '教师安排成功', '教师安排失败')) {
         this.getInfo('reload');
@@ -424,7 +467,6 @@ export default {
         if (_.isArray(notified)) {
           const r = notified.find(f => f.notifiedid === teaid);
           if (r) {
-            console.log(r);
             return r.status;
           }
         }