Browse Source

01/08 合班提测

1
mo 4 years ago
parent
commit
f477b96c5b

+ 27 - 52
src/views/teamDetail/componentClass/calenderStudentList.vue

@@ -1,22 +1,5 @@
 <template>
   <div>
-    <!-- <el-collapse v-model="activeNames">
-      <el-collapse-item
-        :name="index"
-        v-for="(key, index) in mergeInfo"
-        :key="index"
-      >
-        <template #title>
-          <div class="header">
-            <span>
-              <span>班级:{{ getCLassName(index) }}</span>
-            </span>
-          </div>
-        </template>
-
-        <studentPayItem  :mergeInfo='mergeInfo' :index='index' :classList="classList" :classGroupStudents='classGroupStudents'/>
-      </el-collapse-item>
-    </el-collapse> -->
     <paymentCycle
       ref="cycle"
       :form="cycle"
@@ -69,11 +52,10 @@
   </div>
 </template>
 <script>
-import studentPayItem from "./studentPayItem";
 import paymentCycle from "@/views/resetTeaming/modals/payment-cycle";
 import otherform from "@/views/resetTeaming/modals/other";
 import { getTimes } from "@/utils";
-import { spanGroupMergeClassSplitClassAffirm } from '@/api/buildTeam'
+import { spanGroupMergeClassSplitClassAffirm } from "@/api/buildTeam";
 export default {
   props: [
     "studentIds",
@@ -83,7 +65,6 @@ export default {
     "mergeInfo",
   ],
   components: {
-    studentPayItem,
     paymentCycle,
     otherform,
   },
@@ -118,40 +99,34 @@ export default {
       });
       return str;
     },
-   async submit() {
-      console.log("提交");
-      //   this.$refs.form.validate((res) => {
-      //     if (res) {
-      //       let obj = {};
-      //       obj.musicGroupPaymentCalenderDtos.musicGroupPaymentCalenderStudentDetails = this.mergeInfo;
-      //       obj.musicGroupPaymentCalenderDtos.masterClassGroupId = this.masterClassGroupId;
-      //       obj.musicGroupPaymentCalenderDtos.memo = this.form.memo;
-      //       console.log(this.classList)
-      //       return
-      //       obj.classGroupIds = this.classList.map((classes) => {
-      //         return classes.id;
-      //       });
-      //       obj.studentIds = this.studentIds;
-      //     }
-      //   });
-      //   console.log(this.mergeInfo);
+    async submit() {
+      let obj = {};
+      let some = this.getData()
+      if(some){
+        obj.musicGroupPaymentCalenderDtos = [some];
 
-      let obj = {}
-      obj.musicGroupPaymentCalenderDtos = [this.getData()]
+      }else{
+        return
+      }
 
       obj.classGroupIds = this.classList.map((classes) => {
-
-              return classes.id;
-            });
-      obj.masterClassGroupId = this.masterClassGroupId
-      obj.classGroupStudents = this.classGroupStudents
-            console.log(obj)
-            try{
-              const reset = await spanGroupMergeClassSplitClassAffirm(obj)
-              console.log(reset)
-            }catch(e){
-              console.log(e)
-            }
+        return classes.id;
+      });
+      obj.masterClassGroupId = this.masterClassGroupId;
+      obj.classGroupStudents = this.classGroupStudents;
+      obj.studentIds = this.studentIds
+      // console.log(obj);
+      try {
+        const reset = await spanGroupMergeClassSplitClassAffirm(obj);
+        this.$message.success("合并成功");
+        // 1.关闭弹窗
+        // 2.清空合并班
+        // 3.刷新列表
+        this.$emit('refresh')
+        console.log(reset);
+      } catch (e) {
+        console.log(e);
+      }
     },
     getForms() {
       const { $refs: refs } = this;
@@ -186,7 +161,7 @@ export default {
           rest.paymentPattern = paymentPattern;
           rest.payUserType = "STUDENT";
           rest.paymentType = "SPAN_GROUP_CLASS_ADJUST";
-          rest.musicGroupPaymentCalenderStudentDetails = this.mergeInfoList
+          rest.musicGroupPaymentCalenderStudentDetails = this.mergeInfoList;
           rest.musicGroupPaymentDateRangeList = [
             {
               ...other,

+ 9 - 1
src/views/teamDetail/componentClass/classCompound.vue

@@ -122,6 +122,7 @@
         :masterClassGroupId="masterClassGroupId"
         :classGroupStudents="classGroupStudents"
         :mergeInfo="mergeInfo"
+        @refresh='refresh'
       />
       <span slot="footer" class="dialog-footer">
         <el-button @click="calenderStudentVisible = false">取 消</el-button>
@@ -168,6 +169,7 @@ export default {
     },
     clearCom() {
       this.$emit("clearCom");
+
     },
     async submitClass() {
       if (!this.radio) {
@@ -227,7 +229,13 @@ export default {
 
       // 试着请求
     },
-    getList() {},
+    getList() {
+       this.$emit("getList");
+    },
+    refresh(){
+      this.clearCom()
+      this.getList()
+    },
     closeReset() {
       this.clearCom();
       this.show = false;

+ 0 - 155
src/views/teamDetail/componentClass/studentPayItem.vue

@@ -1,155 +0,0 @@
-
-<template>
-  <div>
-    <!--  v-if="Object.keys(payItem).length > 0" -->
-    <paymentCycle
-      ref="cycle"
-      :form="cycle"
-      :isUserType="true"
-      :isCommon="true"
-      :isDisabled="true"
-      :hideMoney="true"
-    />
-    <!--  v-if="Object.keys(payItem).length > 0" -->
-    <otherform :form="other" ref="other" />
-    <el-table
-      :data="mergeInfo[index]"
-      :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
-      max-height="300px"
-      height="300px"
-    >
-      <el-table-column
-        prop="userId"
-        align="center"
-        width="120"
-        label="学员编号"
-      ></el-table-column>
-      <el-table-column
-        prop="username"
-        align="center"
-        width="120"
-        label="学员姓名"
-      ></el-table-column>
-      <el-table-column prop="phone" align="center" width="120" label="课程类型">
-        <template slot-scope="scope">
-          <div>
-            {{ scope.row.courseType | coursesType }}
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column prop="subjectNames" align="center" label="原价">
-        <template slot-scope="scope">
-          <div>
-            <el-input v-model="scope.row.courseOriginalPrice"></el-input>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column align="center" label="现价">
-        <template slot-scope="scope">
-          <div>
-            <el-input v-model="scope.row.courseCurrentPrice"></el-input>
-          </div>
-        </template>
-      </el-table-column>
-    </el-table>
-  </div>
-</template>
-<script>
-import paymentCycle from "@/views/resetTeaming/modals/payment-cycle";
-import otherform from "@/views/resetTeaming/modals/other";
-import { getTimes } from "@/utils";
-export default {
-  components: { paymentCycle, otherform },
-  props: ["mergeInfo", "index","classList",'classGroupStudents'],
-  data() {
-    return {
-      payItem: {},
-      cycle: {
-        paymentAmount: null,
-        paymentPattern: null,
-      },
-      other: {},
-      musicGroupId:''
-    };
-  },
-  mounted() {
-    console.log(this.classList)
-     this.classList.forEach((classes) => {
-        if (classes.id == this.index) {
-          this.musicGroupId = classes.musicGroupId
-          console.log(this.musicGroupId)
-        }
-      });
-  },
-  methods: {
-    getForms() {
-      const { $refs: refs } = this;
-      // [refs.base, refs.eclass, refs.cycle, ...(refs.cycles || []), refs.other, refs.payment]
-      return [refs.cycle, refs.other]
-        .filter((item) => !!item)
-        .map((item) => item.$refs.form || item);
-    },
-    getData() {
-      const forms = this.getForms();
-      const valided = [];
-      for (const form of forms) {
-        form.validate((valid) => {
-          if (valid) {
-            valided.push(form);
-          }
-        });
-      }
-      // if (this.eclass.length < 1) {
-      //   return this.$message.error("请至少选择一条加课信息");
-      // }
-      console.log(valided.length, forms.length);
-      if (valided.length === forms.length) {
-          const { leixing, ...rest } = {
-            ...this.form,
-            ...this.other,
-            musicGroupPaymentCalenderCourseSettingsList: this.corusePayList,
-          };
-
-          if (this.$refs.cycle) {
-            const {
-              paymentDate,
-              paymentValid,
-              paymentPattern,
-              ...other
-            } = this.cycle;
-            rest.paymentPattern = paymentPattern;
-            rest.payUserType = "STUDENT";
-            rest.paymentType = "SPAN_GROUP_CLASS_ADJUST";
-            rest.musicGroupPaymentCalenderStudentDetails =this.mergeInfo[this.index]
-            rest.studentIds = classGroupStudents[this.index]
-            rest.musicGroupPaymentDateRangeList = [
-              {
-                ...other,
-                ...getTimes(paymentDate, [
-                  "startPaymentDate",
-                  "deadlinePaymentDate",
-                ]),
-                ...getTimes(paymentValid, [
-                  "paymentValidStartDate",
-                  "paymentValidEndDate",
-                ]),
-              },
-            ];
-          }
-          const data = {
-            ...rest,
-            musicGroupId: this.musicGroupId,
-          };
-          return data;
-
-        // 说明验证通过
-      } else {
-        this.$message.error("请填写必要信息");
-        return "error";
-      }
-    },
-  },
-};
-</script>
-<style lang="scss" scoped>
-</style>