Jelajahi Sumber

Merge branch '04/02-resetClass' into 03/12permission

mo 4 tahun lalu
induk
melakukan
ccc9b8d77a

+ 9 - 1
src/main.js

@@ -66,7 +66,7 @@ class DonMessage {
 // 修改默认属性
 ElementUI.Dialog.props.closeOnClickModal.default = false;
 // ElementUI.Dialog.props.destroyOnClose.default = true;
-
+console.log(ElementUI.Input)
 // 全局修改选择如果value与label都为数字0则清空
 const SelectValueWatch = ElementUI.Select.watch.value
 ElementUI.Select.watch.value = function (newValue, oldValue) {
@@ -89,6 +89,14 @@ document.addEventListener('mousewheel', function () {
     document.activeElement.blur()
   }
 })
+document.addEventListener('keydown', function (event) {
+  if(event.keyCode == 13){
+    setTimeout(res=>{
+      document.activeElement.blur()
+    },300)
+
+  }
+})
 
 /**
  * If you don't want to use mock-server

+ 18 - 0
src/views/serverDetail/index.vue

@@ -69,6 +69,21 @@
             v-model.trim="searchForm.operatorId"
           />
         </el-form-item>
+      <el-form-item prop="jobNature">
+          <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-date-picker
             style="width: 410px"
@@ -225,6 +240,7 @@ import load from "@/utils/loading";
 import { getTeacherServeInfo, teacherServeRemindPush } from "./api";
 import { getTimes } from "@/utils";
 import { getNowDateAndSunday, getNowDateAndMonday } from "@/utils/date";
+import { jobNature } from "@/utils/searchArray";
 export default {
   components: { pagination, serverMask },
   data() {
@@ -236,6 +252,7 @@ export default {
         reminded: "",
         unDone: "",
         operatorId: "",
+        jobNature:""
       },
       orderDate: [],
       tableList: [],
@@ -250,6 +267,7 @@ export default {
       lookVisible: false,
       activeRow: null,
       chioseList: [],
+       jobNature: jobNature,
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)

+ 18 - 3
src/views/teamDetail/components/modals/classroom-preview.vue

@@ -1,13 +1,14 @@
 <template>
   <div>
-    <el-form inline>
+    <!-- <el-form inline>
       <el-form-item label="主教老师:">{{coreTeacherName}}</el-form-item>
       <el-form-item label="助教老师:" v-if="assistantName">{{assistantName}}</el-form-item>
-    </el-form>
+    </el-form> -->
     <el-table
       :header-cell-style="{background:'#EDEEF0',color:'#444'}"
       :data="typelist"
     >
+
       <el-table-column
         label="课程类型"
         prop="name"
@@ -31,6 +32,14 @@
       :data="details"
       max-height="300px"
     >
+             <el-table-column
+        label="主教老师"
+        prop="actualTeacherName"
+      ></el-table-column>
+           <el-table-column
+        label="助教老师"
+        prop="teachingTeacherNames"
+      ></el-table-column>
       <el-table-column
         label="课程类型"
         prop="type"
@@ -46,7 +55,13 @@
       <el-table-column
         label="开始时间"
         prop="startClassTime"
-      ></el-table-column>
+      >
+      <template slot-scope="scope">
+        <div>
+          {{scope.row.startClassTime | dateForMinFormat}}
+        </div>
+      </template>
+      </el-table-column>
       <el-table-column
         label="课程时长(分钟)"
         key="time"

+ 276 - 258
src/views/teamDetail/components/modals/classroom-setting-item.vue

@@ -10,212 +10,238 @@
         <el-radio :label="false">否</el-radio>
       </el-radio-group>
     </el-form-item> -->
-    <el-table v-if="form && form.cycle" :data="form.cycle">
-      <el-table-column prop="time" label="课程时长(分)" width="160">
+    <el-table v-if="form && form.cycle" :data="form.cycle" :show-header="false">
+      <el-table-column>
         <template slot-scope="scope">
-          <el-form-item
-            :prop="'classs.' + type + '.cycle.' + scope.$index + '.time'"
-            :rules="[{ required: true, message: '请选择课程时长' }]"
-            inline-message
-          >
-            <el-select
-              v-model.trim="scope.row.time"
-              style="width: 100% !important"
-              placeholder="请选择课程时长"
-              clearable
-              :disabled="!!selectPrice"
-              @change="
-                (val) => {
-                  startTimeChange(scope, val);
-                }
+          <div>
+            <el-form-item
+              :prop="'classs.' + type + '.cycle.' + scope.$index + '.coreTeacher'"
+              label-width="88px"
+              :rules="[{ required: true, message: '请选择主教老师' }]"
+            >
+              <el-select
+                v-model.trim="scope.row.coreTeacher"
+                placeholder="请选择主教老师"
+                clearable
+                filterable
+              >
+              <!--     @change="changecoreTeacher" -->
+                <el-option
+                  v-for="(item, index) in teacherList"
+                  :key="index"
+                  :label="item.realName"
+                  :value="String(item.id)"
+                ></el-option>
+              </el-select>
+              <!-- <remote-search :commit="'setTeachers'" v-model="form.coreTeacher"  /> -->
+            </el-form-item>
+            <el-form-item
+              prop="assistant"
+              v-if="
+                activeType != 'HIGH' &&
+                activeType != 'HIGH_ONLINE' &&
+                activeType != 'MUSIC_NETWORK'
               "
-              filterable
             >
-              <el-option
-                v-for="(item, index) in pricesArray"
-                :key="index"
-                :disabled="
-                  surplustime + (parseFloat(scope.row.time) || 0) < item
+              <!-- <remote-search :commit="'setTeachers'" v-model="form.assistant"  :multiple='true'/> -->
+              <el-select
+                v-model.trim="scope.row.assistant"
+                placeholder="请选择助教老师"
+                filterable
+                clearable
+                multiple
+                collapse-tags
+              >
+                <el-option
+                  v-for="(item, index) in cooperationList"
+                  :key="index"
+                  :label="item.realName"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item
+              :prop="'classs.' + type + '.cycle.' + scope.$index + '.time'"
+              :rules="[{ required: true, message: '请选择课程时长' }]"
+              inline-message
+            >
+              <el-select
+                v-model.trim="scope.row.time"
+                style="width: 180px !important"
+                placeholder="请选择课程时长"
+                clearable
+                :disabled="!!selectPrice"
+                @change="
+                  (val) => {
+                    startTimeChange(scope, val);
+                  }
                 "
-                :label="item"
-                :value="item"
+                filterable
               >
-              </el-option>
-            </el-select>
-            <!-- <el-input disabled v-model="scope.row.time" placeholder="请输入课程时长"/> -->
-          </el-form-item>
-        </template>
-      </el-table-column>
-      <el-table-column label="预计课时数" width="160">
-        <template slot-scope="scope">
-          <!--   -->
-          <el-form-item
-            :prop="
-              'classs.' + type + '.cycle.' + scope.$index + '.expectCourseNum'
-            "
-            :rules="[
-              { required: true, message: '请输入预计课时数' },
-              { pattern: /^\+?[1-9]\d*$/, message: '请输入大于0的正整数' },
-            ]"
-            inline-message
-          >
-            <el-input
-              type="number"
-              v-model.trim="scope.row.expectCourseNum"
-              placeholder="请输入预计课数"
-              style="width: 130px !important"
-              @input="(val)=>{getUseTime(scope.row)}"
+                <el-option
+                  v-for="(item, index) in pricesArray"
+                  :key="index"
+                  :disabled="
+                    surplustime + (parseFloat(scope.row.time) || 0) < item
+                  "
+                  :label="item"
+                  :value="item"
+                >
+                </el-option>
+              </el-select>
+              <!-- <el-input disabled v-model="scope.row.time" placeholder="请输入课程时长"/> -->
+            </el-form-item>
+            <el-form-item
+              :prop="
+                'classs.' + type + '.cycle.' + scope.$index + '.expectCourseNum'
+              "
+              :rules="[
+                { required: true, message: '请输入预计课时数' },
+                { pattern: /^\+?[1-9]\d*$/, message: '请输入大于0的正整数' },
+              ]"
+              inline-message
             >
-            </el-input>
-          </el-form-item>
-        </template>
-      </el-table-column>
-      <el-table-column prop="dayOfWeek" label="循环周期" width="160">
-        <template slot-scope="scope">
-          <el-form-item
-            inline-message
-            :rules="[{ required: true, message: '请选择循环周期' }]"
-            :prop="'classs.' + type + '.cycle.' + scope.$index + '.dayOfWeek'"
-          >
-            <el-select
-              v-model.trim="scope.row.dayOfWeek"
-              style="width: 100% !important"
-              placeholder="请选择循环周期"
-              clearable
-              filterable
-              @change="(val)=>{getUseTime(scope.row)}"
+              <!--  style="width: 130px !important" -->
+              <el-input
+                style="width: 180px !important"
+                type="number"
+                v-model.trim="scope.row.expectCourseNum"
+                placeholder="请输入预计课数"
+                @input="
+                  (val) => {
+                    getUseTime(scope.row);
+                  }
+                "
+              >
+              </el-input>
+            </el-form-item>
+            <el-form-item
+              inline-message
+              :rules="[{ required: true, message: '请选择循环周期' }]"
+              :prop="'classs.' + type + '.cycle.' + scope.$index + '.dayOfWeek'"
             >
-              <el-option
-                v-for="(item, index) in weekDateList"
-                :key="index"
-                :label="item.label"
-                :value="item.value"
+              <el-select
+                v-model.trim="scope.row.dayOfWeek"
+                style="width: 180px !important"
+                placeholder="请选择循环周期"
+                clearable
+                filterable
+                @change="
+                  (val) => {
+                    getUseTime(scope.row);
+                  }
+                "
               >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </template>
-      </el-table-column>
-
-      <el-table-column prop="startClassTime" label="开始时间" width="160">
-        <template slot-scope="scope">
-          <el-form-item
-            :prop="
-              'classs.' + type + '.cycle.' + scope.$index + '.startClassTime'
-            "
-            :rules="[{ required: true, message: '请选择开始时间' }]"
-            inline-message
-          >
-            <el-time-picker
-              style="width: 100% !important"
-              v-model.trim="scope.row.startClassTime"
-              format="HH:mm"
-              value-format="HH:mm"
-              placeholder="请选择时间"
-              @change="timeChange(scope.row)"
-              :picker-options="{
-                selectableRange: ['04:30:00 - 23:59:59'],
-              }"
+                <el-option
+                  v-for="(item, index) in weekDateList"
+                  :key="index"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item
+              :prop="
+                'classs.' + type + '.cycle.' + scope.$index + '.startClassTime'
+              "
+              :rules="[{ required: true, message: '请选择开始时间' }]"
+              inline-message
             >
-              <!--   @change="startTimeChange(scope.row)" -->
-            </el-time-picker>
-          </el-form-item>
-        </template>
-      </el-table-column>
-      <el-table-column prop="endClassTime" label="结束时间" width="160">
-        <template slot-scope="scope">
-          <el-form-item
-            :prop="
-              'classs.' + type + '.cycle.' + scope.$index + '.endClassTime'
-            "
-            inline-message
-          >
-            <el-time-picker
-              style="width: 100% !important"
-              v-model.trim="scope.row.endClassTime"
-              format="HH:mm"
-              disabled
-              value-format="HH:mm"
-              placeholder="请选择时间"
-              :picker-options="{
-                selectableRange: [scope.row.startClassTime + ':00 - 23:59:59'],
-              }"
+              <el-time-picker
+                style="width: 180px !important"
+                v-model.trim="scope.row.startClassTime"
+                format="HH:mm"
+                value-format="HH:mm"
+                placeholder="请选择开始时间"
+                @change="timeChange(scope.row)"
+                :picker-options="{
+                  selectableRange: ['04:30:00 - 23:59:59'],
+                }"
+              >
+                <!--   @change="startTimeChange(scope.row)" -->
+              </el-time-picker>
+            </el-form-item>
+            <el-form-item
+              :prop="
+                'classs.' + type + '.cycle.' + scope.$index + '.endClassTime'
+              "
+              inline-message
             >
-            </el-time-picker>
-          </el-form-item>
-        </template>
-      </el-table-column>
-      <el-table-column label="是否跳过节假日" width="160">
-        <template slot-scope="scope">
-          <el-form-item
-            :prop="'classs.' + type + '.cycle.' + scope.$index + '.holiday'"
-            :rules="[{ required: true, message: '请选择是否跳过节假日' }]"
-            inline-message
-          >
-            <el-select
-              v-model.trim="scope.row.holiday"
-              style="width: 100% !important"
-              placeholder="是否跳过节假日"
-              filterable
-              @change="holidayChange(scope.row)"
+              <el-time-picker
+                style="width: 180px !important"
+                v-model.trim="scope.row.endClassTime"
+                format="HH:mm"
+                disabled
+                value-format="HH:mm"
+                placeholder="请选择结束时间"
+                :picker-options="{
+                  selectableRange: [
+                    scope.row.startClassTime + ':00 - 23:59:59',
+                  ],
+                }"
+              >
+              </el-time-picker>
+            </el-form-item>
+            <el-form-item
+              :prop="'classs.' + type + '.cycle.' + scope.$index + '.holiday'"
+              :rules="[{ required: true, message: '请选择是否跳过节假日' }]"
+              inline-message
             >
-              <el-option label="是" :value="true"></el-option>
-              <el-option label="否" :value="false"> </el-option>
-            </el-select>
-          </el-form-item>
-        </template>
-      </el-table-column>
-      <el-table-column label="排课起始时间" width="170">
-        <template slot-scope="scope">
-          <el-form-item
-            inline-message
-            :prop="'classs.' + type + '.cycle.' + scope.$index + '.startDate'"
-            :rules="[{ required: true, message: '请选择排课起始时间' }]"
-          >
-            <el-date-picker
-              v-model.trim="scope.row.startDate"
-              :picker-options="pickerOptions"
-              style="width: 100% !important"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="选择日期"
-              @change="
-                (val) => {
-                  changeStartDate(val, scope.row);
-                }
-              "
+              <el-select
+                v-model.trim="scope.row.holiday"
+                style="width: 180px !important"
+                placeholder="是否跳过节假日"
+                filterable
+                @change="holidayChange(scope.row)"
+              >
+                <el-option label="是" :value="true"></el-option>
+                <el-option label="否" :value="false"> </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item
+              inline-message
+              :prop="'classs.' + type + '.cycle.' + scope.$index + '.startDate'"
+              :rules="[{ required: true, message: '请选择排课起始时间' }]"
             >
-            </el-date-picker>
-          </el-form-item>
-        </template>
-      </el-table-column>
-      <el-table-column label="排课结束时间" width="170">
-        <template slot-scope="scope">
-          <el-form-item
-            inline-message
-            :prop="'classs.' + type + '.cycle.' + scope.$index + '.endDate'"
-            :rules="[{ required: true, message: '请选择排课结束时间' }]"
-          >
-            <el-date-picker
-              v-model.trim="scope.row.endDate"
-              :disabled="true"
-              :picker-options="pickerOptions"
-              style="width: 100% !important"
-              type="date"
-              value-format="yyyy-MM-dd"
-              placeholder="选择日期"
+              <el-date-picker
+                v-model.trim="scope.row.startDate"
+                :picker-options="pickerOptions"
+                style="width: 180px !important"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择日期"
+                @change="
+                  (val) => {
+                    changeStartDate(val, scope.row);
+                  }
+                "
+              >
+              </el-date-picker>
+            </el-form-item>
+            <el-form-item
+              inline-message
+              :prop="'classs.' + type + '.cycle.' + scope.$index + '.endDate'"
+              :rules="[{ required: true, message: '请选择排课结束时间' }]"
             >
-            </el-date-picker>
-          </el-form-item>
-        </template>
-      </el-table-column>
-      <el-table-column prop="date" width="50px">
-        <template slot-scope="scope">
-          <i
-            @click="remove(scope.$index, scope)"
-            v-if="form.cycle.length > 1"
-            class="close-icon el-icon-circle-close"
-          ></i>
+              <el-date-picker
+                v-model.trim="scope.row.endDate"
+                :disabled="true"
+                :picker-options="pickerOptions"
+                style="width: 180px !important"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择日期"
+              >
+              </el-date-picker>
+            </el-form-item>
+
+            <i
+              @click="remove(scope.$index, scope)"
+              v-if="form.cycle.length > 1"
+              class="close-icon el-icon-circle-close"
+            ></i>
+          </div>
         </template>
       </el-table-column>
     </el-table>
@@ -242,7 +268,7 @@ for (const item of classTimeList) {
 }
 
 export default {
-  props: ["form", "type", "surplustime", "prices", "selectPrice", "holidays"],
+  props: ["form", "type", "surplustime", "prices", "selectPrice", "holidays","teacherList","activeType",'cooperationList'],
   data() {
     return {
       classTimeListByType,
@@ -279,29 +305,29 @@ export default {
   },
   methods: {
     updateUseTime() {
-      let time = 0
-        for (const item of this.form.cycle) {
-          time += (item.time || 0) * (item.expectCourseNum || 0)
-        }
-        this.useTime = time
-        this.$emit('setUserTime', time, this.type)
+      let time = 0;
+      for (const item of this.form.cycle) {
+        time += (item.time || 0) * (item.expectCourseNum || 0);
+      }
+      this.useTime = time;
+      this.$emit("setUserTime", time, this.type);
     },
     create() {
-      if(this.surplustime<=this.useTime){
-        this.$message.error('已排课时长使用完毕,请修改预计课时数')
-        return
+      if (this.surplustime <= this.useTime) {
+        this.$message.error("已排课时长使用完毕,请修改预计课时数");
+        return;
       }
       const initVal = {};
       if (this.selectPrice) {
         initVal.time = this.selectPrice;
       }
       this.form.cycle.push(initVal);
-      this.updateUseTime()
+      this.updateUseTime();
     },
 
     remove(index) {
       this.form.cycle.splice(index, 1);
-      this.updateUseTime()
+      this.updateUseTime();
     },
     startTimeChange(item, val) {
       this.getUseTime(item.row);
@@ -316,7 +342,7 @@ export default {
         this.$set(item.row, "endClassTime", "");
       }
       if (val) {
-      let activeTime = val * Math.max((item.row.expectCourseNum || 0), 0)
+        let activeTime = val * Math.max(item.row.expectCourseNum || 0, 0);
         this.$set(
           item.row,
           "expectCourseNum",
@@ -339,81 +365,72 @@ export default {
       } else {
         this.$set(item, "endClassTime", "");
       }
-      this.updateUseTime()
+      this.updateUseTime();
     },
     holidayChange(row) {
-      this.updateEndTime(row)
+      this.updateEndTime(row);
     },
     getUseTime(row) {
-      this.updateEndTime(row)
+      this.updateEndTime(row);
       this.useTime = 0;
       this.form.cycle.forEach((item) => {
         this.useTime +=
           (item.expectCourseNum ? parseInt(item.expectCourseNum) : 0) *
           parseInt(item.time);
       });
-      this.updateUseTime()
-    //  this.$emit('setUserTime', this.useTime, this.type)
+      this.updateUseTime();
+      //  this.$emit('setUserTime', this.useTime, this.type)
     },
     addData(startDate, dayOfWeek) {
       let num;
-      let dayjs = this.$helpers.dayjs
+      let dayjs = this.$helpers.dayjs;
       let date = dayjs(startDate).toDate();
       dayOfWeek - date.getDay() >= 0
         ? (num = dayOfWeek - date.getDay())
         : (num = dayOfWeek - date.getDay() + 7);
-      return num
+      return num;
     },
     updateEndTime(row) {
-      console.log(row)
-        if (row.dayOfWeek && row.startDate && typeof row.holiday === 'boolean') {
-          // const num = this.addData(row.startDate, row.dayOfWeek)
-          // const week = dayjs(row.startDate).get('day') == 0 ? 7 : dayjs(row.startDate).get('day')
-          const selectWeek = row.dayOfWeek == 7 ? 0 : row.dayOfWeek
-          let exp = Math.max(row.expectCourseNum, 0)
-          let end = dayjs(row.startDate)
-          // console.log(selectWeek, end.get('day'))
-          if (row.holiday) {
-            while (exp > 0) {
-              if (selectWeek == end.get('day') && !this.holidays.includes(end.format('YYYY-MM-DD'))) {
-                exp--
-              }
-              end = end.add(1, 'day')
-              if (exp === 0) {
-                end = end.subtract(1, 'day')
-              }
+      console.log(row);
+      if (row.dayOfWeek && row.startDate && typeof row.holiday === "boolean") {
+        // const num = this.addData(row.startDate, row.dayOfWeek)
+        // const week = dayjs(row.startDate).get('day') == 0 ? 7 : dayjs(row.startDate).get('day')
+        const selectWeek = row.dayOfWeek == 7 ? 0 : row.dayOfWeek;
+        let exp = Math.max(row.expectCourseNum, 0);
+        let end = dayjs(row.startDate);
+        // console.log(selectWeek, end.get('day'))
+        if (row.holiday) {
+          while (exp > 0) {
+            if (
+              selectWeek == end.get("day") &&
+              !this.holidays.includes(end.format("YYYY-MM-DD"))
+            ) {
+              exp--;
             }
-          } else {
-            while (exp > 0) {
-              if (selectWeek == end.get('day')) {
-                exp--
-              }
-              end = end.add(1, 'day')
-              if (exp === 0) {
-                end = end.subtract(1, 'day')
-              }
+            end = end.add(1, "day");
+            if (exp === 0) {
+              end = end.subtract(1, "day");
             }
           }
-          const enumd = this.addData(end.format('YYYY-MM-DD'), row.dayOfWeek)
-          console.log(enumd)
-          // end = end.add(enumd, 'day')
-          this.$set(
-          row,
-          "endDate",
-          end.format('YYYY-MM-DD')
-        );
+        } else {
+          while (exp > 0) {
+            if (selectWeek == end.get("day")) {
+              exp--;
+            }
+            end = end.add(1, "day");
+            if (exp === 0) {
+              end = end.subtract(1, "day");
+            }
+          }
+        }
+        const enumd = this.addData(end.format("YYYY-MM-DD"), row.dayOfWeek);
+        console.log(enumd);
+        // end = end.add(enumd, 'day')
+        this.$set(row, "endDate", end.format("YYYY-MM-DD"));
       } else {
-        this.$set(
-          row,
-          "endDate",
-          ''
-        );
+        this.$set(row, "endDate", "");
       }
 
-
-
-
-
       // if (row.dayOfWeek && row.startDate && typeof row.holiday === 'boolean') {
       //     // const num = this.addData(row.startDate, row.dayOfWeek)
       //     const week = dayjs(row.startDate).get('day') == 0 ? 7 : dayjs(row.startDate).get('day')
@@ -443,8 +460,8 @@ export default {
       // }
     },
     changeStartDate(val, row) {
-      this.updateEndTime(row)
-      this.updateUseTime()
+      this.updateEndTime(row);
+      this.updateUseTime();
     },
   },
 };
@@ -454,5 +471,6 @@ export default {
   cursor: pointer;
   font-size: 16px;
   margin-bottom: 24px;
+  line-height: 40px;
 }
 </style>

+ 27 - 8
src/views/teamDetail/components/modals/classroom-setting.vue

@@ -21,7 +21,7 @@
           ></el-input>
         </el-form-item>
       </el-row>
-      <el-form-item
+      <!-- <el-form-item
         label="主教老师"
         prop="coreTeacher"
         label-width="88px"
@@ -41,9 +41,9 @@
             :value="String(item.id)"
           ></el-option>
         </el-select>
-        <!-- <remote-search :commit="'setTeachers'" v-model="form.coreTeacher"  /> -->
-      </el-form-item>
-      <el-form-item
+        <remote-search :commit="'setTeachers'" v-model="form.coreTeacher"  />
+     </el-form-item> -->
+      <!-- <el-form-item
         label="助教老师"
         prop="assistant"
         v-if="
@@ -52,7 +52,7 @@
           activeType != 'MUSIC_NETWORK'
         "
       >
-        <!-- <remote-search :commit="'setTeachers'" v-model="form.assistant"  :multiple='true'/> -->
+
         <el-select
           v-model.trim="form.assistant"
           placeholder="请选择助教老师"
@@ -67,7 +67,7 @@
             :value="item.id"
           ></el-option>
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item
         v-if="!!Object.keys(allClasss).length"
         style="display: block"
@@ -102,6 +102,9 @@
           <courseItem
             :surplustime="surplustime[key]"
             @setUserTime="setUserTime"
+             :teacherList="teacherList"
+             :activeType="activeType"
+              :cooperationList="cooperationList"
             :type="key"
             :form="item"
             :prices="prices"
@@ -121,7 +124,7 @@
       title="班级预览"
       :visible.sync="previewVisible"
       append-to-body
-      width="700px"
+      width="900px"
     >
       <classrome-preview
         :types="form.classs"
@@ -392,7 +395,7 @@ export default {
                 students: this.studentSubmitedData?.seleched,
                 courseTimes: item.cycle.length,
                 courseTimeDtoList: item.cycle.map((_) => ({
-
+                  classGroupTeacherMapperList:this.formatTeacher(_),
                   courseType: key,
                   dayOfWeek: _.dayOfWeek,
                   endClassTime: _.endClassTime,
@@ -489,6 +492,22 @@ export default {
       // })
 
     },
+    formatTeacher(row){
+      console.log(row)
+    let arr = []
+      if(row.coreTeacher){
+           let obj ={}
+        obj.teacherRole = 'BISHOP'
+        obj.userId = row.coreTeacher
+        arr.push(obj)
+      }
+      if(row.assistant?.length>0){
+        row.assistant.forEach(ass=>{
+          arr.push({teacherRole:'TEACHING',userId:ass})
+        })
+      }
+      return arr
+    }
   },
   // watch:{
   //   musicSurplus(){

+ 11 - 7
src/views/teamDetail/components/modals/select-student.vue

@@ -25,7 +25,8 @@
             <!-- <remote-search :commit="'setTeachers'" v-model="form.coreTeacher"  /> -->
           </el-form-item>
         </el-col>
-        <el-col :span="10" :offset="4">
+        <!-- :offset="4" -->
+        <el-col :span="10" >
           <el-form-item
             label="助教老师"
             prop="assistant"
@@ -66,8 +67,9 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="10" :offset="showName ? 4 : 0">
-          <el-form-item label="声部" style="margin-right: 0;">
+        <!-- :offset="showName ? 4 : 0" -->
+        <el-col :span="10" >
+          <el-form-item label="声部" style="margin-right: 0;" >
             <el-select
               v-model="sound"
               style="width: 100%"
@@ -88,6 +90,7 @@
         </el-col>
       </el-row>
       <el-transfer
+      v-if="!showName"
         filterable
         :titles="['所有学员', '已选学员']"
         filter-placeholder="请输入学生姓名"
@@ -204,9 +207,9 @@ export default {
       if (!this.isOnlyChangeUser && this.activeType == 'HIGH_ONLINE' && (this.seleched.length < 3 || this.seleched.length > 5)) {
         return this.$message.error('线上技能班必须为3-5人')
       }
-      if (this.seleched.length < 1 && !this.isStudentRemove) {
-        return this.$message.error('请至少选择一名学生')
-      }
+      // if (this.seleched.length < 1 && !this.isStudentRemove) {
+      //   return this.$message.error('请至少选择一名学生')
+      // }
       if (this.activeType == 'MUSIC_NETWORK' && this.seleched.length > 1) {
         return this.$message.error('乐团网管课仅可添加一名学生')
       }
@@ -225,7 +228,8 @@ export default {
           } else {
             this.$listeners.submited({
               seleched: this.seleched,
-              ...this.form
+              ...this.form,
+              soundList:this.sound
             })
           }
         }

+ 48 - 8
src/views/teamDetail/components/resetClass.vue

@@ -130,10 +130,9 @@
                 <el-button
                   type="text"
                   v-if="
-                    (permission('classGroup/classGroupUpdate') ||
-                      permission('classGroup/revisionClassGroup') ||
-                      permission('classGroup/revisionAddClassGroup')) &&
-                    team_status == 'PROGRESS'
+                   ( permission('classGroup/classGroupUpdate') ||
+                    permission('classGroup/revisionClassGroup') ||
+                    permission('classGroup/revisionAddClassGroup'))&&scope.row.studentNum>0
                   "
                   @click="classAdjustment(scope.row)"
                   >排课</el-button
@@ -228,7 +227,7 @@
     <!-- 老师以及课程设置 -->
     <el-dialog
       title="班级排课"
-      width="1400px"
+      width="1200px"
       :visible.sync="infoVisible"
       :modal-append-to-body="false"
     >
@@ -914,11 +913,49 @@ export default {
         },
       ];
     },
+    getClassDate(data) {
+      return {
+        type: this.activeType,
+        name: data?.name,
+        musicGroupId: this.teamid,
+        subjectIdList:
+          data?.soundList.length > 0 ? data?.soundList.join(",") : null,
+        teacherMapperList: formatClassGroupTeacherMapperList(
+          data.coreTeacher,
+          data.assistant
+        ),
+        groupType: "MUSIC",
+      };
+    },
     async submitClass(data) {
       const list = this.getSubmitData(data, { onlyCreateClassGroup: true });
+      let obj = this.getClassDate(data);
+      if (this.activeType == "MUSIC_NETWORK") {
+        try {
+          await revisionAddClassGroup(list);
+          this.$message.success("提交成功");
+          this.studentVisible = false;
+          this.getList();
+        } catch (error) {
+          console.log(error);
+        }
+      } else {
+        createClass(obj).then((res) => {
+          if (res.code == 200) {
+            this.studentVisible = false;
+            this.$message.success("提交成功");
+            this.getList();
+          }
+        });
+      }
+
+      return;
+      console.log(data);
       try {
         if (this.classType == 1) {
           // 0新建班级 2 3 4新增班级修改
+          console.log(list, "submitClass,临时班");
+          return;
           await revisionClassGroup(list);
           this.$message.success("提交成功");
         } else if (
@@ -926,6 +963,8 @@ export default {
           this.classType == 3 ||
           this.classType == 4
         ) {
+          console.log(list, "submitClass");
+          return;
           await revisionAddClassGroup(list);
           this.$message.success("提交成功");
         }
@@ -1000,7 +1039,7 @@ export default {
       this.isSearch = true;
       this.className = "";
       this.isTemporary = true;
-      this.activeType = "SPAN";
+      this.activeType = "SNAP";
       this.activeChioseSound = null;
       this.setType("SNAP");
       this.getNoClassStudent("SNAP");
@@ -1034,7 +1073,7 @@ export default {
       console.log(this.activeChioseSound);
       // 搜索学生
       // 根据声部id  乐团id搜索学生
-      if (this.activeType == "SPAN") {
+      if (this.activeType == "SNAP") {
         teamSoundStudent({
           musicGroupId: this.teamid,
           actualSubjectId: this.activeChioseSound,
@@ -1125,7 +1164,8 @@ export default {
       this.isSearch = false;
       this.activeType = row.type;
       this.activeChioseSound = null;
-      this.isStudentRemove = row.currentClassTimes == row.totalClassTimes ? true : false // 上课时长是否没有
+      this.isStudentRemove =
+        row.currentClassTimes == row.totalClassTimes ? true : false; // 上课时长是否没有
       // 根据单机班id 查询声部班内的所有学生
       getClassAllStudent({ classGroupId: row.id }).then((res) => {
         if (res.code == 200) {

+ 45 - 28
src/views/teamDetail/teamCourseList.vue

@@ -22,7 +22,7 @@
       >
         <el-form-item>
           <el-input
-          type="number"
+            type="number"
             v-model.trim="searchForm.courseIdSearch"
             clearable
             placeholder="课程编号"
@@ -334,18 +334,23 @@
             width="130px"
           >
             <template slot-scope="scope">
-              {{
-                scope.row.newCourseId > 0 &&
-                scope.row.newCourseId == scope.row.id
-                  ? "合并课"
-                  : null
-              }}
-              {{
-                scope.row.newCourseId > 0 &&
-                scope.row.newCourseId != scope.row.id
-                  ? "被合并课"
-                  : null
-              }}
+              <div>
+                <span
+                  v-if="
+                    scope.row.newCourseId > 0 &&
+                    scope.row.newCourseId == scope.row.id
+                  "
+                  >合并课
+                </span>
+                <el-button
+                  type="text"
+                  @click="common(scope.row)"
+                  v-if=" scope.row.newCourseId > 0 &&
+                  scope.row.newCourseId != scope.row.id"
+                >
+                  被合并课
+                </el-button>
+              </div>
             </template>
           </el-table-column>
           <el-table-column
@@ -366,7 +371,7 @@
           >
             <template slot-scope="scope">
               <div>
-                <!-- <el-button
+                <el-button
                   type="text"
                   @click="removeCourse(scope.row)"
                   v-permission="
@@ -389,13 +394,7 @@
                   @click="resetClass(scope.row)"
                   >调整</el-button
                 >
-                <el-button
-                  type="text"
-                  @click="common(scope.row)"
-                  v-if="scope.row.newCourseId > 0"
-                >
-                  合并课
-                </el-button>
+
                 <el-button
                   type="text"
                   @click="addCompound(scope.row)"
@@ -528,10 +527,28 @@
           </div>
         </el-form-item>
         <el-form-item label="学员考勤" v-if="maskForm.status != 'NOT_START'">
-          <div class="inputStyle" :class="maskForm.errorAttendanceNum != 0 ? 'red' : null">{{ maskForm.errorAttendanceNum != 0 ? '异常' : '正常' }}</div>
+          <div
+            class="inputStyle"
+            :class="maskForm.errorAttendanceNum != 0 ? 'red' : null"
+          >
+            {{ maskForm.errorAttendanceNum != 0 ? "异常" : "正常" }}
+          </div>
         </el-form-item>
         <el-form-item label="老师考勤" v-if="maskForm.status != 'NOT_START'">
-          <div class="inputStyle" :class="maskForm.signInStatusEnum == 1 && maskForm.signOutStatusEnum == 1? null : 'red'">{{ maskForm.signInStatusEnum == 1 && maskForm.signOutStatusEnum == 1 ? '正常' : '异常' }}</div>
+          <div
+            class="inputStyle"
+            :class="
+              maskForm.signInStatusEnum == 1 && maskForm.signOutStatusEnum == 1
+                ? null
+                : 'red'
+            "
+          >
+            {{
+              maskForm.signInStatusEnum == 1 && maskForm.signOutStatusEnum == 1
+                ? "正常"
+                : "异常"
+            }}
+          </div>
         </el-form-item>
         <el-form-item v-if="maskForm.school" label="教学点">
           {{ maskForm.school.name }}
@@ -684,7 +701,7 @@ const initSearch = {
   teacherIdList: null, // 老师编号
   schoolId: null, // 教学点编号
   creatTimer: [],
-  courseIdSearch:null
+  courseIdSearch: null,
 };
 export default {
   data() {
@@ -784,8 +801,8 @@ export default {
       this.searchForm.timer = [nowTime, nowTime];
       this.getList();
     },
-    async removeCourse() {
-      if (this.deleteList.length < 1) {
+    async removeCourse(row) {
+      if (this.deleteList.length < 1 && !row) {
         this.$message.error("请自少选择一个班级");
         return;
       }
@@ -793,7 +810,7 @@ export default {
       let arr = this.deleteList.map((course) => {
         return course.id;
       });
-      let courseScheduleIds = arr.join(",");
+      let courseScheduleIds = arr.join(",") || row.id;
       try {
         await this.$confirm("是否确认删除此数据?", "提示", {
           type: "warning",
@@ -819,7 +836,7 @@ export default {
       this.searchForm = {
         ...initSearch,
         timer: [],
-        search: row.newCourseId,
+        courseIdSearch: row.newCourseId,
       };
       this.search();
     },

+ 3 - 3
vue.config.js

@@ -20,9 +20,8 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'http://192.168.3.139:8000' // 箭河
 // let target = 'http://192.168.3.38:8000' //邹璇
 // let target = 'http://192.168.3.57:8000' //勇哥
-let target = 'http://dev.dayaedu.com' // 测试服
-// let target = 'http://47.114.176.40:8000' //开发环境
-// let target = 'https://test.dayaedu.com' //开发环境
+let target = 'http://dev.dayaedu.com' // 开发环境
+// let target = 'https://test.dayaedu.com' //测试环境
 // let target = 'http://192.168.3.134' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
@@ -64,6 +63,7 @@ module.exports = {
       // http://192.168.3.28:8000
       // http://192.168.3.134
       // http://47.114.176.40:8000
+      // let target = 'http://dev.dayaedu.com'
       '/api-auth': {
         target: 'http://dev.dayaedu.com',
         // target: 'http://47.114.176.40:8000',