Jelajahi Sumber

学校端

1
mo 2 tahun lalu
induk
melakukan
3dc46384f7

+ 3 - 1
src/utils/searchArray.js

@@ -30,7 +30,8 @@ import {
   payUserType,
   levelStatus,
   evaluateStatus,
-  problemType
+  problemType,
+  schoolUserType
 } from "../constant";
 // 课程类型
 let tenantConfig = sessionStorage.getItem("tenantConfig");
@@ -884,6 +885,7 @@ export const payUserTypeList = getValueForKey(payUserType);
 export const levelStatusList = getValueForKey(levelStatus);
 export const evaluateStatusList = getValueForKey(evaluateStatus)
 export const problemTypeList = getValueForKey(problemType)
+export const schoolUserTypeList = getValueForKey(schoolUserType)
 //downListType
 function getValueForKey(obj) {
   let arr = [];

+ 41 - 1
src/views/categroyManager/insideSetting/branchManager.vue

@@ -256,6 +256,23 @@
             </el-select>
           </el-form-item>
         </el-row>
+        <el-row>
+          <el-form-item
+            label="合作单位logo"
+            prop="isEnable"
+            :label-width="formLabelWidth"
+          >
+            <image-cropper
+              :options="cropperOptions"
+              bucket_name="cloud-coach"
+              :imgSize="2"
+              :imageUrl="form.logo"
+              showSize
+              @crop-upload-success="cropSuccess"
+            />
+            <p style="color: red">大小2M以内,格式为jpg、png、gif图片</p>
+          </el-form-item>
+        </el-row>
         <el-alert
           style="margin: 10px 0"
           title="合作单位联系人"
@@ -370,6 +387,7 @@ import { getOrganRole } from "@/api/buildTeam";
 import emptyPage from "@/components/emptyPage";
 import qs from "qs";
 import { isBoolean } from "@rongcloud/engine";
+import ImageCropper from "@/components/ImageCropper";
 let validPhone = (rule, value, callback) => {
   if (!value) {
     callback(new Error("请输入电话号码"));
@@ -381,7 +399,7 @@ let validPhone = (rule, value, callback) => {
 };
 export default {
   name: "branchManager",
-  components: { pagination, emptyPage },
+  components: { pagination, emptyPage, ImageCropper },
   data() {
     return {
       searchForm: {
@@ -417,6 +435,7 @@ export default {
         fullJobResource: null,
         organId: null,
         educationUserId: null,
+        logo: null,
         cooperationOrganLinkmanList: [
           { cooperationOrganId: "", job: "", linkman: "", mobileNo: "" },
         ],
@@ -439,6 +458,16 @@ export default {
       context:
         "合作单位即为合作学校,可以为本机构下的各个分部创建合作单位,创建乐团时需选择合作单位用于区分和管理各合作方的乐团。若本机构乐团无合作方,可将本机构创建为合作单位,并在创建乐团时选择。",
       contextFlag: false,
+      cropperOptions: {
+        autoCrop: true, //是否默认生成截图框
+        autoCropWidth: 200, //默认生成截图框宽度
+        autoCropHeight: 200, //默认生成截图框高度
+        fixedBox: true, //是否固定截图框大小 不允许改变
+        previewsCircle: false, //预览图是否是圆形
+        full: true, // 是否输出原图比例的截图
+        enlarge: 2,
+        title: "logo", //模态框上显示的标题
+      },
     };
   },
   async mounted() {
@@ -568,6 +597,7 @@ export default {
           fullJobResource: rows.fullJobResource,
           isEnable: rows.isEnable,
           educationUserId: rows.educationUserId,
+          logo: rows.logo,
         };
 
         let cooperationOrganLinkmanList =
@@ -596,6 +626,7 @@ export default {
           fullJobResource: rows.fullJobResource,
           isEnable: rows.isEnable,
           educationUserId: rows.educationUserId,
+          logo: rows.logo,
         };
         let cooperationOrganLinkmanList =
           rows.cooperationOrganLinkmanList.length > 0
@@ -648,6 +679,15 @@ export default {
         });
       }
     },
+    cropClose() {
+      console.log("上传操作结束");
+    },
+    //上传图片成功
+    cropSuccess(data) {
+      // this.imgUrl = data.data.avatar
+      this.form.logo = data.data.url;
+      console.log(this.form.logo, "cropSuccess");
+    },
   },
   watch: {
     teachingStatus(val) {

+ 38 - 1
src/views/schoolManager/accountManager.vue

@@ -122,6 +122,14 @@
                     >启用</el-button
                   >
                 </auth>
+                <auth auths="schoolStaff/updateAccount">
+                  <el-button
+                    type="text"
+                    v-if="scope.row.status == 9"
+                    @click="resetCount(scope.row)"
+                    >修改</el-button
+                  >
+                </auth>
                 <auth auths="schoolStaff/remove">
                   <el-button
                     type="text"
@@ -152,6 +160,24 @@
         />
       </div>
     </div>
+
+    <el-dialog title="修改" width="450px" :visible.sync="dialogFormVisible">
+      <updateAccountModels
+        :activeRow="activeRow"
+        ref="updateAccountModelsRef"
+        v-if="dialogFormVisible"
+        @close="
+          () => {
+            dialogFormVisible = false;
+            getList();
+          }
+        "
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
+        <el-button @click="submitMessage" type="primary">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -169,8 +195,9 @@ import {
   schoolStaffRemove,
   schoolStaffResetPwd,
 } from "./api";
+import updateAccountModels from "./modals/updateAccountModels";
 export default {
-  components: { pagination },
+  components: { pagination, updateAccountModels },
   data() {
     return {
       searchForm: {
@@ -189,6 +216,8 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
+      dialogFormVisible: false,
+      activeRow: null,
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -232,6 +261,11 @@ export default {
         this.getList();
       });
     },
+    resetCount(row) {
+      this.activeRow = row;
+      this.dialogFormVisible = true;
+      console.log(row);
+    },
     async updateStatus(row) {
       let str = "";
       let status = "";
@@ -300,6 +334,9 @@ export default {
         console.log(error);
       }
     },
+    submitMessage() {
+      this.$refs.updateAccountModelsRef.submit();
+    },
   },
   watch: {
     "searchForm.organId"(val) {

+ 9 - 0
src/views/schoolManager/api.js

@@ -55,3 +55,12 @@ export const submitCoursePatrolEvaluation = data => request2({
   // params:data,
   method: 'post',
 })
+
+
+// 修改账户
+export const updateAccount = data => request2({
+  url: `/api-web/schoolStaff/updateAccount`,
+  data,
+  // params:data,
+  method: 'post',
+})

+ 142 - 0
src/views/schoolManager/modals/updateAccountModels.vue

@@ -0,0 +1,142 @@
+<template>
+  <div class="">
+    <el-form
+      :model="form"
+      ref="form"
+      :inline="true"
+      class="eidtForm"
+      label-position="left"
+    >
+      <el-form-item
+        label="手机号"
+        prop="phone"
+        :label-width="formLabelWidth"
+        :rules="[
+          { required: true, message: '请输入手机号', trigger: 'change' },
+          {
+            pattern: /^1[3456789]\d{9}$/,
+            message: '请输入正确的手机号',
+            trigger: 'blur',
+          },
+        ]"
+      >
+        <el-input v-model.trim="form.phone" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item
+        label="合作单位"
+        prop="coopId"
+        :label-width="formLabelWidth"
+        :rules="[{ required: true, message: '请输选择合作单位', trigger: 'change' }]"
+      >
+        <el-select
+          clearable
+          filterable
+          placeholder="请选择合作单位"
+          v-model="form.coopId"
+        >
+          <el-option
+            v-for="(item, index) in cooperations"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="账号类型"
+        prop="userType"
+        :label-width="formLabelWidth"
+        :rules="[{ required: true, message: '请输选择账号类型', trigger: 'change' }]"
+      >
+        <el-select
+          clearable
+          filterable
+          placeholder="请选择账号类型"
+          v-model="form.userType"
+        >
+          <el-option
+            v-for="(item, index) in schoolUserTypeList"
+            :key="index"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+<script>
+import avatar from "@/assets/images/base/woman.png";
+import { updateAccount, submitCoursePatrolEvaluation } from "../api";
+import { getCooperation } from "@/api/buildTeam";
+import { schoolUserTypeList } from "@/utils/searchArray";
+export default {
+  props: ["activeRow"],
+  data() {
+    return {
+      formLabelWidth: "120px",
+      form: {
+        coopId: "",
+        phone: "",
+        staffId: "",
+        userType: "",
+      },
+      cooperations: [],
+      schoolUserTypeList,
+    };
+  },
+  mounted() {
+    this.form.coopId = this.activeRow.schoolId;
+    this.form.phone = this.activeRow.mobile;
+    this.form.staffId = this.activeRow.id;
+    this.form.userType = this.activeRow.userType;
+    getCooperation({ rows: 1000 }).then((res) => {
+      if (res.code == 200) {
+        this.cooperations = res.data.rows;
+      }
+    });
+  },
+  methods: {
+    async submit() {
+      this.$refs.form.validate(async (flag) => {
+        if (flag) {
+          try {
+            const res = await updateAccount({
+              ...this.form,
+            });
+            this.$message.success("修改成功");
+            this.$emit("close");
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.eidtForm {
+  ::v-deep .el-form-item__content {
+    // display: block !important;
+  }
+  // ::v-deep .el-form--inline {
+
+  // }
+  ::v-deep .el-select {
+    width: 300px !important;
+  }
+  ::v-deep .el-date-editor {
+    width: 300px !important;
+  }
+  ::v-deep .el-checkbox {
+    margin-left: 15px !important;
+  }
+  ::v-deep .el-input {
+    position: relative;
+    font-size: 14px;
+    display: inline-block;
+    width: 300px !important;
+  }
+}
+</style>

+ 48 - 41
src/views/teachManager/modals/addRoot.vue

@@ -1,12 +1,7 @@
 <template>
   <div>
     <el-alert title="教材信息" :closable="false" class="alert" type="info" />
-    <el-form
-      :model="form"
-      label-width="120px"
-      class="form"
-      ref="form"
-    >
+    <el-form :model="form" label-width="120px" class="form" ref="form">
       <el-form-item
         label="教材名称"
         prop="name"
@@ -18,12 +13,16 @@
           },
         ]"
       >
-        <el-input v-model="form.name" placeholder="请输入教材名称" style="width: 100%"></el-input>
+        <el-input
+          v-model="form.name"
+          placeholder="请输入教材名称"
+          style="width: 100%"
+        ></el-input>
       </el-form-item>
       <el-form-item
         label="音源设置"
         prop="soundResource"
-        v-if="level <= 1 && (level == 1 && type != 'create')"
+        v-if="level <= 1 && level == 1 && type != 'create'"
         :rules="[
           {
             required: true,
@@ -32,7 +31,13 @@
           },
         ]"
       >
-        <el-select filterable placeholder="请选择音源设置" clearable v-model="form.soundResource" style="width: 100% !important">
+        <el-select
+          filterable
+          placeholder="请选择音源设置"
+          clearable
+          v-model="form.soundResource"
+          style="width: 100% !important"
+        >
           <el-option label="NotePerformer音源" value="NOTEPERFORMER"></el-option>
           <el-option label="标准音源" value="TANG"></el-option>
           <el-option label="官方音源" value="OFFICIAL"></el-option>
@@ -57,10 +62,15 @@
           :imageHeightM="imageHeightM"
           ref="uploadImg"
         ></upload> -->
-        <image-cropper :options="cropperOptions" bucket_name='cloud-coach' :imgSize="2" :imageUrl="form.coverImg" showSize @crop-upload-success="cropSuccess" />
-        <p style="color: red">
-          大小2M以内,格式为jpg、png、gif图片
-        </p>
+        <image-cropper
+          :options="cropperOptions"
+          bucket_name="cloud-coach"
+          :imgSize="2"
+          :imageUrl="form.coverImg"
+          showSize
+          @crop-upload-success="cropSuccess"
+        />
+        <p style="color: red">大小2M以内,格式为jpg、png、gif图片</p>
       </el-form-item>
     </el-form>
     <span slot="footer" class="dialog-footer">
@@ -71,17 +81,13 @@
 </template>
 <script>
 import Upload from "@/components/Upload/index";
-import ImageCropper from '@/components/ImageCropper'
-import {
-  addsysMusicScore,
-  getSysMusicScoreDetail,
-  resetsysMusicScore,
-} from "../api";
+import ImageCropper from "@/components/ImageCropper";
+import { addsysMusicScore, getSysMusicScoreDetail, resetsysMusicScore } from "../api";
 export default {
   props: ["type", "activeRow"],
   components: {
     Upload,
-    ImageCropper
+    ImageCropper,
   },
   data() {
     return {
@@ -109,7 +115,7 @@ export default {
         previewsCircle: false, //预览图是否是圆形
         full: true, // 是否输出原图比例的截图
         enlarge: 2,
-        title: '教材封面图', //模态框上显示的标题
+        title: "教材封面图", //模态框上显示的标题
       },
     };
   },
@@ -117,21 +123,23 @@ export default {
     await this.$store.dispatch("setBranchs");
     if (this.activeRow?.id) {
       // 判断是否是根元素处理
-      if(this.activeRow?.parentId != 0 || this.type == 'create' ) {
+      if (this.activeRow?.parentId != 0 || this.type == "create") {
         // this.imageWidthM = 210
         // this.imageHeightM = 268
-        this.cropperOptions.autoCropWidth = 210
-        this.cropperOptions.autoCropHeight = 268
+        this.cropperOptions.autoCropWidth = 210;
+        this.cropperOptions.autoCropHeight = 268;
       }
-      console.log(this.activeRow, 'level')
-      this.level = this.activeRow?.level || 0
+      console.log(this.activeRow, "level");
+      this.level = this.activeRow?.level || 0;
       try {
         const res = await getSysMusicScoreDetail({ id: this.activeRow.id });
-        if(this.type == 'create') { // 添加一级分类或子级
+        if (this.type == "create") {
+          // 添加一级分类或子级
           this.form.organId = res.data.organId.split(",").map((item) => {
             return Number(item);
           });
-        } else if(this.type == 'update') { // 修改分类
+        } else if (this.type == "update") {
+          // 修改分类
           this.form.name = res.data.name;
           this.form.organId = res.data.organId.split(",").map((item) => {
             return Number(item);
@@ -146,11 +154,10 @@ export default {
     formatParentId(id, list, ids = []) {
       for (const item of list) {
         if (item.sysMusicScoreCategoriesList) {
-          const cIds = this.formatParentId(
-            id,
-            item.sysMusicScoreCategoriesList,
-            [...ids, item.id]
-          );
+          const cIds = this.formatParentId(id, item.sysMusicScoreCategoriesList, [
+            ...ids,
+            item.id,
+          ]);
           if (cIds.includes(id)) {
             return cIds;
           }
@@ -165,11 +172,11 @@ export default {
       this.$refs.form.validate(async (flag) => {
         if (flag) {
           let { organId, ...rest } = this.form;
-          let parentId = 0
-          if(this.type == 'create') {
-            parentId = this.activeRow?.id || 0
-          } else if(this.type == 'update') {
-            parentId = this.activeRow?.parentId || 0
+          let parentId = 0;
+          if (this.type == "create") {
+            parentId = this.activeRow?.id || 0;
+          } else if (this.type == "update") {
+            parentId = this.activeRow?.parentId || 0;
           }
           let obj = {
             ...rest,
@@ -177,7 +184,7 @@ export default {
             organId: organId.join(","),
           };
           try {
-            if (this.type == 'update') {
+            if (this.type == "update") {
               obj.id = this.activeRow?.id;
               await resetsysMusicScore(obj);
               this.$message.success("修改成功");
@@ -200,13 +207,13 @@ export default {
     },
     //上传操作结束
     cropClose() {
-      console.log('上传操作结束')
+      console.log("上传操作结束");
     },
     //上传图片成功
     cropSuccess(data) {
       // this.imgUrl = data.data.avatar
       this.form.coverImg = data.data.url;
-      console.log(this.form.coverImg)
+      console.log(this.form.coverImg);
     },
   },
   computed: {},