Jelajahi Sumber

Merge branch '03/03SAVECHECK' into online

mo 4 tahun lalu
induk
melakukan
8d4c9709d9

+ 2 - 1
src/router/notKeepAliveList.js

@@ -91,7 +91,8 @@ export default [
   '/arrearage-students',
   '/business/strudentPayInfo',
   '/timedTask/timedTask',
-  '/business/createPayment'
+  '/business/createPayment',
+  '/business/teamDraft'
   // '/business/teamAudit',
   // '/business/feeAudit',
 ]

+ 108 - 95
src/views/teamBuild/components/soundSetComponents/soundSetCore.vue

@@ -1,6 +1,9 @@
 <template>
   <div>
-    <div :class="isField ? 'soundBtnWrap' : 'soundBtnFixed'"   v-if="teamStatus != 'resetTeam' && !basdisabled">
+    <div
+      :class="isField ? 'soundBtnWrap' : 'soundBtnFixed'"
+      v-if="teamStatus != 'resetTeam' && !basdisabled"
+    >
       <el-button
         type="primary"
         @click="allin"
@@ -17,7 +20,7 @@
         >添加</el-button
       >
     </div>
-    <div class="wall"  v-if="teamStatus != 'resetTeam' && !basdisabled"></div>
+    <div class="wall" v-if="teamStatus != 'resetTeam' && !basdisabled"></div>
     <div class="coreWrap">
       <el-checkbox-group v-model="checkList" @change="lookCheck">
         <el-collapse v-model="chioseActiveSound">
@@ -139,17 +142,22 @@ export default {
     this.init();
   },
   deactivated() {
-       window.removeEventListener("scroll", this.getScroll);
+    window.removeEventListener("scroll", this.getScroll);
+  },
+  beforeDestroy() {
+    sessionStorage.setItem(
+      `${this.teamid}sound`,
+      JSON.stringify(this.activeSoundList)
+    );
   },
   activated() {
-
-    if (this.teamid && this.teamid != this.$route.query.id||this.teamStatus !=this.$route.query.type) {
-
+    if (
+      (this.teamid && this.teamid != this.$route.query.id) ||
+      this.teamStatus != this.$route.query.type
+    ) {
       this.init();
-    }
-
-    else {
-      if (!this.teamid&& this.activeSoundList.length < 1) {
+    } else {
+      if (!this.teamid && this.activeSoundList.length < 1) {
         this.init();
       }
     }
@@ -164,13 +172,7 @@ export default {
       this.basdisabled = false;
     }
   },
-destroyed() {
-   this.activeSoundList = [];
-},
-  deactivated() {
 
-
-  },
   methods: {
     init() {
       // 获取第一页的数据
@@ -187,87 +189,101 @@ destroyed() {
       } else {
         this.basdisabled = false;
       }
-      getSoundTree({ tenantId: 1 }).then((res) => {
-        if (res.code == 200) {
-          this.soundList = res.data.rows;
-          if (this.teamStatus == "newTeam" && type && section) {
-            getDefaultSubject({
-              chargeTypeId: type,
-              organId: section,
-              number: 1,
-            }).then((res) => {
-              if (res.code == 200) {
-                let activeSound = [];
-                this.activeSoundList = res.data.map((item) => {
-                  activeSound.push(item.id);
-                  return this.initSound(item);
-                });
-                this.activeSound = activeSound;
-                this.chioseActiveSound = activeSound;
-                this.changeActiveSound(activeSound.join(","));
-              }
-            });
-          } else {
-            this.teamid = this.$route.query.id;
-            if (this.teamid) {
-              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;
-                    this.chioseActiveSound = activeSound;
-                    this.changeActiveSound(activeSound.join(","));
-                    // 格式化商品和教辅
-                    res.data.musicGroupSubjectGoodsGroups.forEach((shop) => {
-                      let index = findIndex(this.activeSoundList, (o) => {
-                        return o.id == shop.subjectId;
-                      });
+      let sotrage = JSON.parse(
+        sessionStorage.getItem(`${this.$route.query.id}sound`)
+      );
+      if (sotrage&&sotrage[0]?.id) {
+        this.activeSoundList = sotrage;
+        let activeSound = [];
 
-                      if (index != -1) {
-                        if (shop.type == "ACCESSORIES") {
-                          shop.goodsIdList.split(",").forEach((item) => {
-                            this.activeSoundList[index].markChioseList.push(
-                              parseInt(item)
+        this.activeSoundList.forEach((item) => {
+          activeSound.push(item.id);
+        });
+        this.chioseActiveSound = activeSound;
+      } else {
+        getSoundTree({ tenantId: 1 }).then((res) => {
+          if (res.code == 200) {
+            this.soundList = res.data.rows;
+            if (this.teamStatus == "newTeam" && type && section) {
+              getDefaultSubject({
+                chargeTypeId: type,
+                organId: section,
+                number: 1,
+              }).then((res) => {
+                if (res.code == 200) {
+                  let activeSound = [];
+                  this.activeSoundList = res.data.map((item) => {
+                    activeSound.push(item.id);
+                    return this.initSound(item);
+                  });
+                  this.activeSound = activeSound;
+                  this.chioseActiveSound = activeSound;
+                  this.changeActiveSound(activeSound.join(","));
+                }
+              });
+            } else {
+              this.teamid = this.$route.query.id;
+              if (this.teamid) {
+                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;
+                      this.chioseActiveSound = activeSound;
+                      this.changeActiveSound(activeSound.join(","));
+                      // 格式化商品和教辅
+                      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)
                             );
-                          });
-                        } 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,
-                            groupRemissionCourseFee: Boolean(
-                              shop.groupRemissionCourseFee
-                            ),
-                          });
+                            this.activeSoundList[index].chioseMusic.push({
+                              musical: parseInt(shop.goodsIdList),
+                              type: typeJson,
+                              groupPrice: shop.price,
+                              borrowPrice: shop.depositFee,
+                              groupRemissionCourseFee: Boolean(
+                                shop.groupRemissionCourseFee
+                              ),
+                            });
+                          }
                         }
-                      }
-                    });
+                      });
+                    }
                   }
-                }
-              );
+                );
+              }
             }
           }
-        }
-      });
+        });
+      }
+
       getSubject({ tenantId: 1 }).then((res) => {
         if (res.code == 200) {
           this.childSoundList = res.data;
@@ -610,10 +626,7 @@ destroyed() {
         window.pageYOffset ||
         document.documentElement.scrollTop ||
         document.body.scrollTop;
-      if (
-        !!this.scrollTop &&
-        this.scrollTop >= 210
-      ) {
+      if (!!this.scrollTop && this.scrollTop >= 210) {
         this.isField = false;
       } else {
         this.isField = true;

+ 137 - 102
src/views/teamBuild/components/teamBaseInfo.vue

@@ -333,7 +333,6 @@
   </div>
 </template>
 <script>
-
 import {
   getSection,
   getType,
@@ -414,24 +413,23 @@ export default {
     if (this.$route.query.id) {
       this.teamid = this.$route.query.id;
     }
-    this.teamStatus =this.$route.query.type
+    this.teamStatus = this.$route.query.type;
     if (this.$route.query.type == "newTeam") {
       this.onReset();
     }
- console.log(this.$route.query)
+
     this.init();
-    // this.$forceUpdate();
   },
   activated() {
-    // console.log('直接进编辑')
-    if (this.teamid && this.teamid != this.$route.query.id || this.teamStatus !=this.$route.query.type) {
-          this.init();
+    if (
+      (this.teamid && this.teamid != this.$route.query.id) ||
+      this.teamStatus != this.$route.query.type
+    ) {
+      this.init();
     }
 
-    if (this.$route.query.clear == 'true') {
-
+    if (this.$route.query.clear == "true") {
       this.onReset();
-
     }
     if (this.teamStatus == "newTeam") {
       this.$store.dispatch("buildIndex", 0);
@@ -440,22 +438,26 @@ export default {
     if (this.teamStatus != "newTeam") {
       this.$store.dispatch("draftIndex", 0);
     }
-      this.teamStatus = this.$route.query.type;
+    this.teamStatus = this.$route.query.type;
 
-      if (
-        this.teamStatus == "look" ||
-        this.teamStatus == "teamAudit" ||
-        this.teamStatus == "feeAudit"
-      ) {
-        this.basdisabled = true;
-      } else {
-        this.basdisabled = false;
-      }
+    if (
+      this.teamStatus == "look" ||
+      this.teamStatus == "teamAudit" ||
+      this.teamStatus == "feeAudit"
+    ) {
+      this.basdisabled = true;
+    } else {
+      this.basdisabled = false;
+    }
   },
   deactivated() {
-    this.teamStatus = 'dis'
+
+  },
+  beforeDestroy(){
+    sessionStorage.setItem(`${this.teamid}base`,JSON.stringify(this.topFrom));
   },
 
+
   methods: {
     //|| this.teamStatus === 'teamAudit'
     isNotEditing: function () {
@@ -492,12 +494,6 @@ export default {
     },
     init() {
       this.isInit = true;
-
-      // 分为3种  this.teamStatus
-      //          1.resetTeam 乐团修改
-      //          2. newTeam  新建乐团
-      //          3.teamList  跨团修改
-      //          4.teamDraft 乐团草稿
       this.teamStatus = this.$route.query.type;
       if (this.teamStatus == "newTeam") {
         this.$store.dispatch("buildIndex", 0);
@@ -509,12 +505,10 @@ export default {
       // 传过来的乐团信息
       this.activeTeam = this.getTeamList;
       if (
-
         this.teamStatus == "look" ||
         this.teamStatus == "teamAudit" ||
         this.teamStatus == "feeAudit"
       ) {
-
         this.basdisabled = true;
       } else {
         this.basdisabled = false;
@@ -522,87 +516,128 @@ export default {
       if (this.$route.query.id) {
         // 单团修改
         this.teamid = this.$route.query.id;
-        getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
-          if (res.code == 200) {
-            // if (this.$listeners.getBaseInfo) {
-            //   this.$listeners.getBaseInfo(res.data);
-            // }
+        let sotrage = JSON.parse(sessionStorage.getItem(`${this.$route.query.id}base`)) ;
+        if (!sotrage?.section) {
 
-            // 头部
-            this.topFrom.name = res.data.musicGroup.name;
-            this.$emit("getName", this.topFrom.name);
-            this.topFrom.time = res.data.musicGroup.applyExpireDate;
-            this.topFrom.type = res.data.musicGroup.chargeTypeId;
-            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.courseViewType = res.data.musicGroup.courseViewType;
-            this.topFrom.school = res.data.musicGroup.cooperationOrganId;
-            this.topFrom.teacher = res.data.musicGroup.educationalTeacherId;
-            this.topFrom.boss = res.data.musicGroup.teamTeacherId;
-            this.topFrom.address = res.data.musicGroup.schoolId;
-            this.topFrom.salary = res.data.musicGroup.settlementType;
-            this.topFrom.head = res.data.musicGroup.directorUserId
-              ? res.data.musicGroup.directorUserId
-              : null;
-            this.topFrom.isClass = res.data.musicGroup.isClassroomLessons;
-            this.topFrom.startTime = res.data.musicGroup.expectStartGroupDate;
-            this.topFrom.ownershipType = res.data.musicGroup.ownershipType;
-            this.topFrom.repairUserId = res.data.musicGroup.repairUserId
-              ? res.data.musicGroup.repairUserId
-              : null;
-            this.topFrom.feeType = res.data.musicGroup.feeType
-              ? res.data.musicGroup.feeType
-              : null;
-            // // 循环缴费月
-            // this.payList.chioseMonth = res.data.months;
-            if (res.data.musicGroup.organId) {
-              // 获取员工
-              queryEmployByOrganId({
-                organId: res.data.musicGroup.organId,
-                rows: 1000,
-              }).then((res) => {
-                if (res.code == 200) {
-                  this.orgianList = res.data.rows;
-                }
-              });
-              // 获取合作单位
-              queryByOrganId({ organId: res.data.musicGroup.organId }).then(
-                (res) => {
+          getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
+            if (res.code == 200) {
+              // if (this.$listeners.getBaseInfo) {
+              //   this.$listeners.getBaseInfo(res.data);
+              // }
+
+              // 头部
+              this.topFrom.name = res.data.musicGroup.name;
+
+              this.topFrom.time = res.data.musicGroup.applyExpireDate;
+              this.topFrom.type = res.data.musicGroup.chargeTypeId;
+              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;
+              this.topFrom.boss = res.data.musicGroup.teamTeacherId;
+              this.topFrom.address = res.data.musicGroup.schoolId;
+              this.topFrom.salary = res.data.musicGroup.settlementType;
+              this.topFrom.head = res.data.musicGroup.directorUserId
+                ? res.data.musicGroup.directorUserId
+                : null;
+              this.topFrom.isClass = res.data.musicGroup.isClassroomLessons;
+              this.topFrom.startTime = res.data.musicGroup.expectStartGroupDate;
+              this.topFrom.ownershipType = res.data.musicGroup.ownershipType;
+              this.topFrom.repairUserId = res.data.musicGroup.repairUserId
+                ? res.data.musicGroup.repairUserId
+                : null;
+              this.topFrom.feeType = res.data.musicGroup.feeType
+                ? res.data.musicGroup.feeType
+                : null;
+              // // 循环缴费月
+              // this.payList.chioseMonth = res.data.months;
+              if (res.data.musicGroup.organId) {
+                // 获取员工
+                queryEmployByOrganId({
+                  organId: res.data.musicGroup.organId,
+                  rows: 1000,
+                }).then((res) => {
                   if (res.code == 200) {
-                    this.cooperationList = res.data;
+                    this.orgianList = res.data.rows;
                   }
-                }
-              );
-              // 获取教学点
-              getSchool({ organId: res.data.musicGroup.organId }).then(
-                (res) => {
+                });
+                // 获取合作单位
+                queryByOrganId({ organId: res.data.musicGroup.organId }).then(
+                  (res) => {
+                    if (res.code == 200) {
+                      this.cooperationList = res.data;
+                    }
+                  }
+                );
+                // 获取教学点
+                getSchool({ organId: res.data.musicGroup.organId }).then(
+                  (res) => {
+                    if (res.code == 200) {
+                      this.addList = res.data;
+                      this.isInit = false;
+                    }
+                  }
+                );
+
+                // 获取维修技师
+                findTechnician().then((res) => {
                   if (res.code == 200) {
-                    this.addList = res.data;
-                    this.isInit = false;
+                    this.technician = res.data;
                   }
-                }
-              );
+                });
+              }
+              this.$emit("getBaseInfo", res.data);
 
-              // 获取维修技师
-              findTechnician().then((res) => {
-                if (res.code == 200) {
-                  this.technician = res.data;
-                }
-              });
             }
-            this.$emit("getBaseInfo", res.data);
-          }
-        });
-      } else {
-      }
+          });
+        }else{
+          this.topFrom = sotrage
+             if ( this.topFrom.section) {
+                // 获取员工
+                queryEmployByOrganId({
+                  organId: this.topFrom.section,
+                  rows: 1000,
+                }).then((res) => {
+                  if (res.code == 200) {
+                    this.orgianList = res.data.rows;
+                  }
+                });
+                // 获取合作单位
+                queryByOrganId({ organId: this.topFrom.section }).then(
+                  (res) => {
+                    if (res.code == 200) {
+                      this.cooperationList = res.data;
+                    }
+                  }
+                );
+                // 获取教学点
+                getSchool({ organId: this.topFrom.section }).then(
+                  (res) => {
+                    if (res.code == 200) {
+                      this.addList = res.data;
+                      this.isInit = false;
+                    }
+                  }
+                );
 
+                // 获取维修技师
+                findTechnician().then((res) => {
+                  if (res.code == 200) {
+                    this.technician = res.data;
+                  }
+                });
+             }
+
+             }
+      }
+      this.$emit("getName", this.topFrom.name);
       getEmployeeOrgan().then((res) => {
         if (res.code == 200) {
           this.sectionList = res.data;

+ 6 - 1
src/views/teamBuild/teamDraft.vue

@@ -46,11 +46,13 @@
       <div class="stepcontent">
         <div v-show="activeIndex == 0">
           <teamBaseInfo @chiosetab="chiosetab"
+          @getName="getName"
                         ref='teamBaseInfo'
                         :getTeamList="getTeamList"
                         @getBaseInfo="getBaseInfo" />
         </div>
-        <div v-show="activeIndex == 1"  v-if="showSecond">
+        <!-- v-if="showSecond" -->
+        <div v-if="activeIndex == 1"  >
           <teamSoundMoney @chiosetab="chiosetab"
                           :getTeamList="getTeamList"
                           @getBaseInfo="getBaseInfo" />
@@ -140,6 +142,9 @@ export default {
       this.baseInfo = baseInfo
       this.pageName = baseInfo.musicGroup?.name
     },
+    getName(name){
+       this.pageName = name
+    }
   },
   computed: {
     showFlag () {