Browse Source

Merge branch '10/23-test' into yuetuan

wolyshaw 4 years ago
parent
commit
8d46995f78

+ 7 - 7
src/constant/index.js

@@ -91,10 +91,10 @@ export const payOrderType = {
   SCHOOL:'学校'
 }
 
-// export const auditType = {
-//   AUDITING,
-//   REJECT,
-//   NO,
-//   OPEN,
-//   OVER
-// }
+export const auditType = {
+  AUDITING:'审核中',
+  REJECT:'拒绝',
+  NO:'未开启缴费',
+  OPEN:'开启缴费',
+  OVER:'缴费已结束'
+}

+ 2 - 1
src/views/resetTeaming/components/resetPayList.vue

@@ -428,7 +428,8 @@ export default {
       this.userVisible = true
     },
     getList () {
-      return musicGroupPaymentCalenderQueryPage({ page: this.rules.page, rows: this.rules.limit, musicGroupId: this.$route.query.id,payUserType:this.searchForm.payUserType }).then(res => {
+      let musicGroupId = this.$route.query.id
+      return musicGroupPaymentCalenderQueryPage({ page: this.rules.page, rows: this.rules.limit, musicGroupId, payUserType:this.searchForm.payUserType }).then(res => {
         if (res.code == 200) {
           this.rules.total = res.data.total
           this.tableList = res.data.rows;

+ 7 - 4
src/views/teamBuild/components/soundSetComponents/chioseMusic.vue

@@ -7,6 +7,7 @@
         <div class="flexRow">
           <p class="title">可选乐器{{index+1}}:</p>
           <el-select style="width:180px"
+          :disabled='basdisabled'
                      v-model="music.musical"
                      @change="(val)=>{chioseMusic(val,music)}">
             <el-option v-for="(item,index) in item.goodsList"
@@ -16,9 +17,9 @@
           </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 :disabled='basdisabled' label="GROUP">团购</el-checkbox>
+            <el-checkbox :disabled='basdisabled' label="LEASE">租赁</el-checkbox>
+            <el-checkbox :disabled='basdisabled' label="FREE">免费</el-checkbox>
           </el-checkbox-group>
         </div>
       </el-col>
@@ -41,6 +42,7 @@
           <el-input type="number"
                     v-if="music.type&&music.type.length>0?music.type.includes('LEASE'):false"
                     v-model="music.borrowPrice"
+                    :disabled='basdisabled'
                     style="width:180px"> <template slot="append">元</template></el-input>
           <el-input value="--"
                     v-else
@@ -58,6 +60,7 @@
     <div class="coreItemRow">
       <p class="title"></p>
       <el-button type="info"
+      v-if="!basdisabled"
                  plain
                  style="width:558px"
                  size="mini"
@@ -68,7 +71,7 @@
 </template>
 <script>
 export default {
-  props: ['item'],
+  props: ['item','basdisabled'],
   data () {
     return {
       radio: '',

+ 109 - 57
src/views/teamBuild/components/soundSetComponents/soundSetCore.vue

@@ -1,24 +1,20 @@
 <template>
   <div>
     <div class="soundBtnWrap">
-      <el-button type="primary" @click="allin" v-if="teamStatus != 'resetTeam'"
+      <el-button type="primary" @click="allin" v-if="teamStatus != 'resetTeam'&&!basdisabled"
         >全选</el-button
       >
       <el-button
         type="danger"
         @click="deleteRow"
-        v-if="teamStatus != 'resetTeam'"
+        v-if="teamStatus != 'resetTeam'&&!basdisabled"
         >删除</el-button
       >
-      <el-button type="primary" @click="soundVisible = true">添加</el-button>
+      <el-button type="primary" @click="soundVisible = true" v-if="!basdisabled">添加</el-button>
     </div>
     <div class="coreWrap">
-      <el-checkbox-group v-model="checkList" @change="lookCheck">
-        <el-collapse
-          v-model="chioseActiveSound"
-          accordion
-          @change="changeActiveSound"
-        >
+      <el-checkbox-group v-model="checkList" @change="lookCheck" >
+        <el-collapse v-model="chioseActiveSound">
           <el-collapse-item
             v-for="(item, index) in activeSoundList"
             :name="item.id"
@@ -26,24 +22,26 @@
           >
             <template slot="title">
               <div class="coreItemTitle">
-                <el-checkbox :label="item.id">{{ item.sound }}</el-checkbox>
+                <el-checkbox :label="item.id" :disabled='basdisabled'>{{ item.sound }}</el-checkbox>
               </div>
             </template>
             <div class="coreItem">
               <div class="coreItemRow">
                 <p class="title">计划招生人数:</p>
                 <el-input
+                :disabled='basdisabled'
                   style="width: 180px"
                   v-model="item.expectedStudentNum"
                 ></el-input>
               </div>
             </div>
-            <chioseMusic :item="item" @lookMusic="lookMusic" />
+            <chioseMusic :item="item" @lookMusic="lookMusic" :basdisabled="basdisabled"/>
             <div class="coreItemRow">
               <p class="title">教辅:</p>
               <el-select
                 style="width: 558px !important"
                 v-model="item.markChioseList"
+                :disabled='basdisabled'
                 clearable
                 filterable
                 multiple
@@ -97,20 +95,19 @@ export default {
       childSoundList: [],
       activeSoundList: [], //列表上的声部
       activeSound: null, // 展开的列表
-      chioseActiveSound: null,
+      chioseActiveSound: [],
       soundList: [], // 接口返回的一级二级声部
       childSoundList: [],
       teamStatus: "", // 乐团状态
       checkList: [],
+      basdisabled:false
     };
   },
   mounted() {
     this.init();
-    console.log("mounted");
   },
   activated() {
     this.init();
-    console.log("activated");
   },
   methods: {
     init() {
@@ -124,6 +121,11 @@ export default {
       if (this.$route.query.rules) {
         this.Frules = this.$route.query.rules;
       }
+      if (this.teamStatus == "look" || this.teamStatus == "teamAudit") {
+        this.basdisabled = true;
+      } else {
+        this.basdisabled = false;
+      }
       getSoundTree({ tenantId: 1 }).then((res) => {
         if (res.code == 200) {
           this.soundList = res.data.rows;
@@ -140,8 +142,8 @@ export default {
                   return this.initSound(item);
                 });
                 this.activeSound = activeSound;
-                this.chioseActiveSound = activeSound[0];
-                this.changeActiveSound(activeSound[0]);
+                this.chioseActiveSound = activeSound;
+                this.changeActiveSound(activeSound.join(","));
               }
             });
           } else {
@@ -165,8 +167,8 @@ export default {
                     }
                   );
                   this.activeSound = activeSound;
-                  this.chioseActiveSound = activeSound[0];
-                  this.changeActiveSound(activeSound[0]);
+                  this.chioseActiveSound = activeSound;
+                  this.changeActiveSound(activeSound.join(","));
                   // 格式化商品和教辅
 
                   res.data.musicGroupSubjectGoodsGroups.forEach((shop) => {
@@ -195,7 +197,6 @@ export default {
                       }
                     }
                   });
-                  console.log(this.activeSoundList);
                 }
               }
             );
@@ -231,6 +232,14 @@ export default {
         }
       }
       this.activeSoundList = newSoundList;
+      let newActiveSound = [];
+      this.activeSoundList.forEach((item) => {
+        newActiveSound.push(item.id);
+      });
+      this.activeSound = newActiveSound;
+      this.chioseActiveSound = newActiveSound;
+      console.log(newActiveSound.join(","));
+      this.changeActiveSound(newActiveSound.join(","));
       this.soundVisible = false;
     },
     initSound(item) {
@@ -248,47 +257,76 @@ export default {
       return obj;
     },
     changeActiveSound(val) {
-      this.activeSoundList.forEach((item) => {
-        if (item.id == val) {
-          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;
-              }
-            });
-          }
+      // 写入声部商品和辅件
+      getSubjectGoods({
+        subjectIds: val,
+        chargeTypeId: this.topfor.type,
+      }).then((res) => {
+        if (res.code == 200) {
+          let keys = Object.keys(res.data);
+          this.activeSoundList.forEach((item) => {
+            if (keys.indexOf(item.id + "") != -1) {
+              let goodList = [];
+              let markList = [];
+              res.data[item.id].forEach((shop) => {
+                if (shop.type == "INSTRUMENT") {
+                  goodList.push(shop);
+                } else if (shop.type == "ACCESSORIES") {
+                  markList.push(shop);
+                }
+              });
+              item.goodsList = goodList;
+              item.markList = markList;
+            }
+          });
         }
       });
     },
+
+    // return
+    // if (item.id == val) {
+    //   if (item.goodsList.length < 1 || item.markList.length < 1) {
+    //     getSubjectGoods({
+    //       subjectIds: 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() {},
 
-    submitInfo() {
+    submitInfo(type) {
       // 计划招生人数
       // 可选乐器
       // 教辅
+      let flag = true;
       this.activeSoundList.forEach((item) => {
         if (!item.expectedStudentNum) {
           this.$message.error(`请填写${item.sound}的预计招生人数`);
+          flag = false;
           return;
         }
         if (!item.chioseMusic[0]?.musical) {
           this.$message.error(`请至少一个选择${item.sound}的可选乐器`);
+          flag = false;
           return;
         }
       });
+      if (!flag) return;
       // 新建团
       let obj = {};
       if (this.teamStatus == "newTeam") {
@@ -361,12 +399,26 @@ export default {
           createTeam(obj).then((res) => {
             if (res.code == 200) {
               // 成功 跳转到乐团报名详情
+              let query = this.$route.query;
+              query.type = "teamDraft";
+              this.$router.push({
+                query: {
+                  ...query,
+                  id: res.data,
+                },
+              });
               this.$emit("chiosetab", 2);
             }
           });
         } else {
           obj.musicGroupId = this.teamid;
-          obj.musicGroupStatus = "DRAFT";
+
+          if (type) {
+            obj.musicGroupStatus = "AUDIT";
+          } else {
+            obj.musicGroupStatus = "DRAFT";
+          }
+
           updateSubjectInfo(obj).then((res) => {
             if (res.code == 200) {
               this.$message.success("提交成功");
@@ -424,7 +476,7 @@ export default {
         schoolId: this.topfor.address,
         expectStartGroupDate: this.topfor.startTime,
         isClassroomLessons: this.topfor.isClass,
-        status: 'DRAFT',
+        status: "DRAFT",
         ownershipType: this.topfor.ownershipType,
         repairUserId: this.topfor.repairUserId,
         feeType: this.topfor.feeType,
@@ -437,22 +489,22 @@ export default {
       immediate: true,
       deep: true,
       handler(n) {
-       let chioseSoundNum = 0;
-       let PlannedCount =0;
+        let chioseSoundNum = 0;
+        let PlannedCount = 0;
         let activeSoundList = this.activeSoundList;
-      if (n) {
-        let Count = 0;
-        if (n.length > 0) {
-          for (let item in n) {
-            Count += parseInt(n[item]?.expectedStudentNum) || 0;
+        if (n) {
+          let Count = 0;
+          if (n.length > 0) {
+            for (let item in n) {
+              Count += parseInt(n[item]?.expectedStudentNum) || 0;
+            }
           }
-        }
 
-       chioseSoundNum = Count
-       PlannedCount = n.length
-       this.$emit('getNumber',chioseSoundNum,PlannedCount)
-      }
-      }
+          chioseSoundNum = Count;
+          PlannedCount = n.length;
+          this.$emit("getNumber", chioseSoundNum, PlannedCount);
+        }
+      },
     },
   },
 };

+ 8 - 9
src/views/teamBuild/components/teamBaseInfo.vue

@@ -619,7 +619,6 @@ export default {
   },
   created () { },
   activated () {
-    console.log(dayjs('2014-12-03').format('YYYY-MM-DD HH:mm:ss'))
     this.payList = {
       school: {
         ischeck: false,
@@ -1052,14 +1051,14 @@ export default {
           check.push(this.checkList[i].ischeck);
         }
       }
-      let checkFlag = false;
-      check.forEach((item) => {
-        checkFlag = checkFlag || item;
-      });
-      if (!checkFlag) {
-        this.$message.error("请至少选择一种乐团课程类型");
-        return;
-      }
+      // let checkFlag = false;
+      // check.forEach((item) => {
+      //   checkFlag = checkFlag || item;
+      // });
+      // if (!checkFlag) {
+      //   this.$message.error("请至少选择一种乐团课程类型");
+      //   return;
+      // }
       this.$refs["topinfo"].validate((valid, object) => {
         if (!valid) {
           this.$message.error("请填写必要参数");

+ 31 - 15
src/views/teamBuild/components/teamPayInfo.vue

@@ -1,29 +1,45 @@
 <template>
   <div class="pay-container">
-   <resetPayList :isNewGropu='true'/>
+    <resetPayList :isNewGropu="true" />
+    <div class="btnWrap">
+      <div class="PrevBtn" @click="goback">上一步</div>
+      <!--  v-if="teamStatus != 'teamAudit'" -->
+      <div class="submitBtn">预览</div>
+  
+    </div>
   </div>
 </template>
-<script> 
+<script>
 // import { payOrderTypeList}  from "@/utils/searchArray";
-import resetPayList from '@/views/resetTeaming/components/resetPayList'
+import resetPayList from "@/views/resetTeaming/components/resetPayList";
 export default {
-    components:{resetPayList},
+  components: { resetPayList },
   data() {
     return {
-        searchForm:{
-            courseScheduleType:null
-        },
-
-    }
+      searchForm: {
+        courseScheduleType: null,
+      },
+    };
   },
-  created (){
-
+  created() {},
+  methods: {
+    goback() {},
+    submitAudit(){
+      let teamId =  this.$route.query.id
+    }
   },
-  methods:{
-      search(){},
-      onReSet(){}
-  }
 };
 </script>
 <style lang="scss" scoped>
+.btnWrap {
+  margin-top: 40px;
+  .PrevBtn {
+    background-color: #13817a;
+    width: 120px;
+  }
+  .submitBtn {
+    background-color: #13817a;
+    width: 120px;
+  }
+}
 </style>

+ 54 - 13
src/views/teamBuild/components/teamSoundSet.vue

@@ -4,7 +4,11 @@
       <p>当前选择声部数(个):{{ chioseSoundNum }}</p>
       <p style="margin-left: 30px">计划招生人数(个):{{ PlannedCount }}</p>
     </div>
-    <soundSetCore ref="soundSetCore" @chiosetab="chiosetab" @getNumber='getNumber'/>
+    <soundSetCore
+      ref="soundSetCore"
+      @chiosetab="chiosetab"
+      @getNumber="getNumber"
+    />
     <div class="btnWrap">
       <div class="PrevBtn" @click="goback">上一步</div>
       <!--  v-if="teamStatus != 'teamAudit'" -->
@@ -18,6 +22,16 @@
       >
         下一步
       </div>
+      <div
+        class="submitBtn"
+        @click="submitAudit(1)"
+        v-if="teamStatus != 'teamAudit'"
+      >
+        提交审核
+      </div>
+      <div class="submitBtn" @click="approval" v-if="teamStatus == 'teamAudit'">
+        审核通过
+      </div>
     </div>
   </div>
 </template>
@@ -48,12 +62,20 @@ export default {
       Fsearch: null,
       Frules: null,
       activeSoundList: [],
-      chioseSoundNum:0,
-      PlannedCount:0
+      chioseSoundNum: 0,
+      PlannedCount: 0,
+      teamStatus: null,
+      teamid:null
     };
   },
-  mounted() {},
-  activated() {},
+  mounted() {
+    this.teamid = this.$route.query.id;
+    this.teamStatus = this.$route.query.type;
+  },
+  activated() {
+    this.teamid = this.$route.query.id;
+    this.teamStatus = this.$route.query.type;
+  },
   methods: {
     goback() {
       this.$emit("chiosetab", 0);
@@ -64,16 +86,35 @@ export default {
     chiosetab(val) {
       this.$emit("chiosetab", val);
     },
-      getNumber(chioseSoundNum,PlannedCount){
-    this.chioseSoundNum = chioseSoundNum
-    this.PlannedCount = PlannedCount
-  },
+    submitAudit(val) {
+      this.$refs.soundSetCore.submitInfo(val);
+    },
+    getNumber(chioseSoundNum, PlannedCount) {
+      this.chioseSoundNum = chioseSoundNum;
+      this.PlannedCount = PlannedCount;
+    },
+    approval() {
+      this.$confirm(`是否审核通过?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          auditSuccess({ musicGroupId: this.teamid }).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("审核通过");
+              this.$router.push({
+                path: "/business/teamDetail",
+                query: { search: this.Fsearch, rules: this.Frules },
+              });
+            }
+          });
+        })
+        .catch(() => {});
+    },
   },
 
-
-  computed: {
-   
-  },
+  computed: {},
 };
 </script>
 <style lang="scss" scoped>

+ 3 - 0
src/views/teamBuild/index.vue

@@ -105,6 +105,7 @@ export default {
       this.teamStatus = this.$route.query.type;
       if (this.$route.query.teamList) {
         this.getTeamList = this.$route.query.teamList;
+        console.log( this.getTeamList)
       }
       // 判断是否带缓存参数
       if (this.$route.query.search) {
@@ -117,8 +118,10 @@ export default {
       if (this.teamStatus == "newTeam") {
         // 新建团
         this.pageName = "建团申请";
+         this.activeIndex = 0;
       } else {
         this.pageName = "乐团修改";
+         this.activeIndex = 0;
       }
     },
     chiosetab(val) {