Browse Source

11104 14:55

缴费修改测试
Xiao_Mo 4 years ago
parent
commit
29afa77cc6

+ 7 - 0
src/views/resetTeaming/api.js

@@ -32,3 +32,10 @@ export const musicGroupPaymentCalenderDetailBatchAdd = data => request2({
   data: data,
   data: data,
   method: 'post',
   method: 'post',
 })
 })
+
+// musicGroupPaymentCalender/update
+export const musicGroupPaymentCalenderDetailBatchUpdate = data => request2({
+  url: '/api-web/musicGroupPaymentCalender/update',
+  data: data,
+  method: 'post',
+})

+ 2 - 1
src/views/resetTeaming/components/resetPayList.vue

@@ -324,7 +324,6 @@
       :title="payFormTitle"
       :title="payFormTitle"
       :visible.sync="userVisible"
       :visible.sync="userVisible"
       width="800px"
       width="800px"
-      destroy-on-close
     >
     >
       <userPayForm
       <userPayForm
         @close="userVisible = false"
         @close="userVisible = false"
@@ -438,7 +437,9 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   //生命周期 - 挂载完成(可以访问DOM元素)
   async mounted() {
   async mounted() {
     // 获取分部
     // 获取分部
+
     this.init();
     this.init();
+    console.log(this.baseInfo)
   },
   },
   computed: {
   computed: {
     payOrderTypeList() {
     payOrderTypeList() {

+ 5 - 3
src/views/resetTeaming/index.vue

@@ -2,7 +2,7 @@
   <div class="m-container">
   <div class="m-container">
     <h2>
     <h2>
       <el-page-header @back="onCancel"
       <el-page-header @back="onCancel"
-                      content="乐团修改"></el-page-header>
+                      :content="teamName"></el-page-header>
 
 
     </h2>
     </h2>
     <div class="m-core">
     <div class="m-core">
@@ -14,7 +14,7 @@
                      v-if="permission('/resetTeaming/teamBaseInfo')"
                      v-if="permission('/resetTeaming/teamBaseInfo')"
                      name="1">
                      name="1">
           <teamBaseInfo v-if="activeIndex == 1"
           <teamBaseInfo v-if="activeIndex == 1"
-                        @getBaseInfo="getBaseInfo"
+                        @getBaseInfo="getBaseInfo" 
                         :baseInfo="baseInfo"
                         :baseInfo="baseInfo"
                         @getName='getName' />
                         @getName='getName' />
         </el-tab-pane>
         </el-tab-pane>
@@ -81,7 +81,8 @@ export default {
       // }
       // }
       Fsearch: null,
       Fsearch: null,
       Frules: null,
       Frules: null,
-      name: null
+      name: null,
+      teamName:'乐团修改'
     }
     }
   },
   },
   created () {
   created () {
@@ -119,6 +120,7 @@ export default {
     },
     },
     getBaseInfo(baseInfo) {
     getBaseInfo(baseInfo) {
       this.baseInfo = baseInfo
       this.baseInfo = baseInfo
+      this.teamName = baseInfo.musicGroup.name
     },
     },
     handleClick (val) {
     handleClick (val) {
       this.activeIndex = val.name
       this.activeIndex = val.name

+ 171 - 147
src/views/resetTeaming/modals/user-pay-form.vue

@@ -1,10 +1,6 @@
 <template>
 <template>
   <div>
   <div>
-    <el-alert
-      title="课程信息设置"
-      :closable="false"
-      class="alert"
-      type="info">
+    <el-alert title="课程信息设置" :closable="false" class="alert" type="info">
     </el-alert>
     </el-alert>
     <userBaseinfo
     <userBaseinfo
       :form.sync="form"
       :form.sync="form"
@@ -21,7 +17,8 @@
         title="加课信息设置"
         title="加课信息设置"
         :closable="false"
         :closable="false"
         class="alert"
         class="alert"
-        type="info">
+        type="info"
+      >
       </el-alert>
       </el-alert>
       <extraClass
       <extraClass
         :form="eclass"
         :form="eclass"
@@ -43,11 +40,7 @@
       :isDisabled="form.leixing === '1' || paymentType == '0'"
       :isDisabled="form.leixing === '1' || paymentType == '0'"
     />
     />
     <template>
     <template>
-      <el-alert
-        title="缴费设置"
-        :closable="false"
-        class="alert"
-        type="info">
+      <el-alert title="缴费设置" :closable="false" class="alert" type="info">
       </el-alert>
       </el-alert>
       <paymentCycle
       <paymentCycle
         ref="cycle"
         ref="cycle"
@@ -57,22 +50,12 @@
         :isDisabled="form.leixing === '1' || paymentType == '0'"
         :isDisabled="form.leixing === '1' || paymentType == '0'"
       />
       />
     </template>
     </template>
-    <el-alert
-      title="其它"
-      :closable="false"
-      class="alert"
-      type="info">
+    <el-alert title="其它" :closable="false" class="alert" type="info">
     </el-alert>
     </el-alert>
-    <otherform
-      :form="other"
-      ref="other"
-    />
+    <otherform :form="other" ref="other" />
     <div slot="footer" class="dialog-footer">
     <div slot="footer" class="dialog-footer">
       <el-button @click="$listeners.close">取 消</el-button>
       <el-button @click="$listeners.close">取 消</el-button>
-      <el-button
-        type="primary"
-        @click="submit"
-        >下一步</el-button>
+      <el-button type="primary" @click="submit">下一步</el-button>
     </div>
     </div>
     <el-dialog
     <el-dialog
       :title="nextTitle"
       :title="nextTitle"
@@ -80,46 +63,49 @@
       width="600px"
       width="600px"
       append-to-body
       append-to-body
     >
     >
-      <classrooms
-        @close="closeNext"
-      />
+      <classrooms @close="closeNext" />
     </el-dialog>
     </el-dialog>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { chargeTypeList, musicGroupOrganizationCourseSettingsQueryPage } from '@/api/specialSetting'
-import { musicGroupPaymentCalenderAdd } from '../api'
-import { getTimes } from '@/utils'
-import userBaseinfo from './user-baseinfo'
-import paymentCycle from './payment-cycle'
-import extraClass from './extra-class'
-import classrooms from './classrooms'
-import otherform from './other'
+import {
+  chargeTypeList,
+  musicGroupOrganizationCourseSettingsQueryPage,
+} from "@/api/specialSetting";
+import {
+  musicGroupPaymentCalenderAdd,
+  musicGroupPaymentCalenderDetailBatchUpdate,
+} from "../api";
+import { getTimes } from "@/utils";
+import userBaseinfo from "./user-baseinfo";
+import paymentCycle from "./payment-cycle";
+import extraClass from "./extra-class";
+import classrooms from "./classrooms";
+import otherform from "./other";
 
 
 const paymentTypeFormat = {
 const paymentTypeFormat = {
-  0: 'MUSIC_APPLY',
-  1: 'MUSIC_RENEW',
-  2: 'ADD_COURSE',
-  3: 'ADD_STUDENT',
-}
+  0: "MUSIC_APPLY",
+  1: "MUSIC_RENEW",
+  2: "ADD_COURSE",
+  3: "ADD_STUDENT",
+};
 
 
 export default {
 export default {
-  props: ['type', 'musicGroupId', 'baseInfo', 'paymentType','rowDetail'],
+  props: ["type", "musicGroupId", "baseInfo", "paymentType", "rowDetail"],
   components: {
   components: {
     userBaseinfo,
     userBaseinfo,
     paymentCycle,
     paymentCycle,
     extraClass,
     extraClass,
     classrooms,
     classrooms,
-    otherform
-   
+    otherform,
   },
   },
   data() {
   data() {
     return {
     return {
       options: [],
       options: [],
       form: {
       form: {
-        payUserType: this.type === 'user' ? 'STUDENT' : 'SCHOOL',
-        leixing: '1',
-        musicGroupOrganizationCourseSettingId:null
+        payUserType: this.type === "user" ? "STUDENT" : "SCHOOL",
+        leixing: "1",
+        musicGroupOrganizationCourseSettingId: null,
       },
       },
       other: {},
       other: {},
       cycles: [{}],
       cycles: [{}],
@@ -129,176 +115,214 @@ export default {
       nextVisible: false,
       nextVisible: false,
       typeList: [],
       typeList: [],
       charges: [],
       charges: [],
-    }
-  },
-  mounted(){
-    this.init()
-  },
-  activated(){
-    this.init()
-  },
-  methods:{
-      init(){
-        if(this.rowDetail){
-          this.form.musicGroupOrganizationCourseSettingId = this.rowDetail.musicGroupOrganizationCourseSettingId
-          console.log(this.form.musicGroupOrganizationCourseSettingId)
-        }
-      },
+    };
   },
   },
   computed: {
   computed: {
     isCommon() {
     isCommon() {
-      return this.form.leixing === '1'
+      return this.form.leixing === "1";
     },
     },
     isDisabled() {
     isDisabled() {
-      console.log(this.form.leixing === '1' || String(this.paymentType) === '0')
-      return this.form.leixing === '1' || String(this.paymentType) === '0'
+      return this.form.leixing === "1" || String(this.paymentType) === "0";
     },
     },
     isUserType() {
     isUserType() {
-      return this.type === 'user'
+      return this.type === "user";
     },
     },
     nextTitle() {
     nextTitle() {
-      return this.isCommon ? '乐团课程-班级选择' : '临时加课-班级选择'
+      return this.isCommon ? "乐团课程-班级选择" : "临时加课-班级选择";
     },
     },
     chargesById() {
     chargesById() {
-      const data = {}
+      const data = {};
       for (const item of this.charges) {
       for (const item of this.charges) {
-        data[item.id] = item
+        data[item.id] = item;
       }
       }
-      return data
+      return data;
     },
     },
   },
   },
   watch: {
   watch: {
     type() {
     type() {
-      this.$set(this.form, 'payUserType', this.type === 'user' ? 'STUDENT' : 'SCHOOL')
+      this.$set(
+        this.form,
+        "payUserType",
+        this.type === "user" ? "STUDENT" : "SCHOOL"
+      );
     },
     },
-    baseInfo() {
-      this.getCharges()
+    baseInfo(val) {
+      this.getCharges();
     },
     },
-    'form.leixing'() {
-      this.cycles = [{}]
-      this.collapse = [0]
-      this.cycle = {}
-      this.cycle.paymentAmount = ''
-      if (this.form.leixing === '1') {
-        this.eclass = []
-      } else if (this.form.leixing === '2') {
-        this.eclass = [{}]
-        this.$set(this.form, 'musicGroupOrganizationCourseSettingId', '')
+    "form.leixing"() {
+      this.cycles = [{}];
+      this.collapse = [0];
+      this.cycle = {};
+      this.cycle.paymentAmount = "";
+      if (this.form.leixing === "1") {
+        this.eclass = [];
+      } else if (this.form.leixing === "2") {
+        this.eclass = [{}];
+        this.$set(this.form, "musicGroupOrganizationCourseSettingId", "");
       }
       }
     },
     },
-    'form.musicGroupOrganizationCourseSettingId'() {
-      const eclas = this.chargesById[this.form.musicGroupOrganizationCourseSettingId]
-      this.eclass = eclas?.details || []
-      this.syncAllMoney()
-    }
+    "form.musicGroupOrganizationCourseSettingId"(val) {
+      this.getCharges();
+    },
   },
   },
   mounted() {
   mounted() {
-    this.getCharges()
+    this.init();
+  },
+  activated() {
+    this.init();
   },
   },
   methods: {
   methods: {
+    init() {
+      console.log(this.rowDetail);
+      if (this.rowDetail) {
+        this.form.musicGroupOrganizationCourseSettingId = this.rowDetail.musicGroupOrganizationCourseSettingId;
+        this.$set(
+          this.other,
+          "isGiveMusicNetwork",
+          this.rowDetail.isGiveMusicNetwork
+        );
+        this.$set(this.other, "memo", this.rowDetail.memo);
+      }
+    },
     syncAllMoney() {
     syncAllMoney() {
-      let money = 0
+      let money = 0;
       for (const item of this.eclass) {
       for (const item of this.eclass) {
-        money += item.courseCurrentPrice
+        money += item.courseCurrentPrice;
       }
       }
-      this.$set(this.cycle, 'paymentAmount', money)
-      return money
+      this.$set(this.cycle, "paymentAmount", money);
+      this.$set(
+        this.cycle,
+        "paymentPattern",
+        this.rowDetail?.paymentPattern + ""
+      );
+      let arr = [
+        this.rowDetail?.paymentValidStartDate,
+        this.rowDetail?.paymentValidEndDate,
+      ];
+      this.$set(this.cycle, "paymentValid", arr);
+      return money;
     },
     },
     async getChargeTypeList() {
     async getChargeTypeList() {
       try {
       try {
         const res = await chargeTypeList({
         const res = await chargeTypeList({
-          row: 9999
-        })
-        this.typeList = res.data.rows
+          row: 9999,
+        });
+        this.typeList = res.data.rows;
       } catch (error) {}
       } catch (error) {}
     },
     },
     async getCharges() {
     async getCharges() {
-      const chargeTypeId = this.baseInfo?.musicGroup?.chargeTypeId
+      const chargeTypeId = this.baseInfo?.musicGroup?.chargeTypeId;
       try {
       try {
         const res = await musicGroupOrganizationCourseSettingsQueryPage({
         const res = await musicGroupOrganizationCourseSettingsQueryPage({
           row: 9999,
           row: 9999,
-          chargeTypeId
-        })
-        this.charges = res.data.rows
+          chargeTypeId,
+        });
+        this.charges = res.data.rows;
+        const eclas = this.chargesById[
+          this.form.musicGroupOrganizationCourseSettingId
+        ];
+        this.eclass = eclas?.details || [];
+
+        this.syncAllMoney();
       } catch (error) {}
       } catch (error) {}
     },
     },
     addExtraClass() {
     addExtraClass() {
-      this.eclass.push({})
+      this.eclass.push({});
     },
     },
     removeExtraClass(index) {
     removeExtraClass(index) {
-      this.eclass[index] = null
-      this.eclass = this.eclass.filter(item => !!item)
+      this.eclass[index] = null;
+      this.eclass = this.eclass.filter((item) => !!item);
     },
     },
     addCycle() {
     addCycle() {
-      this.cycles.push({})
-      this.collapse.push(this.collapse.length)
+      this.cycles.push({});
+      this.collapse.push(this.collapse.length);
     },
     },
     removeCycle(index) {
     removeCycle(index) {
-      this.cycles[index] = null
-      this.cycles = this.cycles.filter(item => !!item)
-      this.collapse.pop()
+      this.cycles[index] = null;
+      this.cycles = this.cycles.filter((item) => !!item);
+      this.collapse.pop();
     },
     },
     collapseChange(val) {
     collapseChange(val) {
-      this.collapse = val
+      this.collapse = val;
     },
     },
     closeNext() {
     closeNext() {
-      this.nextVisible = false
+      this.nextVisible = false;
     },
     },
     getForms() {
     getForms() {
-      const { $refs: refs } = this
+      const { $refs: refs } = this;
       return [refs.base, refs.eclass, refs.cycle, refs.other]
       return [refs.base, refs.eclass, refs.cycle, refs.other]
-        .filter(item => !!item)
-        .map(item => item.$refs.form)
+        .filter((item) => !!item)
+        .map((item) => item.$refs.form);
     },
     },
     async submit() {
     async submit() {
-      const forms = this.getForms()
-      const valided = []
+      const forms = this.getForms();
+      const valided = [];
       for (const form of forms) {
       for (const form of forms) {
-        form.validate(valid => {
+        form.validate((valid) => {
           if (valid) {
           if (valid) {
-            valided.push(form)
+            valided.push(form);
           }
           }
-        })
+        });
       }
       }
       if (valided.length === forms.length) {
       if (valided.length === forms.length) {
-        const { paymentDate, paymentValid, leixing, ...rest } = {...this.form, ...this.other, ...this.cycle, musicGroupPaymentCalenderCourseSettingsList: this.eclass}
+        const { paymentDate, paymentValid, leixing, ...rest } = {
+          ...this.form,
+          ...this.other,
+          ...this.cycle,
+          musicGroupPaymentCalenderCourseSettingsList: this.eclass,
+        };
         const data = {
         const data = {
           ...rest,
           ...rest,
-          paymentType: paymentTypeFormat[(this.paymentType == 0 ? this.paymentType : leixing)],
+          paymentType:
+            paymentTypeFormat[
+              this.paymentType == 0 ? this.paymentType : leixing
+            ],
           musicGroupId: this.musicGroupId,
           musicGroupId: this.musicGroupId,
-          ...getTimes(paymentDate, ['startPaymentDate', 'deadlinePaymentDate']),
-          ...getTimes(paymentValid, ['paymentValidStartDate', 'paymentValidEndDate']),
+          ...getTimes(paymentDate, ["startPaymentDate", "deadlinePaymentDate"]),
+          ...getTimes(paymentValid, [
+            "paymentValidStartDate",
+            "paymentValidEndDate",
+          ]),
+        };
+        if (!this.rowDetail?.id) {
+          try {
+            const res = await musicGroupPaymentCalenderAdd(data);
+            this.$listeners.close();
+            this.$listeners.submited(res.data);
+          } catch (error) {}
+        } else {
+           try {
+          data.id = this.rowDetail.id
+          const res = await musicGroupPaymentCalenderDetailBatchUpdate(data);
+          this.$listeners.close();
+          this.$listeners.submited(res.data);
+          } catch (error) {}
         }
         }
-        try {
-          const res = await musicGroupPaymentCalenderAdd(data)
-          this.$listeners.close()
-          this.$listeners.submited(res.data)
-        } catch (error) {}
       }
       }
-    }
+    },
   },
   },
 };
 };
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
-  .dialog-footer{
-    margin-top: 20px;
-    display: block;
-    text-align: right;
-  }
-  .alert{
-    margin-bottom: 10px;
-  }
-  .collapse-title{
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    width: 100%;
-    .el-icon-circle-close{
-      font-size: 16px;
-      margin-right: 10px;
-    }
-  }
-  /deep/ .el-collapse-item__wrap{
-    padding-top: 20px;
+.dialog-footer {
+  margin-top: 20px;
+  display: block;
+  text-align: right;
+}
+.alert {
+  margin-bottom: 10px;
+}
+.collapse-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  width: 100%;
+  .el-icon-circle-close {
+    font-size: 16px;
+    margin-right: 10px;
   }
   }
+}
+/deep/ .el-collapse-item__wrap {
+  padding-top: 20px;
+}
 </style>
 </style>

+ 5 - 4
src/views/teamBuild/components/teamBaseInfo.vue

@@ -751,10 +751,11 @@ export default {
         this.basdisabled = false;
         this.basdisabled = false;
       }
       }
       if (
       if (
-        this.teamStatus == "resetTeam" ||
-        this.teamStatus == "teamDraft" ||
-        this.teamStatus == "teamAudit" ||
-        this.teamStatus == "look"
+        // this.teamStatus == "resetTeam" ||
+        // this.teamStatus == "teamDraft" ||
+        // this.teamStatus == "teamAudit" ||
+        // this.teamStatus == "look"
+        this.$route.query.id
       ) {
       ) {
         // 单团修改
         // 单团修改
         this.teamid = this.$route.query.id;
         this.teamid = this.$route.query.id;

+ 2 - 1
src/views/teamBuild/components/teamPayInfo.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div class="pay-container">
   <div class="pay-container">
-    <resetPayList :isNewGropu="true" />
+    <resetPayList :isNewGropu="true" :baseInfo="baseInfo"/>
     <div class="btnWrap">
     <div class="btnWrap">
       <div class="PrevBtn" @click="goback">上一步</div>
       <div class="PrevBtn" @click="goback">上一步</div>
       <!--  v-if="teamStatus != 'teamAudit'" -->
       <!--  v-if="teamStatus != 'teamAudit'" -->
@@ -13,6 +13,7 @@
 // import { payOrderTypeList}  from "@/utils/searchArray";
 // import { payOrderTypeList}  from "@/utils/searchArray";
 import resetPayList from "@/views/resetTeaming/components/resetPayList";
 import resetPayList from "@/views/resetTeaming/components/resetPayList";
 export default {
 export default {
+  props:['baseInfo'],
   components: { resetPayList },
   components: { resetPayList },
   data() {
   data() {
     return {
     return {

+ 6 - 2
src/views/teamBuild/index.vue

@@ -59,13 +59,13 @@
       <!-- 下面显示的内容 -->
       <!-- 下面显示的内容 -->
       <div class="stepcontent">
       <div class="stepcontent">
         <div v-show="activeIndex == 0">
         <div v-show="activeIndex == 0">
-          <teamBaseInfo @chiosetab="chiosetab" :getTeamList="getTeamList" />
+          <teamBaseInfo @chiosetab="chiosetab" :getTeamList="getTeamList" @getBaseInfo="getBaseInfo"/>
         </div>
         </div>
         <div v-if="activeIndex == 1">
         <div v-if="activeIndex == 1">
           <teamSoundMoney @chiosetab="chiosetab" :getTeamList="getTeamList" />
           <teamSoundMoney @chiosetab="chiosetab" :getTeamList="getTeamList" />
         </div>
         </div>
         <div v-if="activeIndex == 2">
         <div v-if="activeIndex == 2">
-          <teamPayInfo @chiosetab="chiosetab" :getTeamList="getTeamList" />
+          <teamPayInfo @chiosetab="chiosetab" :getTeamList="getTeamList" :baseInfo="baseInfo"/>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
@@ -134,6 +134,10 @@ export default {
         query: { search: this.Fsearch, rules: this.Frules },
         query: { search: this.Fsearch, rules: this.Frules },
       });
       });
     },
     },
+     getBaseInfo(baseInfo) {
+      this.baseInfo = baseInfo
+      this.pageName = baseInfo.musicGroup?.name
+    },
   },
   },
 };
 };
 </script>
 </script>