Преглед изворни кода

Merge branch 'music-list' into online

wolyshaw пре 4 година
родитељ
комит
13e420a3a6

+ 11 - 0
src/api/buildTeam.js

@@ -1490,3 +1490,14 @@ export function spanGroupMergeClassSplitClassAffirm(data) {
     data:data
   })
 }
+
+// 发送缴费提醒
+export function sendWaitRenewMessage(data) {
+  return request2({
+    url: api + `/musicGroupPaymentCalenderDetail/sendWaitRenewMessage`,
+    method: 'get',
+    params:data,
+    data:{}
+  })
+}
+

+ 2 - 0
src/components/install.js

@@ -17,6 +17,7 @@ import empty from '@/components/empty'
 import autoHeight from '@/components/auto-height'
 import auth from '@/components/Auth'
 import filterSearch from '@/components/filter-search'
+import singeFileUpload from '@/components/singe-file-upload'
 
 export default {
   install(Vue) {
@@ -34,5 +35,6 @@ export default {
     Vue.component(autoHeight.name, autoHeight)
     Vue.component(auth.name, auth)
     Vue.component(filterSearch.name, filterSearch)
+    Vue.component(singeFileUpload.name, singeFileUpload)
   }
 }

+ 78 - 0
src/components/singe-file-upload/index.vue

@@ -0,0 +1,78 @@
+<template>
+  <el-upload
+    action="/api-web/uploadFile"
+    :headers="headers"
+    :on-success="success"
+    :on-remove="remove"
+    :on-error="error"
+    :limit="1"
+    :file-list="filelist"
+    :accept="accept">
+    <el-button size="small" type="primary" plain>点击上传</el-button>
+    <div slot="tip" v-if="tips" class="el-upload__tip">{{tips}}</div>
+  </el-upload>
+</template>
+
+<script>
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'singe-file-upload',
+  props: {
+    tips: {
+      type: String,
+      default: ''
+    },
+    value: {
+      type: String,
+      default: ''
+    },
+    accept: {
+      type: String,
+      default: ''
+    }
+  },
+  watch: {
+    value() {
+      if (this.value) {
+        this.filelist = [{
+          name: this.value,
+          url: this.value,
+        }]
+      } else {
+        this.remove()
+      }
+    }
+  },
+  data() {
+    return {
+      filelist: [],
+      headers: {
+        Authorization: getToken()
+      },
+    }
+  },
+  methods: {
+    remove() {
+      this.filelist = []
+      this.$emit('update:value', '')
+      this.$emit('input', '')
+    },
+    error() {
+      this.remove()
+    },
+    success(res) {
+      if (res.code == 200) {
+        this.filelist = [{
+          name: res.data.url,
+          url: res.data.url,
+        }]
+        this.$emit('update:value', res.data.url)
+        this.$emit('input', res.data.url)
+      } else {
+        this.remove()
+        this.$message.error(res.msg || '上传失败')
+      }
+    },
+  }
+}
+</script>

+ 8 - 0
src/views/accompaniment/api.js

@@ -27,6 +27,14 @@ export const Update = data => {
   })
 }
 
+export const queryPageSysExam = data => {
+  return request({
+    url: '/api-web/sysExamSongAccompaniment/queryPage',
+    method: 'get',
+    params: data,
+  })
+}
+
 export const Del = id => {
   return request({
     url: '/api-web/sysExamSong/del/' + id,

+ 10 - 11
src/views/accompaniment/index.vue

@@ -20,11 +20,11 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item prop="subjectId">
+        <!-- <el-form-item prop="subjectId">
           <el-select v-model="searchForm.subjectId" clearable filterable placeholder="请选择声部">
             <el-option v-for="item in selects.subjects" :value="item.id" :label="item.name" :key="item.id"></el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
         <el-button @click="submit" type="primary">搜索</el-button>
         <el-button @click="reset" type="danger">重置</el-button>
       </saveform>
@@ -36,7 +36,7 @@
         <el-table-column
           align="center"
           prop="id"
-          label="伴奏编号"
+          label="编号"
         >
                 <template slot-scope="scope">
               <div>
@@ -44,11 +44,10 @@
               </div>
             </template>
         </el-table-column>
-        </el-table-column>
         <el-table-column
           align="center"
           prop="name"
-          label="伴奏名称"
+          label="名称"
           width="180px"
         >
          <template slot-scope="scope">
@@ -66,7 +65,7 @@
             {{scope.row.type | songUseTypeFormat}}
           </template>
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           align="center"
           prop="subjectNames"
           label="声部"
@@ -82,7 +81,7 @@
           align="center"
           prop="speed"
           label="速度"
-        />
+        /> -->
         <el-table-column
           align="center"
           prop="createUserName"
@@ -126,16 +125,16 @@
         @pagination="FetchList"
       />
     </div>
-    <el-dialog width="400px" :visible.sync="audioVisible" title="播放伴奏">
-      <audio v-if="audioVisible" style="display: block; margin: auto" controls :src="activeUrl"/>
+    <el-dialog v-if="audioVisible" width="400px" :visible.sync="audioVisible" title="播放伴奏">
+      <audio style="display: block; margin: auto" controls :src="activeUrl"/>
     </el-dialog>
     <el-dialog
       :title="title"
       :visible.sync="visible"
-      width="500px"
+      width="700px"
+      v-if="visible"
     >
       <submit-form
-        v-if="visible"
         :detail="detail"
         :type="type"
         @submited="FetchList"

+ 142 - 73
src/views/accompaniment/modals/form.vue

@@ -2,45 +2,81 @@
   <div>
     <el-form ref="form" :model="form" label-width="100px">
       <el-form-item
-        prop="name"
-        label="伴奏名称"
-        :rules="[{required: true, message: '请输入伴奏名称'}]"
+        prop="sysExamSong.name"
+        label="曲名"
+        :rules="[{required: true, message: '请输入曲名'}]"
       >
-        <el-input placeholder="请输入伴奏名称" v-model="form.name"/>
+        <el-input placeholder="请输入曲名" v-model="form.sysExamSong.name"/>
       </el-form-item>
       <el-form-item
-        prop="subjectIds"
-        label="伴奏声部"
-        :rules="[{required: true, message: '请选择伴奏声部'}]"
+        label="原音"
+        prop="sysExamSong.url"
+        :rules="[{required: true, message: '请选择原音'}]"
       >
-        <el-select style="width: 100%!important;" collapse-tags multiple v-model="form.subjectIds" placeholder="请选择伴奏声部">
-          <el-option v-for="item in selects.subjects" :value="String(item.id)" :label="item.name" :key="item.id"></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item
-        prop="speed"
-        label="伴奏速度"
-        :rules="[{required: true, message: '请输入伴奏速度'}]"
-      >
-        <el-input type="number" placeholder="请输入伴奏速度" v-model="form.speed"/>
-      </el-form-item>
-      <el-form-item
-        label="伴奏文件"
-        prop="url"
-        :rules="[{required: true, message: '请选择伴奏文件'}]"
-      >
-        <el-upload
-          action="/api-web/uploadFile"
-          :headers="headers"
-          :on-success="success"
-          :on-remove="remove"
-          :limit="1"
-          :file-list="filelist"
-          accept=".mp3, .aac">
-          <el-button size="small" type="primary" plain>点击上传</el-button>
-          <div slot="tip" class="el-upload__tip">仅支持上传 mp3/aac 格式音频文件</div>
-        </el-upload>
+        <singe-file-upload
+          tips="仅支持上传 mp3/aac 格式音频文件"
+          accept=".mp3, .aac"
+          v-model="form.sysExamSong.url"
+        />
       </el-form-item>
+      <div class="files" v-for="(song, index) in form.sysExamSongAccompaniments" :key="index">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item
+              :prop="`sysExamSongAccompaniments.${index}.subjectId`"
+              label="声部"
+              :rules="[{required: true, message: '请选择声部'}]"
+            >
+              <el-select style="width: 100%!important;" v-model="song.subjectId" placeholder="请选择声部">
+                <el-option
+                  v-for="item in selects.subjects"
+                  :value="item.id"
+                  :label="item.name"
+                  :key="item.id"
+                  :disabled="hasSubjectId(item.id)"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item
+              :prop="`sysExamSongAccompaniments.${index}.speed`"
+              label="速度"
+              :rules="[{required: true, message: '请输入速度'}]"
+            >
+              <el-input type="number" placeholder="请输入速度" v-model="song.speed"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item
+              label="mp3文件"
+              :prop="`sysExamSongAccompaniments.${index}.mp3Url`"
+              :rules="[{required: true, message: '请选择mp3文件'}]"
+            >
+              <singe-file-upload
+                tips="仅支持上传 mp3/aac 格式音频文件"
+                accept=".mp3, .aac"
+                v-model="song.mp3Url"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item
+              label="MusicXML"
+              :prop="`sysExamSongAccompaniments.${index}.xmlUrl`"
+              :rules="[{required: true, message: '请选择MusicXML文件'}]"
+            >
+              <singe-file-upload
+                tips="仅支持上传 xml 格式文件"
+                accept=".xml"
+                v-model="song.xmlUrl"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-button class="file-remove" type="text" @click="removeSys(index)" :disabled="form.sysExamSongAccompaniments.length == 1">删除</el-button>
+      </div>
+      <el-button @click="createSys" type="info" style="width: 100%;margin-bottom: 20px;" plain>添加伴奏</el-button>
       <div class="btns">
         <el-button type="primary" @click="submit">提交</el-button>
         <el-button @click="$listeners.close">取消</el-button>
@@ -49,57 +85,73 @@
   </div>
 </template>
 <script>
-import { getToken } from "@/utils/auth"
-import { Add, Update } from '../api'
+import { Add, Update, queryPageSysExam } from '../api'
 export default {
   props: ['detail', 'type'],
   data() {
     return {
-      headers: {
-        Authorization: getToken()
-      },
-      filelist: [],
       form: {
-        name: '',
-        subjectIds: [],
-        speed: '',
-        url: ''
+        sysExamSong: {
+          name: '',
+          url: '',
+        },
+        sysExamSongAccompaniments: [
+          {
+            subjectId: '',
+            speed: '',
+            mp3Url: '',
+            xmlUrl: ''
+          },
+        ],
+        delExamSongAccompanimentIds: []
       }
     }
   },
   mounted() {
     this.$store.dispatch('setSubjects')
     if (this.detail) {
-      for (const key in this.form) {
-        if (this.form.hasOwnProperty(key)) {
-          if (key === 'subjectIds') {
-            this.$set(this.form, 'subjectIds', (this.detail[key] || '').split(','))
-          } else {
-            this.$set(this.form, key, this.detail[key])
-          }
-        }
-      }
-      this.filelist = [{
-        name: this.detail.url,
+      this.$set(this.form, 'sysExamSong', {
+        name: this.detail.name,
         url: this.detail.url,
-      }]
+      })
+      this.FeatchDetailList()
     }
   },
   methods: {
-    remove() {
-      this.filelist = []
-      this.$set(this.form, 'url', '')
+    async FeatchDetailList() {
+      try {
+        const res = await queryPageSysExam({
+          sysExamSongId: this.detail.id
+        })
+        this.$set(this.form, 'sysExamSongAccompaniments', res.data)
+      } catch (error) {}
+    },
+    createSys() {
+      this.form.sysExamSongAccompaniments.push({
+        subjectId: '',
+        speed: '',
+        mp3Url: '',
+        xmlUrl: ''
+      })
+    },
+    async removeSys(index) {
+      try {
+        await this.$confirm('是否确认删除此伴奏?', '提示', {
+          type: 'warning'
+        })
+        if (this.form.sysExamSongAccompaniments[index]) {
+          this.form.delExamSongAccompanimentIds.push(this.form.sysExamSongAccompaniments[index].id)
+        }
+
+        this.form.sysExamSongAccompaniments.splice(index, 1)
+      } catch (error) {}
     },
-    success(res) {
-      if (res.code == 200) {
-        this.filelist = [{
-          name: res.data.url,
-          url: res.data.url,
-        }]
-        this.$set(this.form, 'url', res.data.url)
-      } else {
-        this.$message.error(res.msg || '上传失败')
+    hasSubjectId(id) {
+      const ids = []
+      for (const item of this.form.sysExamSongAccompaniments) {
+        ids.push(item.subjectId)
       }
+      return ids.includes(id)
     },
     async submit() {
       this.$refs.form.validate(async (valid) => {
@@ -107,16 +159,20 @@ export default {
           if (!this.detail) {
             await Add({
               ...this.form,
-              subjectIds: this.form.subjectIds.join(','),
-              type: 'COMMON',
+              sysExamSong: {
+                ...this.form.sysExamSong,
+                type: 'COMMON',
+              }
             })
             this.$message.success('提交成功')
           } else {
             await Update({
               ...this.form,
-              subjectIds: this.form.subjectIds.join(','),
-              type: this.detail.type,
-              id: this.detail.id
+              sysExamSong: {
+                ...this.form.sysExamSong,
+                type: 'COMMON',
+                id: this.detail.id
+              }
             })
             this.$message.success('修改成功')
           }
@@ -132,4 +188,17 @@ export default {
   .btns{
     text-align: right;
   }
+  .files{
+    background-color: #f8f8f8;
+    padding: 20px 0;
+    padding-right: 20px;
+    margin-bottom: 20px;
+    border-radius: 5px;
+    position: relative;
+    .file-remove{
+      position: absolute;
+      right: 20px;
+      bottom: 10px;
+    }
+  }
 </style>

+ 45 - 2
src/views/resetTeaming/components/strudentPayInfo.vue

@@ -186,7 +186,13 @@
         >
           开启缴费
         </div>
-
+        <div
+          class="newBand"
+          @click="payRemind"
+          v-permission="'musicGroupPaymentCalenderDetail/sendWaitRenewMessage'"
+        >
+          缴费提醒
+        </div>
         <!-- <div
           class="newBand"
           @click="addStudentBtn"
@@ -446,6 +452,7 @@ import {
   queryCanAddStudent,
   addMusicGroupPaymentCalenderStudent,
   delMusicGroupPaymentCalenderStudent,
+  sendWaitRenewMessage
 } from "@/api/buildTeam";
 
 export default {
@@ -609,7 +616,7 @@ export default {
           path: "/business/resetTeaming",
           query: { ...this.$route.query },
         });
-      } else if(query.type == 'look') {
+      } else if (query.type == "look") {
         this.$store.dispatch("delVisitedViews", this.$route);
         this.$router.push({
           path: "/business/teamLookBase",
@@ -782,6 +789,42 @@ export default {
       this.$refs.singleTable.setCurrentRow(row);
       this.studentVisible = false;
     },
+    payRemind(){
+       console.log(this.activeChiose)
+       let submitArr = [];
+       let msgArr = '';
+       let str = ''
+       this.activeChiose.forEach(item=>{
+         if(item.open){
+           submitArr.push(item.userId)
+         }else{
+           msgArr+=item?.sysUser?.username+','
+         }
+       })
+       console.log(submitArr,msgArr)
+
+       if(msgArr){
+         str=`${msgArr}未开启缴费无法提醒`
+       }else{
+         str='是否发送提醒'
+       }
+      this.$confirm(str, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async() => {
+          try{
+            const res = await sendWaitRenewMessage({studentIds:submitArr.join(','),calenderId:this.$route.query.paymentId})
+            this.$message.success('提醒成功')
+            this.getList()
+          }catch(e){
+
+          }
+        }).catch(() => {
+
+        });
+
+    }
   },
   watch: {
     payVisible(val) {