Browse Source

新增学员修改

wolyshaw 4 năm trước cách đây
mục cha
commit
e085f0db07

+ 2 - 8
src/views/resetTeaming/modals/extra-class.vue

@@ -23,7 +23,7 @@
               v-model="list.form[scope.$index].courseType"
               placeholder="课程类型"
               clearable
-              @change="priceChange(scope.row, scope.$index)"
+              @change="$listeners.priceChange(scope.row, scope.$index)"
               :disabled="isDisabled"
             >
               <el-option
@@ -83,7 +83,7 @@
               v-model="list.form[scope.$index].courseTotalMinuties"
               :controls="false"
               :precision="0"
-              @change="() => $listeners.priceChange(scope.row, scope.$index)"
+              @change="$listeners.priceChange(scope.row, scope.$index)"
               :min="1"
               :disabled="isDisabled"
               placeholder="课程时长"
@@ -182,13 +182,7 @@ export default {
       }
     }
   },
-  mounted() {
-    console.log(this.clearable)
-  },
   methods: {
-    priceChange(item, index) {
-      this.$listeners.priceChange({...item},)
-    },
     change(val) {
       this.$listeners.moneyChange()
     },

+ 26 - 12
src/views/teamDetail/components/modals/create-user-pay.vue

@@ -67,6 +67,7 @@
       :isUserType="true"
       :isCommon="false"
       :isDisabled="true"
+      :courseUnitPriceSettingsByType="organizationCourseUnitPriceSettingsByType"
       @moneyChange="syncAllMoney"
     />
     <el-alert title="缴费设置" :closable="false" class="alert" type="info">
@@ -76,7 +77,7 @@
       :isUserType="true"
       :form.sync="cycle"
       :isCommon="false"
-      :isDisabled="false"
+      :isDisabled="true"
     />
     <div slot="footer" class="dialog-footer">
       <el-button @click="$listeners.close">取 消</el-button>
@@ -89,15 +90,17 @@ import paymentCycle from "../../../resetTeaming/modals/payment-cycle";
 import extraClass from "../../../resetTeaming/modals/extra-class";
 import { musicGroupPaymentCalenderAdd } from '../../../resetTeaming/api'
 import { queryRemainCourseTypeDuration } from '../../api'
-import { getTimes } from "@/utils";
+import { courseType } from '@/constant'
+import { getTimes, objectToOptions } from "@/utils";
 export default {
-  props: ["snapList", "highList", "mixList", "signList", 'createdUserId', 'organizationCourseUnitPriceSettings', 'musicGroupId'],
+  props: ["snapList", "highList", "mixList", "signList", 'createdUserId', 'organizationCourseUnitPriceSettings', 'musicGroupId', 'baseInfo'],
   components: {
     paymentCycle,
     extraClass
   },
   data() {
     return {
+      courseTypeOptions: courseType,
       ids: '',
       form: {
         signClass: '',
@@ -107,15 +110,7 @@ export default {
       },
       cycle: {},
       eclass: [],
-    }
-  },
-  computed: {
-    organizationCourseUnitPriceSettingsByType() {
-      const _ = {}
-      for (const item of this.organizationCourseUnitPriceSettings) {
-        _[item.courseType] = item
-      }
-      return _
+      organizationCourseUnitPriceSettingsByType: {},
     }
   },
   watch: {
@@ -131,6 +126,12 @@ export default {
     'form.snapClass'() {
       this.classChange()
     },
+    baseInfo() {
+      this.formatCourse()
+    }
+  },
+  mounted() {
+    this.formatCourse()
   },
   methods: {
     addExtraClass() {
@@ -153,6 +154,19 @@ export default {
       this.eclass[index] = null;
       this.eclass = this.eclass.filter((item) => !!item);
     },
+    formatCourse() {
+      const organId = this.baseInfo?.organId
+      const chargeTypeId = this.baseInfo?.chargeTypeId
+      const _ = {}
+      const list = (this.organizationCourseUnitPriceSettings || [])
+        .filter(item => organId && organId == item.organId && chargeTypeId && chargeTypeId == item.chargeTypeId)
+      for (const item of list) {
+        _[item.courseType] = item
+      }
+      console.log(_)
+      this.organizationCourseUnitPriceSettingsByType = _
+      return _
+    },
     async classChange() {
       try {
         const ids = [this.form.signClass, this.form.mixClass, this.form.highClass, ...this.form.snapClass].filter(item => !!item).join(',')

+ 7 - 0
src/views/teamDetail/components/studentList.vue

@@ -715,6 +715,7 @@
         :musicGroupId="this.teamid"
         :organizationCourseUnitPriceSettings="organizationCourseUnitPriceSettings"
         :createdUserId="createdUserId"
+        :baseInfo="baseInfo"
         @submited="getList"
         @close="createUserPayVisible = false"
       />
@@ -731,6 +732,7 @@ import {
   findSubjectPlan,
   getGoods,
   getSubject,
+  getMusicGroup,
   getMusicGroupAllClass,
   StudentFeeIsLock,
   updateStudentFee
@@ -762,6 +764,7 @@ export default {
       quitVisible: false, // 退团信息确认的弹窗
       studentClassVisible: false, // 学员所在班级弹窗
       addStudentVisible: false, //新增学员弹窗
+      teamid: '',
       topFrom: {
         // 顶部的禁选框集合
         expect: "2", // 预期招生
@@ -789,6 +792,7 @@ export default {
       classMask: {
         studentName: ""
       },
+      baseInfo: {},
       searchLsit: [],
       tableList: [], //
       rules: {
@@ -984,6 +988,9 @@ export default {
       //     this.signList = res.data;
       //   }
       // })
+      // 获取乐团基本信息
+      getMusicGroup({ musicGroupId: this.teamid })
+        .then(res => this.baseInfo = res.data)
       // 获取乐团所有合奏课
       getMusicGroupAllClass({ musicGroupId: this.teamid }).then(res => {
         if (res.code == 200) {