瀏覽代碼

提交一下

1
mo 4 年之前
父節點
當前提交
487a80c7a8
共有 2 個文件被更改,包括 198 次插入76 次删除
  1. 80 48
      src/views/childrensDay/detail.vue
  2. 118 28
      src/views/childrensDay/index.vue

+ 80 - 48
src/views/childrensDay/detail.vue

@@ -14,9 +14,9 @@
         :model="searchForm"
         @submit="search"
         @reset="onReSet"
-        ref='searchForm'
+        ref="searchForm"
       >
-        <el-form-item prop="organId">
+        <el-form-item prop="search">
           <el-input
             v-model="searchForm.search"
             placeholder="学员姓名/编号/手机号"
@@ -29,8 +29,8 @@
             clearable
             placeholder="是否预约"
           >
-            <el-option value="0" label="否"></el-option>
             <el-option value="1" label="是"></el-option>
+            <el-option value="0" label="否"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item prop="subjectId">
@@ -48,48 +48,48 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item>
+        <el-form-item prop="gradeFlag">
           <el-select
-            v-model.trim="searchForm.school"
+            v-model.trim="searchForm.gradeFlag"
             filterable
             clearable
             placeholder="是否参加乐器考级"
           >
-            <el-option value="0" label="否"></el-option>
             <el-option value="1" label="是"></el-option>
+            <el-option value="0" label="否"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item>
+        <el-form-item prop="theoryFlag">
           <el-select
-            v-model.trim="searchForm.school"
+            v-model.trim="searchForm.theoryFlag"
             filterable
             clearable
             placeholder="是否参加乐理考级"
           >
-            <el-option value="0" label="否"></el-option>
             <el-option value="1" label="是"></el-option>
+            <el-option value="0" label="否"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item>
+        <el-form-item prop="vipFlag">
           <el-select
-            v-model.trim="searchForm.school"
+            v-model.trim="searchForm.vipFlag"
             filterable
             clearable
             placeholder="是否购买VIP"
           >
-            <el-option value="0" label="否"></el-option>
             <el-option value="1" label="是"></el-option>
+            <el-option value="0" label="否"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item>
+        <el-form-item prop="theoryPriceFlag">
           <el-select
-            v-model.trim="searchForm.school"
+            v-model.trim="searchForm.theoryPriceFlag"
             filterable
             clearable
             placeholder="是否购买乐理课"
           >
-            <el-option value="0" label="否"></el-option>
             <el-option value="1" label="是"></el-option>
+            <el-option value="0" label="否"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -142,40 +142,59 @@
           ></el-table-column>
           <el-table-column
             align="center"
-            prop="isReserve"
-            label="是否预约"
-          >
-          <template slot-scope="scope">
-            <div>
-              {{scope.row.isReserve?'是':'否'}}
-            </div>
-          </template>
-          </el-table-column>
-          <el-table-column
-            align="center"
-            prop="studentId"
-            label="报考器乐等级"
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="studentId"
-            label="乐理报考等级"
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="studentId"
-            label="是否购买VIP"
+            prop="subjectName"
+            label="学员声部"
           ></el-table-column>
+          <el-table-column align="center" prop="isReserve" label="是否预约">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.isReserve ? "是" : "否" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="studentId" label="报考器乐等级">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.gradeLeave + "级" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="studentId" label="乐理报考等级">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.theoryLevel + "级" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="studentId" label="是否购买VIP">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.buyVipFlag ? "是" : "否" }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             prop="studentId"
             label="是否购买乐理课"
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.buyTheoryCourseFlag ? "是" : "否" }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             prop="studentId"
             label="支付金额"
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.totalAmount |moneyFormat }}
+              </div>
+            </template>
+          </el-table-column>
         </el-table>
         <pagination
           sync
@@ -207,6 +226,10 @@ export default {
         search: null,
         isReserve: null,
         subjectId: null,
+        gradeFlag: null,
+        vipFlag: null,
+        theoryPriceFlag: null,
+        theoryFlag: null,
       },
 
       tableList: [{}],
@@ -234,28 +257,37 @@ export default {
   methods: {
     init() {
       this.musicGroupName = this.$route.query.musicGroupName || "对外分部";
-      getSubject({
-      }).then((res) => {
+      getSubject({}).then((res) => {
         if (res.code == 200) {
           this.soundList = res.data;
         }
       });
-      this.getList()
+      this.getList();
     },
     async getList() {
       try {
-        const res = await getMusicGroupDetail({ page: this.rules.page,
+        const res = await getMusicGroupDetail({
+          page: this.rules.page,
           rows: this.rules.limit,
-          ...this.searchForm,musicGroupId:this.$route.query.musicGroupId});
-          this.tableList = res.data.rows;
-          this.rules.total = res.data.total
+          ...this.searchForm,
+          musicGroupId: this.$route.query.musicGroupId,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
       } catch {}
     },
     search() {
       this.rules.page = 1;
       this.getList();
     },
-    onReSet() {},
+    onReSet() {
+            this.rules = {
+        ...this.rules,
+        page: 1,
+      };
+      this.$refs.searchForm.resetFields();
+      this.search();
+    },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push({

+ 118 - 28
src/views/childrensDay/index.vue

@@ -10,7 +10,7 @@
       <save-form
         :inline="true"
         :model="searchForm"
-        ref='searchForm'
+        ref="searchForm"
         @submit="search"
         @reset="onReSet"
       >
@@ -73,35 +73,43 @@
         <el-button type="primary" @click="onCreateQRCode('placeholder')"
           >占位链接</el-button
         >
-        <el-button type="primary">器乐考级链接</el-button>
-        <el-button type="primary">VIP课程链接</el-button>
-        <el-button type="primary">乐理考级链接</el-button>
-        <el-button type="primary">导出</el-button>
+        <el-button type="primary" @click="onCreateQRCode('music')">器乐考级链接</el-button>
+        <el-button type="primary" @click="onCreateQRCode('vip')">VIP课程链接</el-button>
+        <el-button type="primary" @click="onCreateQRCode('theory')">乐理考级链接</el-button>
+        <el-button type="primary" >导出</el-button>
       </div>
-      <statistic :col="6" class="statistic" :cols="0">
+      <statistic :col="4" class="statistic" :cols="0">
         <statistic-item>
-          <span><count-to :endVal="3000" /></span>
+          <span><count-to :endVal="statInfo.instrumentalMusicNum" /></span>
           <span>器乐考级人次</span>
         </statistic-item>
         <statistic-item>
-          <span><count-to :endVal="3000" /></span>
-          <span>乐考级人次</span>
+          <span><count-to :endVal="statInfo.musicTheoryNum" /></span>
+          <span>乐考级人次</span>
         </statistic-item>
         <statistic-item>
-          <span><count-to :endVal="3000" /></span>
-          <span>器乐考级人次</span>
+          <span><count-to :endVal="statInfo.buyMusicTheoryNum" /></span>
+          <span>乐理课购买人数</span>
         </statistic-item>
         <statistic-item>
-          <span><count-to :endVal="3000" /></span>
-          <span>器乐考级人次</span>
+          <span><count-to :endVal="statInfo.buyMusicTheoryAmount" /></span>
+          <span>乐理课成交金额</span>
         </statistic-item>
         <statistic-item>
-          <span><count-to :endVal="3000" /></span>
-          <span>器乐考级人次</span>
+          <span><count-to :endVal="statInfo.buyVip1Num" /></span>
+          <span>1v1VIP课购买人数</span>
         </statistic-item>
         <statistic-item>
-          <span><count-to :endVal="3000" /></span>
-          <span>器乐考级人次</span>
+          <span><count-to :endVal="statInfo.buyVip1Amount" /></span>
+          <span>1v1VIP课购成交金额</span>
+        </statistic-item>
+        <statistic-item>
+          <span><count-to :endVal="statInfo.buyVip2Num" /></span>
+          <span>1v2VIP课购买人数</span>
+        </statistic-item>
+        <statistic-item>
+          <span><count-to :endVal="statInfo.buyVip2Amount" /></span>
+          <span>1v2VIP课购成交金额</span>
         </statistic-item>
       </statistic>
       <div class="tableWrap">
@@ -152,16 +160,39 @@
           ></el-table-column>
           <el-table-column
             align="center"
-            prop="buyVipNum"
-            label="vip课购买人数"
+            prop="buyVip1Num"
+            label="1v1VIP课购买人数"
           ></el-table-column>
           <el-table-column
             align="center"
-            prop="buyVipAmount"
-            label="vip课成交金额"
+            prop="buyVip1Amount"
+            label="1v1VIP课成交金额"
+          >
+           <template slot-scope="scope">
+              <div>
+                {{ scope.row.buyVip1Amount |moneyFormat }}
+              </div>
+            </template>
+
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="buyVip2Num"
+            label="1v2VIP课购买人数"
           ></el-table-column>
           <el-table-column
             align="center"
+            prop="buyVip2Amount"
+            label="1v2VIP课成交金额"
+          >
+             <template slot-scope="scope">
+              <div>
+                {{ scope.row.buyVip2Amount |moneyFormat }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
             prop="buyMusicTheoryNum"
             label="乐理课购买人数"
           ></el-table-column>
@@ -169,7 +200,13 @@
             align="center"
             prop="buyMusicTheoryAmount"
             label="乐理课成交金额"
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.buyMusicTheoryAmount |moneyFormat }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column align="center" prop="studentId" label="操作">
             <template slot-scope="scope">
               <div>
@@ -204,6 +241,26 @@ import load from "@/utils/loading";
 import { queryByOrganId, getSchool, getMusicGroup } from "@/api/systemManage";
 import { getMusicGroupGradeList } from "./api";
 import countTo from "vue-count-to";
+const baseStatusInfo = {
+  buyMusicTheoryAmount: 0,
+  buyMusicTheoryNum: 0,
+  buyVip1Amount: 0,
+  buyVip1Num: 0,
+  buyVip2Amount: 0,
+  buyVip2Num: 0,
+  cooperationOrganId: 0,
+  cooperationOrganName: "",
+  instrumentalMusicNum: 0,
+  musicGroupId: "",
+  musicGroupName: "",
+  musicTheoryNum: 0,
+  noReserveNum: 0,
+  normalNum: 0,
+  organId: 0,
+  organName: "",
+  reserveNum: 0,
+  totalAmount: 0,
+};
 export default {
   components: { pagination, "count-to": countTo, qrCode },
 
@@ -228,6 +285,9 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
+      statInfo: {
+        ...baseStatusInfo,
+      },
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -251,6 +311,11 @@ export default {
         });
         this.tableList = res.data.rows;
         this.rules.total = res.data.total;
+        if (res?.data?.statInfo) {
+          this.statInfo = { ...res.data.statInfo };
+        } else {
+          this.statInfo = { ...baseStatusInfo };
+        }
       } catch (e) {}
     },
     search() {
@@ -270,11 +335,41 @@ export default {
         this.codeTitle = "占位链接";
         this.qrCodeUrl = vaildStudentUrl() + "/#/childrenSeat";
       }
+      if(status == "theory"){
+         this.codeTitle = "乐理考级链接";
+        this.qrCodeUrl = vaildStudentUrl() + "/#/childrenPayment?dHlwZT0y";
+      }
+
+      if(status == "music"){
+          this.codeTitle = "器乐考级链接";
+        this.qrCodeUrl = vaildStudentUrl() + "/#/childrenPayment?dHlwZT0x";
+      }
+      if(status == "vip"){
+            this.codeTitle = "VIP课程链接";
+        this.qrCodeUrl = vaildStudentUrl() + "/#/childrenPayment";
+      }
       this.codeStatus = true;
     },
     changeOrgan(val) {
       this.searchForm.cooperationId = null;
       this.searchForm.musicGroupId = null;
+    },
+    changeCooper(val) {
+      this.searchForm.musicGroupId = null;
+    },
+    gotoDetail(row) {
+      // query:{'musicGroupId':}
+      this.$router.push({
+        path: "/business/childrensdayDetail",
+        query: {
+          musicGroupId: row.musicGroupId,
+          musicGroupName: row.musicGroupName,
+        },
+      });
+    },
+  },
+  watch: {
+    "searchForm.organId"(val) {
       if (val) {
         queryByOrganId({ organId: val }).then((res) => {
           if (res.code == 200) {
@@ -283,18 +378,13 @@ export default {
         });
       }
     },
-    changeCooper(val) {
-      this.searchForm.musicGroupId = null;
+    "searchForm.cooperationId"(val) {
       if (val) {
         getMusicGroup({ cooperationId: val }).then((res) => {
           this.musicList = res.data;
         });
       }
     },
-    gotoDetail(row) {
-      // query:{'musicGroupId':}
-      this.$router.push({ path: "/business/childrensdayDetail",query:{'musicGroupId':row.musicGroupId,'musicGroupName':row.musicGroupName} });
-    },
   },
 };
 </script>