浏览代码

教研室

lzw11 1 年之前
父节点
当前提交
3d620d73c3
共有 2 个文件被更改,包括 1324 次插入1272 次删除
  1. 1223 1191
      src/components/pages/teacherOffice/index.vue
  2. 101 81
      src/components/pages/teacherOffice/teacherType.vue

+ 1223 - 1191
src/components/pages/teacherOffice/index.vue

@@ -1,1293 +1,1325 @@
 <template>
-    <div class="pb_content" style="background: unset">
-      <div v-if="ctype == 1" class="pb_content_body" style="
+  <div class="pb_content" style="background: unset">
+    <div v-if="ctype == 1" class="pb_content_body" style="
                 background: #fff;
                 padding: 0px 25px;
                 box-sizing: border-box;
                 border-radius: 5px;
               ">
-        <div class="pb_head top">
-          <span>教研室管理</span>
-          <div class="student_button" style="border-radius: 4px;">
-            <el-button type="primary" class="bgColor" @click="dialogVisible = true">添加教研室</el-button>
-          </div>
-        </div>
-        <div class="student_head">
-          <div class="student_search">
-            <span>
-              <el-input placeholder="请输入教研室名称" v-model="sClassName" clearable>
-              </el-input>
-            </span>
-            <el-button type="primary" @click="searchClass">查询</el-button>
-          </div>
+      <div class="pb_head top">
+        <span>教研室管理</span>
+        <div class="student_button" style="border-radius: 4px;">
+          <el-button type="primary" class="bgColor" @click="dialogVisible = true">添加教研室</el-button>
         </div>
       </div>
-      <div class="pb_content_body" v-if="ctype == 1">
-        <div class="student_table">
-          <el-table v-if="ctype == 1" ref="table" :key="1" :data="tableData" border :height="tableHeight" :fit="true"
-            v-loading="isLoading" style="width: 100%; height: 60%" :header-cell-style="{ background: '#f1f1f1' }"
-            :row-class-name="tableRowClassName">
-            <el-table-column prop="name" label="教研室名称" align="center">
-            </el-table-column>
-            <el-table-column prop="pnum" label="人数" align="center">
-            </el-table-column>
-            <el-table-column label="操作" width="400px">
-              <template slot-scope="scope">
-                <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看老师</el-button>
-                <!-- <el-button type="primary" size="small" @click="updateG(scope.row.pid, scope.row.id)">修改年级</el-button> -->
-                <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
-                <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <div class="student_page">
-          <el-pagination background layout="prev, pager, next" :page-size="10" :total="total" v-if="page"
-            @current-change="handleCurrentChange">
-          </el-pagination>
+      <div class="student_head">
+        <div class="student_search">
+          <span>
+            <el-input placeholder="请输入教研室名称" v-model="sClassName" clearable>
+            </el-input>
+          </span>
+          <el-button type="primary" @click="searchClass">查询</el-button>
         </div>
       </div>
-      <div v-if="ctype == 2" class="pb_content_body" style="
+    </div>
+    <div class="pb_content_body" v-if="ctype == 1">
+      <div class="student_table">
+        <el-table v-if="ctype == 1" ref="table" :key="1" :data="tableData" border :height="tableHeight" :fit="true"
+          v-loading="isLoading" style="width: 100%; height: 60%" :header-cell-style="{ background: '#f1f1f1' }"
+          :row-class-name="tableRowClassName">
+          <el-table-column prop="name" label="教研室名称" align="center">
+          </el-table-column>
+          <el-table-column prop="typeName" label="教研室类型" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.parentid == 6">教研室</span>
+              <span v-else>{{ scope.row.typeName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="pnum" label="人数" align="center">
+          </el-table-column>
+          <el-table-column label="操作" width="400px">
+            <template slot-scope="scope">
+              <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看老师</el-button>
+              <!-- <el-button type="primary" size="small" @Sclick="updateG(scope.row.pid, scope.row.id)">修改年级</el-button> -->
+              <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
+              <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="student_page">
+        <el-pagination background layout="prev, pager, next" :page-size="10" :total="total" v-if="page"
+          @current-change="handleCurrentChange">
+        </el-pagination>
+      </div>
+    </div>
+    <div v-if="ctype == 2" class="pb_content_body" style="
                 background: #fff;
                 padding: 0px 25px;
                 box-sizing: border-box;
                 border-radius: 5px;
               ">
-        <div class="pb_head top">
-          <span>查看老师-{{ getGrade(cid) }}</span>
-          <div class="student_button" style="border-radius: 4px;">
-            <el-button type="primary" class="bgColor" @click="ctype = 1, getClass()">返回</el-button>
-          </div>
+      <div class="pb_head top">
+        <span>查看老师-{{ getGrade(cid) }}</span>
+        <div class="student_button" style="border-radius: 4px;">
+          <el-button type="primary" class="bgColor" @click="ctype = 1, getClass()">返回</el-button>
         </div>
-        <div class="student_head">
-          <div class="head_left">
-            <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入用户名" style="margin:0 10px"></el-input>
-            <!-- <el-select disabled v-model="cid" placeholder="请选择教研室" class="student_input" @change="searchStudent"
+      </div>
+      <div class="student_head">
+        <div class="head_left">
+          <el-input v-model="sPhoneUser" class="student_input" placeholder="请输入用户名" style="margin:0 10px"></el-input>
+          <!-- <el-select disabled v-model="cid" placeholder="请选择教研室" class="student_input" @change="searchStudent"
               style="margin:0 10px">
               <el-option label="所有人" value=""></el-option>
               <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
             </el-select> -->
-            <el-button class="student_button" @click="searchStudent">查询</el-button>
-          </div>
-          <div class="head_right">
-            <el-button @click="addStudent">添加老师</el-button>
-          </div>
+          <el-button class="student_button" @click="searchStudent">查询</el-button>
+        </div>
+        <div class="head_right">
+          <el-button @click="addStudent">添加老师</el-button>
         </div>
       </div>
-      <div class="pb_content_body" v-if="ctype == 2">
-        <div class="student_table">
-          <el-table v-if="ctype == 2" :key="2" ref="table2" :data="tableData2" border :height="tableHeight" :fit="true"
-            v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
-            :row-class-name="tableRowClassName">
-            <el-table-column label="姓名" min-width="10" align="center">
-              <template slot-scope="scope">
-                <div class="userImg">
-                  <div class="tx">
-                    <img :src="scope.row.headportrait != null
-                        ? scope.row.headportrait
-                        : tx
-                      " alt />
-                  </div>
-                  <div style="
+    </div>
+    <div class="pb_content_body" v-if="ctype == 2">
+      <div class="student_table">
+        <el-table v-if="ctype == 2" :key="2" ref="table2" :data="tableData2" border :height="tableHeight" :fit="true"
+          v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
+          :row-class-name="tableRowClassName">
+          <el-table-column label="姓名" min-width="10" align="center">
+            <template slot-scope="scope">
+              <div class="userImg">
+                <div class="tx">
+                  <img :src="scope.row.headportrait != null
+                    ? scope.row.headportrait
+                    : tx
+                    " alt />
+                </div>
+                <div style="
                             width: 150px;
                             text-align: left;
                             white-space: nowrap;
                             overflow: hidden;
                             text-overflow: ellipsis;
                           ">
-                    {{ scope.row.name }}
-                  </div>
+                  {{ scope.row.name }}
                 </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="老师账号" min-width="15" align="center">
-              <template slot-scope="scope">
-                <div>{{ scope.row.un ? scope.row.un : "" }}</div>
-              </template>
-            </el-table-column>
-            <el-table-column prop="classname2" label="教研室" min-width="15" align="center">
-            </el-table-column>
-            <el-table-column label="操作" width="250px">
-              <template slot-scope="scope">
-                <div class="btnBox">
-                  <el-button class="de_button" type="primary" size="small"
-                    @click="iniPassword(scope.row.userid)" v-show="false">初始化密码</el-button>
-                  <!-- <el-button class="de_button" type="primary" size="small" @click="updateStudentA(scope.row)">修改</el-button> -->
-                  <el-button class="de_button" type="primary" size="small"
-                    @click="deleteClassStudent(scope.row.userid)">移除</el-button>
-                  <!-- <div class="delete">
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column label="老师账号" min-width="15" align="center">
+            <template slot-scope="scope">
+              <div>{{ scope.row.un ? scope.row.un : "" }}</div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="classname2" label="教研室" min-width="15" align="center">
+          </el-table-column>
+          <el-table-column label="操作" width="250px">
+            <template slot-scope="scope">
+              <div class="btnBox">
+                <el-button class="de_button" type="primary" size="small" @click="iniPassword(scope.row.userid)"
+                  v-show="false">初始化密码</el-button>
+                <!-- <el-button class="de_button" type="primary" size="small" @click="updateStudentA(scope.row)">修改</el-button> -->
+                <el-button class="de_button" type="primary" size="small"
+                  @click="deleteClassStudent(scope.row.userid)">移除</el-button>
+                <!-- <div class="delete">
                     <img src="../../../assets/remove.png" alt @click="deleteStudent(scope.row.userid, scope.row.state)" />
                   </div> -->
-                </div>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <div class="student_page">
-          <el-pagination background layout="prev, pager, next" :page-size="10" :total="total2" v-if="page2"
-            @current-change="handleCurrentChange2"></el-pagination>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="student_page">
+        <el-pagination background layout="prev, pager, next" :page-size="10" :total="total2" v-if="page2"
+          @current-change="handleCurrentChange2"></el-pagination>
+      </div>
+    </div>
+    <el-dialog :visible.sync="dialogVisibleAddStudent" :append-to-body="true" width="700px" :before-close="handleClose"
+      class="add_student">
+      <div slot="title" class="header-title">
+        <div class="logoImg">
+          <img src="../../../assets/logo.png" alt />
         </div>
+        <div class="title_add_student">添加老师</div>
       </div>
-      <el-dialog :visible.sync="dialogVisibleAddStudent" :append-to-body="true" width="700px" :before-close="handleClose"
-        class="add_student">
-        <div slot="title" class="header-title">
-          <div class="logoImg">
-            <img src="../../../assets/logo.png" alt />
-          </div>
-          <div class="title_add_student">添加老师</div>
+      <el-form>
+        <el-form-item label="老师姓名" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师姓名" clearable v-model="sName" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="老师学号" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师学号" clearable v-model="sId" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="老师手机号" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师手机号" clearable v-model="sPhone" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="老师账号" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师账号" clearable v-model="sMail" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="所属学校" :label-width="formLabelWidth">
+          <el-input disabled style="width: 300px" v-model="schoolName"></el-input>
+        </el-form-item>
+        <el-form-item label="教研室" :label-width="formLabelWidth">
+          <el-select v-model="cid" placeholder="请选择教研室" disabled>
+            <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <div style="text-align: center; color: #adb3b7">
+          注:添加老师的账号密码为123456
         </div>
-        <el-form>
-          <el-form-item label="老师姓名" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师姓名" clearable v-model="sName" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="老师学号" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师学号" clearable v-model="sId" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="老师手机号" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师手机号" clearable v-model="sPhone" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="老师账号" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师账号" clearable v-model="sMail" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="所属学校" :label-width="formLabelWidth">
-            <el-input disabled style="width: 300px" v-model="schoolName"></el-input>
-          </el-form-item>
-          <el-form-item label="教研室" :label-width="formLabelWidth">
-            <el-select v-model="cid" placeholder="请选择教研室" disabled>
-              <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
-            </el-select>
-          </el-form-item>
-          <div style="text-align: center; color: #adb3b7">
-            注:添加老师的账号密码为123456
-          </div>
-        </el-form>
-        <span slot="footer" class="dialog-footer flex">
-          <el-button class="right" @click="insertStudent">确认</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog :visible.sync="dialogVisibleUpdate" :append-to-body="true" width="700px" :before-close="handleClose"
-        class="add_student">
-        <div slot="title" class="header-title">
-          <div class="logoImg">
-            <img src="../../../assets/logo.png" alt />
-          </div>
-          <div class="title_add_student">修改老师</div>
+      </el-form>
+      <span slot="footer" class="dialog-footer flex">
+        <el-button class="right" @click="insertStudent">确认</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog :visible.sync="dialogVisibleUpdate" :append-to-body="true" width="700px" :before-close="handleClose"
+      class="add_student">
+      <div slot="title" class="header-title">
+        <div class="logoImg">
+          <img src="../../../assets/logo.png" alt />
         </div>
-        <el-form>
-          <el-form-item label="老师名称" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师姓名" clearable v-model="userinfo.name" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="老师学号" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师学号" clearable v-model="userinfo.studentid" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="老师手机号" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师手机号" clearable v-model="userinfo.phonenumber" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="老师账号" :label-width="formLabelWidth">
-            <span>
-              <el-input placeholder="请输入老师账号" clearable v-model="userinfo.un" class="add_input"></el-input>
-            </span>
-          </el-form-item>
-          <el-form-item label="所属学校" :label-width="formLabelWidth">
-            <el-input disabled style="width: 300px" v-model="schoolName"></el-input>
-          </el-form-item>
-          <el-form-item label="教研室" :label-width="formLabelWidth">
-            <el-select multiple collapse-tags v-model="userinfo.classid" placeholder="请选择教研室">
-              <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
-            </el-select>
-          </el-form-item>
-          <div style="text-align: center; color: #adb3b7">
-            注:添加老师的账号密码为123456
-          </div>
-        </el-form>
-        <span slot="footer" class="dialog-footer flex">
-          <el-button class="right" @click="updateStudent">修改</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog title="添加教研室" :visible.sync="dialogVisible" :append-to-body="true" width="25%" :before-close="handleClose"
-        class="dialog_diy">
-        <el-form>
-          <el-form-item label="教研室名称" :label-width="formLabelWidth">
-            <el-input v-model="className" auto-complete="off" placeholder="请输入教研室..."></el-input>
-          </el-form-item>
-        </el-form>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="dialogVisible = false">取 消</el-button>
-          <el-button type="primary" @click="insertClass">确 定</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog title="修改年级" :visible.sync="dialogVisibleGrade" :append-to-body="true" width="25%"
-        :before-close="handleClose" class="dialog_diy">
-        <el-form>
-          <el-form-item label="选择年级" :label-width="formLabelWidth">
-            <el-select v-model="gid" placeholder="请选择教研室" class="student_input" style="margin:0 10px" clearable>
-              <el-option v-for="(item, index) in grade" :key="index" :label="item.name" :value="item.id"></el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="dialogVisibleGrade = false">取 消</el-button>
-          <el-button type="primary" @click="updateGrade">确 定</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog title="修改教研室" :visible.sync="dialogVisible1" :append-to-body="true" width="25%" :before-close="handleClose"
-        class="dialog_diy">
-        <el-form>
-          <el-form-item label="教研室名称" :label-width="formLabelWidth">
-            <el-input v-model="className1" auto-complete="off" placeholder="请输入教研室..."></el-input>
-          </el-form-item>
-        </el-form>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="dialogVisible1 = false">取 消</el-button>
-          <el-button type="primary" @click="updateClass">确 定</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog title="添加老师" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
-        :before-close="handleClose" class="addNewPP">
-        <div class="people">
-          <div class="people_top">
-            <div class="people_top_right">
-              <div class="people_search">
-                <el-input placeholder="搜索老师姓名" v-model="searchTN" @keyup.enter.native="getClassStudent"></el-input>
-                <div class="search_img" @click="getClassStudent">
-                  <img src="../../../assets/icon/search.png" alt />
-                </div>
+        <div class="title_add_student">修改老师</div>
+      </div>
+      <el-form>
+        <el-form-item label="老师名称" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师姓名" clearable v-model="userinfo.name" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="老师学号" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师学号" clearable v-model="userinfo.studentid" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="老师手机号" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师手机号" clearable v-model="userinfo.phonenumber" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="老师账号" :label-width="formLabelWidth">
+          <span>
+            <el-input placeholder="请输入老师账号" clearable v-model="userinfo.un" class="add_input"></el-input>
+          </span>
+        </el-form-item>
+        <el-form-item label="所属学校" :label-width="formLabelWidth">
+          <el-input disabled style="width: 300px" v-model="schoolName"></el-input>
+        </el-form-item>
+        <el-form-item label="教研室" :label-width="formLabelWidth">
+          <el-select multiple collapse-tags v-model="userinfo.classid" placeholder="请选择教研室">
+            <el-option v-for="(item, index) in classJuri" :key="index" :label="item.name" :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <div style="text-align: center; color: #adb3b7">
+          注:添加老师的账号密码为123456
+        </div>
+      </el-form>
+      <span slot="footer" class="dialog-footer flex">
+        <el-button class="right" @click="updateStudent">修改</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="添加教研室" :visible.sync="dialogVisible" :append-to-body="true" width="25%"
+      :before-close="handleClose" class="dialog_diy">
+      <el-form>
+        <el-form-item label="教研室名称" :label-width="formLabelWidth">
+          <el-input v-model="className" auto-complete="off" placeholder="请输入教研室..."></el-input>
+        </el-form-item>
+        <el-form-item label="教研室类型" :label-width="formLabelWidth">
+          <el-select v-model="typeId" placeholder="类型">
+            <el-option v-for="item in options" :key="item.typeId" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="handleCancel">取 消</el-button>
+        <el-button type="primary" @click="insertClass">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="修改年级" :visible.sync="dialogVisibleGrade" :append-to-body="true" width="25%"
+      :before-close="handleClose" class="dialog_diy">
+      <el-form>
+        <el-form-item label="选择年级" :label-width="formLabelWidth">
+          <el-select v-model="gid" placeholder="请选择教研室" class="student_input" style="margin:0 10px" clearable>
+            <el-option v-for="(item, index) in grade" :key="index" :label="item.name" :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleGrade = false">取 消</el-button>
+        <el-button type="primary" @click="updateGrade">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="修改教研室" :visible.sync="dialogVisible1" :append-to-body="true" width="25%"
+      :before-close="handleClose" class="dialog_diy">
+      <el-form>
+        <el-form-item label="教研室名称" :label-width="formLabelWidth">
+          <el-input v-model="className1" auto-complete="off" placeholder="请输入教研室..."></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible1 = false">取 消</el-button>
+        <el-button type="primary" @click="updateClass">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog title="添加老师" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
+      :before-close="handleClose" class="addNewPP">
+      <div class="people">
+        <div class="people_top">
+          <div class="people_top_right">
+            <div class="people_search">
+              <el-input placeholder="搜索老师姓名" v-model="searchTN" @keyup.enter.native="getClassStudent"></el-input>
+              <div class="search_img" @click="getClassStudent">
+                <img src="../../../assets/icon/search.png" alt />
               </div>
             </div>
-            <div class="people_nav">选择成员</div>
           </div>
-          <div class="t_j_box" style="
+          <div class="people_nav">选择成员</div>
+        </div>
+        <div class="t_j_box" style="
                     padding: 20px 0 0 25px;
                     width: calc(100% - 55px);
                     margin-left: 25px;
                   ">
-            <span>姓名</span>
-            <span>账号</span>
-          </div>
-          <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="teacherJuri.length" v-loading="isLoading2">
-            <el-checkbox v-for="item in teacherJuri" :key="item.userid" :label="item.userid">
-              <div class="t_j_box">
-                <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
-                  <span>{{ item.name ? item.name : "暂无姓名" }}</span>
-                </el-tooltip>
-                <el-tooltip placement="top" :content="item.username.split('@')[0]">
-                  <span>{{ item.username.split('@')[0] }}</span>
-                </el-tooltip>
-              </div>
-            </el-checkbox>
-          </el-checkbox-group>
-          <div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
-        </div>
-        <div style="margin-top: 10px;">
-          <el-pagination background layout="prev, pager, next" :page-size="pageSize3" :total="total3"
-            v-if="page3 && teacherJuri.length" style="padding-bottom: 20px"
-            @current-change="handleCurrentChange3"></el-pagination>
+          <span>姓名</span>
+          <span>账号</span>
         </div>
-        <span slot="footer" class="dialog-footer">
-          <el-button @click="dialogVisibleMember = false">取 消</el-button>
-          <el-button type="primary" @click="addClassStudent">确定</el-button>
-        </span>
-      </el-dialog>
-    </div>
-  </template>
-  
-  <script>
-  import TaskListHeader from 'gantt-elastic/src/components/TaskList/TaskListHeader.vue';
-  
-  export default {
-    data() {
-      return {
-        tableHeight: "500px",
-        isLoading: false,
-        formLabelWidth: "100px",
-        sClassName: "",
-        className: "",
-        className1: "",
-        classid: "",
-        dialogVisible: false,
-        dialogVisible1: false,
-        dialogVisibleUpdate: false,
-        dialogVisibleAddStudent: false,
-        tableData: [],
-        page: 1,
-        total: 0,
-        tableData2: [],
-        page2: 1,
-        total2: 0,
-        userid: this.$route.query.userid,
-        oid: this.$route.query.oid,
-        cid: "",
-        ctype: 1,
-        sName: "",
-        sPhone: "",
-        sId: "",
-        schoolName: "",
-        sByClass: "",
-        sMail: "",
-        classJuri: [],
-        userinfo: {},
-        userinfoA: {},
-        sPhoneUser: "",
-        tx: require("../../../assets/avatar.png"),
-        dialogVisibleMember: false,
-        checkboxList3: [],
-        teacherJuri: [],
-        pageSize3: 10,
-        total3: 0,
-        page3: 1,
-        isLoading2: false,
-        searchTN: "",
-        grade: [],
-        gid: "",
-        dialogVisibleGrade: false
+        <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="teacherJuri.length" v-loading="isLoading2">
+          <el-checkbox v-for="item in teacherJuri" :key="item.userid" :label="item.userid">
+            <div class="t_j_box">
+              <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
+                <span>{{ item.name ? item.name : "暂无姓名" }}</span>
+              </el-tooltip>
+              <el-tooltip placement="top" :content="item.username.split('@')[0]">
+                <span>{{ item.username.split('@')[0] }}</span>
+              </el-tooltip>
+            </div>
+          </el-checkbox>
+        </el-checkbox-group>
+        <div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
+      </div>
+      <div style="margin-top: 10px;">
+        <el-pagination background layout="prev, pager, next" :page-size="pageSize3" :total="total3"
+          v-if="page3 && teacherJuri.length" style="padding-bottom: 20px"
+          @current-change="handleCurrentChange3"></el-pagination>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleMember = false">取 消</el-button>
+        <el-button type="primary" @click="addClassStudent">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import TaskListHeader from 'gantt-elastic/src/components/TaskList/TaskListHeader.vue';
+
+export default {
+  data() {
+    return {
+      tableHeight: "500px",
+      isLoading: false,
+      formLabelWidth: "100px",
+      sClassName: "",
+      className: "",
+      className1: "",
+      classid: "",
+      dialogVisible: false,
+      dialogVisible1: false,
+      dialogVisibleUpdate: false,
+      dialogVisibleAddStudent: false,
+      tableData: [],
+      page: 1,
+      total: 0,
+      tableData2: [],
+      page2: 1,
+      total2: 0,
+      userid: this.$route.query.userid,
+      oid: this.$route.query.oid,
+      cid: "",
+      ctype: 1,
+      sName: "",
+      sPhone: "",
+      sId: "",
+      schoolName: "",
+      sByClass: "",
+      sMail: "",
+      classJuri: [],
+      userinfo: {},
+      userinfoA: {},
+      sPhoneUser: "",
+      tx: require("../../../assets/avatar.png"),
+      dialogVisibleMember: false,
+      checkboxList3: [],
+      teacherJuri: [],
+      pageSize3: 10,
+      total3: 0,
+      page3: 1,
+      isLoading2: false,
+      searchTN: "",
+      grade: [],
+      gid: "",
+      dialogVisibleGrade: false,
+      options: [
+        {
+          typeId: 6,
+          label: '教研室'
+        }
+      ],
+      typeId: ""
+
+    };
+  },
+  created() {
+    this.page = 1;
+    this.getClass();
+    this.getClass2();
+    this.selectGrage()
+    this.getSchoolName();
+  },
+  computed: {
+    getGrade() {
+      return function (gid) {
+        let name = ''
+        this.grade.forEach(element => {
+          if (element.id == gid) {
+            name = element.name
+          }
+        });
+        return name ? name : '暂无'
+      }
+    }
+  },
+  mounted() {
+    this.$nextTick(function () {
+      this.tableHeight =
+        window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+      if (this.tableHeight <= 530) {
+        this.tableHeight = 530;
+      }
+      // 监听窗口大小变化
+      let self = this;
+      window.onresize = function () {
+        self.tableHeight =
+          window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+        if (self.tableHeight <= 530) {
+          self.tableHeight = 530;
+        }
       };
+    });
+  },
+  methods: {
+    //获取教研室列表
+    selectGrage() {
+      let params = {
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
+        .then((res) => {
+          this.grade = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
     },
-    created() {
-      this.page = 1;
+    tableRowClassName({ row, rowIndex }) {
+      if ((rowIndex + 1) % 2 === 0) {
+        return "even_row";
+      } else {
+        return "";
+      }
+    },
+    handleCurrentChange(val) {
+      this.page = val;
       this.getClass();
-      this.getClass2();
-      this.selectGrage()
-      this.getSchoolName();
     },
-    computed: {
-      getGrade() {
-        return function (gid) {
-          let name = ''
-          this.grade.forEach(element => {
-            if (element.id == gid) {
-              name = element.name
-            }
-          });
-          return name ? name : '暂无'
-        }
-      }
+    handleClose(done) {
+      this.typeId = ''
+      done();
     },
-    mounted() {
-      this.$nextTick(function () {
-        this.tableHeight =
-          window.innerHeight - this.$refs.table.$el.offsetTop - 200;
-        if (this.tableHeight <= 530) {
-          this.tableHeight = 530;
-        }
-        // 监听窗口大小变化
-        let self = this;
-        window.onresize = function () {
-          self.tableHeight =
-            window.innerHeight - self.$refs.table.$el.offsetTop - 200;
-          if (self.tableHeight <= 530) {
-            self.tableHeight = 530;
-          }
-        };
-      });
+    handleCancel() {
+      this.dialogVisible = false;
+      this.typeId = ''; // 清空下拉菜单的值
     },
-    methods: {
-      //获取教研室列表
-      selectGrage() {
-        let params = {
-          oid: this.oid,
-        };
-        this.ajax
-          .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
-          .then((res) => {
-            this.grade = res.data[0];
-          })
-          .catch((err) => {
-            this.isLoading = false;
-            console.error(err);
-          });
-      },
-      tableRowClassName({ row, rowIndex }) {
-        if ((rowIndex + 1) % 2 === 0) {
-          return "even_row";
-        } else {
-          return "";
-        }
-      },
-      handleCurrentChange(val) {
-        this.page = val;
-        this.getClass();
-      },
-      handleClose(done) {
-        done();
-      },
-      time() {
-        if (!this.now) {
-          this.now = new Date().getTime();
+    time() {
+      if (!this.now) {
+        this.now = new Date().getTime();
+        return true;
+      } else {
+        let time = new Date().getTime();
+        if (time - this.now > 3000) {
+          this.now = time;
           return true;
         } else {
-          let time = new Date().getTime();
-          if (time - this.now > 3000) {
-            this.now = time;
-            return true;
-          } else {
-            return false;
-          }
-        }
-      },
-      searchClass() {
-        this.page = 1;
-        this.getClass();
-      },
-      updateG(gid, id) {
-        this.gid = gid;
-        this.classid = id;
-        this.dialogVisibleGrade = true;
-      },
-      updateGrade() {
-        this.$confirm("确定修改吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-          .then(() => {
-            let params = [{
-              cid: this.gid,
-              student: JSON.stringify([this.classid])
-            }];
-            this.ajax
-              .post(this.$store.state.api + "addGradeClass", params)
-              .then((res) => {
-                this.gid = '';
-                this.classid = '';
-                this.dialogVisibleGrade = false
-                this.getClass();
-              })
-              .catch((err) => {
-                console.error(err);
-              });
-          })
-          .catch(() => { });
-      },
-      openUpdate(id, n) {
-        this.classid = id;
-        this.className1 = n;
-        this.dialogVisible1 = true;
-      },
-      //新增教研室
-      insertClass() {
-        let params = {
-          name: this.className,
-          oid: this.oid,
-          uid: this.userid,
-        };
-        this.ajax
-          .get(this.$store.state.api + "insertTeacherOffice", params)
-          .then((res) => {
-            if (res.data[0] && res.data[0][0].classname == 1) {
-              this.$message({
-                message: "不能与其他教研室名称相同!",
-                type: "error",
-              });
-            } else {
-              this.$message({
-                message: "新增成功",
-                type: "success",
-              });
-              this.dialogVisible = false;
-              this.sClassName = "";
-              this.getClass();
-              this.className = "";
-            }
-          })
-          .catch((err) => {
-            this.$message({
-              message: "新增失败",
-              type: "error",
-            });
-            console.error(err);
-          });
-      },
-      //修改教研室
-      updateClass() {
-        let params = {
-          id: this.classid,
-          n: this.className1,
-          oid: this.oid,
-        };
-        this.ajax
-          .get(this.$store.state.api + "updateTeacherOffice", params)
-          .then((res) => {
-            if (res.data[0] && res.data[0][0].classname == 1) {
-              this.$message({
-                message: "不能与其他教研室名称相同!",
-                type: "error",
-              });
-            } else {
-              this.$message({
-                message: "修改成功",
-                type: "success",
-              });
-              this.dialogVisible1 = false;
-              this.getClass();
-              this.classid = "";
-              this.className1 = "";
-            }
-          })
-          .catch((err) => {
-            this.$message({
-              message: "修改失败",
-              type: "error",
-            });
-            console.error(err);
-          });
-      },
-      //获取教研室列表
-      getClass() {
-        this.isLoading = true;
-        let params = {
-          // username: this.$store.state.userInfo.userid,
-          cu: "",
-          oid: this.oid,
-          cn: this.sClassName,
-          page: this.page,
-        };
-        this.ajax
-          .get(this.$store.state.api + "selectTeacherOffice", params)
-          .then((res) => {
-            this.isLoading = false;
-            this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-            this.tableData = res.data[0];
-          })
-          .catch((err) => {
-            this.isLoading = false;
-            console.error(err);
-          });
-      },
-      //删除教研室
-      deleteClass(id) {
-        let params = {
-          id: id,
-        };
-        if (this.time()) {
-          this.$confirm("确定删除此教研室吗?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-          })
-            .then(() => {
-              this.ajax
-                .get(this.$store.state.api + "deleteClass", params)
-                .then((res) => {
-                  this.$message({
-                    message: "删除成功",
-                    type: "success",
-                  });
-                  if (this.page != 1 && this.tableData.length == 1) {
-                    this.page - 1;
-                  }
-                  this.getClass();
-                })
-                .catch((err) => {
-                  this.$message.error("删除失败");
-                  console.error(err);
-                });
-            })
-            .catch(() => { });
-        }
-      },
-      addStudent() {
-        // this.dialogVisibleAddStudent = true;
-        // (this.sName = ""), (this.sPhone = ""), (this.sByClass = ""), this.sMail;
-        // this.getClass2();
-        this.dialogVisibleMember = true
-        this.searchTN = ""
-        this.getClassStudent();
-      },
-      //新增老师
-      insertStudent() {
-        if (this.sName === "") {
-          this.$message.error("老师姓名不能为空");
-          return;
-        } else if (
-          this.sPhone != "" &&
-          !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.sPhone)
-        ) {
-          this.$message.error("手机号格式不正确");
-          return;
-        } else if (
-          !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)
-        ) {
-          this.$message.error("邮箱格式不正确");
-          return;
+          return false;
         }
-  
-        if (this.time()) {
-          let params = { un: this.sMail };
+      }
+    },
+    searchClass() {
+      this.page = 1;
+      this.getClass();
+    },
+    updateG(gid, id) {
+      this.gid = gid;
+      this.classid = id;
+      this.dialogVisibleGrade = true;
+    },
+    updateGrade() {
+      this.$confirm("确定修改吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let params = [{
+            cid: this.gid,
+            student: JSON.stringify([this.classid])
+          }];
           this.ajax
-            .get(this.$store.state.api + "findMail", params)
+            .post(this.$store.state.api + "addGradeClass", params)
             .then((res) => {
-              if (res.data[0].length > 0) {
-                this.$message.error("此老师账号已被注册");
-              } else {
-                this.add_Student();
-              }
+              this.gid = '';
+              this.classid = '';
+              this.dialogVisibleGrade = false
+              this.getClass();
             })
             .catch((err) => {
               console.error(err);
             });
-        }
-      },
-      add_Student() {
-        let params = [
-          {
-            username: this.sMail,
-            userpassword: 123456,
-            alias: this.sName,
-            oid: this.oid,
-            ph: this.sPhone,
-            sid: this.sId,
-            cid: this.cid,
-          },
-        ];
-        this.ajax
-          .post(this.$store.state.api + "batchRegistration", params)
-          .then((res) => {
-  
-            let params = [
-              {
-                userid: res.data.uid,
-                username: this.sName,
-                sid: this.sId,
-                type: 2,
-                oid: res.data.oid,
-                phone: res.data.ph,
-                cid: res.data.cid,
-                intro: "",
-                sex: "0",
-              },
-            ];
-            this.ajax
-              .post(this.$store.state.api + "updateUserByEdu", params)
-              .then((res) => {
-                console.log(res);
-              })
-              .catch((err) => {
-                console.error(err);
-              });
+        })
+        .catch(() => { });
+    },
+    openUpdate(id, n) {
+      this.classid = id;
+      this.className1 = n;
+      this.dialogVisible1 = true;
+    },
+    //新增教研室
+    insertClass() {
+      // 检查是否选择了教研室类型
+      if (this.typeId == "") {
+        this.$message({
+          message: "请选择教研室类型",
+          type: "warning",
+        });
+        return; // 停止继续执行
+      }
+      let params = {
+        name: this.className,
+        oid: this.oid,
+        uid: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "insertTeacherOffice", params)
+        .then((res) => {
+          if (res.data[0] && res.data[0][0].classname == 1) {
+            this.$message({
+              message: "不能与其他教研室名称相同!",
+              type: "error",
+            });
+          } else {
             this.$message({
               message: "新增成功",
               type: "success",
             });
-            this.dialogVisibleAddStudent = false;
-            this.sPhone = "";
-            this.sName = "";
-            this.sByClass = [];
-            this.sMail = "";
-            this.getStudent(this.cid);
-          })
-          .catch((err) => {
-            this.isLoading = false;
+            this.dialogVisible = false;
+            this.sClassName = "";
+            this.getClass();
+            this.className = "";
+          }
+        })
+        .catch((err) => {
+          this.$message({
+            message: "新增失败",
+            type: "error",
+          });
+          console.error(err);
+        });
+    },
+    //修改教研室
+    updateClass() {
+      let params = {
+        id: this.classid,
+        n: this.className1,
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "updateTeacherOffice", params)
+        .then((res) => {
+          if (res.data[0] && res.data[0][0].classname == 1) {
             this.$message({
-              message: "新增失败",
+              message: "不能与其他教研室名称相同!",
               type: "error",
             });
-            console.error(err);
-          });
-      },
-      updateStudentA(res) {
-        this.userinfo = JSON.parse(JSON.stringify(res));
-        this.userinfoA = JSON.parse(JSON.stringify(res));
-        this.userinfo.classid = this.userinfo.classid.split(",")
-        this.dialogVisibleUpdate = true;
-      },
-      updateStudent() {
-        if (this.userinfo.name === "") {
-          this.$message.error("老师姓名不能为空");
-          return;
-        } else if (!this.userinfo.classid) {
-          this.$message.error("请为老师选择教研室");
-          return;
-        } else if (
-          this.userinfo.phonenumber &&
-          !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.userinfo.phonenumber)
-        ) {
-          this.$message.error("手机号格式不正确");
-          return;
-        } else if (
-          !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
-            this.userinfo.un
-          )
-        ) {
-          this.$message.error("邮箱格式不正确");
-          return;
-        }
-  
-        if (this.time()) {
-          if (this.userinfoA.un != this.userinfo.un) {
-            let params = { un: this.userinfo.un };
-            this.ajax
-              .get(this.$store.state.api + "findMail", params)
-              .then((res) => {
-                if (res.data[0].length > 0) {
-                  this.$message.error("此老师账号已被注册");
-                } else {
-                  this.update_Student();
-                }
-              })
-              .catch((err) => {
-                console.error(err);
-              });
           } else {
-            this.update_Student();
-          }
-        }
-      },
-      update_Student() {
-        let params = [
-          {
-            userid: this.userinfo.userid,
-            username: this.userinfo.un,
-            alias: this.userinfo.name,
-            ph: this.userinfo.phonenumber,
-            sid: this.userinfo.studentid,
-            cid: this.userinfo.classid.join(","),
-          },
-        ];
-        this.ajax
-          .post(this.$store.state.api + "updateStudentInfo", params)
-          .then((res) => {
             this.$message({
               message: "修改成功",
               type: "success",
             });
-            this.dialogVisibleUpdate = false;
-            this.getStudent(this.cid);
-          })
-          .catch((err) => {
-            this.isLoading = false;
-            this.$message({
-              message: "修改失败",
-              type: "error",
-            });
-            console.error(err);
+            this.dialogVisible1 = false;
+            this.getClass();
+            this.classid = "";
+            this.className1 = "";
+          }
+        })
+        .catch((err) => {
+          this.$message({
+            message: "修改失败",
+            type: "error",
           });
-      },
-      deleteClassStudent(id) {
-        let params = [{ uid: id, cid: this.cid }];
-        this.$confirm("确定在本教研室移除此老师吗?", "提示", {
+          console.error(err);
+        });
+    },
+    //获取教研室列表
+    getClass() {
+      this.isLoading = true;
+      let params = {
+        // username: this.$store.state.userInfo.userid,
+        cu: "",
+        oid: this.oid,
+        cn: this.sClassName,
+        pid: "6",
+        page: this.page,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTeacherOffice2", params)
+        .then((res) => {
+          this.isLoading = false;
+          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+          this.tableData = res.data[0];
+          console.log(this.tableData, "tableData");
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    //删除教研室
+    deleteClass(id) {
+      let params = {
+        id: id,
+      };
+      if (this.time()) {
+        this.$confirm("确定删除此教研室吗?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning",
         })
           .then(() => {
             this.ajax
-              .post(this.$store.state.api + "deleteClassTeacher", params)
+              .get(this.$store.state.api + "deleteClass", params)
               .then((res) => {
                 this.$message({
-                  message: "操作成功",
+                  message: "删除成功",
                   type: "success",
                 });
-                this.getStudent(this.cid);
+                if (this.page != 1 && this.tableData.length == 1) {
+                  this.page - 1;
+                }
+                this.getClass();
               })
               .catch((err) => {
-                this.$message.error("操作失败");
+                this.$message.error("删除失败");
                 console.error(err);
               });
           })
           .catch(() => { });
-      },
-      //获取教研室列表
-      getClass2() {
-        this.isLoading = true;
-        let params = {
-          oid: this.oid,
-        };
-        this.ajax
-          .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
-          .then((res) => {
-            this.isLoading = false;
-            this.classJuri = res.data[0];
-          })
-          .catch((err) => {
-            this.isLoading = false;
-            console.error(err);
-          });
-      },
-      getSchoolName() {
-        let params = {
-          oid: this.oid,
-        };
+      }
+    },
+    addStudent() {
+      // this.dialogVisibleAddStudent = true;
+      // (this.sName = ""), (this.sPhone = ""), (this.sByClass = ""), this.sMail;
+      // this.getClass2();
+      this.dialogVisibleMember = true
+      this.searchTN = ""
+      this.getClassStudent();
+    },
+    //新增老师
+    insertStudent() {
+      if (this.sName === "") {
+        this.$message.error("老师姓名不能为空");
+        return;
+      } else if (
+        this.sPhone != "" &&
+        !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.sPhone)
+      ) {
+        this.$message.error("手机号格式不正确");
+        return;
+      } else if (
+        !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(this.sMail)
+      ) {
+        this.$message.error("邮箱格式不正确");
+        return;
+      }
+
+      if (this.time()) {
+        let params = { un: this.sMail };
         this.ajax
-          .get(this.$store.state.api + "selectSchoolName2", params)
+          .get(this.$store.state.api + "findMail", params)
           .then((res) => {
-            this.schoolName = res.data[0][0].name;
+            if (res.data[0].length > 0) {
+              this.$message.error("此老师账号已被注册");
+            } else {
+              this.add_Student();
+            }
           })
           .catch((err) => {
             console.error(err);
           });
-      },
-      searchStudent() {
-        this.page2 = 1;
-        this.getStudent(this.cid);
-      },
-      handleCurrentChange2(val) {
-        this.page2 = val;
-        this.getStudent(this.cid);
-      },
-      handleCurrentChange3(val) {
-        this.page3 = val;
-        this.getClassStudent();
-      },
-      getStudent(cid) {
-        this.cid = cid
-        this.ctype = 2
-        this.isLoading = true;
-        let params = {
+      }
+    },
+    add_Student() {
+      let params = [
+        {
+          username: this.sMail,
+          userpassword: 123456,
+          alias: this.sName,
           oid: this.oid,
+          ph: this.sPhone,
+          sid: this.sId,
           cid: this.cid,
-          cu: "",
-          cn: this.sPhoneUser,
-          page: this.page2,
-        };
-        this.ajax
-          .get(this.$store.state.api + "selectTeacher2", params)
-          .then((res) => {
-            this.isLoading = false;
-            this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
-            this.tableData2 = res.data[0];
-            this.getClass2();
-          })
-          .catch((err) => {
-            this.isLoading = false;
-            console.error(err);
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "batchRegistration", params)
+        .then((res) => {
+
+          let params = [
+            {
+              userid: res.data.uid,
+              username: this.sName,
+              sid: this.sId,
+              type: 2,
+              oid: res.data.oid,
+              phone: res.data.ph,
+              cid: res.data.cid,
+              intro: "",
+              sex: "0",
+            },
+          ];
+          this.ajax
+            .post(this.$store.state.api + "updateUserByEdu", params)
+            .then((res) => {
+              console.log(res);
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+          this.$message({
+            message: "新增成功",
+            type: "success",
           });
-      },
-      getClassStudent() {
-        this.isLoading2 = true;
-        let params = {
-          oid: this.oid,
-          cid: this.cid,
-          cn: this.searchTN,
-          page: this.page3,
-          num: this.pageSize3,
-        };
-        this.ajax
-          .get(this.$store.state.api + "getClassTeacher", params)
-          .then((res) => {
-            this.isLoading2 = false;
-            this.total3 = res.data[0].length > 0 ? res.data[0][0].num : 0;
-            this.teacherJuri = res.data[0];
-          })
-          .catch((err) => {
-            this.isLoading2 = false;
-            console.error(err);
+          this.dialogVisibleAddStudent = false;
+          this.sPhone = "";
+          this.sName = "";
+          this.sByClass = [];
+          this.sMail = "";
+          this.getStudent(this.cid);
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          this.$message({
+            message: "新增失败",
+            type: "error",
           });
-      },
-      addClassStudent() {
-        if (!this.checkboxList3.length) {
-          this.$message.error('请选择要添加教研室的老师');
-          return;
+          console.error(err);
+        });
+    },
+    updateStudentA(res) {
+      this.userinfo = JSON.parse(JSON.stringify(res));
+      this.userinfoA = JSON.parse(JSON.stringify(res));
+      this.userinfo.classid = this.userinfo.classid.split(",")
+      this.dialogVisibleUpdate = true;
+    },
+    updateStudent() {
+      if (this.userinfo.name === "") {
+        this.$message.error("老师姓名不能为空");
+        return;
+      } else if (!this.userinfo.classid) {
+        this.$message.error("请为老师选择教研室");
+        return;
+      } else if (
+        this.userinfo.phonenumber &&
+        !/^[1][3,4,5,7,8][0-9]{9}$/.test(this.userinfo.phonenumber)
+      ) {
+        this.$message.error("手机号格式不正确");
+        return;
+      } else if (
+        !/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/.test(
+          this.userinfo.un
+        )
+      ) {
+        this.$message.error("邮箱格式不正确");
+        return;
+      }
+
+      if (this.time()) {
+        if (this.userinfoA.un != this.userinfo.un) {
+          let params = { un: this.userinfo.un };
+          this.ajax
+            .get(this.$store.state.api + "findMail", params)
+            .then((res) => {
+              if (res.data[0].length > 0) {
+                this.$message.error("此老师账号已被注册");
+              } else {
+                this.update_Student();
+              }
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        } else {
+          this.update_Student();
         }
-        let params = [{
-          cid: this.cid,
-          student: JSON.stringify(this.checkboxList3)
-        }];
-        this.ajax
-          .post(this.$store.state.api + "addClassTeacher", params)
-          .then((res) => {
-            this.$message.success("添加成功")
-            this.checkboxList3 = []
-            this.dialogVisibleMember = false
-            this.getStudent(this.cid)
-          })
-          .catch((err) => {
-            console.error(err);
+      }
+    },
+    update_Student() {
+      let params = [
+        {
+          userid: this.userinfo.userid,
+          username: this.userinfo.un,
+          alias: this.userinfo.name,
+          ph: this.userinfo.phonenumber,
+          sid: this.userinfo.studentid,
+          cid: this.userinfo.classid.join(","),
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "updateStudentInfo", params)
+        .then((res) => {
+          this.$message({
+            message: "修改成功",
+            type: "success",
           });
-      },
-      iniPassword(id) {
-        this.$confirm("确定" + "初始化" + "此老师的密码吗?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
+          this.dialogVisibleUpdate = false;
+          this.getStudent(this.cid);
         })
-          .then(() => {
-            let params = [
-              {
-                uid: id,
-                pa: 123456,
-              },
-            ];
-            this.ajax
-              .post(this.$store.state.api + "iniPassword", params)
-              .then((res) => {
-                this.$message({
-                  message: "初始化密码成功!",
-                  type: "success",
-                });
-              })
-              .catch((err) => {
-                console.error(err);
+        .catch((err) => {
+          this.isLoading = false;
+          this.$message({
+            message: "修改失败",
+            type: "error",
+          });
+          console.error(err);
+        });
+    },
+    deleteClassStudent(id) {
+      let params = [{ uid: id, cid: this.cid }];
+      this.$confirm("确定在本教研室移除此老师吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.ajax
+            .post(this.$store.state.api + "deleteClassTeacher", params)
+            .then((res) => {
+              this.$message({
+                message: "操作成功",
+                type: "success",
               });
-          })
-          .catch(() => { });
-      },
+              this.getStudent(this.cid);
+            })
+            .catch((err) => {
+              this.$message.error("操作失败");
+              console.error(err);
+            });
+        })
+        .catch(() => { });
+    },
+    //获取教研室列表
+    getClass2() {
+      this.isLoading = true;
+      let params = {
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
+        .then((res) => {
+          this.isLoading = false;
+          this.classJuri = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    getSchoolName() {
+      let params = {
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectSchoolName2", params)
+        .then((res) => {
+          this.schoolName = res.data[0][0].name;
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    searchStudent() {
+      this.page2 = 1;
+      this.getStudent(this.cid);
+    },
+    handleCurrentChange2(val) {
+      this.page2 = val;
+      this.getStudent(this.cid);
+    },
+    handleCurrentChange3(val) {
+      this.page3 = val;
+      this.getClassStudent();
+    },
+    getStudent(cid) {
+      this.cid = cid
+      this.ctype = 2
+      this.isLoading = true;
+      let params = {
+        oid: this.oid,
+        cid: this.cid,
+        cu: "",
+        cn: this.sPhoneUser,
+        page: this.page2,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTeacher2", params)
+        .then((res) => {
+          this.isLoading = false;
+          this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
+          this.tableData2 = res.data[0];
+          this.getClass2();
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    getClassStudent() {
+      this.isLoading2 = true;
+      let params = {
+        oid: this.oid,
+        cid: this.cid,
+        cn: this.searchTN,
+        page: this.page3,
+        num: this.pageSize3,
+      };
+      this.ajax
+        .get(this.$store.state.api + "getClassTeacher", params)
+        .then((res) => {
+          this.isLoading2 = false;
+          this.total3 = res.data[0].length > 0 ? res.data[0][0].num : 0;
+          this.teacherJuri = res.data[0];
+        })
+        .catch((err) => {
+          this.isLoading2 = false;
+          console.error(err);
+        });
+    },
+    addClassStudent() {
+      if (!this.checkboxList3.length) {
+        this.$message.error('请选择要添加教研室的老师');
+        return;
+      }
+      let params = [{
+        cid: this.cid,
+        student: JSON.stringify(this.checkboxList3)
+      }];
+      this.ajax
+        .post(this.$store.state.api + "addClassTeacher", params)
+        .then((res) => {
+          this.$message.success("添加成功")
+          this.checkboxList3 = []
+          this.dialogVisibleMember = false
+          this.getStudent(this.cid)
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    iniPassword(id) {
+      this.$confirm("确定" + "初始化" + "此老师的密码吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let params = [
+            {
+              uid: id,
+              pa: 123456,
+            },
+          ];
+          this.ajax
+            .post(this.$store.state.api + "iniPassword", params)
+            .then((res) => {
+              this.$message({
+                message: "初始化密码成功!",
+                type: "success",
+              });
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        })
+        .catch(() => { });
     },
-  };
-  </script>
-  
-  <style scoped>
-  .dialog_diy>>>.el-dialog__header {
-    background: #3d67bc !important;
-    padding: 15px 20px;
-  }
-  
-  .dialog_diy>>>.el-dialog__title {
-    color: #fff;
-  }
-  
-  .student_table>>>.el-table--border td {
-    border-right: 0px !important;
-  }
-  
-  .dialog_diy>>>.el-dialog__headerbtn {
-    top: 19px;
-  }
-  
-  .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
-    color: #fff;
-  }
-  
-  .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
-    color: #fff;
-  }
-  
-  .student_head>>>.el-button--primary {
-    background-color: #2268bc;
-  }
-  
-  .xls_button {
-    font-size: 14px;
-    cursor: pointer;
-    text-decoration: underline;
-    color: rgb(34, 104, 188);
-  }
-  
-  .pb_head {
-    margin: 0 !important;
-    width: 100% !important;
-  }
-  
-  .student_page {
-    margin-top: 10px;
-  }
-  
-  .student_head {
-    margin-top: 10px;
-    padding-bottom: 15px;
-    display: flex;
-    justify-content: space-between;
-  }
-  
-  .student_search {
-    display: flex;
-    width: 300px;
-  }
-  
-  .student_search span {
-    margin: 0 10px 0 0;
-  }
-  
-  .student_button {
-    display: flex;
-    height: 40px;
-  }
-  
-  .student_button .el-button--primary {
-    /* margin-right: 10px; */
-  }
-  
-  .upload-demo {
-    display: flex;
-    flex-direction: column;
-    align-items: end;
-    /* position: relative; */
-    width: 100px;
-    overflow: hidden;
-  }
-  
-  .student_table {
-    margin: 20px 0;
-  }
-  
-  .el-table>>>.even_row {
-    background-color: #f1f1f1;
-  }
-  
-  .top {
-    display: flex;
-    justify-content: space-between;
-  }
-  
-  .bgColor {
-    background: #2167bc;
-  }
-  
-  .student_table>>>.el-table,
-  .student_table>>>.el-table__body-wrapper {
-    height: auto !important;
-  }
-  
-  .student_head {
-    margin-top: 10px;
-    padding-bottom: 10px;
-    display: flex;
-    justify-content: space-between;
-  }
-  
-  .head_left {
-    display: flex;
-    align-items: center;
-  }
-  
-  .head_right {
-    display: flex;
-    flex-direction: row;
-    flex-wrap: nowrap;
-    align-items: baseline;
-  }
-  
-  .student_input>>>.el-input__inner {
-    width: 190px;
-    font-size: 13px;
-    padding: 0 10px;
-  }
-  
-  .student_button {
-    color: #fff;
-    background: #2268bc;
-  }
-  
-  .head_right>button:nth-child(1) {
-    color: #fff;
-    background: #2268bc;
-  }
-  
-  
-  .head_right>div {
-    line-height: 40px;
-    margin-left: 10px;
-    color: #2a6dbe;
-    text-decoration: underline;
-    cursor: pointer;
-  }
-  
-  .userImg {
-    display: flex;
-    flex-direction: row;
-    justify-content: center;
-    align-items: center;
-  }
-  
-  .tx {
-    width: 40px;
-    margin-right: 10px;
-  }
-  
-  .delete {
-    width: 25px;
-    height: 25px;
-    cursor: pointer;
-    margin-left: 10px;
-  }
-  
-  .tx>img,
-  .delete>img {
-    width: 100%;
-    height: 100%;
-  }
-  
-  .btnBox {
-    display: flex;
-    align-items: center;
-  }
-  
-  .add_student>>>.el-dialog__header {
-    padding: 20px 20px 10px;
-    text-align: center;
-    background: #32455b;
-  }
-  
-  .add_student>>>.el-dialog__title {
-    font-size: 14px !important;
-    color: #fff !important;
-  }
-  
-  .add_student>>>.el-dialog__headerbtn {
-    font-size: 20px !important;
-  }
-  
-  .add_student>>>.el-form-item__label {
-    margin-left: 65px;
-  }
-  
-  .add_student>>>.el-form-item {
-    display: flex;
-  }
-  
-  .add_student>>>.el-form-item__content {
-    margin: 0 !important;
-  }
-  
-  .add_input {
-    width: 365px;
-  }
-  
-  .add_student>>>.el-dialog__footer {
-    text-align: center !important;
-  }
-  
-  .right {
-    width: 250px;
-    color: #fff;
-    background: #0e72e6;
-    margin-bottom: 20px;
-  }
-  
-  .header-title {
-    display: flex;
-  }
-  
-  .logoImg {
-    width: 30px;
-  }
-  
-  .logoImg>img {
-    width: 100%;
-    height: 100%;
-  }
-  
-  .title_add_student {
-    margin: 0 auto;
-    color: #fff;
-  }
-  
-  .upload-demo {
-    line-height: 0px !important;
-  }
-  
-  .upload-demo>>>.el-button {
-    color: #fff;
-    background: #2268bc;
-    width: 70px;
-    height: 30px;
-    padding: 0 !important;
-    font-size: 12px;
-    line-height: 0 !important;
-  }
-  
-  .people {
-    border: 1px solid rgb(229 229 229);
-    height: 495px;
-    border-radius: 5px;
-    width: 100%;
-    overflow: auto;
-  }
-  
-  .people_top {
-    display: flex;
-    width: 100%;
-    /* justify-content: space-between; */
-    /* align-items: center; */
-    flex-direction: column;
-    padding: 10px 25px 0;
-    box-sizing: border-box;
-  }
-  
-  .people_nav,
-  .people_top_right {
-    /* padding: 20px 0 0 20px; */
-  }
-  
-  .people_top_right {
-    height: 40px;
-    margin-bottom: 10px;
-  }
-  
-  .people_search {
-    display: flex;
-    position: relative;
-  }
-  
-  .people_search>>>.el-input__inner {
-    /* height: 25px; */
-    width: 95%;
-  }
-  
-  .search_img {
-    width: 20px;
-    height: 20px;
-    position: absolute;
-    right: 30px;
-    top: 50%;
-    transform: translateY(-50%);
-  }
-  
-  .search_img>img {
-    width: 100%;
-    height: 100%;
-  }
-  
-  .people_name {
-    display: flex;
-    justify-content: flex-start;
-    padding: 10px 0 0 25px;
-    flex-direction: column;
-    flex-wrap: nowrap;
-    height: calc(100% - 140px);
-    overflow-y: auto;
-    overflow-x: hidden;
-    flex-direction: column;
-  }
-  
-  .people_name>>>.el-checkbox {
-    width: 100%;
-    display: flex;
-    align-items: center;
-    margin-bottom: 10px;
-  }
-  
-  .people_name>>>.el-checkbox__label {
-    text-overflow: ellipsis;
-    overflow: hidden;
-    width: 100%;
-  }
-  
-  .addNewPP>>>.el-dialog__body {
-    padding: 5px 20px;
-  }
-  
-  .t_j_box {
-    display: flex;
-  }
-  
-  .t_j_box span:nth-child(1) {
-    width: 50%;
-    overflow: hidden;
-    margin-right: 10px;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-  }
-  
-  .t_j_box span:nth-child(2) {
-    width: 50%;
-    overflow: hidden;
-    margin-right: 10px;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-  }
-  </style>
-  
+  },
+};
+</script>
+
+<style scoped>
+.dialog_diy>>>.el-dialog__header {
+  background: #3d67bc !important;
+  padding: 15px 20px;
+}
+
+.dialog_diy>>>.el-dialog__title {
+  color: #fff;
+}
+
+.student_table>>>.el-table--border td {
+  border-right: 0px !important;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn {
+  top: 19px;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+
+.student_head>>>.el-button--primary {
+  background-color: #2268bc;
+}
+
+.xls_button {
+  font-size: 14px;
+  cursor: pointer;
+  text-decoration: underline;
+  color: rgb(34, 104, 188);
+}
+
+.pb_head {
+  margin: 0 !important;
+  width: 100% !important;
+}
+
+.student_page {
+  margin-top: 10px;
+}
+
+.student_head {
+  margin-top: 10px;
+  padding-bottom: 15px;
+  display: flex;
+  justify-content: space-between;
+}
+
+.student_search {
+  display: flex;
+  width: 300px;
+}
+
+.student_search span {
+  margin: 0 10px 0 0;
+}
+
+.student_button {
+  display: flex;
+  height: 40px;
+}
+
+.student_button .el-button--primary {
+  /* margin-right: 10px; */
+}
+
+.upload-demo {
+  display: flex;
+  flex-direction: column;
+  align-items: end;
+  /* position: relative; */
+  width: 100px;
+  overflow: hidden;
+}
+
+.student_table {
+  margin: 20px 0;
+}
+
+.el-table>>>.even_row {
+  background-color: #f1f1f1;
+}
+.top {
+  display: flex;
+  justify-content: space-between;
+}
+
+.bgColor {
+  background: #2167bc;
+}
+
+.student_table>>>.el-table,
+.student_table>>>.el-table__body-wrapper {
+  height: auto !important;
+}
+
+.student_head {
+  margin-top: 10px;
+  padding-bottom: 10px;
+  display: flex;
+  justify-content: space-between;
+}
+
+.head_left {
+  display: flex;
+  align-items: center;
+}
+
+.head_right {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: baseline;
+}
+
+.student_input>>>.el-input__inner {
+  width: 190px;
+  font-size: 13px;
+  padding: 0 10px;
+}
+
+.student_button {
+  color: #fff;
+  background: #2268bc;
+}
+
+.head_right>button:nth-child(1) {
+  color: #fff;
+  background: #2268bc;
+}
+
+
+.head_right>div {
+  line-height: 40px;
+  margin-left: 10px;
+  color: #2a6dbe;
+  text-decoration: underline;
+  cursor: pointer;
+}
+
+.userImg {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+}
+
+.tx {
+  width: 40px;
+  margin-right: 10px;
+}
+
+.delete {
+  width: 25px;
+  height: 25px;
+  cursor: pointer;
+  margin-left: 10px;
+}
+
+.tx>img,
+.delete>img {
+  width: 100%;
+  height: 100%;
+}
+
+.btnBox {
+  display: flex;
+  align-items: center;
+}
+
+.add_student>>>.el-dialog__header {
+  padding: 20px 20px 10px;
+  text-align: center;
+  background: #32455b;
+}
+
+.add_student>>>.el-dialog__title {
+  font-size: 14px !important;
+  color: #fff !important;
+}
+
+.add_student>>>.el-dialog__headerbtn {
+  font-size: 20px !important;
+}
+
+.add_student>>>.el-form-item__label {
+  margin-left: 65px;
+}
+
+.add_student>>>.el-form-item {
+  display: flex;
+}
+
+.add_student>>>.el-form-item__content {
+  margin: 0 !important;
+}
+
+.add_input {
+  width: 365px;
+}
+
+.add_student>>>.el-dialog__footer {
+  text-align: center !important;
+}
+
+.right {
+  width: 250px;
+  color: #fff;
+  background: #0e72e6;
+  margin-bottom: 20px;
+}
+
+.header-title {
+  display: flex;
+}
+
+.logoImg {
+  width: 30px;
+}
+
+.logoImg>img {
+  width: 100%;
+  height: 100%;
+}
+
+.title_add_student {
+  margin: 0 auto;
+  color: #fff;
+}
+
+.upload-demo {
+  line-height: 0px !important;
+}
+
+.upload-demo>>>.el-button {
+  color: #fff;
+  background: #2268bc;
+  width: 70px;
+  height: 30px;
+  padding: 0 !important;
+  font-size: 12px;
+  line-height: 0 !important;
+}
+
+.people {
+  border: 1px solid rgb(229 229 229);
+  height: 495px;
+  border-radius: 5px;
+  width: 100%;
+  overflow: auto;
+}
+
+.people_top {
+  display: flex;
+  width: 100%;
+  /* justify-content: space-between; */
+  /* align-items: center; */
+  flex-direction: column;
+  padding: 10px 25px 0;
+  box-sizing: border-box;
+}
+
+.people_nav,
+.people_top_right {
+  /* padding: 20px 0 0 20px; */
+}
+
+.people_top_right {
+  height: 40px;
+  margin-bottom: 10px;
+}
+
+.people_search {
+  display: flex;
+  position: relative;
+}
+
+.people_search>>>.el-input__inner {
+  /* height: 25px; */
+  width: 95%;
+}
+
+.search_img {
+  width: 20px;
+  height: 20px;
+  position: absolute;
+  right: 30px;
+  top: 50%;
+  transform: translateY(-50%);
+}
+
+.search_img>img {
+  width: 100%;
+  height: 100%;
+}
+
+.people_name {
+  display: flex;
+  justify-content: flex-start;
+  padding: 10px 0 0 25px;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  height: calc(100% - 140px);
+  overflow-y: auto;
+  overflow-x: hidden;
+  flex-direction: column;
+}
+
+.people_name>>>.el-checkbox {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.people_name>>>.el-checkbox__label {
+  text-overflow: ellipsis;
+  overflow: hidden;
+  width: 100%;
+}
+
+.addNewPP>>>.el-dialog__body {
+  padding: 5px 20px;
+}
+
+.t_j_box {
+  display: flex;
+}
+
+.t_j_box span:nth-child(1) {
+  width: 50%;
+  overflow: hidden;
+  margin-right: 10px;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.t_j_box span:nth-child(2) {
+  width: 50%;
+  overflow: hidden;
+  margin-right: 10px;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+</style>

+ 101 - 81
src/components/pages/teacherOffice/teacherType.vue

@@ -9,13 +9,13 @@
         <div class="pb_head top">
           <span>教研室类型管理</span>
           <div class="student_button" style="border-radius: 4px;">
-            <el-button type="primary" class="bgColor" @click="dialogVisible = true">添加教研室</el-button>
+            <el-button type="primary" class="bgColor" @click="dialogVisible = true">添加教研室类型</el-button>
           </div>
         </div>
         <div class="student_head">
           <div class="student_search">
             <span>
-              <el-input placeholder="请输入教研室名称" v-model="sClassName" clearable>
+              <el-input placeholder="请输入教研室类型" v-model="sClassName" clearable>
               </el-input>
             </span>
             <el-button type="primary" @click="searchClass">查询</el-button>
@@ -27,13 +27,13 @@
           <el-table v-if="ctype == 1" ref="table" :key="1" :data="tableData" border :height="tableHeight" :fit="true"
             v-loading="isLoading" style="width: 100%; height: 60%" :header-cell-style="{ background: '#f1f1f1' }"
             :row-class-name="tableRowClassName">
-            <el-table-column prop="name" label="教研室名称" align="center">
-            </el-table-column>
-            <el-table-column prop="pnum" label="人数" align="center">
+            <el-table-column prop="name" label="教研室类型" align="center">
             </el-table-column>
+            <!-- <el-table-column prop="pnum" label="人数" align="center">
+            </el-table-column> -->
             <el-table-column label="操作" width="400px">
               <template slot-scope="scope">
-                <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看老师</el-button>
+                <!-- <el-button type="primary" size="small" @click="getStudent(scope.row.id)">查看老师</el-button> -->
                 <!-- <el-button type="primary" size="small" @click="updateG(scope.row.pid, scope.row.id)">修改年级</el-button> -->
                 <el-button type="primary" size="small" @click="openUpdate(scope.row.id, scope.row.name)">修改</el-button>
                 <el-button type="primary" size="small" @click="deleteClass(scope.row.id)">删除</el-button>
@@ -218,13 +218,14 @@
           <el-button class="right" @click="updateStudent">修改</el-button>
         </span>
       </el-dialog>
-      <el-dialog title="添加教研室" :visible.sync="dialogVisible" :append-to-body="true" width="25%" :before-close="handleClose"
+      <el-dialog title="添加教研室类型" :visible.sync="dialogVisible" :append-to-body="true" width="25%" :before-close="handleClose"
         class="dialog_diy">
         <el-form>
-          <el-form-item label="教研室名称" :label-width="formLabelWidth">
-            <el-input v-model="className" auto-complete="off" placeholder="请输入教研室..."></el-input>
+          <el-form-item label="教研室类型" :label-width="formLabelWidth">
+            <el-input v-model="className" auto-complete="off" placeholder="请输入教研室类型..."></el-input>
           </el-form-item>
         </el-form>
+
         <span slot="footer" class="dialog-footer">
           <el-button @click="dialogVisible = false">取 消</el-button>
           <el-button type="primary" @click="insertClass">确 定</el-button>
@@ -304,10 +305,10 @@
       </el-dialog>
     </div>
   </template>
-  
+
   <script>
   import TaskListHeader from 'gantt-elastic/src/components/TaskList/TaskListHeader.vue';
-  
+
   export default {
     data() {
       return {
@@ -440,7 +441,7 @@
       },
       searchClass() {
         this.page = 1;
-        this.getClass();
+        this.getType();
       },
       updateG(gid, id) {
         this.gid = gid;
@@ -545,6 +546,25 @@
             console.error(err);
           });
       },
+      getType(){
+
+        let params = {
+          cu:"",
+          oid:this.oid,
+          cn:this.sClassName,
+          pid:this.pid
+        };
+        this.ajax
+          .get(this.$store.state.api + "selectTeacherOfficeType",params)
+          .then((res) => {
+            this.isLoading = false;
+            this.tableData = res.data[0];
+            console.log(this.tableData,"tableData在此");
+          })
+          .catch((err) => {
+            console.error(err);
+          });
+      },
       //获取教研室列表
       getClass() {
         this.isLoading = true;
@@ -553,7 +573,8 @@
           cu: "",
           oid: this.oid,
           cn: this.sClassName,
-          page: this.page,
+          page: this.page
+
         };
         this.ajax
           .get(this.$store.state.api + "selectTeacherOffice", params)
@@ -624,7 +645,7 @@
           this.$message.error("邮箱格式不正确");
           return;
         }
-  
+
         if (this.time()) {
           let params = { un: this.sMail };
           this.ajax
@@ -656,7 +677,7 @@
         this.ajax
           .post(this.$store.state.api + "batchRegistration", params)
           .then((res) => {
-  
+
             let params = [
               {
                 userid: res.data.uid,
@@ -725,7 +746,7 @@
           this.$message.error("邮箱格式不正确");
           return;
         }
-  
+
         if (this.time()) {
           if (this.userinfoA.un != this.userinfo.un) {
             let params = { un: this.userinfo.un };
@@ -938,78 +959,78 @@
     },
   };
   </script>
-  
+
   <style scoped>
   .dialog_diy>>>.el-dialog__header {
     background: #3d67bc !important;
     padding: 15px 20px;
   }
-  
+
   .dialog_diy>>>.el-dialog__title {
     color: #fff;
   }
-  
+
   .student_table>>>.el-table--border td {
     border-right: 0px !important;
   }
-  
+
   .dialog_diy>>>.el-dialog__headerbtn {
     top: 19px;
   }
-  
+
   .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
     color: #fff;
   }
-  
+
   .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
     color: #fff;
   }
-  
+
   .student_head>>>.el-button--primary {
     background-color: #2268bc;
   }
-  
+
   .xls_button {
     font-size: 14px;
     cursor: pointer;
     text-decoration: underline;
     color: rgb(34, 104, 188);
   }
-  
+
   .pb_head {
     margin: 0 !important;
     width: 100% !important;
   }
-  
+
   .student_page {
     margin-top: 10px;
   }
-  
+
   .student_head {
     margin-top: 10px;
     padding-bottom: 15px;
     display: flex;
     justify-content: space-between;
   }
-  
+
   .student_search {
     display: flex;
     width: 300px;
   }
-  
+
   .student_search span {
     margin: 0 10px 0 0;
   }
-  
+
   .student_button {
     display: flex;
     height: 40px;
   }
-  
+
   .student_button .el-button--primary {
     /* margin-right: 10px; */
   }
-  
+
   .upload-demo {
     display: flex;
     flex-direction: column;
@@ -1018,65 +1039,65 @@
     width: 100px;
     overflow: hidden;
   }
-  
+
   .student_table {
     margin: 20px 0;
   }
-  
+
   .el-table>>>.even_row {
     background-color: #f1f1f1;
   }
-  
+
   .top {
     display: flex;
     justify-content: space-between;
   }
-  
+
   .bgColor {
     background: #2167bc;
   }
-  
+
   .student_table>>>.el-table,
   .student_table>>>.el-table__body-wrapper {
     height: auto !important;
   }
-  
+
   .student_head {
     margin-top: 10px;
     padding-bottom: 10px;
     display: flex;
     justify-content: space-between;
   }
-  
+
   .head_left {
     display: flex;
     align-items: center;
   }
-  
+
   .head_right {
     display: flex;
     flex-direction: row;
     flex-wrap: nowrap;
     align-items: baseline;
   }
-  
+
   .student_input>>>.el-input__inner {
     width: 190px;
     font-size: 13px;
     padding: 0 10px;
   }
-  
+
   .student_button {
     color: #fff;
     background: #2268bc;
   }
-  
+
   .head_right>button:nth-child(1) {
     color: #fff;
     background: #2268bc;
   }
-  
-  
+
+
   .head_right>div {
     line-height: 40px;
     margin-left: 10px;
@@ -1084,101 +1105,101 @@
     text-decoration: underline;
     cursor: pointer;
   }
-  
+
   .userImg {
     display: flex;
     flex-direction: row;
     justify-content: center;
     align-items: center;
   }
-  
+
   .tx {
     width: 40px;
     margin-right: 10px;
   }
-  
+
   .delete {
     width: 25px;
     height: 25px;
     cursor: pointer;
     margin-left: 10px;
   }
-  
+
   .tx>img,
   .delete>img {
     width: 100%;
     height: 100%;
   }
-  
+
   .btnBox {
     display: flex;
     align-items: center;
   }
-  
+
   .add_student>>>.el-dialog__header {
     padding: 20px 20px 10px;
     text-align: center;
     background: #32455b;
   }
-  
+
   .add_student>>>.el-dialog__title {
     font-size: 14px !important;
     color: #fff !important;
   }
-  
+
   .add_student>>>.el-dialog__headerbtn {
     font-size: 20px !important;
   }
-  
+
   .add_student>>>.el-form-item__label {
     margin-left: 65px;
   }
-  
+
   .add_student>>>.el-form-item {
     display: flex;
   }
-  
+
   .add_student>>>.el-form-item__content {
     margin: 0 !important;
   }
-  
+
   .add_input {
     width: 365px;
   }
-  
+
   .add_student>>>.el-dialog__footer {
     text-align: center !important;
   }
-  
+
   .right {
     width: 250px;
     color: #fff;
     background: #0e72e6;
     margin-bottom: 20px;
   }
-  
+
   .header-title {
     display: flex;
   }
-  
+
   .logoImg {
     width: 30px;
   }
-  
+
   .logoImg>img {
     width: 100%;
     height: 100%;
   }
-  
+
   .title_add_student {
     margin: 0 auto;
     color: #fff;
   }
-  
+
   .upload-demo {
     line-height: 0px !important;
   }
-  
+
   .upload-demo>>>.el-button {
     color: #fff;
     background: #2268bc;
@@ -1188,7 +1209,7 @@
     font-size: 12px;
     line-height: 0 !important;
   }
-  
+
   .people {
     border: 1px solid rgb(229 229 229);
     height: 495px;
@@ -1196,7 +1217,7 @@
     width: 100%;
     overflow: auto;
   }
-  
+
   .people_top {
     display: flex;
     width: 100%;
@@ -1206,27 +1227,27 @@
     padding: 10px 25px 0;
     box-sizing: border-box;
   }
-  
+
   .people_nav,
   .people_top_right {
     /* padding: 20px 0 0 20px; */
   }
-  
+
   .people_top_right {
     height: 40px;
     margin-bottom: 10px;
   }
-  
+
   .people_search {
     display: flex;
     position: relative;
   }
-  
+
   .people_search>>>.el-input__inner {
     /* height: 25px; */
     width: 95%;
   }
-  
+
   .search_img {
     width: 20px;
     height: 20px;
@@ -1235,12 +1256,12 @@
     top: 50%;
     transform: translateY(-50%);
   }
-  
+
   .search_img>img {
     width: 100%;
     height: 100%;
   }
-  
+
   .people_name {
     display: flex;
     justify-content: flex-start;
@@ -1252,28 +1273,28 @@
     overflow-x: hidden;
     flex-direction: column;
   }
-  
+
   .people_name>>>.el-checkbox {
     width: 100%;
     display: flex;
     align-items: center;
     margin-bottom: 10px;
   }
-  
+
   .people_name>>>.el-checkbox__label {
     text-overflow: ellipsis;
     overflow: hidden;
     width: 100%;
   }
-  
+
   .addNewPP>>>.el-dialog__body {
     padding: 5px 20px;
   }
-  
+
   .t_j_box {
     display: flex;
   }
-  
+
   .t_j_box span:nth-child(1) {
     width: 50%;
     overflow: hidden;
@@ -1281,7 +1302,7 @@
     text-overflow: ellipsis;
     white-space: nowrap;
   }
-  
+
   .t_j_box span:nth-child(2) {
     width: 50%;
     overflow: hidden;
@@ -1290,4 +1311,3 @@
     white-space: nowrap;
   }
   </style>
-