Browse Source

提交测试

1
mo 3 years ago
parent
commit
59595cd9fa

+ 0 - 2
src/main.js

@@ -76,9 +76,7 @@ ElementUI.Dialog.props.closeOnClickModal.default = false;
 //  (ElementUI.Input)
 // 全局修改选择如果value与label都为数字0则清空
 const SelectValueWatch = ElementUI.Select.watch.value
-// console.log(ElementUI.Select)
 ElementUI.Select.watch.value = function (newValue, oldValue) {
-// console.log(this)
   SelectValueWatch.call(this, newValue, oldValue)
   if (this.selected && this.selected.value === 0 && this.selected.currentLabel === 0 && newValue !== oldValue) {
     this.handleClearClick.call(this, {

+ 5 - 1
src/utils/vueFilter.js

@@ -132,7 +132,11 @@ Vue.filter('dayjsFormatWeek', (value) => {
     return value
   }
 })
-
+Vue.filter('courseViewType', (value) => {
+  let arr = ['课程收费',"会员收费"]
+  return arr[value]
+})
+// courseViewType
 Vue.filter('dayjsFormatMinute', (value) => {
   if (value) {
     return dayjs(value).format('HH:mm')

+ 1 - 1
src/views/categroyManager/productSystem/memberSet.vue

@@ -60,7 +60,7 @@
       ></el-table-column>
       <el-table-column
         align="center"
-        prop="type"
+        prop="operatorName"
         label="修改人"
       ></el-table-column>
       <el-table-column align="center" label="操作">

+ 15 - 0
src/views/teamBuild/components/soundSetComponents/chioseMusic.vue

@@ -204,6 +204,21 @@ export default {
       this.$set(music, "groupRemissionCourseFee", val);
     },
   },
+  // watch: {
+  //   item: {
+  //     immediate: true,
+  //     handler(newVal, oldVal) {
+  //       console.log(newVal, oldVal);
+  //       if (!oldVal) {
+  //         // 第一次赋值的时候
+  //         // 每当item 改变的时候 验证一下
+  //         // 1.是不是每个选中的商品chioseMusic 都在goodsList
+  //         // 2.是不是每个markChioseList 都在markList
+  //         //
+  //       }
+  //     },
+  //   },
+  // },
 };
 </script>
 <style lang="scss" scoped>

+ 71 - 24
src/views/teamBuild/components/soundSetComponents/soundSetCore.vue

@@ -184,7 +184,7 @@ export default {
         JSON.stringify(this.activeSoundList)
       );
     },
-    init() {
+    async init() {
       // 获取第一页的数据
       // this.topfor = this.$store.getters.topinfo;
       // let type = this.topfor.type;
@@ -207,7 +207,7 @@ export default {
         localStorage.getItem(`${this.$route.query.id}sound`)
       );
 
-      getSoundTree({ tenantId: 1 }).then((res) => {
+      getSoundTree({ tenantId: 1 }).then(async (res) => {
         if (res.code == 200) {
           this.soundList = res.data.rows;
           if (sotrage && sotrage[0]?.id) {
@@ -220,7 +220,7 @@ export default {
             });
             this.chioseActiveSound = activeSound;
             this.activeSound = activeSound;
-            this.changeActiveSound(activeSound.join(","));
+          await  this.changeActiveSound(activeSound.join(","));
           } else {
             if (this.teamStatus == "newTeam") {
               this.getDefaultSubject();
@@ -228,14 +228,14 @@ export default {
               this.teamid = this.$route.query.id;
               if (this.teamid) {
                 findMusicGroupSubjectInfo({ musicGroupId: this.teamid }).then(
-                  (res) => {
+                  async (res) => {
                     if (res.code == 200) {
                       // 如果没有一个声部 则请求默认声部
 
                       if (res.data?.musicGroupSubjectPlans?.length > 0) {
                         let activeSound = [];
-                        this.activeSoundList = res.data?.musicGroupSubjectPlans.map(
-                          (item) => {
+                        this.activeSoundList =
+                          res.data?.musicGroupSubjectPlans.map((item) => {
                             activeSound.push(item.subjectId);
                             return {
                               id: parseInt(item.subjectId),
@@ -246,13 +246,13 @@ export default {
                               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;
@@ -283,6 +283,7 @@ export default {
                             }
                           }
                         );
+                           await this.changeActiveSound(activeSound.join(","));
                       } else {
                         this.getDefaultSubject();
                       }
@@ -309,7 +310,7 @@ export default {
         chargeTypeId: type,
         organId: section,
         number: 1,
-      }).then((res) => {
+      }).then(async (res) => {
         if (res.code == 200) {
           let activeSound = [];
           this.activeSoundList = res.data.map((item) => {
@@ -318,14 +319,14 @@ export default {
           });
           this.activeSound = activeSound;
           this.chioseActiveSound = activeSound;
-          this.changeActiveSound(activeSound.join(","));
+        await this.changeActiveSound(activeSound.join(","));
         }
       });
     },
     lookCheck(val) {
       this.checkList = [...new Set(val)];
     },
-    chioseSound(activeSound) {
+  async chioseSound(activeSound) {
       // 同步数据
       this.activeSound = [...new Set(activeSound)];
       let newSoundList = [];
@@ -351,7 +352,7 @@ export default {
       });
       this.activeSound = newActiveSound;
       this.chioseActiveSound = newActiveSound;
-      this.changeActiveSound(newActiveSound.join(","));
+     await this.changeActiveSound(newActiveSound.join(","));
       this.soundVisible = false;
     },
     initSound(item) {
@@ -374,17 +375,18 @@ export default {
       };
       return obj;
     },
-    changeActiveSound(val) {
+    async changeActiveSound(val) {
       // 写入声部商品和辅件
-      getSubjectGoods({
+   return getSubjectGoods({
         subjectIds: val,
         chargeTypeId: this.topfor.type,
         musicGroupId: this.teamid,
-         courseViewType:this.topfor.courseViewType
+        courseViewType: this.topfor.courseViewType,
       }).then((res) => {
         if (res.code == 200) {
           if (res.data) {
             let keys = Object.keys(res.data);
+            console.log("activeSoundList", this.activeSoundList);
             this.activeSoundList.forEach((item) => {
               if (keys.indexOf(item.id + "") != -1) {
                 let goodList = [];
@@ -400,23 +402,60 @@ export default {
                 item.markList = markList;
               }
             });
+            this.checkShopAndMark()
           }
         }
       });
     },
-
     lookMusic() {},
+    checkShopAndMark() {
+      let loadash = this.$helpers.lodash;
+      this.activeSoundList.forEach((item) => {
+        // 格式化教辅
+        let markIdList = item.markList.map((mark) => {
+          return mark.id;
+        });
+        let goodsIdList = item.goodsList.map(good=>{
+          return good.id
+        })
+        for (let i = 0; i < item.markChioseList.length; i++) {
+          if (!markIdList.includes(item.markChioseList[i])) {
+            item.markChioseList.splice(i--, 1);
+          }
+        }
 
-    submitInfo(type) {
-      // 计划招生人数
-      // 可选乐器
-      // 教辅
-
+          for (let i = 0; i < item.chioseMusic.length; i++) {
+          if (!goodsIdList.includes(item.chioseMusic[i].musical)) {
+             item.chioseMusic.splice(i--, 1);
+          }
+        }
+        // item.markChioseList.forEach((markChiose, index) => {
+        //   console.log(markChiose);
+        //   if (!markIdList.includes(markChiose)) {
+        //     item.markChioseList.splice(index--, 1);
+        //   }
+        // });
+        // if (item.markList.length > 0) {
+        //   item.markList.find((mark) => {
+        //     if (!item.markChioseList.includes(mark.id)) {
+        //       // 不包含就要删除就删除这一项
+        //       let loadash = this.$helper.loadash;
+        //       loadash.pull(item.markChioseList, mark.id);
+        //     }
+        //   });
+        // }else{
+        //   item.markChioseList = []
+        // }
+      });
+    },
+    checkSubmit (){
+       let flag = true;
       if (this.activeSoundList.length <= 0) {
         this.$message.error(`请至少设置一个声部`);
+        flag = false
         return;
       }
-      let flag = true;
+
       this.activeSoundList.forEach((item) => {
         if (!item.expectedStudentNum) {
           this.$message.error(`请填写${item.sound}的预计招生人数`);
@@ -424,7 +463,7 @@ export default {
           return;
         }
         if (!item.chioseMusic[0]?.musical) {
-          this.$message.error(`请至少一个选择${item.sound}的可选乐器`);
+          this.$message.error(`请选择${item.sound}的可选乐器`);
           flag = false;
           return;
         }
@@ -437,6 +476,14 @@ export default {
           }
         });
       });
+      return flag
+    },
+    submitInfo(type) {
+      // 计划招生人数
+      // 可选乐器
+      // 教辅
+
+      let flag = this.checkSubmit()
       if (!flag) return;
       // 新建团
       let obj = {};

+ 3 - 0
src/views/teamBuild/components/teamSoundSet.vue

@@ -149,6 +149,9 @@ export default {
       this.$emit("getBaseInfo", baseInfo);
     },
     approval() {
+      // 审核通过 验证商品
+     let flag = this.$refs.soundSetCore.checkSubmit()
+      if (!flag) return;
       this.$confirm(`是否审核通过?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 157 - 82
src/views/teamDetail/teamList.vue

@@ -2,13 +2,18 @@
   <div class="m-container">
     <h2>
       <div class="squrt"></div>
-      乐团管理 <filter-search @reload="reloadSearch" :moreKeys="['organId']" :keys="['searchType']" />
+      乐团管理
+      <filter-search
+        @reload="reloadSearch"
+        :moreKeys="['organId']"
+        :keys="['searchType']"
+      />
     </h2>
     <div class="m-core">
       <div class="btnList" style="margin-bottom: 20px">
         <el-button
           type="primary"
-          v-if=" permission('musicGroup/createGroup')"
+          v-if="permission('musicGroup/createGroup')"
           @click="createNewTeam"
           >新建乐团</el-button
         >
@@ -81,6 +86,17 @@
             ></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item prop="courseViewType">
+          <el-select
+            v-model.trim="topForm.courseViewType"
+            filterable
+            placeholder="请选择收费模式"
+            clearable
+          >
+            <el-option label="课程收费" value="0"></el-option>
+            <el-option label="会员收费" value="1"></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item>
           <el-button type="danger" native-type="submit">搜索</el-button>
         </el-form-item>
@@ -99,8 +115,11 @@
                            :selectable="checkSelectable"
                            width="50">
           </el-table-column> -->
-          <el-table-column prop="organName" align="center"
-            label="所属分部"></el-table-column>
+          <el-table-column
+            prop="organName"
+            align="center"
+            label="所属分部"
+          ></el-table-column>
           <el-table-column
             prop="id"
             width="100"
@@ -136,6 +155,13 @@
               </div>
             </template>
           </el-table-column>
+                 <el-table-column prop="status" align="center" label="收费模式">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.courseViewType | courseViewType }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             prop="chargeTypeName"
@@ -203,17 +229,23 @@
                 <!-- 审核中 编辑 -->
                 <el-button
                   type="text"
-                  v-if="scope.row.status == 'AUDIT' && permission('musicGroup/auditSuccess')"
+                  v-if="
+                    scope.row.status == 'AUDIT' &&
+                    permission('musicGroup/auditSuccess')
+                  "
                   @click="lookTeamDetail(scope.row)"
                   >审核</el-button
                 >
                 <el-button
                   type="text"
-                  v-if="scope.row.status == 'DRAFT' && permission('musicGroup/update')"
+                  v-if="
+                    scope.row.status == 'DRAFT' &&
+                    permission('musicGroup/update')
+                  "
                   @click="lookTeamDetail(scope.row)"
                   >编辑</el-button
                 >
-                          <!-- 审核失败 编辑 -->
+                <!-- 审核失败 编辑 -->
                 <el-button
                   type="text"
                   v-if="
@@ -227,15 +259,15 @@
                 <el-button
                   type="text"
                   v-if="
-                    ( scope.row.status == 'PRE_APPLY'||
-                       scope.row.status == 'PAUSE'||
-                       scope.row.status == 'PRE_BUILD_FEE'||
-                      scope.row.status == 'PROGRESS'||
-                       scope.row.status == 'CANCELED'||
+                    (scope.row.status == 'PRE_APPLY' ||
+                      scope.row.status == 'PAUSE' ||
+                      scope.row.status == 'PRE_BUILD_FEE' ||
+                      scope.row.status == 'PROGRESS' ||
+                      scope.row.status == 'CANCELED' ||
                       scope.row.status == 'APPLY' ||
                       scope.row.status == 'PAY' ||
                       scope.row.status == 'PREPARE' ||
-                        scope.row.status == 'CLOSE' ||
+                      scope.row.status == 'CLOSE' ||
                       scope.row.status == 'FEE_AUDIT') &&
                     permission('/resetTeaming')
                   "
@@ -268,7 +300,6 @@
                   >查看</el-button
                 > -->
 
-
                 <el-button
                   type="text"
                   v-if="
@@ -276,14 +307,15 @@
                       scope.row.status == 'AUDIT' ||
                       scope.row.status == 'FEE_AUDIT' ||
                       scope.row.status == 'APPLY' ||
-                      scope.row.status == 'PAY'|| scope.row.status == 'PRE_APPLY'||scope.row.status =='PRE_BUILD_FEE') &&
+                      scope.row.status == 'PAY' ||
+                      scope.row.status == 'PRE_APPLY' ||
+                      scope.row.status == 'PRE_BUILD_FEE') &&
                     permission('musicGroup/cancelMusicGroup')
                   "
                   @click="stopTeam(scope.row)"
                   >取消乐团</el-button
                 >
 
-
                 <el-button
                   v-if="
                     scope.row.status == 'PREPARE' &&
@@ -385,6 +417,7 @@ export default {
         payType: "",
         word: "",
         orgin: "",
+        courseViewType:""
       },
       organList: [],
       typeList: [], // 收费类型
@@ -465,6 +498,7 @@ export default {
         chargeTypeId: this.topForm.payType || null,
         musicGroupName: this.topForm.teamName || null,
         musicGroupStatus: this.topForm.status || null,
+        courseViewType:this.topForm.courseViewType||null,
         searchType: this.$route.query.searchType,
       }).then((res) => {
         if (res.code == 200) {
@@ -476,14 +510,16 @@ export default {
     createNewTeam() {
       // this.$store.dispatch("buildIndex", 0);
       // this.$store.dispatch("delVisitedViews", { path: "/business/teamBuild" });
-       localStorage.removeItem(`newTeambase`);
-    this.$router.push({
-            path: "/business/resetTeaming",
-              query: { type: "newTeam",team_status:'newTeam'}},
-            (router) => {
-              router.meta.title = "新建乐团";
-            }
-          );
+      localStorage.removeItem(`newTeambase`);
+      this.$router.push(
+        {
+          path: "/business/resetTeaming",
+          query: { type: "newTeam", team_status: "newTeam" },
+        },
+        (router) => {
+          router.meta.title = "新建乐团";
+        }
+      );
     },
 
     resetTeam() {
@@ -622,7 +658,7 @@ export default {
     lookTeamDetail(row) {
       localStorage.removeItem(`${row.id}base`);
       localStorage.removeItem(`${row.id}sound`);
-      localStorage.removeItem('newTeambase')
+      localStorage.removeItem("newTeambase");
       switch (row.status) {
         case "DRAFT": {
           // 编辑中
@@ -637,9 +673,11 @@ export default {
           //     router.meta.title = "编辑乐团";
           //   }
           // );
-          this.$router.push({
-            path: "/business/resetTeaming",
-              query: { type: "teamDraft", id: row.id,team_status:row.status }},
+          this.$router.push(
+            {
+              path: "/business/resetTeaming",
+              query: { type: "teamDraft", id: row.id, team_status: row.status },
+            },
             (router) => {
               router.meta.title = "乐团编辑中";
             }
@@ -653,7 +691,12 @@ export default {
           this.$router.push(
             {
               path: "/business/resetTeaming",
-              query: { type: "teamAudit", id: row.id, clear: "true",team_status:row.status },
+              query: {
+                type: "teamAudit",
+                id: row.id,
+                clear: "true",
+                team_status: row.status,
+              },
             },
             (router) => {
               router.meta.title = "乐团审核中";
@@ -667,19 +710,21 @@ export default {
           //   path: "/business/createPayment",
           //   query: { type: "PRE_BUILD_FEE", id: row.id, name: row.name },
           // });
-          this.$router.push({
-            path: "/business/resetTeaming",
-            query: {
-              type: "look",
-              id: row.id,
-              name: row.name,
-              team_status: "PRE_BUILD_FEE",
-              tabrouter:3
+          this.$router.push(
+            {
+              path: "/business/resetTeaming",
+              query: {
+                type: "look",
+                id: row.id,
+                name: row.name,
+                team_status: "PRE_BUILD_FEE",
+                tabrouter: 3,
+              },
             },
-
-          }, (router) => {
+            (router) => {
               router.meta.title = "创建缴费中";
-            });
+            }
+          );
           break;
         }
         case "FEE_AUDIT": {
@@ -688,7 +733,12 @@ export default {
           this.$router.push(
             {
               path: "/business/resetTeaming",
-              query: { type: "feeAudit", id: row.id, clear: "true",team_status:row.status },
+              query: {
+                type: "feeAudit",
+                id: row.id,
+                clear: "true",
+                team_status: row.status,
+              },
             },
             (router) => {
               router.meta.title = "乐团费用审核中";
@@ -702,7 +752,12 @@ export default {
           this.$router.push(
             {
               path: "/business/resetTeaming",
-              query: { type: "teamDraft", id: row.id, clear: "true",team_status:row.status },
+              query: {
+                type: "teamDraft",
+                id: row.id,
+                clear: "true",
+                team_status: row.status,
+              },
             },
             (router) => {
               router.meta.title = "乐团审核失败";
@@ -713,18 +768,21 @@ export default {
         case "PRE_APPLY": {
           // 预报名
 
-          this.$router.push({
-            path: "/business/resetTeaming",
-            query: {
-              type: "look",
-              id: row.id,
-              name: row.name,
-              team_status: "PRE_APPLY",
-              tabrouter:9
+          this.$router.push(
+            {
+              path: "/business/resetTeaming",
+              query: {
+                type: "look",
+                id: row.id,
+                name: row.name,
+                team_status: "PRE_APPLY",
+                tabrouter: 9,
+              },
             },
-          },  (router) => {
+            (router) => {
               router.meta.title = "乐团预报名";
-            });
+            }
+          );
           // this.$router.push({
           //   path: "/business/forecastName",
           //   query: { id: row.id, name: row.name },
@@ -741,8 +799,8 @@ export default {
                 id: row.id,
                 name: row.name,
                 team_status: "APPLY",
-                type:'look',
-                tabrouter:11
+                type: "look",
+                tabrouter: 11,
               },
             },
             (router) => {
@@ -761,8 +819,8 @@ export default {
                 id: row.id,
                 name: row.name,
                 team_status: "PAY",
-                type:'look',
-                tabrouter:11
+                type: "look",
+                tabrouter: 11,
               },
             },
             (router) => {
@@ -773,32 +831,43 @@ export default {
         }
         case "PREPARE": {
           // 筹备中 跳转到乐团设置界面
-          this.$router.push({
-            path: `/business/resetTeaming`,
-            query: {  type:'look',status: row.status, id: row.id, name: row.name,team_status:row.status,tabrouter:10 },
-          },
-           (router) => {
+          this.$router.push(
+            {
+              path: `/business/resetTeaming`,
+              query: {
+                type: "look",
+                status: row.status,
+                id: row.id,
+                name: row.name,
+                team_status: row.status,
+                tabrouter: 10,
+              },
+            },
+            (router) => {
               router.meta.title = "乐团筹备中";
-            });
+            }
+          );
           break;
         }
         case "PROGRESS": {
           // 进行中
           // 调到乐团详情 teamDetails
-          this.$router.push({
-            path: `/business/resetTeaming`,
-            query: {
-              status: row.status,
-              id: row.id,
-              name: row.name,
-              organId: row.organId,
-             type:'resetTeam',
-              team_status:row.status
+          this.$router.push(
+            {
+              path: `/business/resetTeaming`,
+              query: {
+                status: row.status,
+                id: row.id,
+                name: row.name,
+                organId: row.organId,
+                type: "resetTeam",
+                team_status: row.status,
+              },
             },
-
-          }, (router) => {
+            (router) => {
               router.meta.title = "乐团进行中";
-            });
+            }
+          );
           break;
         }
         case "CANCELED": {
@@ -806,7 +875,11 @@ export default {
           this.$router.push(
             {
               path: "/business/resetTeaming",
-              query: { type: "teamCanceled", id: row.id ,team_status:row.status},
+              query: {
+                type: "teamCanceled",
+                id: row.id,
+                team_status: row.status,
+              },
             },
             (router) => {
               router.meta.title = "取消乐团";
@@ -820,16 +893,18 @@ export default {
           //   path: `/teamLists`,
           //   query: { status: row.status, id: row.id, name: row.name },
           // });
-          this.$router.push({
-            path: "/business/resetTeaming",
-            query: { type: "resetTeam", id: row.id,team_status:row.status },
-          },
-          (router) => {
+          this.$router.push(
+            {
+              path: "/business/resetTeaming",
+              query: { type: "resetTeam", id: row.id, team_status: row.status },
+            },
+            (router) => {
               router.meta.title = "乐团暂停";
             }
           );
           break;
-        }case "CLOSE":{
+        }
+        case "CLOSE": {
           this.$router.push(
             {
               path: `/business/resetTeaming`,
@@ -838,7 +913,7 @@ export default {
                 id: row.id,
                 name: row.name,
                 team_status: "CLOSE",
-                type:'look'
+                type: "look",
               },
             },
             (router) => {