Browse Source

乐团修改

wolyshaw 4 years ago
parent
commit
5a8c540675

+ 3 - 1
src/components/Descriptions/Descriptions.vue

@@ -60,11 +60,13 @@ export default {
   mounted() {
     this.generateChildrenRow(this.$slots.default || [])
   },
+  beforeUpdate() {
+    this.generateChildrenRow(this.$slots.default || [])
+  },
   methods: {
     // 获取描述内容子项
     generateChildrenRow(dataSource) {
       const dataList = dataSource.filter(item => item.tag === 'descriptions-item')
-      console.log(dataList)
       this.rows = []
       let leftSpan = this.column
       let children = []

+ 7 - 0
src/constant/index.js

@@ -71,6 +71,13 @@ export const paymentType = {
   1: '报名',
 }
 
+export const userPaymentType = {
+  ADD_STUDEN: '新增学员',
+  ADD_COURSE: '临时加课',
+  MUSIC_APPLY: '乐团报名',
+  MUSIC_RENEW: '乐团续费',
+}
+
 export const payStatus = {
   AUDITING: '审核中',
   REJECT: '拒绝',

+ 10 - 1
src/utils/vueFilter.js

@@ -1,7 +1,7 @@
 import Vue from 'vue'
 import dayjs from 'dayjs'
 import numeral from 'numeral'
-import { feeProject, feeType, saleType, payStatus, payOrderType } from '../constant'
+import { feeProject, feeType, saleType, payStatus, payOrderType, paymentPatternType, payUserType, userPaymentType, courseType } from '../constant'
 
 // 合并数组
 Vue.filter('joinArray', (value, type) => {
@@ -162,6 +162,15 @@ Vue.filter('dateForMinFormat', (value) => {
   }
 })
 
+Vue.filter('paymentPatternTypeFormat', val => paymentPatternType[val])
+// 支付用户类型
+Vue.filter('payUserTypeFormat', val => payUserType[val])
+// 支付缴费方式
+Vue.filter('userPaymentTypeFormat', val => userPaymentType[val])
+// 课程类型格式化
+Vue.filter('courseTypeFormat', val => courseType[val])
+
+
 // 时间处理
 Vue.filter('timer', (value) => {
   if (value) {

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

@@ -26,3 +26,9 @@ export const getMusicGroupStu = data => request2({
   params: data,
   method: 'get',
 })
+
+export const musicGroupPaymentCalenderDetailBatchAdd = data => request2({
+  url: '/api-web/musicGroupPaymentCalenderDetail/batchAdd',
+  data: data,
+  method: 'post',
+})

+ 20 - 17
src/views/resetTeaming/components/resetPayList.vue

@@ -19,8 +19,8 @@
       </el-form-item>
 
       <el-form-item>
-        <el-button type="danger" @click="search">搜索</el-button>
-        <el-button @click="onReSet" type="primary">重置</el-button>
+        <el-button type="danger" @click="getList">搜索</el-button>
+        <!-- <el-button @click="onReSet" type="primary">重置</el-button> -->
       </el-form-item>
     </el-form>
     <div class="topWrap">
@@ -252,7 +252,7 @@
     <el-dialog
       title="查看"
       :visible.sync="reviewVisible"
-      width="800px"
+      width="900px"
       destroy-on-close
     >
       <reviewDetail
@@ -320,12 +320,14 @@ import dayjs from 'dayjs'
 import QRCode from 'qrcodejs2'
 import { vaildStudentUrl } from '@/utils/validate'
 import { addMusicGroupPaymentCalender, getMusicGroupPaymentCalender, resetMusicGroupPaymentCalender, delMusicGroupPaymentCalender } from "@/api/buildTeam";
-import { musicGroupPaymentCalenderQueryPage, getMusicGroupStu } from '../api'
+import { musicGroupPaymentCalenderQueryPage, getMusicGroupStu, musicGroupPaymentCalenderDetailBatchAdd } from '../api'
 import setStudentFee from './studentPayBase'
 import userPayForm from '../modals/user-pay-form'
 import schoolPayForm from '../modals/school-pay-form'
 import review from '../modals/review'
 import reviewDetail from '../modals/review-detail'
+import { userPaymentType } from '@/constant'
+import { objectToOptions } from '@/utils'
 export default {
   props: ['baseInfo','isNewGropu'],
   components: {
@@ -379,9 +381,10 @@ export default {
       qrcodes: true,
       qrcode: null,
       codeUrl: null,
-      chioseStudentVisible: false,
+      chioseStudentVisible: true,
       chioseStudentList: [],
-      clearStduent: true
+      clearStduent: true,
+      musicGroupPaymentCalenderId: '',
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -393,6 +396,9 @@ export default {
 
   },
   computed: {
+    payOrderTypeList() {
+      return objectToOptions(userPaymentType)
+    },
     payFormTitle() {
       return this.payFormType === 'user' ? '新增学员缴费' : '新增学校缴费'
     }
@@ -431,10 +437,13 @@ export default {
         this.payForm.paymentValidEndDate = null
       }
     },
-    async payedSubmited() {
+    async payedSubmited(data) {
       try {
         await this.getList()
         this.chioseStudentVisible = true
+        if (data) {
+          this.musicGroupPaymentCalenderId = data.musicGroupPaymentCalenderId
+        }
       } catch (error) {}
     },
     onCreateQRCode () { // 生成报名二维码
@@ -535,17 +544,11 @@ export default {
       obj.studentIds = this.chioseStudentList.map(stu => {
         return stu.userId
       }).join(',')
-      obj.musicGroupId = this.$route.query.id
-      obj.startPaymentDate = this.payForm.startPaymentDate + ' 00:00:00'
-      obj.deadlinePaymentDate = this.payForm.deadlinePaymentDate + ' 23:59:59'
-      obj.paymentValidStartDate = this.payForm.paymentValidStartDate ? dayjs(this.payForm.paymentValidStartDate).format('YYYY-MM-DD') : this.payForm.paymentValidStartDate,
-        obj.paymentValidEndDate = this.payForm.paymentValidEndDate ? dayjs(this.payForm.paymentValidEndDate).format('YYYY-MM-DD') : this.payForm.paymentValidEndDate,
-        obj.paymentPattern = this.payForm.paymentPattern
-      obj.type = this.payForm.type
-      obj.memo = this.payForm.memo
-      addMusicGroupPaymentCalender(obj).then(res => {
+      obj.musicGroupPaymentCalenderId = this.musicGroupPaymentCalenderId
+      return
+      musicGroupPaymentCalenderDetailBatchAdd(obj).then(res => {
         if (res.code == 200) {
-          this.$message.success('恭喜你创建成功')
+          this.$message.success('添加成功')
           this.$refs.setStudentFee.clearTable()
           this.payVisible = false;
           this.chioseStudentVisible = false;

+ 6 - 6
src/views/resetTeaming/components/studentPayBase.vue

@@ -31,9 +31,9 @@
                    type="primary">重置</el-button>
       </el-form-item>
     </el-form>
-    <div class="newBand"
+    <!-- <div class="newBand"
          @click="resetPays"
-         v-permission="'musicGroupStudentFee/batchUpdateCourseFee'">修改缴费金额</div>
+         v-permission="'musicGroupStudentFee/batchUpdateCourseFee'">修改缴费金额</div> -->
     <div class="tableWrap">
       <el-table style="width: 100%"
                 :header-cell-style="{background:'#EDEEF0',color:'#444'}"
@@ -70,8 +70,8 @@
         </el-table-column> -->
         <el-table-column align="center"
                          prop="courseFee"
-                         label="缴费金额"></el-table-column>
-        <el-table-column align="center"
+                         label="缴费金额(元)"></el-table-column>
+        <!-- <el-table-column align="center"
                          label="操作">
           <template slot-scope="scope">
             <div>
@@ -80,7 +80,7 @@
                          @click="resetPay(scope.row)">修改金额</el-button>
             </div>
           </template>
-        </el-table-column>
+        </el-table-column> -->
       </el-table>
       <!-- <pagination :total="rules.total"
                   :page.sync="rules.page"
@@ -284,4 +284,4 @@ export default {
   height: 300px;
   overflow: auto;
 }
-</style>
+</style>

+ 27 - 15
src/views/resetTeaming/modals/review-detail.vue

@@ -6,13 +6,13 @@
       class="alert"
       type="info">
     </el-alert>
-    <descriptions :column="3">
+    <descriptions :column="2">
       <descriptions-item label="分部名称:">{{auditDto.organName}}</descriptions-item>
       <descriptions-item label="乐团名称:">{{auditDto.musicGroupName}}</descriptions-item>
       <descriptions-item label="乐团编号:">{{auditDto.musicGroupId}}</descriptions-item>
-      <descriptions-item label="申请时间:">{{auditDto.paymentType}}</descriptions-item>
-      <descriptions-item label="申请类型:">申请类型</descriptions-item>
-      <descriptions-item label="订单类型:">订单类型</descriptions-item>
+      <descriptions-item label="申请时间:">{{auditDto.createTime}}</descriptions-item>
+      <descriptions-item label="申请类型:">{{auditDto.paymentType | userPaymentTypeFormat}}</descriptions-item>
+      <descriptions-item label="订单类型:">{{auditDto.payUserType | payUserTypeFormat}}</descriptions-item>
       <descriptions-item label="学员数量:">{{studentNum}}</descriptions-item>
     </descriptions>
     <el-alert
@@ -22,32 +22,35 @@
       type="info">
     </el-alert>
     <descriptions :column="3">
-      <descriptions-item label="收费标准:">{{auditDto.musicGroupPaymentCalenderId}}</descriptions-item>
+      <descriptions-item label="收费标准:">{{musicGroupPaymentCalenderCourseSettingName}}</descriptions-item>
     </descriptions>
       <el-table
-        :data="[]"
+        :data="musicGroupPaymentCalenderCourseSettings"
         stripe
-        style="width: 100%">
+        style="width: 100%;margin-top: 10px;">
         <el-table-column
-          prop="date"
+          prop="courseType"
           label="课程类型"
           width="120">
+          <template slot-scope="scope">
+            {{ scope.row.courseType | courseTypeFormat}}
+          </template>
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="isStudentOptional"
           label="是否免费"
           width="100">
         </el-table-column>
         <el-table-column
-          prop="address"
+          prop="courseTotalMinuties"
           label="课程总时长(分钟)">
         </el-table-column>
         <el-table-column
-          prop="address"
+          prop="courseCurrentPrice"
           label="现价(元)">
         </el-table-column>
         <el-table-column
-          prop="address"
+          prop="courseOriginalPrice"
           label="原价(元)">
         </el-table-column>
       </el-table>
@@ -59,9 +62,9 @@
     </el-alert>
     <descriptions :column="2">
       <descriptions-item label="缴费金额:">{{auditDto.paymentAmount}}</descriptions-item>
-      <descriptions-item label="缴费方式:">{{auditDto.paymentType}}</descriptions-item>
-      <descriptions-item label="缴费日期:">{{auditDto.paymentValidStartDate}} - {{auditDto.paymentValidEndDate}}</descriptions-item>
-      <descriptions-item label="缴费有效期:">缴费有效期</descriptions-item>
+      <descriptions-item label="缴费方式:">{{auditDto.paymentPattern | paymentPatternTypeFormat}}</descriptions-item>
+      <descriptions-item v-if="auditDto.payUserType !== 'SCHOOL'" label="缴费日期:">{{auditDto.startPaymentDate}} - {{auditDto.deadlinePaymentDate}}</descriptions-item>
+      <descriptions-item label="缴费有效期:">{{auditDto.paymentValidStartDate}} - {{auditDto.paymentValidEndDate}}</descriptions-item>
     </descriptions>
     <el-alert
       title="其他"
@@ -93,6 +96,15 @@ export default {
       ...initData,
     }
   },
+  computed: {
+    musicGroupPaymentCalenderCourseSettingName() {
+      const active = this.musicGroupPaymentCalenderCourseSettings[0]
+      if (active) {
+        return active.name
+      }
+      return ''
+    }
+  },
   async mounted() {
     try {
       const res = await musicGroupPaymentCalenderView({