فهرست منبع

组件抽离备份

1
mo 4 سال پیش
والد
کامیت
c938309535

+ 1 - 0
package.json

@@ -27,6 +27,7 @@
     "i": "^0.3.6",
     "js-cookie": "2.2.0",
     "linq": "^3.2.2",
+    "lodash": "^4.17.20",
     "node-sass": "^4.13.1",
     "normalize.css": "7.0.0",
     "npm": "^6.13.0",

+ 1 - 1
src/App.vue

@@ -319,7 +319,7 @@ input[type="number"] {
   .nextBtn {
     width: 120px;
     height: 40px;
-    background-color: #444;
+    background-color: #13817a;
   }
   .okBtn {
     width: 120px;

+ 1 - 1
src/views/accompanyManager/accompanys.vue

@@ -810,7 +810,7 @@ export default {
       });
     },
     getList () {
-      findPracticeGroupCourseSchedules({ practiceId: this.practiceId }).then(
+      findPracticeGroupCourseSchedules({ practiceId: this.practiceId, page: this.pageInfo.page, rows: this.pageInfo.limit }).then(
         res => {
           if (res.code == 200) {
             this.tableList = res.data.pageInfo.rows;

+ 76 - 46
src/views/teamBuild/components/soundSetComponents/chioseMusic.vue

@@ -1,40 +1,58 @@
 <template>
   <div>
+    <div v-for="(music,index) in item.chioseMusic">
+      </el-row class="chioseMusic">
+      <el-col>
+        <div class="flexRow">
+          <p class="title">可选乐器{{index+1}}:</p>
+          <el-select style="width:180px"
+                     v-model="music.musical"
+                     @change="(val)=>{chioseMusic(val,music)}">
+            <el-option v-for="(item,index) in item.goodsList"
+                       :key="index"
+                       :label="item.name"
+                       :value="item.id"></el-option>
+          </el-select>
+          <el-checkbox-group v-model="music.type"
+                             class="marginLeft10">
+            <el-checkbox label="GROUP">团购</el-checkbox>
+            <el-checkbox label="LEASE">租赁</el-checkbox>
+            <el-checkbox label="FREE">免费</el-checkbox>
+          </el-checkbox-group>
+        </div>
+      </el-col>
+      <el-col :xs="24"
+              :sm="24"
+              :md="18"
+              :lg="12">
+        <div class="flexRow">
+          <p class="title">团购价:</p>
+          <el-input type="number"
+                    v-if="music.type&&music.type.length>0?music.type.includes('GROUP'):false"
+                    v-model="music.groupPrice"
+                    disabled
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <el-input value="--"
+                    v-else
+                    disabled
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <p class="title">租赁押金:</p>
+          <el-input type="number"
+                    v-if="music.type&&music.type.length>0?music.type.includes('LEASE'):false"
+                    v-model="music.borrowPrice"
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <el-input value="--"
+                    v-else
+                    disabled
+                    style="width:180px"> <template slot="append">元</template></el-input>
+          <i class="el-icon-close marginLeft10"
+             v-if="item.chioseMusic.length >1"
+             @click="deleteMusic(music)"
+             style="font-size:20px; cursor: pointer;"></i>
+        </div>
 
-    <div class="chioseMusic coreItemRow"
-         v-for="(music,index) in item.chioseMusic">
-      <p class="title">可选乐器{{index+1}}:</p>
-      <el-select style="width:180px"
-                 v-model="music.musical"
-                 @change="(val)=>{chioseMusic(val,music)}">
-        <el-option v-for="(item,index) in item.goodsList"
-                   :key="index"
-                   :label="item.name"
-                   :value="item.id"></el-option>
-      </el-select>
-      <el-radio-group v-model="music.type"
-                      class="marginLeft10">
-        <el-radio label="GROUP">团购</el-radio>
-        <el-radio label="LEASE">租赁</el-radio>
-        <el-radio label="FREE">免费</el-radio>
-      </el-radio-group>
-      <el-input type="number"
-                v-if="music.type == 'GROUP'"
-                class="marginLeft10"
-                v-model="music.groupPrice"
-                disabled
-                style="width:140px"> <template slot="append">元</template></el-input>
-      <el-input type="number"
-                v-else-if="music.type == 'LEASE'"
-                v-model="music.borrowPrice"
-                class="marginLeft10"
-                style="width:140px"> <template slot="append">元</template></el-input>
-      <div style="width:150px"
-           v-else></div>
-      <i class="el-icon-close marginLeft10"
-         v-if="item.chioseMusic.length >1"
-         @click="deleteMusic(music)"
-         style="font-size:20px; cursor: pointer;"></i>
+      </el-col>
+      </el-row>
     </div>
     <div class="coreItemRow">
       <p class="title"></p>
@@ -56,11 +74,12 @@ export default {
       goods: ''
     }
   },
-  mounted () { },
+  created () { console.log(this.item) },
+  mounted () {
+
+  },
   methods: {
     chioseMusic (val, music) {
-
-
       this.item.goodsList.map((some, index) => {
         if (some.id == val) {
           music.groupPrice = some.groupPurchasePrice
@@ -69,7 +88,7 @@ export default {
       })
     },
     addMusic () {
-      this.item.chioseMusic.push({ musical: '', type: 'GROUP', groupPrice: 0, borrowPrice: 1500 })
+      this.item.chioseMusic.push({ musical: '', type: ['GROUP'], groupPrice: null, borrowPrice: 1500 })
       this.$emit('lookMusic')
     },
     deleteMusic (music) {
@@ -85,6 +104,9 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+.chioseMusic {
+  width: 100%;
+}
 .coreItemRow {
   padding-left: 20px;
   height: 50px;
@@ -92,16 +114,24 @@ export default {
   display: flex;
   flex-direction: row;
   align-items: center;
-  p {
-    margin-right: 10px;
-  }
-  .title {
-    width: 100px;
-    text-align: right;
-  }
+  width: 100%;
+}
+p {
+  margin-right: 10px;
+}
+.title {
+  width: 100px;
+  text-align: right;
+  margin-right: 10px;
 }
-
 .marginLeft10 {
   margin-left: 10px;
 }
+.flexRow {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  padding-left: 20px;
+  margin-top: 10px;
+}
 </style>

+ 10 - 4
src/views/teamBuild/components/soundSetComponents/chioseSoundList.vue

@@ -8,11 +8,12 @@
           <div class="categroy"
                v-for="(item,index) in soundList"
                :key="index">
-            <p>{{item.name }}</p>
+            <p>{{item.name}}</p>
             <el-checkbox :label="sound.id"
                          @change="changeCheck"
+                         :disabled="activeSoundList.includes(sound.id)"
                          v-for="(sound,indexs) in item.subjects"
-                         :key="indexs">{{sound.name }}</el-checkbox>
+                         :key="indexs">{{sound.name}}</el-checkbox>
           </div>
         </div>
       </el-checkbox-group>
@@ -34,18 +35,21 @@ export default {
   data () {
     return {
       chioseSoundNum: '',
-      activeSoundList: this.activeSound,
+      activeSoundList: this.activeSound || [],
     }
   },
   mounted () {
     console.log(this.soundList)
   },
+  activated () {
+    console.log(this.soundList)
+  },
   methods: {
     generates () {
       this.$emit('chioseSound', this.activeSoundList)
     },
     changeCheck () {
-      console.log(this.activeSoundList)
+      console.log(this.soundList)
     }
   }
 }
@@ -64,8 +68,10 @@ export default {
     max-height: 300px;
     overflow: auto;
     .categroy {
+      z-index: 100;
       width: 150px;
       min-width: 150px;
+      color: #606266;
       .el-checkbox {
         height: 30px;
         line-height: 30px;

+ 0 - 0
src/views/teamBuild/components/soundSetComponents/soundSetCore.vue


+ 0 - 0
src/views/teamBuild/components/teamPayInfo.vue


+ 284 - 48
src/views/teamBuild/components/teamSoundSet.vue

@@ -5,15 +5,17 @@
       <p style="margin-left:30px;">计划招生人数(个):{{PlannedCount}}</p>
     </div>
     <div class="soundBtnWrap">
-      <el-button type="primary">全选</el-button>
-      <el-button type="danger">删除</el-button>
+      <el-button type="primary"
+                 @click="allin">全选</el-button>
+      <el-button type="danger"
+                 @click="deleteRow">删除</el-button>
       <el-button type="primary"
                  @click="soundVisible = true">添加</el-button>
     </div>
     <div class="coreWrap">
       <el-checkbox-group v-model="checkList"
                          @change='lookCheck'>
-        <el-collapse v-model="activeSound"
+        <el-collapse v-model="chioseActiveSound"
                      accordion
                      @change="changeActiveSound">
           <el-collapse-item v-for="(item,index) in activeSoundList"
@@ -51,9 +53,16 @@
         </el-collapse>
       </el-checkbox-group>
     </div>
+    <div class="btnWrap">
+      <div class="PrevBtn"
+           @click="goback">上一步</div>
+      <!--  v-if="teamStatus != 'teamAudit'" -->
+      <div class="submitBtn"
+           v-permission="{child: 'musicGroup/createGroup', parent: '/teamBuild/soundMoney'}"
+           @click="submitInfo()">下一步</div>
+    </div>
     <el-dialog title="声部选择"
-               :visible.sync="soundVisible"
-               :modal-append-to-body="false">
+               :visible.sync="soundVisible">
       <chioseSoundList :soundList="soundList"
                        :activeSound='activeSound'
                        @chioseSound="chioseSound" />
@@ -79,13 +88,12 @@ import dayjs from 'dayjs'
 import chioseMusic from './soundSetComponents/chioseMusic'
 import chioseAccessory from './soundSetComponents/chioseAccessory'
 import chioseSoundList from './soundSetComponents/chioseSoundList'
+import { findIndex } from 'lodash'
 export default {
   components: { chioseMusic, chioseAccessory, chioseSoundList },
   data () {
     return {
       topfor: null, // 第一页的数据
-      chioseSoundNum: 0,
-      PlannedCount: 0,
       checkList: [],
       Fsearch: null,
       Frules: null,
@@ -95,6 +103,7 @@ export default {
       teamStatus: '',// 乐团状态
       activeSoundList: [], //列表上的声部
       activeSound: null, // 展开的列表
+      chioseActiveSound: null
     }
   },
   mounted () {
@@ -129,20 +138,63 @@ export default {
                   return this.initSound(item);
                 });
                 this.activeSound = activeSound;
-
-                //  = 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 里面
+                this.chioseActiveSound = activeSound[0]
+                this.changeActiveSound(activeSound[0])
               }
             });
+          } else {
+            this.$nextTick(res => {
+              this.teamid = this.$route.query.id;
+              findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(
+                res => {
+                  if (res.code == 200) {
+                    let activeSound = []
+                    this.activeSoundList = res.data?.musicGroupSubjectPlans.map(item => {
+                      activeSound.push(item.subjectId)
+                      return {
+                        id: parseInt(item.subjectId),
+                        sound: item.subName,
+                        expectedStudentNum: item.expectedStudentNum,
+                        chioseMusic: [],
+                        markChioseList: [],
+                        goodsList: [],
+                        markList: [],
+                      }
+                    })
+                    this.activeSound = activeSound;
+                    console.log(this.activeSound)
+                    // 格式化商品和教辅
+
+                    res.data.musicGroupSubjectGoodsGroups.forEach(shop => {
+                      let index = findIndex(this.activeSoundList, (o) => {
+                        return o.id == shop.subjectId
+                      })
+
+                      if (index != -1) {
+                        if (shop.type == 'ACCESSORIES') {
+                          shop.goodsIdList.split(',').forEach(item => {
+                            this.activeSoundList[index].markChioseList.push(parseInt(item))
+                          })
+                        } else if (shop.type == 'INSTRUMENT') {
+                          // 商品
+                          let typeJson = Object.keys(JSON.parse(shop.kitGroupPurchaseTypeJson))
+                          this.activeSoundList[index].chioseMusic.push({
+                            musical: parseInt(shop.goodsIdList),
+                            type: typeJson,
+                            groupPrice: shop.price,
+                            borrowPrice: shop.depositFee
+                          })
+                        }
+
+                      }
+
+
+                    })
+
+
+                  }
+                })
+            })
           }
         }
       });
@@ -153,30 +205,25 @@ export default {
       })
     },
     lookCheck (val) {
-      console.log(val)
+      this.checkList = [...new Set(val)]
     },
     chioseSound (activeSound) {
       // 同步数据
-      this.activeSound = activeSound;
+      this.activeSound = [...new Set(activeSound)];
       let newSoundList = []
 
       for (let i in this.childSoundList) {
-        if (activeSound.includes(this.childSoundList[i].id)) {
-          console.log(this.childSoundList[i])
+        if (this.activeSound.includes(this.childSoundList[i].id)) {
           newSoundList.push(this.initSound(this.childSoundList[i]))
         }
-
       }
-
       let idList = this.activeSoundList.map(item => {
-        console.log(item)
         return item.id
       })
-      console.log(newSoundList, idList, this.activeSoundList)
       for (let x in newSoundList) {
-        if (idList.includes(newSoundList[x].id)) {
-          console.log(x)
-          newSoundList[x] = this.activeSoundList[x]
+        const indexof = idList.indexOf(newSoundList[x]?.id)
+        if (indexof > -1) {
+          newSoundList[x] = this.activeSoundList[indexof]
         }
       }
       this.activeSoundList = newSoundList
@@ -187,7 +234,7 @@ export default {
         id: item.id,
         sound: item.name,
         expectedStudentNum: item.expectedStudentNum,
-        chioseMusic: [{ musical: '', type: 'GROUP', groupPrice: 0, borrowPrice: 1500 }],
+        chioseMusic: [{ musical: '', type: ["GROUP"], groupPrice: 0, borrowPrice: 1500 }],
         markChioseList: [],
         goodsList: [],
         markList: [],
@@ -196,29 +243,204 @@ export default {
       return obj
     },
     changeActiveSound (val) {
-      this.activeSoundList.map(item => {
+      this.activeSoundList.forEach(item => {
         if (item.id == val) {
-          getSubjectGoods({ subjectId: item.id, chargeTypeId: this.topfor.type }).then(res => {
+          if (item.goodsList.length < 1 || item.markList.length < 1) {
+            getSubjectGoods({ subjectId: item.id, chargeTypeId: this.topfor.type }).then(res => {
+              if (res.code == 200) {
+                let goodList = []
+                let markList = []
+                res.data.forEach(item => {
+                  if (item.type == 'INSTRUMENT') {
+                    goodList.push(item)
+                  } else if (item.type == 'ACCESSORIES') {
+                    markList.push(item)
+                  }
+                })
+                item.goodsList = goodList;
+                item.markList = markList;
+              }
+            });
+          }
+
+        }
+      })
+    },
+    lookMusic () {
+
+    },
+    goback () {
+      this.$emit("chiosetab", 0);
+    },
+    submitInfo () {
+      // 计划招生人数
+      // 可选乐器
+      // 教辅
+      this.activeSoundList.forEach(item => {
+        if (!item.expectedStudentNum) {
+          this.$message.error(`请填写${item.sound}的预计招生人数`)
+          return
+        }
+        if (!item.chioseMusic[0].musical) {
+          this.$message.error(`请至少一个选择${item.sound}的可选乐器`)
+          return
+        }
+      })
+      // 新建团
+      let obj = {}
+      if (this.teamStatus == "newTeam") {
+        this.initCreateTeam(obj)
+      }
+      //  初始化声部
+      obj.musicGroupSubjectGoodsGroups = [];
+      obj.musicGroupSubjectPlans = [];
+      this.activeSoundList.forEach(active => {
+        // 格式化声部数据
+        let item = {
+          expectedStudentNum: active.expectedStudentNum,
+          subName: active.sound,
+          subjectId: active.id
+        };
+        obj.musicGroupSubjectPlans.push(item);
+        // 格式化商品数据 chioseMusic: [{ musical: '', type: ["GROUP"], groupPrice: 0, borrowPrice: 1500 }],
+        active.chioseMusic.forEach(music => {
+          let goodsItem = null;
+          let depositFee = music.borrowPrice
+          let price = music.groupPrice
+          let index = findIndex(active.goodsList, (o) => {
+            return o.id == music.musical
+          })
+          if (index != -1) {
+            goodsItem = active.goodsList[index]
+          }
+          let kitGroupPurchaseTypeJson = {}
+          music.type.forEach(type => {
+            kitGroupPurchaseTypeJson[type] = 0
+          })
+          kitGroupPurchaseTypeJson = JSON.stringify(kitGroupPurchaseTypeJson)
+          if (goodsItem) {
+            let some = {
+              subjectId: active.id,
+              type: "INSTRUMENT",
+              goodsIdList: music.musical,
+              name: goodsItem.name,
+              kitGroupPurchaseTypeJson,
+              depositFee,
+              price
+            };
+            obj.musicGroupSubjectGoodsGroups.push(some);
+          }
+        })
+        // 格式化辅件
+        //  markChioseList: [],
+        // goodsList: [],
+        // markList: [],
+        active.markChioseList.forEach(ass => {
+          let index = findIndex(active.markList, (o) => {
+            return o.id == ass
+          })
+          let goodsItem = null;
+          if (index != -1) {
+            goodsItem = active.markList[index]
+          }
+          if (goodsItem) {
+            let some = {
+              subjectId: active.id,
+              type: "ACCESSORIES",
+              goodsIdList: ass,
+              name: goodsItem.name,
+              price: goodsItem.groupPurchasePrice,
+            };
+            obj.musicGroupSubjectGoodsGroups.push(some);
+          }
+
+        })
+        if (this.teamStatus == 'newTeam') {
+          createTeam(obj).then(res => {
+            if (res.code == 200) {
+              // 成功 跳转到乐团报名详情
+            }
+          });
+        } else {
+          obj.musicGroupId = this.teamid
+          obj.musicGroupStatus = "DRAFT"
+          updateSubjectInfo(obj).then(res => {
             if (res.code == 200) {
-              let goodList = []
-              let markList = []
-              res.data.forEach(item => {
-                if (item.type == 'INSTRUMENT') {
-                  goodList.push(item)
-                } else if (item.type == 'ACCESSORIES') {
-                  markList.push(item)
-                }
-              })
-              item.goodsList = goodList;
-              item.markList = markList;
+              this.$message.success("提交成功");
             }
           });
         }
       })
     },
-    lookMusic () {
-      console.log(this.activeSoundList)
+    deleteRow () {
+      if (this.checkList.length < 1) {
+        this.$message.error('请至少勾选一个')
+        return
+      }
+      for (let i = 0; i < this.activeSoundList.length; i++) {
+        let index = this.checkList.indexOf(this.activeSoundList[i].id)
+        if (index != -1) {
+          this.activeSoundList.splice(i, 1)
+          this.activeSound.splice(i, 1)
+          i--
+        }
+      }
+      this.checkList = []
+
+
+    },
+    allin () {
+      this.checkList = []
+      this.activeSoundList.forEach((item, index) => {
+        this.checkList.push(item.id)
+      })
+
+    },
+
+    initCreateTeam (obj) {
+      let enrollClasses;
+      this.topfor.startClass
+        ? (enrollClasses = this.topfor.startClass.join(","))
+        : (enrollClasses = null);
+      obj.musicGroup = {
+        settlementType: this.topfor.salary,
+        applyExpireDate: dayjs(this.topfor.time).format('YYYY-MM-DD HH:mm:ss'),
+        chargeTypeId: this.topfor.type,
+        cooperationOrganId: this.topfor.school,
+        teamTeacherId: this.topfor.boss,
+        educationalTeacherId: this.topfor.teacher,
+        enrollClasses,
+        name: this.topfor.name,
+        organId: this.topfor.section,
+        paymentPattern: this.topfor.paymentPattern,
+        paymentValidStartDate: this.topfor.paymentValidStartDate ? dayjs(this.topfor.paymentValidStartDate).format('YYYY-MM-DD') : this.topfor.paymentValidStartDate,
+        paymentValidEndDate: this.topfor.paymentValidEndDate ? dayjs(this.topfor.paymentValidEndDate).format('YYYY-MM-DD') : this.topfor.paymentValidEndDate,
+        // paymentMonths:obj.months  有待确认
+        schoolId: this.topfor.address,
+        expectStartGroupDate: this.topfor.startTime,
+        isClassroomLessons: this.topfor.isClass,
+        status,
+        ownershipType: this.topfor.ownershipType,
+        repairUserId: this.topfor.repairUserId,
+        feeType: this.topfor.feeType
+      };
+      return obj
     }
+  },
+  computed: {
+    PlannedCount () {
+      let Count = 0;
+      if (this.activeSoundList.length > 0) {
+        for (let item in this.activeSoundList) {
+          Count += parseInt(this.activeSoundList[item]?.expectedStudentNum) || 0;
+        }
+      }
+
+      return Count;
+    }, chioseSoundNum () {
+
+      return this.activeSoundList.length;
+    },
   }
 }
 </script>
@@ -240,8 +462,8 @@ export default {
 }
 .coreItemTitle {
   background-color: #edeef0;
-  height: 48px;
-  line-height: 48px;
+  height: 46px;
+  line-height: 46px;
   padding: 0 20px;
 }
 .coreItem {
@@ -264,4 +486,18 @@ export default {
 .marginLeft10 {
   margin-left: 10px;
 }
+/deep/.el-collapse-item__header {
+  border-bottom: 1px solid #fff;
+}
+.btnWrap {
+  margin-top: 40px;
+  .PrevBtn {
+    background-color: #13817a;
+    width: 120px;
+  }
+  .submitBtn {
+    background-color: #13817a;
+    width: 120px;
+  }
+}
 </style>