浏览代码

02/17 13:08

1111
261568008@qq.com 5 年之前
父节点
当前提交
fefa728831

+ 8 - 1
src/api/buildTeam.js

@@ -735,7 +735,14 @@ export function resetPassword (data) {
     data: qs.stringify(data)
   })
 }
-
+// 管理员修改密码
+export function resetPassword2 (data) {
+  return request({
+    url: `/api-auth/user/updatePassword2`,
+    method: 'POST',
+    data: qs.stringify(data)
+  })
+}
 
 // 查询是否设置课酬 checkSetSalary
 export function checkSetSalary (data) {

+ 64 - 2
src/views/studentManager/studentList.vue

@@ -144,6 +144,7 @@
                            label="课程余额(元)">
           </el-table-column>
           <el-table-column align='center'
+          width="150px"
                            label="操作">
             <template slot-scope="scope">
               <router-link style="color:#409EFF"
@@ -153,6 +154,8 @@
               <el-button type="text"
                          v-permission="'studentManage/studentUpdate'"
                          @click="resetStudent(scope.row)">修改</el-button>
+                         <!-- api-auth/user/updatePassword2 -->
+                         <el-button v-permission="'api-auth/user/updatePassword2'"  @click="resetPassWrod(scope.row)" type="text">修改密码</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -248,13 +251,30 @@
            v-if="codeUrl2">{{ codeUrl2 }}</p> -->
       </div>
     </el-dialog>
+    <el-dialog title="修改密码" :visible.sync="passwrodVisiable" :before-close="closePassWord"  width="400px" >
+      <el-form :model="passwrodForm" ref="passwrodForm" :inline='true' >
+        <el-form-item label="手机号" prop="phone" label-width="80px" :rules="[{ required: true, message: '手机号不能为空',trigger: 'blur'},{pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号',trigger: 'blur' }]">
+          <el-input v-model.trim="passwrodForm.phone"></el-input>
+        </el-form-item>
+        <el-form-item label="输入密码" prop="password"  label-width="80px" :rules="[{ required: true, message: '密码不能为空',trigger: 'blur'},{pattern:/^[\w]{6,20}$/,message:'密码为6-20位',trigger: 'blur'}]">
+          <el-input v-model.trim="passwrodForm.password"></el-input>
+        </el-form-item>
+        <el-form-item label="再次输入" prop="password2" label-width="80px" :rules="[{ required: true, message: '密码不能为空',trigger: 'blur'},{pattern:/^[\w]{6,20}$/,message:'密码为6-20位',trigger: 'blur'}]">
+          <el-input v-model.trim="passwrodForm.password2"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="passwrodVisiable = false">取 消</el-button>
+        <el-button type="primary" @click="submitResetPassWord">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
 import pagination from '@/components/Pagination/index'
 import { queryStudentList, getStudentInfoByPhone, registerStudent, updateStudent, studentHasCourse } from '@/api/studentManager'
 import { vaildStudentUrl } from '@/utils/validate'
-import { getEmployeeOrgan } from '@/api/buildTeam'
+import { getEmployeeOrgan,resetPassword2 } from '@/api/buildTeam'
 import QRCode from 'qrcodejs2'
 import store from '@/store'
 import axios from 'axios'
@@ -307,7 +327,14 @@ export default {
       maskName: '新增学员',
       qrcodeStatus: false,
       qrcodes: true,
-      activeRow: null
+      activeRow: null,
+   passwrodVisiable: false,
+      passwrodForm: {
+        phone: "",
+        password: "",
+        password2: ""
+      },
+      activatedRow: null
     }
   },
   mounted () {
@@ -503,6 +530,41 @@ export default {
         nation: row.nation
       }
     },
+      resetPassWrod(row) {
+      this.activatedRow = row;
+      this.passwrodForm.phone = row.parentsPhone
+      this.passwrodVisiable = true;
+    },
+    closePassWord(){
+      this.activatedRow = null;
+        this.passwrodForm = {
+        phone: "",
+        password: "",
+        password2: ""
+      }
+      this.$refs['passwrodForm'].resetFields()
+      this.passwrodVisiable = false;
+  
+      
+    },
+    submitResetPassWord(){
+        if (this.passwrodForm.password !== this.passwrodForm.password2) {
+        this.$message.error('两次密码必须相同')
+        return
+      }
+      this.$refs['passwrodForm'].validate(res => {
+        if (res) {
+          // 发请求
+          resetPassword2({ mobile: this.passwrodForm.phone, newPassword: this.passwrodForm.password,userId:this.activatedRow.userId}).then(res => {
+            if (res.code == 200) {
+              // 修改成功
+              this.$message.success('修改成功')
+              this.closePassWord() 
+            }
+          })
+        }
+      })
+    }
   },
   watch: {
     studentVisible (val) {

+ 248 - 211
src/views/teacherManager/teacherList.vue

@@ -4,198 +4,183 @@
       <div class="squrt"></div>老师列表
     </h2>
     <div class="m-core">
-      <div class="newBand"
-           v-permission="'/teacherOperationAdd'"
-           @click="onTeacher('create')">老师新增</div>
+      <div class="newBand" v-permission="'/teacherOperationAdd'" @click="onTeacher('create')">老师新增</div>
       <!-- 搜索标题 -->
-      <el-form :inline="true"
-               class="searchForm"
-               v-model.trim="searchForm">
+      <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
         <el-form-item>
-          <el-input v-model.trim="searchForm.search"
-                    @keyup.enter.native='getList'
-                    placeholder="老师姓名或电话"></el-input>
+          <el-input
+            v-model.trim="searchForm.search"
+            @keyup.enter.native="getList"
+            placeholder="老师姓名或电话"
+          ></el-input>
         </el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.lockFlag"
-                     clearable
-                     filterable
-                     placeholder="老师状态">
-            <el-option v-for="item in teacherStatus"
-                       :key="item.value"
-                       :label="item.label"
-                       :value="item.value"></el-option>
+          <el-select v-model.trim="searchForm.lockFlag" clearable filterable placeholder="老师状态">
+            <el-option
+              v-for="item in teacherStatus"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.subjectId"
-                     filterable
-                     clearable
-                     placeholder="专业技能">
-            <el-option-group v-for="group in subjectList"
-                             :key="group.label"
-                             :label="group.label">
-              <el-option v-for="item in group.options"
-                         :key="item.value"
-                         :label="item.label"
-                         :value="item.value">
-              </el-option>
+          <el-select v-model.trim="searchForm.subjectId" filterable clearable placeholder="专业技能">
+            <el-option-group v-for="group in subjectList" :key="group.label" :label="group.label">
+              <el-option
+                v-for="item in group.options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
             </el-option-group>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.organId"
-                     filterable
-                     clearable
-                     placeholder="请选择分部">
-            <el-option v-for="item in branchList"
-                       :key="item.id"
-                       :label="item.label"
-                       :value="item.value"></el-option>
+          <el-select v-model.trim="searchForm.organId" filterable clearable placeholder="请选择分部">
+            <el-option
+              v-for="item in branchList"
+              :key="item.id"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.jobNature"
-                     filterable
-                     clearable
-                     placeholder="工作类型">
-            <el-option v-for="item in jobNature"
-                       :key="item.value"
-                       :label="item.label"
-                       :value="item.value"></el-option>
+          <el-select v-model.trim="searchForm.jobNature" filterable clearable placeholder="工作类型">
+            <el-option
+              v-for="item in jobNature"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.isProbationPeriod"
-                     clearable
-                     filterable
-                     placeholder="人事状态">
-            <el-option label="试用"
-                       value="0"></el-option>
-            <el-option label="正式"
-                       value="1"></el-option>
+          <el-select
+            v-model.trim="searchForm.isProbationPeriod"
+            clearable
+            filterable
+            placeholder="人事状态"
+          >
+            <el-option label="试用" value="0"></el-option>
+            <el-option label="正式" value="1"></el-option>
           </el-select>
         </el-form-item>
         <!-- isSupportExtraPracticeLesson -->
-        <el-form-item >
-               <el-select v-model.trim="searchForm.isSupportExtraPracticeLesson"
-                     clearable
-                     filterable
-                     placeholder="开放陪练课">
-            <el-option label="是"
-                       value="true"></el-option>
-            <el-option label="否"
-                       value="false"></el-option>
+        <el-form-item>
+          <el-select
+            v-model.trim="searchForm.isSupportExtraPracticeLesson"
+            clearable
+            filterable
+            placeholder="开放陪练课"
+          >
+            <el-option label="是" value="true"></el-option>
+            <el-option label="否" value="false"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button @click="search"
-                     type="danger">搜索</el-button>
-          <el-button @click="onReSet"
-                     type="primary">重置</el-button>
+          <el-button @click="search" type="danger">搜索</el-button>
+          <el-button @click="onReSet" type="primary">重置</el-button>
         </el-form-item>
       </el-form>
       <!-- 列表 -->
       <div class="tableWrap">
-        <el-table :data='tableList'
-                  :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-          <el-table-column align='center'
-                           prop="id"
-                           label="老师编号">
-          </el-table-column>
-          <el-table-column align='center'
-                           prop="realName"
-                           label="老师名称">
-          </el-table-column>
-          <el-table-column align='center'
-                           prop="organName"
-                           label="所属分部">
-          </el-table-column>
-          <el-table-column align='center'
-                           label="老师状态">
-            <template slot-scope="scope">
-              {{ scope.row.lockFlag | teacherStatus }}
-            </template>
+        <el-table :data="tableList" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+          <el-table-column align="center" prop="id" label="老师编号"></el-table-column>
+          <el-table-column align="center" prop="realName" label="老师名称"></el-table-column>
+          <el-table-column align="center" prop="organName" label="所属分部"></el-table-column>
+          <el-table-column align="center" label="老师状态">
+            <template slot-scope="scope">{{ scope.row.lockFlag | teacherStatus }}</template>
           </el-table-column>
-          <el-table-column align='center'
-                           label="专业技能">
+          <el-table-column align="center" label="专业技能">
             <template slot-scope="scope">
-              <span style="max-height: 68px;display: block;"
-                    :title="scope.row.splitSubjectName">{{ scope.row.splitSubjectName }}</span>
+              <span
+                style="max-height: 68px;display: block;"
+                :title="scope.row.splitSubjectName"
+              >{{ scope.row.splitSubjectName }}</span>
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           prop="phone"
-                           label="联系电话">
-          </el-table-column>
-          <el-table-column align='center'
-                           label="工作类型">
-            <template slot-scope="scope">
-              {{ scope.row.jobNature | jobNature }}
-            </template>
-          </el-table-column>
-          <el-table-column align='center'
-                           label="人事状态">
-            <template slot-scope="scope">
-              {{ scope.row.isProbationPeriod ? '正式' : '试用' }}
-            </template>
+          <el-table-column align="center" prop="phone" label="联系电话"></el-table-column>
+          <el-table-column align="center" label="工作类型">
+            <template slot-scope="scope">{{ scope.row.jobNature | jobNature }}</template>
           </el-table-column>
-          <el-table-column align='center'
-                           prop="vipNum"
-                           label="已开小课">
+          <el-table-column align="center" label="人事状态">
+            <template slot-scope="scope">{{ scope.row.isProbationPeriod ? '正式' : '试用' }}</template>
           </el-table-column>
-          <el-table-column align='center'
-                           label="试听课安排">
-            <template slot-scope="scope">
-              {{ scope.row.demoNum > 0 ? '是' : '否' }}
-            </template>
+          <el-table-column align="center" prop="vipNum" label="已开小课"></el-table-column>
+          <el-table-column align="center" label="试听课安排">
+            <template slot-scope="scope">{{ scope.row.demoNum > 0 ? '是' : '否' }}</template>
           </el-table-column>
-            <el-table-column align='center'
-                           label="开放陪练课">
-            <template slot-scope="scope">
-              {{ scope.row.isSupportExtraPracticeLesson  ? '是' : '否' }}
-            </template>
+          <el-table-column align="center" label="开放陪练课">
+            <template slot-scope="scope">{{ scope.row.isSupportExtraPracticeLesson ? '是' : '否' }}</template>
           </el-table-column>
-          <el-table-column align='center'
-                           label="操作">
+          <el-table-column align="center" fixed="right" width="200" label="操作">
             <template slot-scope="scope">
               <!--   let search = JSON.stringify(this.searchForm)
-      let rules = JSON.stringify(this.pageInfo) -->
-              <router-link style="color:#409EFF"
-                           v-permission="'/teacherDetail'"
-                           :to="{path:`/business/teacherDetail?teacherId=${scope.row.id}&teacherName=${scope.row.realName}`,query:{search:JSON.stringify(searchForm),rules:JSON.stringify(pageInfo)}}">查看</router-link>
-              <el-button v-permission="'/teacherIperationUpdate'"
-                         @click="onTeacher('update', scope.row)"
-                         type="text">修改</el-button>
-              <el-button v-permission="'employee/employeeOperate'"
-                         @click="onStaffOperation('LOCK_UNLOCK', scope.row)"
-                         type="text">{{ scope.row.lockFlag == 1 ? '解冻' : '冻结' }}</el-button>
+              let rules = JSON.stringify(this.pageInfo)-->
+              <router-link
+                style="color:#409EFF"
+                v-permission="'/teacherDetail'"
+                :to="{path:`/business/teacherDetail?teacherId=${scope.row.id}&teacherName=${scope.row.realName}`,query:{search:JSON.stringify(searchForm),rules:JSON.stringify(pageInfo)}}"
+              >查看</router-link>
+              <el-button
+                v-permission="'/teacherIperationUpdate'"
+                @click="onTeacher('update', scope.row)"
+                type="text"
+              >修改</el-button>
+              <el-button
+                v-permission="'employee/employeeOperate'"
+                @click="onStaffOperation('LOCK_UNLOCK', scope.row)"
+                type="text"
+              >{{ scope.row.lockFlag == 1 ? '解冻' : '冻结' }}</el-button>
+              <!--  -->
+              <el-button v-permission="'api-auth/user/updatePassword2'"  @click="resetPassWrod(scope.row)" type="text">修改密码</el-button>
             </template>
           </el-table-column>
         </el-table>
-        <pagination :total="pageInfo.total"
-                    :page.sync="pageInfo.page"
-                    :limit.sync="pageInfo.limit"
-                    :page-sizes="pageInfo.page_size"
-                    @pagination="getList" />
+        <pagination
+          :total="pageInfo.total"
+          :page.sync="pageInfo.page"
+          :limit.sync="pageInfo.limit"
+          :page-sizes="pageInfo.page_size"
+          @pagination="getList"
+        />
       </div>
     </div>
+    <el-dialog title="修改密码" :visible.sync="passwrodVisiable" :before-close="closePassWord"  width="400px" >
+      <el-form :model="passwrodForm" ref="passwrodForm" :inline='true' >
+        <el-form-item label="手机号" prop="phone" label-width="80px" :rules="[{ required: true, message: '手机号不能为空',trigger: 'blur'},{pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号',trigger: 'blur' }]">
+          <el-input v-model.trim="passwrodForm.phone"></el-input>
+        </el-form-item>
+        <el-form-item label="输入密码" prop="password"  label-width="80px" :rules="[{ required: true, message: '密码不能为空',trigger: 'blur'},{pattern:/^[\w]{6,20}$/,message:'密码为6-20位',trigger: 'blur'}]">
+          <el-input v-model.trim="passwrodForm.password"></el-input>
+        </el-form-item>
+        <el-form-item label="再次输入" prop="password2" label-width="80px" :rules="[{ required: true, message: '密码不能为空',trigger: 'blur'},{pattern:/^[\w]{6,20}$/,message:'密码为6-20位',trigger: 'blur'}]">
+          <el-input v-model.trim="passwrodForm.password2"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="passwrodVisiable = false">取 消</el-button>
+        <el-button type="primary" @click="submitResetPassWord">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
-import pagination from '@/components/Pagination/index'
-import { teacherQueryPage } from '@/api/teacherManager'
-import { employeeOperate } from '@/api/systemManage'
-import { subjectListTree } from '@/api/specialSetting'
-import { getEmployeeOrgan } from '@/api/buildTeam'
-import { jobNature, teacherStatus } from '@/utils/searchArray'
-import store from '@/store'
+import pagination from "@/components/Pagination/index";
+import { teacherQueryPage } from "@/api/teacherManager";
+import { employeeOperate } from "@/api/systemManage";
+import { subjectListTree } from "@/api/specialSetting";
+import { getEmployeeOrgan,resetPassword2 } from "@/api/buildTeam";
+import { jobNature, teacherStatus } from "@/utils/searchArray";
+import store from "@/store";
 export default {
-  name: 'teacherList',
+  name: "teacherList",
   components: {
     pagination
   },
-  data () {
+  data() {
     return {
       searchForm: {
         lockFlag: null,
@@ -204,7 +189,7 @@ export default {
         subjectId: null,
         organId: null,
         search: null, // 老师姓名或电话
-        isSupportExtraPracticeLesson:null
+        isSupportExtraPracticeLesson: null
       },
       jobNature: jobNature, // 工作类型
       teacherStatus: teacherStatus, // 老师状态
@@ -219,88 +204,99 @@ export default {
         total: 1, // 总条数
         page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
-    }
+      passwrodVisiable: false,
+      passwrodForm: {
+        phone: "",
+        password: "",
+        password2: ""
+      },
+      activatedRow: null
+    };
   },
-  activated () {
+  activated() {
     this.__init();
     this.getList();
   },
-  mounted () {
-    this.__init()
-    this.getList()
+  mounted() {
+    this.__init();
+    this.getList();
   },
   methods: {
-    search () {
+    search() {
       this.pageInfo.page = 1;
       this.getList();
     },
-    __init () {
+    __init() {
       if (this.$route.query.search) {
-        this.$route.query.search instanceof Object ? this.searchForm = this.$route.query.search : this.searchForm = JSON.parse(this.$route.query.search);
+        this.$route.query.search instanceof Object
+          ? (this.searchForm = this.$route.query.search)
+          : (this.searchForm = JSON.parse(this.$route.query.search));
       }
       if (this.$route.query.rules) {
-        this.$route.query.rules instanceof Object ? this.pageInfo = this.$route.query.rules : this.pageInfo = JSON.parse(this.$route.query.rules);
+        this.$route.query.rules instanceof Object
+          ? (this.pageInfo = this.$route.query.rules)
+          : (this.pageInfo = JSON.parse(this.$route.query.rules));
       }
       getEmployeeOrgan().then(res => {
         if (res.code == 200) {
-          this.branchList = []
+          this.branchList = [];
           res.data.forEach(item => {
             this.branchList.push({
               label: item.name,
               value: item.id
-            })
-          })
+            });
+          });
         }
-      })
+      });
 
       subjectListTree({
         delFlag: 0,
         rows: 9999
       }).then(res => {
-        let result = res.data
+        let result = res.data;
         if (res.code == 200) {
-          let tempArray = []
+          let tempArray = [];
           result.rows.forEach((item, index) => {
-            let subject = []
+            let subject = [];
             item.subjects.forEach(s => {
               subject.push({
                 value: s.id,
                 label: s.name
-              })
-            })
+              });
+            });
 
             tempArray[index] = {
               label: item.name,
               options: subject
-            }
-          })
-          this.subjectList = tempArray
+            };
+          });
+          this.subjectList = tempArray;
         }
-      })
+      });
       // this.getList();
     },
-    onTeacher (type, row) {
-      let search = JSON.stringify(this.searchForm)
-      let rules = JSON.stringify(this.pageInfo)
+    onTeacher(type, row) {
+      let search = JSON.stringify(this.searchForm);
+      let rules = JSON.stringify(this.pageInfo);
       let params = {
         type: type,
         search,
         rules
-      }
+      };
       if (row) {
-        params.teacherId = row.id
+        params.teacherId = row.id;
       }
-      let path = '/business/teacherOperation'
-      if (type == 'update') {
-        path = '/business/teacherOperationUpdate'
+      let path = "/business/teacherOperation";
+      if (type == "update") {
+        path = "/business/teacherOperationUpdate";
       }
       this.$router.push({
         path: path,
         query: params
-      })
+      });
     },
-    getList () {
-      let params = this.searchForm
+    getList() {
+      let params = this.searchForm;
       // params.organId = this.organId
       // searchForm: {
       //   lockFlag: null,
@@ -311,50 +307,56 @@ export default {
       //   search: null, // 老师姓名或电话
       //   isSupportExtraPracticeLesson:null
       // },
-      params.lockFlag?params.lockFlag:params.lockFlag = null
-      params.isProbationPeriod?params.isProbationPeriod:params.isProbationPeriod = null
-      params.jobNature?params.jobNature:params.jobNature = null
+      params.lockFlag ? params.lockFlag : (params.lockFlag = null);
+      params.isProbationPeriod
+        ? params.isProbationPeriod
+        : (params.isProbationPeriod = null);
+      params.jobNature ? params.jobNature : (params.jobNature = null);
       // params.subjectId?params.subjectId:params.subjectId = null
-      params.subjectId?params.subjectId:params.subjectId = null
-      params.search?params.search:params.search = null
-      params.isSupportExtraPracticeLesson?params.isSupportExtraPracticeLesson:params.isSupportExtraPracticeLesson = null
-      params.rows = this.pageInfo.limit
-      params.page = this.pageInfo.page
+      params.subjectId ? params.subjectId : (params.subjectId = null);
+      params.search ? params.search : (params.search = null);
+      params.isSupportExtraPracticeLesson
+        ? params.isSupportExtraPracticeLesson
+        : (params.isSupportExtraPracticeLesson = null);
+      params.rows = this.pageInfo.limit;
+      params.page = this.pageInfo.page;
       teacherQueryPage(params).then(res => {
         if (res.code == 200) {
           // console.log(res)
-          this.tableList = res.data.rows
-          this.pageInfo.total = res.data.total
+          this.tableList = res.data.rows;
+          this.pageInfo.total = res.data.total;
         }
-      })
+      });
     },
-    onStaffOperation (type, data) {
-      let str = ''
+    onStaffOperation(type, data) {
+      let str = "";
       if (data.lockFlag != 1) {
-        str = `是否冻结${data.realName}老师?`
+        str = `是否冻结${data.realName}老师?`;
       } else {
-        str = `是否解冻${data.realName}老师?`
+        str = `是否解冻${data.realName}老师?`;
       }
-      this.$confirm(str, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        employeeOperate({
-          employeeId: data.id,
-          operate: type
-        }).then(res => {
-          if (res.code == 200) {
-            this.$message.success('更改成功')
-            this.roleStatus = false
-            this.getList()
-          } else {
-            this.$message.error(res.msg)
-          }
+      this.$confirm(str, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          employeeOperate({
+            employeeId: data.id,
+            operate: type
+          }).then(res => {
+            if (res.code == 200) {
+              this.$message.success("更改成功");
+              this.roleStatus = false;
+              this.getList();
+            } else {
+              this.$message.error(res.msg);
+            }
+          });
         })
-      }).catch(() => { })
+        .catch(() => {});
     },
-    onReSet () {
+    onReSet() {
       this.searchForm = {
         lockFlag: null,
         isProbationPeriod: null,
@@ -362,10 +364,45 @@ export default {
         organId: null,
         subjectId: null,
         search: null
+      };
+    },
+    resetPassWrod(row) {
+      this.activatedRow = row;
+      this.passwrodForm.phone = row.phone
+      this.passwrodVisiable = true;
+    },
+    closePassWord(){
+      this.activatedRow = null;
+        this.passwrodForm = {
+        phone: "",
+        password: "",
+        password2: ""
+      }
+      this.$refs['passwrodForm'].resetFields()
+      this.passwrodVisiable = false;
+  
+      
+    },
+    submitResetPassWord(){
+        if (this.passwrodForm.password !== this.passwrodForm.password2) {
+        this.$message.error('两次密码必须相同')
+        return
       }
+      this.$refs['passwrodForm'].validate(res => {
+        if (res) {
+          // 发请求
+          resetPassword2({ mobile: this.passwrodForm.phone, newPassword: this.passwrodForm.password,userId:this.activatedRow.id}).then(res => {
+            if (res.code == 200) {
+              // 修改成功
+              this.$message.success('修改成功')
+              this.closePassWord() 
+            }
+          })
+        }
+      })
     }
   }
-}
+};
 </script>
 <style lang="scss">
 .el-button + .el-button {

+ 2 - 4
src/views/teacherManager/teacherOperation/components/accompanySet.vue

@@ -18,12 +18,10 @@
             <el-option label="星期三" value="3" />
             <el-option label="星期四" value="4" />
             <el-option label="星期五" value="5" />
-            <el-option label="星期六" value="6" />
-            <el-option label="星期日" value="7" />
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="submitOk">确定</el-button>
+          <el-button type="primary" @click="submitOk" v-permission="'teacherFreeTime/updateSet'">确定</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -32,7 +30,7 @@
 <script>
 import { teacherFreeTime,resetTeacherFreeTime } from '@/api/teacherManager'  
 export default {
-     props: ['teacherId'],
+     props: ['teacherId'], 
   data() {
     return {
       accompanyForm: {

+ 2 - 0
src/views/teacherManager/teacherOperation/index.vue

@@ -21,7 +21,9 @@
           <salarySet :teacherId="teacherId"
                      v-if="activeName=='1'" />
         </el-tab-pane>
+        <!--   'teacherFreeTime/query'-->
          <el-tab-pane label="陪练课设置"
+         permission('/teacherFreeTime/query')
                      name="2"
                      :disabled="isTeacher">
                    <accompany :teacherId="teacherId"