lex 1 yıl önce
ebeveyn
işleme
c2a8652b92

+ 28 - 13
src/views/main/baseinfo/management.vue

@@ -11,16 +11,20 @@
       />
     </div>
 
-    
-
     <div class="ment-container">
       <el-tabs v-model="activeName">
         <el-tab-pane label="总览" name="first">
-          <div v-if="activeName == 'first'" 
-          v-loading="loading" 
-          element-loading-text="加载中..."
-          element-loading-spinner="el-icon-loading">
-            <manageOrganAll :data="data" :search="search" ref="manageOrganAll" />
+          <div
+            v-if="activeName == 'first'"
+            v-loading="loading"
+            element-loading-text="加载中..."
+            element-loading-spinner="el-icon-loading"
+          >
+            <manageOrganAll
+              :data="data"
+              :search="search"
+              ref="manageOrganAll"
+            />
           </div>
         </el-tab-pane>
         <el-tab-pane label="分部数据" name="second">
@@ -40,9 +44,20 @@
           </div>
         </el-tab-pane>
       </el-tabs>
-      <el-button v-permission="'multiDataSourceHomeStats/summerIncome'" class="lookAllBtn" @click="openModel = true">查看总数据</el-button>
+      <el-button
+        v-permission="'multiDataSourceHomeStats/summerIncome'"
+        class="lookAllBtn"
+        @click="openModel = true"
+        >查看总数据</el-button
+      >
     </div>
-    <el-dialog class="dialog" top="2vh" width="80vw" title="总览" :visible.sync="openModel">
+    <el-dialog
+      class="dialog"
+      top="2vh"
+      width="85vw"
+      title="总览"
+      :visible.sync="openModel"
+    >
       <operateEcharts></operateEcharts>
     </el-dialog>
   </el-card>
@@ -251,7 +266,7 @@ export default {
       endDate: "",
       show: true,
       activeName: "first",
-      openModel: false, // 3端弹窗
+      openModel: false // 3端弹窗
     };
   },
   mounted() {
@@ -420,13 +435,13 @@ export default {
     z-index: 100;
   }
 }
-.ment-container{
+.ment-container {
   position: relative;
-  ::v-deep .el-loading-spinner{
+  ::v-deep .el-loading-spinner {
     animation: none;
   }
 }
-.lookAllBtn{
+.lookAllBtn {
   position: absolute;
   top: 0;
   right: 0;

+ 186 - 16
src/views/main/baseinfo/modals/operateEcharts.vue

@@ -9,7 +9,7 @@
         @changeValue="changeValue"
       />
     </div>
-    <statistic :col="4" class="statistic" :cols="12">
+    <statistic :col="6" class="statistic" :cols="12">
       <statistic-item>
         <span>
           现金总收入: (元)
@@ -62,6 +62,32 @@
           />
         </span>
       </statistic-item>
+      <statistic-item>
+        <span>
+          课堂乐器现金收入: (元)
+        </span>
+        <span>
+          <count-to
+            :endVal="ktyqTotal"
+            :duration="300"
+            :decimals="2"
+            :class="'des'"
+          />
+        </span>
+      </statistic-item>
+      <statistic-item>
+        <span>
+          酷乐秀机构版现金收入: (元)
+        </span>
+        <span>
+          <count-to
+            :endVal="colexiuTenantTotal"
+            :duration="300"
+            :decimals="2"
+            :class="'des'"
+          />
+        </span>
+      </statistic-item>
     </statistic>
     <div></div>
 
@@ -84,7 +110,7 @@
           v-model="organId"
           @change="
             () => {
-              this.isChangeOrgan = true 
+              this.isChangeOrgan = true;
               this.getData();
             }
           "
@@ -111,11 +137,26 @@
         </div>
       </div>
       <div class="colexiu-echarts"></div>
+
+      <!-- <div class="eachartTitle">
+        <div>
+          课堂乐器现金收入:
+          <count-to
+            :endVal="ktyqTotal"
+            :duration="300"
+            :decimals="2"
+            class="des"
+          />
+          元
+        </div>
+      </div>
+      <div class="ktyq-echarts"></div>
+
       <div class="eachartTitle">
         <div>
-          管乐团现金收入:
+          酷乐秀机构版现金收入:
           <count-to
-            :endVal="gytTotal"
+            :endVal="colexiuTenantTotal"
             :duration="300"
             :decimals="2"
             class="des"
@@ -123,7 +164,7 @@
         </div>
       </div>
-      <div class="gyt-echarts"></div>
+      <div class="colexiu-tenant-echarts"></div> -->
     </div>
   </div>
 </template>
@@ -144,7 +185,7 @@ export default {
     return {
       organId: "",
       mdate: [],
-      endDate: '',
+      endDate: "",
       gymECharts: null,
       gymData: [],
       gymTotal: 0,
@@ -154,7 +195,13 @@ export default {
       colexiuEcharts: null,
       colexiuData: [],
       colexiuTotal: 0,
-      isChangeOrgan: false,
+      ktyqEcharts: null,
+      ktyqData: [],
+      ktyqTotal: 0,
+      colexiuTenantEcharts: null,
+      colexiuTenantData: [],
+      colexiuTenantTotal: 0,
+      isChangeOrgan: false
     };
   },
   mounted() {
@@ -188,10 +235,10 @@ export default {
             this.gymData = gym.incomeByDates;
           }
           // 切换分部只更新管乐迷数据
-          if (this.isChangeOrgan){
-            this.isChangeOrgan = false
+          if (this.isChangeOrgan) {
+            this.isChangeOrgan = false;
             this.createGym();
-            return
+            return;
           }
           const gyt = res.data.find(item => item.platform == "gyt");
           if (gyt) {
@@ -203,7 +250,19 @@ export default {
             this.colexiuTotal = clx.totalAmount;
             this.colexiuData = clx.incomeByDates;
           }
-          this.init();
+          const ktyq = res.data.find(item => item.platform == "kt");
+          if (ktyq) {
+            this.ktyqTotal = ktyq.totalAmount;
+            this.ktyqData = ktyq.incomeByDates;
+          }
+          const clxt = res.data.find(item => item.platform == "clsOrg");
+          if (clxt) {
+            this.colexiuTenantTotal = clxt.totalAmount;
+            this.colexiuTenantData = clxt.incomeByDates;
+          }
+          this.$nextTick(() => {
+            this.init();
+          });
         }
       });
     },
@@ -216,11 +275,15 @@ export default {
       this.gymECharts.resize();
       this.gytEcharts.resize();
       this.colexiuEcharts.resize();
+      this.ktyqEcharts.resize();
+      this.colexiuTenantEcharts.resize();
     },
     init() {
       this.createGym();
       this.createGyt();
-      this.createColexiu();
+      // this.createColexiu();
+      // this.createColexiuTenant();
+      // this.createKtyq();
     },
     createGym() {
       if (this.gymECharts) {
@@ -240,7 +303,9 @@ export default {
           trigger: "axis",
           formatter: function(data) {
             const item = data[0];
-            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(2)}元`;
+            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(
+              2
+            )}元`;
           }
         },
         grid: {
@@ -277,6 +342,7 @@ export default {
       if (this.gytEcharts) {
         this.gytEcharts.dispose();
       }
+      console.log(document.querySelector(".gyt-echarts"), "document");
       this.gytEcharts = echarts.init(document.querySelector(".gyt-echarts"));
       const option = {
         grid: {
@@ -290,7 +356,9 @@ export default {
           trigger: "axis",
           formatter: function(data) {
             const item = data[0];
-            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(2)}元`;
+            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(
+              2
+            )}元`;
           }
         },
         xAxis: {
@@ -320,6 +388,7 @@ export default {
       if (this.colexiuEcharts) {
         this.colexiuEcharts.dispose();
       }
+      console.log(document.querySelector(".colexiu-echarts"), "document");
       this.colexiuEcharts = echarts.init(
         document.querySelector(".colexiu-echarts")
       );
@@ -335,7 +404,9 @@ export default {
           trigger: "axis",
           formatter: function(data) {
             const item = data[0];
-            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(2)}元`;
+            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(
+              2
+            )}元`;
           }
         },
         xAxis: {
@@ -360,6 +431,103 @@ export default {
         ]
       };
       option && this.colexiuEcharts.setOption(option);
+    },
+    createColexiuTenant() {
+      if (this.colexiuTenantEcharts) {
+        this.colexiuTenantEcharts.dispose();
+      }
+      console.log(
+        document.querySelector(".colexiu-tenant-echarts"),
+        "document"
+      );
+      this.colexiuTenantEcharts = echarts.init(
+        document.querySelector(".colexiu-tenant-echarts")
+      );
+      const option = {
+        grid: {
+          left: 5,
+          top: 30,
+          right: 5,
+          bottom: 5,
+          containLabel: true
+        },
+        tooltip: {
+          trigger: "axis",
+          formatter: function(data) {
+            const item = data[0];
+            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(
+              2
+            )}元`;
+          }
+        },
+        xAxis: {
+          type: "category",
+          data: this.colexiuTenantData.map(item => item.date),
+          axisLabel: {
+            color: "#333",
+            fontSize: 10
+          }
+        },
+        yAxis: {
+          type: "value",
+          axisLabel: { formatter: "{value}元" }
+        },
+        series: [
+          {
+            data: this.colexiuTenantData.map(item => item.totalAmount),
+            type: "bar",
+            color: "#00a79d",
+            barMaxWidth: 40
+          }
+        ]
+      };
+      option && this.colexiuTenantEcharts.setOption(option);
+    },
+    createKtyq() {
+      if (this.ktyqEcharts) {
+        this.ktyqEcharts.dispose();
+      }
+      console.log(document.querySelector(".ktyq-echarts"), "document");
+      this.ktyqEcharts = echarts.init(document.querySelector(".ktyq-echarts"));
+      const option = {
+        grid: {
+          left: 5,
+          top: 30,
+          right: 5,
+          bottom: 5,
+          containLabel: true
+        },
+        tooltip: {
+          trigger: "axis",
+          formatter: function(data) {
+            const item = data[0];
+            return `${item.axisValue}<br /> ${item.marker} ${item.value.toFixed(
+              2
+            )}元`;
+          }
+        },
+        xAxis: {
+          type: "category",
+          data: this.ktyqData.map(item => item.date),
+          axisLabel: {
+            color: "#333",
+            fontSize: 10
+          }
+        },
+        yAxis: {
+          type: "value",
+          axisLabel: { formatter: "{value}元" }
+        },
+        series: [
+          {
+            data: this.ktyqData.map(item => item.totalAmount),
+            type: "bar",
+            color: "#00a79d",
+            barMaxWidth: 40
+          }
+        ]
+      };
+      option && this.ktyqEcharts.setOption(option);
     }
   },
   computed: {
@@ -392,7 +560,9 @@ export default {
   // display: flex;
   .gym-echarts,
   .gyt-echarts,
-  .colexiu-echarts {
+  .colexiu-echarts,
+  .ktyq-echarts,
+  .colexiu-tenant-echarts {
     width: 100%;
     height: 350px;
     margin-bottom: 24px;

+ 2 - 2
vue.config.js

@@ -15,11 +15,11 @@ const name = defaultSettings.title || "管乐迷后台管理系统"; // page tit
 // const port = process.env.port || process.env.npm_config_port || 9528 // dev port
 // http://47.99.212.176:8000
 //  https://online.dayaedu.com
-// let target = "https://online.dayaedu.com"; //线上
+let target = "https://online.dayaedu.com"; //线上
 // let target = 'http://192.168.3.20:8000' //邹璇
 // let target = "http://192.168.0.127:8000"; //勇哥
 // let target = "http://192.168.3.14:8005"; // 原谅
-let target = "https://test.dayaedu.com"; //测试环境
+// let target = "https://test.dayaedu.com"; //测试环境
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**