wolyshaw 4 лет назад
Родитель
Сommit
eed939b6b3

+ 11 - 0
src/utils/utils.js

@@ -0,0 +1,11 @@
+import dayjs from 'dayjs'
+
+export const formatData = (times, keys, format = 'YYYY-MM-DD') => {
+  const data = {}
+  if (times && times.length) {
+    for (let i = 0; i < keys.length; i++) {
+      data[keys[i]] = dayjs(times[i]).format(format)
+    }
+  }
+  return data
+}

+ 11 - 0
src/utils/vueFilter.js

@@ -591,3 +591,14 @@ Vue.filter('feeProject', value => {
 Vue.filter('saleType', value => {
   return saleType[value]
 })
+
+// 缴费状态
+
+Vue.filter('teamPayStatus', value => {
+  const tpl = {
+    0: '按月',
+    1: '按季',
+    2: '一次性',
+  }
+  return tpl[value]
+})

+ 97 - 9
src/views/resetTeaming/components/resetPayList.vue

@@ -38,6 +38,33 @@
                          prop="expectNum"
                          label="预计缴费人数"></el-table-column>
         <el-table-column align="center"
+                         prop="paymentPattern"
+                         label="缴费方式">
+            <template slot-scope="scope">
+              <div>
+                {{scope.row.paymentPattern | teamPayStatus}}
+              </div>
+            </template>
+          </el-table-column>
+        <el-table-column align="center"
+                         prop="paymentValidStartDate"
+                         label="缴费有效期开始日期">
+          <template slot-scope="scope">
+            <div>
+              {{scope.row.paymentValidStartDate | formatTimer}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center"
+                         prop="paymentValidEndDate"
+                         label="缴费有效期结束日期">
+          <template slot-scope="scope">
+            <div>
+              {{scope.row.paymentValidEndDate | formatTimer}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center"
                          prop="actualNum"
                          label="实际缴费人数"></el-table-column>
         <el-table-column align="center"
@@ -109,9 +136,47 @@
                       prop="deadlinePaymentDate">
           <el-date-picker v-model.trim="payForm.deadlinePaymentDate"
                           type="date"
-                          :picker-options="bigin"
+                          :picker-options="beginDate(payForm.startPaymentDate)"
                           value-format="yyyy-MM-dd"
-                          placeholder="开始日期"></el-date-picker>
+                          placeholder="结束日期"></el-date-picker>
+        </el-form-item>
+        <el-form-item
+                      label="缴费方式"
+                      prop="paymentPattern"
+                      :rules="[{ required: true, message: '请选择缴费方式'},]">
+                      <el-select placeholder="缴费方式"
+                                  style="width: 220px"
+                                  clearable
+                                  filterable
+                                  @change="paymentPatternChange"
+                                  v-model.trim="payForm.paymentPattern">
+                                  <el-option :value="0"
+                                              label="按月"></el-option>
+                                  <el-option :value="1"
+                                              label="按季"></el-option>
+                                  <el-option :value="2"
+                                              label="一次性"></el-option>
+                      </el-select>
+        </el-form-item>
+        <el-form-item label="缴费有效期开始"
+                      :rules="[{ required: true, message: '请设置缴费有效期开始日期',trigger: 'blur'}]"
+                      prop="paymentValidStartDate">
+          <el-date-picker v-model.trim="payForm.paymentValidStartDate"
+                          type="date"
+                          @change="changePaymentStartTime"
+                          :picker-options="pickerOptions"
+                          value-format="yyyy-MM-dd"
+                          placeholder="有效期开始日期"></el-date-picker>
+        </el-form-item>
+        <el-form-item label="缴费有效期结束"
+                      :rules="[{ required: payForm.paymentPattern !== 2, message: '请设置缴费有效期结束日期',trigger: 'blur'}]"
+                      prop="paymentValidEndDate">
+          <el-date-picker v-model.trim="payForm.paymentValidEndDate"
+                          type="date"
+                          :disabled="payForm.paymentPattern === 2"
+                          :picker-options="beginDate(payForm.paymentValidStartDate)"
+                          value-format="yyyy-MM-dd"
+                          placeholder="有效期结束日期"></el-date-picker>
         </el-form-item>
         <el-form-item label="收费类型"
                       v-if='isNew'
@@ -208,6 +273,9 @@ export default {
       payForm: {
         startPaymentDate: null,
         deadlinePaymentDate: null,
+        paymentPattern: null,
+        paymentValidStartDate: null,
+        paymentValidEndDate: null,
         type: null,
         memo: null
       },
@@ -223,7 +291,6 @@ export default {
       qrcodes: true,
       qrcode: null,
       codeUrl: null,
-      bigin: this.beginDate(),
       chioseStudentVisible: false,
       chioseStudentList: [],
       clearStduent: true
@@ -253,6 +320,11 @@ export default {
         }
       })
     },
+    paymentPatternChange(val) {
+      if(val === 2) {
+        this.payForm.paymentValidEndDate = null
+      }
+    },
     onCreateQRCode () { // 生成报名二维码
       this.qrcodeStatus = true
       let id = this.$route.query.id
@@ -284,6 +356,14 @@ export default {
       this.isNew = false
       this.activeRow = row
       this.payVisible = true;
+      this.payForm = {
+        ...this.payForm,
+        startPaymentDate: row.startPaymentDate,
+        deadlinePaymentDate: row.deadlinePaymentDate,
+        paymentPattern: row.paymentPattern,
+        paymentValidStartDate: row.paymentValidStartDate,
+        paymentValidEndDate: row.paymentValidEndDate,
+      }
     },
     detelePay (row) {
       let id = row.id;
@@ -320,7 +400,7 @@ export default {
         type: null,
         memo: null
       },
-           * 
+           *
            */
           this.chioseStudentVisible = true
           return
@@ -341,6 +421,9 @@ export default {
       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
+      obj.paymentValidEndDate = this.payForm.paymentValidEndDate
+      obj.paymentPattern = this.payForm.paymentPattern
       obj.type = this.payForm.type
       obj.memo = this.payForm.memo
       addMusicGroupPaymentCalender(obj).then(res => {
@@ -367,6 +450,9 @@ export default {
     changeStartTime (val) {
       this.payForm.deadlinePaymentDate = this.dateAddDays(val, 3)
     },
+    changePaymentStartTime (val) {
+      this.payForm.paymentValidEndDate = null
+    },
     dateAddDays (dataStr, dayCount) {
       let strdate = dataStr; //日期字符串
       let isdate = new Date(strdate.replace(/-/g, "/"));  //把日期字符串转换成日期格式
@@ -374,13 +460,12 @@ export default {
       let pdate = isdate.getFullYear() + "-" + (isdate.getMonth() + 1) + "-" + (isdate.getDate());   //把日期格式转换成字符串
       return pdate;
     },
-    beginDate () {
-      let self = this
+    beginDate (end) {
       return {
         firstDayOfWeek: 1,
         disabledDate (time) {
-          if (self.payForm.startPaymentDate) {
-            return new Date(self.payForm.startPaymentDate).getTime() - 86400000 >= time.getTime()
+          if (end) {
+            return new Date(end).getTime() - 86400000 >= time.getTime()
           } else {
             return time.getTime() + 86400000 < Date.now()
             //开始时间不选时,结束时间最大值小于等于当天
@@ -399,6 +484,9 @@ export default {
       if (!val) {
         this.payForm = {
           startPaymentDate: null,
+          paymentPattern: null,
+          paymentValidStartDate: null,
+          paymentValidEndDate: null,
           type: null,
           memo: null,
           deadlinePaymentDate: null
@@ -444,4 +532,4 @@ export default {
     padding: 15px 15px 0 15px;
   }
 }
-</style>
+</style>

+ 73 - 3
src/views/teamBuild/components/teamBaseInfo.vue

@@ -127,6 +127,46 @@
                           }"
                           placeholder="选择日期"></el-date-picker>
         </el-form-item>
+        <el-form-item
+                      label="缴费方式"
+                      prop="paymentPattern"
+                      @change="changePaymentPattern"
+                      :rules="[{ required: true, message: '请选择缴费方式'},]">
+                      <el-select placeholder="缴费方式"
+                                  :disabled="teamStatus ==='resetTeam' || teamStatus === 'teamDraft' || teamStatus === 'teamAudit'"
+                                  clearable
+                                  filterable
+                                  v-model.trim="topFrom.paymentPattern">
+                                  <el-option :value="0"
+                                              label="按月"></el-option>
+                                  <el-option :value="1"
+                                              label="按季"></el-option>
+                                  <el-option :value="2"
+                                              label="一次性"></el-option>
+                      </el-select>
+        </el-form-item>
+        <el-form-item label="缴费有效期开始"
+                      prop="paymentValidStartDate"
+                      :rules="[{ required: true, message: '请选择缴费有效期开始'},]">
+                      <el-date-picker
+                        :disabled="teamStatus ==='resetTeam' || teamStatus === 'teamDraft' || teamStatus === 'teamAudit'"
+                        v-model="topFrom.paymentValidStartDate"
+                        placeholder="开始日期"
+                        :picker-options="{
+                          firstDayOfWeek:1
+                        }">
+                      </el-date-picker>
+        </el-form-item>
+        <el-form-item label="缴费有效期结束"
+                      prop="paymentValidEndDate"
+                      :rules="[{ required: true, message: '请选择缴费有效期结束'},]">
+                      <el-date-picker
+                        :disabled="teamStatus ==='resetTeam' || teamStatus === 'teamDraft' || teamStatus === 'teamAudit' || topFrom.paymentPattern === 2"
+                        v-model="topFrom.paymentValidEndDate"
+                        :picker-options="beginDate(topFrom.paymentValidStartDate)"
+                        placeholder="结束日期">
+                      </el-date-picker>
+        </el-form-item>
         <el-form-item label="招生年级"
                       prop="startClass"
                       :rules="[{ required: true, message: '请选择招生年纪'},]">
@@ -404,7 +444,6 @@
       </div>
     </div>
   </div>
-  </div>
 </template>
 <script>
 import {
@@ -420,7 +459,7 @@ import {
   getEmployeeOrgan
 } from "@/api/buildTeam";
 import { findTechnician } from "@/api/repairManager";
-
+import dayjs from 'dayjs'
 import {
   queryEmployByOrganId,
   queryByOrganId,
@@ -429,6 +468,7 @@ import {
 import { scrollTo } from "@/utils/scroll-to";
 import axios from "axios";
 import store from "@/store";
+import { formatData } from '@/utils/utils'
 import qs from "qs";
 export default {
   name: "teamBaseInfo",
@@ -451,6 +491,10 @@ export default {
         isClass: false, //是否为课堂课
         startTime: "",
         feeType: null,
+        paymentPattern: '', // 缴费方式
+        paymentValid: [], // 缴费有效期
+        paymentValidStartDate: null, // 缴费有效期开始
+        paymentValidEndDate: null, // 缴费有效期结束
         ownershipType: "OWN", // 合作机构类型
         repairUserId: null, // 维修技师
 
@@ -588,6 +632,24 @@ export default {
     changeFeeType (val) {
       console.log(val == "ONLINE")
     },
+    changePaymentPattern(val) {
+      if (val === 2) {
+        this.topFrom.paymentValidEndDate = null
+      }
+    },
+    beginDate (end) {
+      return {
+        firstDayOfWeek: 1,
+        disabledDate (time) {
+          if (end) {
+            return new Date(end).getTime() - 86400000 >= time.getTime()
+          } else {
+            return time.getTime() + 86400000 < Date.now()
+            //开始时间不选时,结束时间最大值小于等于当天
+          }
+        }
+      }
+    },
     init () {
       this.checkList = {
         soundInfo: {
@@ -673,6 +735,9 @@ export default {
             this.topFrom.startClass = res.data.musicGroup.enrollClasses.split(
               ","
             );
+            this.topFrom.paymentPattern = res.data.musicGroup.paymentPattern
+            this.topFrom.paymentValidStartDate = res.data.musicGroup.paymentValidStartDate
+            this.topFrom.paymentValidEndDate = res.data.musicGroup.paymentValidEndDate
             this.topFrom.section = res.data.musicGroup.organId;
             this.topFrom.school = res.data.musicGroup.cooperationOrganId;
             this.topFrom.teacher = res.data.musicGroup.educationalTeacherId;
@@ -775,9 +840,11 @@ export default {
           boss: "", // 运营主管
           time: "", // 报名截止时间
           startClass: [], // 招生年级起始
+          paymentValid: [], // 缴费有效期时间起始
           address: "", // 教学地点
           salary: "", // 收费模式
           head: "",
+          paymentPattern: "", // 缴费方式
           isClass: false, //是否为课堂课
           startTime: "",
           ownershipType: "OWN", // 合作机构类型
@@ -1018,6 +1085,9 @@ export default {
             educationalTeacherId: this.topFrom.teacher,
             enrollClasses: this.topFrom.startClass.join(","),
             name: this.topFrom.name,
+            paymentPattern: this.topFrom.paymentPattern,
+            paymentValidStartDate: this.topFrom.paymentValidStartDate,
+            paymentValidEndDate: this.topFrom.paymentValidEndDate,
             organId: this.topFrom.section,
             // paymentMonths:obj.months  有待确认
             schoolId: this.topFrom.address,
@@ -1242,4 +1312,4 @@ export default {
     margin-right: 10px;
   }
 }
-</style>
+</style>

+ 7 - 3
src/views/teamBuild/components/teamSoundMoney.vue

@@ -765,6 +765,7 @@
 </template>
 <script>
 import store from "@/store";
+import { formatData } from '@/utils/utils'
 import {
   getSubject,
   getDefaultSubject,
@@ -1298,7 +1299,7 @@ export default {
       // 整理数据提交
       if (this.teamStatus == "newTeam") {
         let obj = {};
-        // 解析数据 
+        // 解析数据
         let courseJson = {};
         for (let i in this.checkfor) {
           if (this.checkfor[i].ischeck) {
@@ -1325,6 +1326,9 @@ export default {
           enrollClasses,
           name: this.topfor.name,
           organId: this.topfor.section,
+          paymentPattern: this.topfor.paymentPattern,
+          paymentValidStartDate: this.topfor.paymentValidStartDate,
+          paymentValidEndDate: this.topfor.paymentValidEndDate,
           // paymentMonths:obj.months  有待确认
           schoolId: this.topfor.address,
           courseForm: JSON.stringify(courseJson),
@@ -1987,7 +1991,7 @@ export default {
 
       if (!checkFlag) {
         marketPrice += Number(parseFloat(coursePrice))
-        //  
+        //
       }
       amount += parseFloat(coursePrice);
       // console.log(this.lookPreviewRow.markList)
@@ -2737,4 +2741,4 @@ export default {
     min-height: calc(100vh - 41px);
   }
 }
-</style>
+</style>