ソースを参照

系统收费 第一版提测

1
mo 4 年 前
コミット
a13c062350

+ 29 - 0
src/api/buildTeam.js

@@ -1598,5 +1598,34 @@ export function preCourseSchedule(data) {
   })
 }
 
+// 取消班级预排课
+export function cancelPreCourseSchedule(data) {
+  return request2({
+    url: api + `/classGroup/cancelPreCourseSchedule`,
+    method: 'post',
+    params:data,
+
+  })
+}
+
+// 获取班级预排课课表
+export function getPreCourseList(data) {
+  return request2({
+    url: api + `/classGroup/queryPreCourseList`,
+    method: 'post',
+    params:data,
+
+  })
+}
+
+// 确认预排课
+export function confirmPreCourseSchedule(data) {
+  return request2({
+    url: api + `/classGroup/confirmPreCourseSchedule`,
+    method: 'post',
+    params:data,
+
+  })
+}
 
 

+ 69 - 36
src/views/resetTeaming/modals/member-setting.vue

@@ -7,11 +7,22 @@
     :inline="true"
   >
     <el-form-item
-      label="会员等级"
+      label="是否购买会员"
       prop="paymentDate"
-      v-if="isUserType"
+      v-if="isUserType&&addStudent"
       :rules="[{ required: true, message: '请选择缴费时间', trigger: 'blur' }]"
     >
+      <el-radio-group v-model="radio">
+        <el-radio :label="true" >购买会员</el-radio>
+        <el-radio :label="false">不购买会员</el-radio>
+      </el-radio-group>
+    </el-form-item>
+    <el-form-item
+      label="会员等级"
+      prop="paymentDate"
+      v-if="isUserType&&radio"
+      :rules="[{ required: true, message: '请选择会员等级', trigger: 'blur' }]"
+    >
       <el-select
         placeholder="会员等级"
         style="width: 620px !important"
@@ -31,7 +42,7 @@
     <el-form-item
       label="会员有效期"
       prop="memberValidDate"
-      v-if="isUserType"
+      v-if="isUserType&&radio"
       :rules="[
         { required: true, message: '请选择会员有效期', trigger: 'blur' },
       ]"
@@ -43,43 +54,50 @@
       >
         <template slot="append">个月</template>
       </el-input>
-       <el-tooltip placement="top" popper-class="mTooltip">
-          <div slot="content">自开课之日起6个月有效。</div>
-          <i
-            class="el-icon-question micon el-tooltip"
-            style="font-size: 18px; color: #f56c6c"
-            v-permission="'export/teacherSalary'"
-          ></i>
-        </el-tooltip>
+      <el-tooltip placement="top" popper-class="mTooltip">
+        <div slot="content">自开课之日起6个月有效。</div>
+        <i
+          class="el-icon-question micon el-tooltip"
+          style="font-size: 18px; color: #f56c6c"
+          v-permission="'export/teacherSalary'"
+        ></i>
+      </el-tooltip>
     </el-form-item>
     <el-form-item
       label="现价"
       prop="memberPaymentAmount"
-      v-if="isUserType"
-      :rules="[{
-              pattern:
-                /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-              message: '请输入正确的金额',
-            },{ required: true, message: '请输入现价', trigger: 'blur' }]"
+      v-if="isUserType&&radio"
+      :rules="[
+        {
+          pattern:
+            /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+          message: '请输入正确的金额',
+        },
+        { required: true, message: '请输入现价', trigger: 'blur' },
+      ]"
     >
-      <el-input style="width:223px" v-model="form.memberPaymentAmount">
+      <el-input style="width: 223px" v-model="form.memberPaymentAmount">
         <template slot="append">元</template>
       </el-input>
     </el-form-item>
     <el-form-item
       label="原价"
       prop="originalMemberPaymentAmount"
-      v-if="isUserType"
+      v-if="isUserType&&radio"
       :rules="[{ required: true, message: '请输入原价', trigger: 'blur' }]"
     >
-      <el-input style="width: 223px" v-model="form.originalMemberPaymentAmount" :disabled='true'>
+      <el-input
+        style="width: 223px"
+        v-model="form.originalMemberPaymentAmount"
+        :disabled="true"
+      >
         <template slot="append">元</template>
       </el-input>
     </el-form-item>
     <el-form-item
       label="缴费时间"
       prop="paymentDate"
-      v-if="isUserType"
+      v-if="isUserType && !addStudent"
       :rules="[{ required: true, message: '请选择缴费时间', trigger: 'blur' }]"
     >
       <el-date-picker
@@ -100,7 +118,7 @@ import { paymentPatternType } from "@/constant";
 import { objectToOptions } from "@/utils";
 import { getAllmemberRank, getMemberFee } from "../api";
 export default {
-  props: ["form", "isUserType", "organId"],
+  props: ["form", "isUserType", "organId", "addStudent"],
   data() {
     return {
       paymentPatternTypeOptions: objectToOptions(paymentPatternType),
@@ -111,6 +129,7 @@ export default {
         },
       },
       memberRankList: [],
+      radio:true
     };
   },
   async mounted() {
@@ -123,25 +142,39 @@ export default {
     }
   },
   methods: {
-   async memberRankSettingIdChange(val) {
-      if(val){
-        try{
-         const res = await getMemberFee({rankId:val,organId:this.organId})
-         if(res.data?.currentHalfYearFee&&res.data?.originalHalfYearFee){
-             this.$set(this.form,'memberPaymentAmount',res.data?.currentHalfYearFee)
-          this.$set(this.form,'originalMemberPaymentAmount',res.data?.originalHalfYearFee)
-         }else{
-           this.$message.error('请设置该会员得默认价格')
-         }
-
+    async memberRankSettingIdChange(val) {
+      if (val) {
+        try {
+          const res = await getMemberFee({
+            rankId: val,
+            organId: this.organId,
+          });
+          if (res.data?.currentHalfYearFee && res.data?.originalHalfYearFee) {
+            this.$set(
+              this.form,
+              "memberPaymentAmount",
+              res.data?.currentHalfYearFee
+            );
+            this.$set(
+              this.form,
+              "originalMemberPaymentAmount",
+              res.data?.originalHalfYearFee
+            );
+          } else {
+            this.$message.error("请设置该会员得默认价格");
+          }
 
-          console.log(this.form.memberPaymentAmount,res.data?.currentHalfYearFee)
-        }catch(e){
-          console.log(e)
+          console.log(
+            this.form.memberPaymentAmount,
+            res.data?.currentHalfYearFee
+          );
+        } catch (e) {
+          console.log(e);
         }
       }
     },
   },
+  watch: {},
 };
 </script>
 <style lang="less" scoped>

+ 3 - 2
src/views/resetTeaming/modals/payment-cycle.vue

@@ -8,7 +8,7 @@
   >
     <el-form-item
     v-if="!hideMoney"
-      label="缴费金额(元)"
+      label="课程金额(元)"
       prop="paymentAmount"
       :rules="[{required: true, message: '请输入缴费金额', trigger: 'blur'}]"
     >
@@ -57,6 +57,7 @@
     <el-form-item
       label="缴费有效期"
       prop="paymentValid"
+      v-if="courseViewType!=1"
       :rules="[{required: true, message: '请选择缴费有效期', trigger: 'blur'}]"
     >
       <el-date-picker
@@ -75,7 +76,7 @@
 import { paymentPatternType } from '@/constant'
 import { objectToOptions } from '@/utils'
 export default {
-  props: ['form', 'className', 'isUserType', 'isDisabled', 'isCommon', 'hidePaymentPattern','hideMoney'],
+  props: ['form', 'className', 'isUserType', 'isDisabled', 'isCommon', 'hidePaymentPattern','hideMoney','courseViewType'],
   data() {
     return {
       paymentPatternTypeOptions: objectToOptions(paymentPatternType),

+ 185 - 18
src/views/teamDetail/components/memberClassList.vue

@@ -30,7 +30,9 @@
           <p>{{ form.startCourseDate }}</p>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="resetStartTime">修改</el-button>
+          <auth auths="musicGroupSchoolTermCourseDetail/upset/4444">
+            <el-button type="primary" @click="resetStartTime">修改</el-button>
+          </auth>
         </el-form-item>
         <el-form-item v-if="form.endSchoolTerm">
           <p style="color: red">该学期结束日期为:{{ form.endSchoolTerm }}</p>
@@ -40,11 +42,70 @@
     <div class="tableWrap" style>
       <el-table
         :data="activeSingleList"
+        @expand-change="changeDetail"
         style
         ref="multipleTable"
         :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
         tooltip-effect="dark"
-      >
+        ><el-table-column type="expand">
+          <template slot-scope="props">
+            <el-table
+              :data="props.row.courseData"
+              :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            >
+              <el-table-column align="center" prop="name" label="课程类型">
+                <template slot-scope="scope">
+                  <div>{{ scope.row.type | courseTypeFormat }}</div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" prop="name" label="课程名称">
+                <template slot-scope="scope">
+                  <div>{{ scope.row.name }}</div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                align="center"
+                prop="name"
+                label="预开始时间"
+                width="200px"
+              >
+                <template slot-scope="scope"
+                  >{{
+                    scope.row.startClassTime
+                      ? scope.row.startClassTime.substr(0, 16)
+                      : ""
+                  }}-{{
+                    scope.row.endClassTime
+                      ? scope.row.endClassTime.substr(11, 5)
+                      : ""
+                  }}</template
+                >
+              </el-table-column>
+              <el-table-column
+                align="center"
+                prop="name"
+                label="课程时长(分钟)"
+              >
+                <template slot-scope="scope">
+                  <div>
+                    {{ getCourseTime(scope.row) }}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                align="center"
+                prop="actualTeacherName"
+                label="主教老师"
+              ></el-table-column>
+              <el-table-column
+                align="center"
+                prop="teachingTeacherNames"
+                label="助教老师"
+              ></el-table-column>
+            </el-table>
+          </template>
+        </el-table-column>
+
         <el-table-column
           align="center"
           prop="name"
@@ -88,7 +149,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="预排课时(分钟)">
+        <el-table-column align="center" label="已预排课次(节)">
           <template slot-scope="scope">
             <div>{{ scope.row.preTotalClassTimes }}</div>
           </template>
@@ -117,11 +178,16 @@
                 @click="planCourse(scope.row)"
                 >预排课</el-button
               >
-              <el-button type="text" v-else>取消排课</el-button>
+              <el-button type="text" v-else @click="cancleCourse(scope.row)"
+                >取消排课</el-button
+              >
             </div>
           </template>
         </el-table-column>
       </el-table>
+      <div class="lastBtnWrap">
+        <el-button type="primary" @click="submitCourse">确认排课</el-button>
+      </div>
     </div>
     <el-dialog
       title="请设置开课日期"
@@ -153,7 +219,7 @@
         :cooperationList="cooperationList" // 助教列表
         :musicGroupId="teamid"
         :activeType="activeType" // 班级类型
-        :courseTypeList="courseTypeList" // 班级可排课类型 
+        :courseTypeList="courseTypeList" // 班级可排课类型
         :detail="infoDetail" // activeRow
         :studentSubmitedData="studentSubmitedData" 班级的学生信息
         @close="infoVisible = false" // 显示隐藏
@@ -165,10 +231,11 @@
       :visible.sync="courseVisible"
     >
       <memberClassSetting
-      :musicGroupSchoolTermCourseDetailId="musicGroupSchoolTermCourseDetailId"
+        v-if="courseVisible"
+        :musicGroupSchoolTermCourseDetailId="musicGroupSchoolTermCourseDetailId"
         :teacherList="teacherList"
         :cooperationList="cooperationList"
-         :courseTypeList="courseTypeList"
+        :courseTypeList="courseTypeList"
         :musicGroupId="teamid"
         :activeType="activeType"
         :detail="classDteail"
@@ -185,10 +252,14 @@ import {
   getTeamBaseInfo,
   musicGroupSchoolTermCourseDetail,
   getTeacher,
+  cancelPreCourseSchedule,
+  getPreCourseList,
+  confirmPreCourseSchedule,
 } from "@/api/buildTeam";
 import { classTimeList, musicClassTypeList } from "@/utils/searchArray";
 import memberClassSetting from "./modals/member-class-setting.vue";
 import { getCourseType } from "@/utils/utils";
+import { diffTimerFormMinute } from "@/utils/date";
 import dayjs from "dayjs";
 export default {
   components: { memberClassSetting },
@@ -216,7 +287,7 @@ export default {
       cooperationList: [],
       activeType: "",
       teamid: "",
-      classDteail:null
+      classDteail: null,
     };
   },
   mounted() {
@@ -280,10 +351,15 @@ export default {
       getAllSignClassandTeacher({ musicGroupId: this.teamid, type: val }).then(
         (res) => {
           if (res.code == 200) {
-             this.activeSingleList = []
-            res.data.map(item=>{
-              if(item.type != 'HIGH'&&item.type != 'DEMO'&&item.type != 'HIGH_ONLINE'&&item.type != 'MUSIC_NETWORK'){
-               this.activeSingleList.push(item)
+            this.activeSingleList = [];
+            res.data.map((item) => {
+              if (
+                item.type != "HIGH" &&
+                item.type != "DEMO" &&
+                item.type != "HIGH_ONLINE" &&
+                item.type != "MUSIC_NETWORK"
+              ) {
+                this.activeSingleList.push(item);
               }
             });
             // this.topForm.count = this.activeSingleList.length
@@ -292,11 +368,11 @@ export default {
       );
     },
     goBack() {
-      this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push({
         path: "/business/resetTeaming",
         query: { ...this.$route.query },
       });
+      this.$store.dispatch("delVisitedViews", this.$route);
     },
     setStartTime() {
       this.$refs.form.validate(async (res) => {
@@ -339,9 +415,8 @@ export default {
                   this.form.startCourseDate = this.lastDate;
                 });
             }
-             console.log(res)
+            console.log(res);
             if (res.code == 200) {
-             
               if (res.data) {
                 this.form.startCourseDate = dayjs(
                   res.data.startCourseDate
@@ -367,18 +442,110 @@ export default {
       this.startVisible = true;
     },
     planCourse(row) {
-      this.classDteail = row
+      this.classDteail = row;
       this.activeType = row.type;
-      console.log(row)
       this.setType(row.type);
       this.courseVisible = true;
     },
     setType(type) {
       this.courseTypeList = getCourseType(type);
-      // this.activeSoundList = this.soundList;
     },
+    cancleCourse(row) {
+      this.$confirm("是否取消预排课", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          try {
+            const res = await cancelPreCourseSchedule({
+              classGroupId: row.id,
+              musicGroupSchoolTermCourseDetailId:
+                this.musicGroupSchoolTermCourseDetailId,
+            });
+            this.$message.success("取消成功");
+            this.getList();
+          } catch (e) {}
+          // musicGroupSchoolTermCourseDetailId
+        })
+        .catch(() => {});
+    },
+    async changeDetail(row, expandedRows) {
+      if (expandedRows.length > 0) {
+        // 展开 请求接口
+        try {
+          const res = await getPreCourseList({ classGroupId: row.id });
+          this.activeSingleList.forEach((item, index) => {
+            if (item.id == row.id) {
+              this.activeSingleList[index].courseData = res.data;
+            }
+          });
+          console.log(this.activeSingleList);
+        } catch (e) {
+          console.log(e);
+        }
+      }
+    },
+    submitCourse() {
+      // confirmPreCourseSchedule
+      this.$confirm("确定提交预排课列表", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          try {
+            const res = await confirmPreCourseSchedule({
+              musicGroupSchoolTermCourseDetailId:
+                this.musicGroupSchoolTermCourseDetailId,
+            });
+            this.$message.success("提交成功");
+            this.getList();
+            this.goBack();
+          } catch (e) {}
+          //
+        })
+        .catch(() => {});
+    },
+    getCourseTime(row) {
+      return diffTimerFormMinute(
+        dayjs(row.classDate).format("YYYY-MM-DD"),
+        dayjs(row.startClassTime).format("HH:mm"),
+        dayjs(row.endClassTime).format("HH:mm")
+      );
+    },
+  },
+  async beforeRouteLeave(to, from, next) {
+    let flag = false;
+    this.activeSingleList.forEach((item) => {
+      if (item.preTotalClassTimes != 0) {
+        flag = true;
+      }
+      if (flag) {
+        this.$confirm("预排课程尚未提交,是否确认跳转其他页面?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(async () => {
+            next();
+            // musicGroupSchoolTermCourseDetailId
+          })
+          .catch(() => {});
+      }else{
+        next()
+      }
+    });
   },
 };
 </script>
 <style lang="scss" scoped>
+.lastBtnWrap {
+  margin-top: 20px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-end;
+  margin-right: 1%;
+}
 </style>

+ 2 - 1
src/views/teamDetail/components/modals/classroom-setting.vue

@@ -12,7 +12,7 @@
           label="班级名称"
           prop="className"
           label-width="88px"
-          :rules="[{ required: true, message: '请填写班级名称' }]" 
+          :rules="[{ required: true, message: '请填写班级名称' }]"
         >
           <el-input
             v-model.trim="form.className"
@@ -395,6 +395,7 @@ export default {
             if (this.form.classs.hasOwnProperty(key)) {
               const item = this.form.classs[key];
               const data = {
+
                 type: this.detail ? undefined : this.activeType,
                 courseType: key,
                 classGroupName:

+ 245 - 126
src/views/teamDetail/components/modals/create-user-pay.vue

@@ -8,7 +8,9 @@
           <el-form-item label="声部班">
             <el-select v-model.trim="form.signClass" filterable clearable>
               <el-option
-                v-for="(item, index) in signList.filter(item => item.lockFlag != 1)"
+                v-for="(item, index) in signList.filter(
+                  (item) => item.lockFlag != 1
+                )"
                 :key="index"
                 :value="item.id"
                 :label="item.name"
@@ -20,7 +22,9 @@
           <el-form-item label="合奏班">
             <el-select v-model.trim="form.mixClass" filterable clearable>
               <el-option
-                v-for="(item, index) in mixList.filter(item => item.lockFlag != 1)"
+                v-for="(item, index) in mixList.filter(
+                  (item) => item.lockFlag != 1
+                )"
                 :key="index"
                 :value="item.id"
                 :label="item.name"
@@ -32,7 +36,9 @@
           <el-form-item label="基础技能班">
             <el-select v-model.trim="form.highClass" filterable clearable>
               <el-option
-                v-for="(item, index) in highList.filter(item => item.lockFlag != 1)"
+                v-for="(item, index) in highList.filter(
+                  (item) => item.lockFlag != 1
+                )"
                 :key="index"
                 :value="item.id"
                 :label="item.name"
@@ -43,13 +49,16 @@
         <el-col :span="12">
           <el-form-item label="临时班">
             <select-all
+              style="width:230px!important"
               v-model.trim="form.snapClass"
               filterable
               clearable
               multiple
             >
               <el-option
-                v-for="(item, index) in snapList.filter(item => item.lockFlag != 1)"
+                v-for="(item, index) in snapList.filter(
+                  (item) => item.lockFlag != 1
+                )"
                 :key="index"
                 :value="item.id"
                 :label="item.name"
@@ -57,15 +66,13 @@
             </select-all>
           </el-form-item>
         </el-col>
-              <el-col :span="12">
+        <el-col :span="12">
           <el-form-item label="线上基础技能班">
-            <el-select
-              v-model.trim="form.highonline"
-              filterable
-              clearable
-            >
+            <el-select v-model.trim="form.highonline" filterable clearable>
               <el-option
-                v-for="(item, index) in highonlineList.filter(item => item.lockFlag != 1)"
+                v-for="(item, index) in highonlineList.filter(
+                  (item) => item.lockFlag != 1
+                )"
                 :key="index"
                 :value="item.id"
                 :label="item.name"
@@ -88,6 +95,22 @@
       @priceChange="priceChange"
       @moneyChange="syncAllMoney"
     />
+    <el-alert
+      title="会员设置"
+      :closable="false"
+      class="alert"
+      style="margin-top: 20px"
+      type="info"
+      v-if="courseViewType == 1"
+    >
+    </el-alert>
+    <memberSetting
+      v-if="courseViewType == 1"
+      :addStudent="true"
+      :form="memberForm"
+      :isUserType="isUserType"
+      :organId="baseInfo.organId"
+    />
     <el-alert title="缴费设置" :closable="false" class="alert" type="info">
     </el-alert>
     <el-form ref="payment" :model="payment">
@@ -95,20 +118,28 @@
         label="缴费方式"
         prop="paymentPattern"
         label-width="160px"
-        :rules="[{required: true, message: '请选择缴费方式', trigger: 'change'}]"
+        :rules="[
+          { required: true, message: '请选择缴费方式', trigger: 'change' },
+        ]"
       >
-        <el-select style="width: 100%!important;" v-model="payment.paymentPattern" placeholder="请选择缴费方式">
+        <el-select
+          style="width: 100% !important"
+          v-model="payment.paymentPattern"
+          placeholder="请选择缴费方式"
+          :disabled="courseViewType == 1"
+        >
           <el-option
             v-for="item in paymentPatternTypeOptions"
             :key="item.value"
             :label="item.label"
-            :value="item.value">
+            :value="item.value"
+          >
           </el-option>
         </el-select>
       </el-form-item>
     </el-form>
     <template v-if="payment.paymentPattern == 0">
-      <el-collapse :value="collapse" @change="collapseChange" >
+      <el-collapse :value="collapse" @change="collapseChange">
         <el-collapse-item
           v-for="(item, index) in cycles"
           :key="index"
@@ -116,8 +147,12 @@
         >
           <template slot="title">
             <div class="collapse-title">
-              <span>缴费周期 {{index + 1}}</span>
-              <i v-if="cycles.length > 1" class="el-icon-circle-close" @click.stop="removeCycle(index)"></i>
+              <span>缴费周期 {{ index + 1 }}</span>
+              <i
+                v-if="cycles.length > 1"
+                class="el-icon-circle-close"
+                @click.stop="removeCycle(index)"
+              ></i>
             </div>
           </template>
           <paymentCycle
@@ -135,9 +170,10 @@
         plain
         type="info"
         size="small"
-        style="width: 100%;margin: 20px 0;"
+        style="width: 100%; margin: 20px 0"
         @click="addCycle"
-      >新增缴费周期</el-button>
+        >新增缴费周期</el-button
+      >
     </template>
     <paymentCycle
       v-else
@@ -147,47 +183,60 @@
       :form.sync="cycle"
       :isCommon="false"
       :isDisabled="true"
+      :courseViewType="courseViewType"
     />
-    <el-alert title="其它"
-              :closable="false"
-              class="alert"
-              type="info">
+
+    <el-alert title="其它" :closable="false" class="alert" type="info">
     </el-alert>
-    <otherform :form="other"
-               ref="other" />
+    <otherform :form="other" ref="other" />
     <div slot="footer" class="dialog-footer">
-      <el-button @click="$listeners.close">取 消</el-button>
-      <el-button type="primary" @click="submit">确认</el-button>
+      <p>缴费总金额:{{ money || 0 }}元</p>
+      <div>
+        <el-button @click="$listeners.close">取 消</el-button>
+        <el-button type="primary" @click="submit">确认</el-button>
+      </div>
     </div>
   </div>
 </template>
 <script>
-import numeral from 'numeral'
+import numeral from "numeral";
 import paymentCycle from "../../../resetTeaming/modals/payment-cycle";
 import otherform from "../../../resetTeaming/modals/other";
 import extraClass from "../../../resetTeaming/modals/extra-class";
-import { musicGroupPaymentCalenderAdd } from '../../../resetTeaming/api'
-import { queryRemainCourseTypeDuration } from '../../api'
-import { courseType } from '@/constant'
+import { musicGroupPaymentCalenderAdd } from "../../../resetTeaming/api";
+import { queryRemainCourseTypeDuration } from "../../api";
+import { courseType } from "@/constant";
 import { getTimes, objectToOptions } from "@/utils";
-import { paymentPatternType } from '@/constant'
+import { paymentPatternType } from "@/constant";
+import memberSetting from "../../../resetTeaming/modals/member-setting";
 export default {
-  props: ["snapList", "highList", "mixList", "signList", 'highonlineList','createdUserId', 'organizationCourseUnitPriceSettings', 'musicGroupId', 'baseInfo'],
+  props: [
+    "snapList",
+    "highList",
+    "mixList",
+    "signList",
+    "highonlineList",
+    "createdUserId",
+    "organizationCourseUnitPriceSettings",
+    "musicGroupId",
+    "baseInfo",
+  ],
   components: {
     paymentCycle,
     otherform,
-    extraClass
+    extraClass,
+    memberSetting,
   },
   data() {
     return {
       courseTypeOptions: courseType,
-      ids: '',
+      ids: "",
       form: {
-        signClass: '',
-        mixClass: '',
-        highClass: '',
-        snapClass: '',
-        highonline:''
+        signClass: "",
+        mixClass: "",
+        highClass: "",
+        snapClass: "",
+        highonline: "",
       },
       payment: {
         paymentPattern: null,
@@ -199,79 +248,109 @@ export default {
       cycles: [{}],
       organizationCourseUnitPriceSettingsByType: {},
       paymentPatternTypeOptions: objectToOptions(paymentPatternType),
-    }
+      isUserType: true,
+      memberForm: {
+        memberRankSettingId: "",
+        memberValidDate: 6,
+        memberPaymentAmount: "",
+        originalMemberPaymentAmount: "",
+        paymentDate: [],
+      },
+      money: "",
+      courseViewType: "",
+    };
   },
   watch: {
-    'form.signClass'() {
-      this.classChange()
+    "form.signClass"() {
+      this.classChange();
     },
-    'form.mixClass'() {
-      this.classChange()
+    "form.mixClass"() {
+      this.classChange();
     },
-    'form.highClass'() {
-      this.classChange()
+    "form.highClass"() {
+      this.classChange();
     },
-    'form.snapClass'() {
-      this.classChange()
+    "form.snapClass"() {
+      this.classChange();
     },
-    'form.highonline'(){
-      this.classChange()
+    "form.highonline"() {
+      this.classChange();
     },
-    'payment.paymentPattern'() {
-      this.syncAllMoney()
+    "payment.paymentPattern"() {
+      this.syncAllMoney();
+    },
+    "memberForm.memberPaymentAmount"() {
+      this.syncAllMoney();
+    },
+    baseInfo(val) {
+      this.formatCourse();
+      this.courseViewType = val.courseViewType;
+      if (val.courseViewType == 1) {
+        this.payment.paymentPattern = "1";
+      }
     },
-    baseInfo() {
-      this.formatCourse()
-    }
   },
   mounted() {
-    this.formatCourse()
+    this.courseViewType = this.baseInfo.courseViewType;
+    if (this.baseInfo.courseViewType == 1) {
+      this.payment.paymentPattern = "1";
+    }
+    this.formatCourse();
   },
   methods: {
     addExtraClass() {
       this.eclass.push({});
     },
-    priceChange (item, index) {
-      const _ = [...this.eclass]
-      const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
-      const price = Math.round(numeral(item.courseTotalMinuties || 1).multiply(active.unitPrice || 1).value())
-      item.courseCurrentPrice = price
-      item.courseOriginalPrice = price
-      _[index] = item
-      this.eclass = [..._]
-      this.syncAllMoney()
+    priceChange(item, index) {
+      const _ = [...this.eclass];
+      const active =
+        this.organizationCourseUnitPriceSettingsByType[item.courseType] || {};
+      const price = Math.round(
+        numeral(item.courseTotalMinuties || 1)
+          .multiply(active.unitPrice || 1)
+          .value()
+      );
+      item.courseCurrentPrice = price;
+      item.courseOriginalPrice = price;
+      _[index] = item;
+      this.eclass = [..._];
+      this.syncAllMoney();
     },
     syncAllMoney() {
       let money = 0;
-      let first = 0
-      let other = 0
+      let first = 0;
+      let other = 0;
+      console.log(this.eclass);
       for (const item of this.eclass) {
         money += item.courseCurrentPrice;
         if (this.cycles && this.cycles.length) {
           if (item.isStudentOptional) {
-            first += item.courseCurrentPrice
+            first += item.courseCurrentPrice;
           } else {
-            const floorMoney = Math.floor(item.courseCurrentPrice / this.cycles.length)
-            const remainder = item.courseCurrentPrice % this.cycles.length
-            first += floorMoney + remainder
-            other += floorMoney
+            const floorMoney = Math.floor(
+              item.courseCurrentPrice / this.cycles.length
+            );
+            const remainder = item.courseCurrentPrice % this.cycles.length;
+            first += floorMoney + remainder;
+            other += floorMoney;
           }
         }
       }
       if (this.cycles.length) {
-        const floorMoney = Math.floor(money / this.cycles.length)
-        const remainder = money % this.cycles.length
+        const floorMoney = Math.floor(money / this.cycles.length);
+        const remainder = money % this.cycles.length;
         this.cycles = this.cycles.map((item, index) => {
           return {
             ...item,
-            paymentAmount: (index === 0 ? first : other)
-          }
-        })
+            paymentAmount: index === 0 ? first : other,
+          };
+        });
       }
       if (this.$refs.cycle) {
-        this.$set(this.cycle, 'paymentAmount', money)
+        this.$set(this.cycle, "paymentAmount", money);
       }
-
+      money += parseFloat(this.memberForm.memberPaymentAmount);
+      this.money = money;
       return money;
     },
     removeExtraClass(index) {
@@ -279,66 +358,91 @@ export default {
       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)
+      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
+        _[item.courseType] = item;
       }
-      this.organizationCourseUnitPriceSettingsByType = _
-      return _
+      this.organizationCourseUnitPriceSettingsByType = _;
+      return _;
     },
     getAllIds() {
-      return [this.form.signClass, this.form.mixClass, this.form.highClass, this.form.highonline,...this.form.snapClass].filter(item => !!item)
+      return [
+        this.form.signClass,
+        this.form.mixClass,
+        this.form.highClass,
+        this.form.highonline,
+        ...this.form.snapClass,
+      ].filter((item) => !!item);
     },
     async classChange() {
       try {
-        const ids = this.getAllIds().join(',')
+        const ids = this.getAllIds().join(",");
         if (ids) {
           const res = await queryRemainCourseTypeDuration({
-            classGroupIdList: ids
-          })
-          this.ids = ids
-          const _ = res.data.map(item => {
-            const active = this.organizationCourseUnitPriceSettingsByType[item.courseType] || {}
-            const money = Math.round(numeral(active.unitPrice || 1).multiply(item.remainMinutes || 1).value())
+            classGroupIdList: ids,
+          });
+          this.ids = ids;
+          const _ = res.data.map((item) => {
+            const active =
+              this.organizationCourseUnitPriceSettingsByType[item.courseType] ||
+              {};
+            const money = Math.round(
+              numeral(active.unitPrice || 1)
+                .multiply(item.remainMinutes || 1)
+                .value()
+            );
             return {
               courseType: item.courseType,
               courseTotalMinuties: item.remainMinutes,
               courseOriginalPrice: money,
               courseCurrentPrice: money,
-            }
-          })
-          this.eclass = [..._]
-          this.syncAllMoney()
+            };
+          });
+          this.eclass = [..._];
+          this.syncAllMoney();
         }
       } catch (error) {
-        console.log(error)
+        console.log(error);
       }
     },
     getForms() {
       const { $refs: refs } = this;
-      return [refs.eclass, refs.cycle, refs.payment, refs.other, ...(refs.cycles || [])]
+      return [
+        refs.eclass,
+        refs.cycle,
+        refs.payment,
+        refs.other,
+        ...(refs.cycles || []),
+      ]
         .filter((item) => !!item)
         .map((item) => item.$refs.form || item);
     },
-    addCycle () {
+    addCycle() {
       this.cycles.push({});
       this.collapse.push(this.cycles.length);
-      this.syncAllMoney()
+      this.syncAllMoney();
     },
-    removeCycle (index) {
+    removeCycle(index) {
       this.cycles[index] = null;
       this.cycles = this.cycles.filter((item) => !!item);
       if (this.collapse.includes(index)) {
         this.collapse.splice(index, 1);
-        this.collapse = this.collapse.map((item, _index) => _index - 1 >= index ? item -- : item)
+        this.collapse = this.collapse.map((item, _index) =>
+          _index - 1 >= index ? item-- : item
+        );
       }
-      this.syncAllMoney()
+      this.syncAllMoney();
     },
-    collapseChange (val) {
+    collapseChange(val) {
       this.collapse = val;
     },
     async submit() {
@@ -352,51 +456,66 @@ export default {
         });
       }
       if (!this.getAllIds().length) {
-        this.$message.error('请至少选择一个班级')
-        return
+        this.$message.error("请至少选择一个班级");
+        return;
       }
       if (forms.length === valided.length) {
-        const cyclelist = this.payment.paymentPattern == 0 ? this.cycles : [this.cycle]
+        const cyclelist =
+          this.payment.paymentPattern == 0 ? this.cycles : [this.cycle];
         const data = {
           attribute1: this.ids,
-          musicGroupPaymentDateRangeList: cyclelist.map(item => {
-            const { paymentDate, paymentValid, ...other } = item
+                ...this.memberForm,
+          musicGroupPaymentDateRangeList: cyclelist.map((item) => {
+            const { paymentDate, paymentValid, ...other } = item;
             return {
+
               ...other,
-              ...getTimes(paymentDate, ["startPaymentDate", "deadlinePaymentDate"]),
+              ...getTimes(paymentDate, [
+                "startPaymentDate",
+                "deadlinePaymentDate",
+              ]),
               ...getTimes(paymentValid, [
                 "paymentValidStartDate",
                 "paymentValidEndDate",
               ]),
               paymentPattern: this.payment.paymentPattern,
-            }
+            };
           }),
           paymentPattern: this.payment.paymentPattern,
           musicGroupId: this.musicGroupId,
-          paymentType: 'ADD_STUDENT',
-          payUserType: 'STUDENT',
+          paymentType: "ADD_STUDENT",
+          payUserType: "STUDENT",
           studentIds: this.createdUserId,
           musicGroupPaymentCalenderCourseSettingsList: this.eclass,
           ...this.other,
-        }
+        };
         try {
-          await musicGroupPaymentCalenderAdd(data)
-          this.$message.success('提交成功')
-          this.$listeners.submited()
-          this.$listeners.close()
+          await musicGroupPaymentCalenderAdd(data);
+          this.$message.success("提交成功");
+          this.$listeners.submited();
+          this.$listeners.close();
         } catch (error) {
-          console.log(error)
+          console.log(error);
         }
       }
-    }
+    },
   },
 };
 </script>
 <style lang="less" scoped>
 .dialog-footer {
   margin-top: 20px;
-  display: block;
-  text-align: right;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  // text-align: right;
+  p {
+    font-size: 16px;
+    margin-right: 20px;
+    color: red;
+    margin-left: 40px;
+  }
 }
 .alert {
   margin-bottom: 10px;

+ 64 - 10
src/views/teamDetail/components/modals/member-class-setting.vue

@@ -21,6 +21,13 @@
           @click="changeTag(key)"
           >{{ courseTypeListByName[key] }}</el-tag
         >
+        <el-button
+          type="text"
+          @click="studentListModalVisible = true"
+          :disabled="detail.id ? false : true"
+          class="studentTitle"
+          >学员列表>></el-button
+        >
       </el-form-item>
       <empty v-if="isEmpty" desc="暂无可排课时长" />
       <p class="title">
@@ -78,22 +85,31 @@
         >确定</el-button
       >
     </div>
+    <el-dialog
+      title="学员列表"
+      width="700px"
+      :visible.sync="studentListModalVisible"
+      append-to-body
+      destroy-on-close
+    >
+      <viewStudentList
+        :list="studentList"
+        v-if="studentListModalVisible"
+        :showOk="true"
+        :isChiose="false"
+        @close="studentListModalVisible = false"
+      />
+    </el-dialog>
   </div>
 </template>
 <script>
 import courseItem from "./classroom-setting-item";
 import MusicStore from "@/views/resetTeaming/store"; // 乐团的基本信息
 import { isEmpty } from "lodash";
-import {
-  getMusicCourseSettingsWithStudents,
-  classGroupUpdate,
-  revisionClassGroup,
-  revisionAddClassGroup,
-  findClassCourseMinute,
-  mergeClassSplitClassAffirm,
-  preCourseSchedule,
-} from "@/api/buildTeam";
+import { preCourseSchedule } from "@/api/buildTeam";
+import { getClassAllStudent } from "@/api/studentManager";
 import { queryByOrganIdAndCourseType } from "@/views/resetTeaming/api";
+import viewStudentList from "@/views/teamDetail/componentClass/student-list";
 const formatClassGroupTeacherMapperList = (core, ass) => {
   const list = [];
   if (core) {
@@ -107,7 +123,7 @@ const formatClassGroupTeacherMapperList = (core, ass) => {
   return list;
 };
 export default {
-  components: { courseItem },
+  components: { courseItem, viewStudentList },
   props: [
     "activeType",
     "courseTypeList",
@@ -140,6 +156,8 @@ export default {
       previewVisible: false,
       previewList: [],
       holidays: [],
+      studentListModalVisible: false,
+      studentList: [],
     };
   },
   async mounted() {
@@ -153,6 +171,22 @@ export default {
       });
       this.prices = res.data;
     } catch (error) {}
+    // console.log('courseTypeList',this.courseTypeList)
+    // 获取班级的学生列表
+    getClassAllStudent({ classGroupId: this.detail.id }).then((res) => {
+      if (res.code == 200) {
+        this.studentList = res.data.map((item) => {
+          return {
+            userId: item.userId,
+            nickName: item.name,
+            gender: item.gender,
+            phone: item.parentsPhone,
+            subjectNames: item.subjectName,
+          };
+        });
+        console.log(this.studentList);
+      }
+    });
     this.setCourseTypeListByName(); // 获取课程名称和枚举的键值对
     this.formatClasss(); // 初始化班级
     this.FetchHoliday(); // 设置节假日
@@ -233,6 +267,7 @@ export default {
             if (this.form.classs.hasOwnProperty(key)) {
               const item = this.form.classs[key];
               const data = {
+                confirmGenerate: true,
                 type: this.detail ? undefined : this.activeType,
                 courseType: key,
                 classGroupName:
@@ -259,6 +294,7 @@ export default {
                   endDate: _.endDate,
                   holiday: _.holiday,
                   expectCourseNum: _.expectCourseNum,
+                  expectCourseMinutes: _.time,
                 })),
                 musicGroupSchoolTermCourseDetailId:
                   this.musicGroupSchoolTermCourseDetailId,
@@ -269,6 +305,23 @@ export default {
           }
           try {
             const res = await preCourseSchedule(list);
+            if (res.code == 207) {
+              await this.$confirm(
+                res.msg || `当前课程课酬预计为0,是否继续`,
+                "提示",
+                {
+                  type: "warning",
+                }
+              );
+              // obj.allowZeroSalary = true;
+              list.forEach((item) => {
+                item.allowZeroSalary = true;
+              });
+              await preCourseSchedule(list);
+              this.$listeners.submited();
+              this.$listeners.close();
+              return;
+            }
             this.$message.success("排课成功");
             this.$listeners.submited();
             this.$listeners.close();
@@ -315,6 +368,7 @@ export default {
   watch: {
     watch: {
       courseTypeList() {
+        console.log("改变");
         this.setCourseTypeListByName();
       },
       detail() {

+ 1 - 1
src/views/teamDetail/components/resetClass.vue

@@ -38,7 +38,7 @@
         <div
           class="newBand"
           style="width: 120px"
-          v-permission="'courseSchedule/coursePostpone'"
+          v-permission="'/memberClassList'"
           v-if="courseViewType == 1"
           @click="gotoMemberCourse"
         >

+ 1 - 1
src/views/teamDetail/components/studentList.vue

@@ -722,7 +722,7 @@
     <el-dialog
       title="选择班级"
       destroy-on-close
-      width="700px"
+      width="830px"
       :visible.sync="createUserPayVisible"
     >
       <createUserPay

+ 2 - 2
vue.config.js

@@ -17,9 +17,9 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // //  https://online.dayaedu.com
 // let target = 'https://online.dayaedu.com' //线上
 // let target = 'http://192.168.3.139:8000' // 箭河
-// let target = 'http://192.168.3.148:8000' //邹璇
+let target = 'http://192.168.3.148:8000' //邹璇
 // let target = 'http://192.168.3.57:8000' //勇哥
-let target = 'http://dev.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/