Kaynağa Gözat

修改数据问题

wolyshaw 4 yıl önce
ebeveyn
işleme
a712659ff6

+ 3 - 1
src/views/accompaniment/index.vue

@@ -5,7 +5,7 @@
     </h2>
     <div class="m-core">
       <el-button @click="open('COMMON')" type="primary" v-permission="'sysExamSong/add'">添加公用伴奏</el-button>
-      <el-button @click="open('PERSON')" type="primary" v-permission="'sysExamSong/add'">添加个人伴奏</el-button>
+      <!-- <el-button @click="open('PERSON')" type="primary" v-permission="'sysExamSong/add'">添加个人伴奏</el-button> -->
       <saveform ref="searchForm" :model.sync="searchForm" inline style="margin-top: 20px">
         <el-form-item prop="search">
           <el-input v-model="searchForm.search" clearable placeholder="伴奏编号/伴奏名称"/>
@@ -122,6 +122,7 @@
       width="500px"
     >
       <submit-form
+        v-if="visible"
         :detail="detail"
         :type="type"
         @submited="FetchList"
@@ -214,6 +215,7 @@ export default {
     },
     open(type) {
       this.type = type
+      this.detail = null
       this.visible = true
     },
     async remove(row) {

+ 2 - 0
src/views/accompaniment/modals/form.vue

@@ -112,12 +112,14 @@ export default {
           if (!this.detail) {
             await Add({
               ...this.form,
+              subjectIds: this.form.subjectIds.join(','),
               type: this.type,
             })
             this.$message.success('提交成功')
           } else {
             await Update({
               ...this.form,
+              subjectIds: this.form.subjectIds.join(','),
               type: this.type,
               id: this.detail.id
             })