Browse Source

1231 17:19

提交测试
mo 5 years ago
parent
commit
e10fb74f0f

+ 13 - 2
src/views/resetTeaming/components/resetSound.vue

@@ -171,7 +171,6 @@
     <!-- <div class="remove"
              @click="removeListItem">删除</div> -->
     <div class="floor">
-
       <div class='add'
            @click="addListItem">添加</div>
     </div>
@@ -239,7 +238,7 @@ export default {
   mounted () {
     // 获取声部信息
     this.teamid = this.$route.query.id
-    this.getSound();
+
     sessionStorage.setItem('resetCode', '2');
     // 获取所有声部
     getSoundTree().then(res => {
@@ -249,6 +248,7 @@ export default {
         for (let key in this.soundList) {
           this.$set(this.soundLists, key, [])
         }
+        this.getSound();
       }
 
     })
@@ -265,6 +265,17 @@ export default {
             let obj = { 'id': item.subjectId, 'sound': item.subName, 'jihua': item.expectedStudentNum, 'yuji': item.fee, 'zhonglei': [], 'fangshi': item.kitGroupPurchaseType, 'fangshiprice': item.depositFee, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [], 'markChioseList': [] }
             return obj;
           })
+          // 这里循环
+          // console.log(this.soundList)
+          this.soundList.forEach((item, i) => {
+            item.subjects.forEach((some, j) => {
+              res.data.musicGroupSubjectPlans.forEach((sub, x) => {
+                if (sub.subjectId == some.id) {
+                  item.subjects.splice(j, 1)
+                }
+              })
+            })
+          })
           // 循环列表里的声部 拿取商品
           for (let i in this.activeSoundList) {
             for (let j in res.data.musicGroupSubjectGoodsGroups) {

+ 32 - 4
src/views/teamBuild/components/teamSoundMoney.vue

@@ -316,6 +316,7 @@ export default {
   methods: {
     // 改变checkbox
     changeList (e) {
+      // console.log(e)
     },
     handleSelectionChange (e) {
       // 点击改变勾选
@@ -346,7 +347,6 @@ export default {
               // 遍历循环所有的group 删除所选id
               for (let key in this.soundLists) {
                 if (this.soundLists[key].indexOf(this.multipleSelection[j].id) != -1) {
-
                   this.soundLists[key].splice(this.soundLists[key].indexOf(this.multipleSelection[j].id), 1)
                 }
               }
@@ -359,6 +359,7 @@ export default {
     },
     // 勾选选中框处理数据,存储勾选过的checkbox值
     checkinlist (obj) {
+      // console.log(this.activeSoundList)
       let flag = false;
       this.activeSoundList.map(item => {
         if (item.id == obj.id) {
@@ -737,10 +738,21 @@ export default {
           getDefaultSubject({ chargeTypeId: type, organId: this.topfor.section, number: 1 }).then(res => {
             if (res.code == 200) {
               this.activeSoundList = res.data.map(item => {
-                this.soundLists[0].push(item.id)
-                let obj = { 'id': item.id, 'sound': item.name, 'jihua': 0, 'yuji': item.fee, 'zhonglei': [], 'fangshi': '', 'fangshiprice': 1500, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [], 'markChioseList': [] }
+                // this.soundLists[0].push(item.subjectId)
+                let obj = { 'id': item.subjectId, 'sound': item.name, 'jihua': item.expectedStudentNum, 'yuji': item.fee, 'zhonglei': [], 'fangshi': item.kitGroupPurchaseType, 'fangshiprice': item.depositFee, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [], 'markChioseList': [] }
+                // this.checkinlist(obj);
                 return obj;
               })
+              //  = arr;
+              this.soundList.forEach((item, i) => {
+                item.subjects.forEach((some, j) => {
+                  res.data.forEach((sub, x) => {
+                    if (sub.id == some.id) {
+                      this.soundLists[i].push(some.id)
+                    }
+                  })
+                })
+              })
               // 并且把所有soundLists 里面
             }
           });
@@ -751,11 +763,27 @@ export default {
           this.teamid = this.$route.query.id;
           findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(res => {
             if (res.code == 200) {
+
               this.activeSoundList = res.data.musicGroupSubjectPlans.map(item => {
-                this.soundLists[0].push(item.subjectId)
+                // this.soundLists[0].push(item.subjectId)
                 let obj = { 'id': item.subjectId, 'sound': item.subName, 'jihua': item.expectedStudentNum, 'yuji': item.fee, 'zhonglei': [], 'fangshi': item.kitGroupPurchaseType, 'fangshiprice': item.depositFee, 'jiaopu': '', 'type': 1, 'typeVisible': false, 'provideVisible': false, 'markVisible': false, 'goodsList': [], 'markList': [], 'markChioseList': [] }
+                this.checkinlist(obj)
                 return obj;
               })
+              // this.activeSoundList = arr;
+              //   这里.....
+              this.soundList.forEach((item, i) => {
+                item.subjects.forEach((some, j) => {
+                  this.activeSoundList.forEach((sub, x) => {
+                    if (sub.id == some.id) {
+                      this.soundLists[i].push(some.id)
+                      // this.checkinlist(some)
+                      // this.activeSoundList.push(some)
+                      // 这里点击勾选
+                    }
+                  })
+                })
+              })
               // 循环列表里的声部 拿取商品
               for (let i in this.activeSoundList) {
                 for (let j in res.data.musicGroupSubjectGoodsGroups) {