billisme 4 年 前
コミット
f430e1e013

+ 10 - 0
src/api/billrecord/billrecord.js

@@ -68,5 +68,15 @@ export const getBussinessList = (current, size, params) => {
   })
 }
 
+export const billStat = (params) => {
+  return request({
+    url: '/api/cyzh-billRecord/billrecord/billStat',
+    method: 'get',
+    params: {
+      ...params,
+    }
+  })
+}
+
 
 

+ 11 - 0
src/api/billrecord/bussinessdebit.js

@@ -48,3 +48,14 @@ export const update = (row) => {
   })
 }
 
+export const debitStat = (params) => {
+  return request({
+    url: '/api/cyzh-guosen/bussinessdebit/debitStat',
+    method: 'get',
+    params: {
+      ...params,
+    }
+  })
+}
+
+

+ 10 - 0
src/api/guosen/bussiness.js

@@ -66,3 +66,13 @@ export const getByAccount = () => {
 
   })
 }
+
+export const enableBussiness = (params) => {
+  return request({
+    url: '/api/cyzh-guosen/bussiness/enableBussiness',
+    method: 'get',
+    params: {
+      ...params
+    }
+  })
+}

+ 28 - 17
src/components/index/accountstatic.vue

@@ -8,11 +8,11 @@
   export default {
     props: {
       head: {},
-      data: {
-        todayIn:{},
-        todayOut:{},
-        historyIn:{},
-        historyOut:{}
+      statData: {
+        todayIn: null,
+        todayOut:null,
+        historyIn:null,
+        historyOut:null
       }
     },
     data() {
@@ -23,45 +23,56 @@
               click: function() {
 
               },
-              count: 100,
+              count: this.statData.todayOut,
               decimals: 2,
-              title: '今日提现',
+              title: '今日分润',
 
             },
             {
               click: function() {
 
               },
-              count: 100,
+              count: this.statData.historyOut,
               decimals: 2,
-              title: '历史提现',
+              title: '历史分润',
 
             },
             {
               click: function() {
 
               },
-              count: 100,
+              count: this.statData.todayIn,
               decimals: 2,
-              title: '今日收入',
+              title: '今日充值',
 
             },
             {
               click: function() {},
-              count: 100,
+              count: this.statData.historyIn,
               decimals: 2,
-              title: '历史收入',
+              title: '历史充值',
 
             }
           ]
         },
       }
     },
+      watch:{
+          statData:{
+              handler(){
+                  this.option.data[0].count = this.statData.todayOut;
+                  this.option.data[1].count = this.statData.historyOut;
+                  this.option.data[2].count = this.statData.todayIn;
+                  this.option.data[3].count = this.statData.historyIn;
+                  this.$forceUpdate()
+              },
+
+              immediate:true,
+                  deep:true
+
+          }
+      },
     mounted() {
-        this.option.data[0].count = this.data.todayOut;
-        this.option.data[1].count = this.data.historyOut;
-        this.option.data[2].count = this.data.todayIn;
-        this.option.data[3].count = this.data.historyIn;
 
     }
   }

+ 19 - 9
src/views/billrecord/chongzhi.vue

@@ -17,13 +17,19 @@
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
-
+      <template slot="menuLeft">
+        <el-button type="warning"
+                   size="small"
+                   v-if="permission.chongzhi_stat && data.length > 0"
+                   @click="handleStat">
+          充值统计</el-button><span span style="color: red; font-weight:bold">{{chongZhiStat}}</span>
+      </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getBussinessList as getList} from "@/api/billrecord/billrecord";
+  import {getBussinessList as getList, billStat} from "@/api/billrecord/billrecord";
   import {mapGetters} from "vuex";
 
   export default {
@@ -31,6 +37,7 @@
       return {
         form: {},
         query: {},
+        chongZhiStat: "",
         loading: true,
         page: {
           pageSize: 10,
@@ -95,15 +102,12 @@
 
               ]
             },
-            {
-              label: "充值方式",
-              prop: "payWay",
-              disabled: true
-            },
             {
               label: "时间",
               prop: "createTime",
-
+              type: "date",
+              search: true,
+              valueFormat: "yyyy-MM-dd HH:mm:ss"
             },
 
           ]
@@ -127,6 +131,11 @@
       }
     },
     methods: {
+      handleStat(){
+        billStat(this.query).then(res =>{
+          this.chongZhiStat = "¥" + res.data.data;
+        })
+      },
       rowSave(row, done, loading) {
         add(row).then(() => {
           this.onLoad(this.page);
@@ -171,11 +180,12 @@
           });
       },
       searchReset() {
+        this.chongZhiStat = "";
         this.query = {};
         this.onLoad(this.page);
       },
       searchChange(params, done) {
-        debugger
+        this.chongZhiStat = "";
         this.query = params;
         this.page.currentPage = 1;
         this.onLoad(this.page, params);

+ 89 - 11
src/views/guosen/bussiness.vue

@@ -19,6 +19,26 @@
         <el-tab v-if="scope.row.apiFilePath == null">无</el-tab>
         <el-tab v-if="scope.row.apiFilePath != null&&scope.row.apiFilePath != ''">有</el-tab>
       </template>
+      <template slot="enable" slot-scope="scope">
+        <el-tag type="primary" v-if="scope.row.enable == 0">启用</el-tag>
+        <el-tag type="danger" v-if="scope.row.enable == 1">禁用</el-tag>
+      </template>
+      <template slot="menu" slot-scope="scope">
+        <el-button
+                type ="text"
+                size="mini"
+                plain
+                v-if="scope.row.enable == 1 && permission.bussiness_enable"
+                @click="handleEnable(scope.row.id, 0)">启用
+        </el-button>
+        <el-button
+                type ="text"
+                size="mini"
+                plain
+                v-if="scope.row.enable == 0 && permission.bussiness_enable"
+                @click="handleEnable(scope.row.id, 1)">禁用
+        </el-button>
+      </template>
     </avue-crud>
   </basic-container>
 </template>
@@ -30,12 +50,14 @@
     add,
     update,
     remove,
-    generateApi
+    generateApi,
+    enableBussiness
   } from "@/api/guosen/bussiness";
   import {
     mapGetters
   } from "vuex";
   import md5 from 'js-md5'
+  import error from "../monitor/log/error";
 
   export default {
     data() {
@@ -121,6 +143,18 @@
                 trigger: "blur"
               }]
             },
+            {
+              label: "最低充值金额",
+              prop: "leastPrice",
+              labelWidth: 130,
+              span: 24,
+              hide: true,
+              rules: [{
+                required: true,
+                message: "请输入最低充值金额",
+                trigger: "blur"
+              }]
+            },
             {
               label: "api文档",
               prop: "apiFilePath",
@@ -143,10 +177,20 @@
                 trigger: "blur"
               }]
             },
+            // {
+            //   label: "关联账号的id",
+            //   prop: "accountId",
+            //   hide: true,
+            //   display: false,
+            //   rules: [{
+            //     required: true,
+            //     message: "请输入关联账号的id",
+            //     trigger: "blur"
+            //   }]
+            // },
             {
-              label: "关联账号的id",
-              prop: "accountId",
-              hide: true,
+              label: "余额(元)",
+              prop: "remain",
               display: false,
               rules: [{
                 required: true,
@@ -155,14 +199,21 @@
               }]
             },
             {
-              label: "余额(元)",
-              prop: "remain",
+              label: "状态",
+              prop: "enable",
+              type: "select",
+              slot: true,
               display: false,
-              rules: [{
-                required: true,
-                message: "请输入关联账号的id",
-                trigger: "blur"
-              }]
+              dicData: [
+                {
+                  label: "禁用",
+                  value: 1
+                },
+                {
+                  label: "启用",
+                  value: 0
+                },
+              ],
             },
           ]
         },
@@ -188,6 +239,33 @@
       }
     },
     methods: {
+      handleEnable(bussinessId, enable){
+        if(enable == 1){
+          this.$confirm("确定要禁用吗?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(() => {
+            let params = {"bussinessId": bussinessId, "enable": enable}
+            enableBussiness(params).then(() => {
+              this.onLoad(this.page);
+              this.$message({
+                type: "success",
+                message: "操作成功!"
+              });
+            })
+          })
+        }else{
+          let params = {"bussinessId": bussinessId, "enable": enable}
+          enableBussiness(params).then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          })
+        }
+      },
       rowSave(row, done, loading) {
         row.userPassword = md5(row.userPassword)
         add(row).then(() => {

+ 28 - 4
src/views/guosen/debit.vue

@@ -82,6 +82,13 @@
         <el-button type="text" size="small" icon="el-icon-zoom-in" @click="handleDetail(scope.row)">分佣对象
         </el-button>
       </template>
+      <template slot="menuLeft">
+        <el-button type="warning"
+                   size="small"
+                   v-if="permission.debt_stat && data.length > 0"
+                   @click="handleStat">
+          分润统计</el-button><span style="color: red; font-weight:bold">{{debtStat}}</span>
+      </template>
     </avue-crud>
 
 
@@ -95,7 +102,8 @@
     getDetail,
     add,
     update,
-    remove
+    remove,
+    debitStat
   } from "@/api/billrecord/bussinessdebit";
   import {
     mapGetters
@@ -110,6 +118,7 @@
       return {
         debitObjectVisible: false,
         debitObject: {},
+        debtStat: "",
         form: {},
         query: {},
         loading: true,
@@ -132,11 +141,13 @@
           viewBtn: false,
           selection: true,
           dialogClickModal: false,
-          column: [{
+          column: [
+            {
               label: "广告商",
               prop: "bussinessId",
               type: "select",
               dicUrl: "/api/cyzh-guosen/bussiness/list?size=500",
+
               dicFormatter:(res)=>{
                 return res.data.records;
               },
@@ -145,7 +156,7 @@
                 value: "id"
               },
               search: true,
-
+              searchSpan: 6,
             },
             {
               label: "扣款类型",
@@ -206,6 +217,7 @@
               prop: "status",
               type: "select",
               search: true,
+              searchSpan: 4,
               dicData: [{
                   label: "待确认",
                   value: 1
@@ -239,6 +251,7 @@
               addDisplay:false,
               editDisplay:false,
               search: true,
+              searchSpan: 4,
               dicData: [
                 {
                   label: "api对接",
@@ -253,7 +266,11 @@
             {
               label: "时间",
               prop: "updateTime",
-            }
+              type: "date",
+              search: true,
+              valueFormat: "yyyy-MM-dd HH:mm:ss",
+              searchSpan: 4,
+            },
           ]
         },
         data: []
@@ -278,6 +295,11 @@
       }
     },
     methods: {
+      handleStat(){
+        debitStat(this.query).then(res =>{
+          this.debtStat = "¥" + res.data.data;
+        })
+      },
       handleDetail(row) {
         this.debitObjectVisible = true;
         this.debitObject = row;
@@ -356,10 +378,12 @@
         done();
       },
       searchReset() {
+        this.debtStat = "";
         this.query = {};
         this.onLoad(this.page);
       },
       searchChange(params, done) {
+        this.debtStat = "";
         this.query = params;
         this.page.currentPage = 1;
         this.onLoad(this.page, params);

+ 36 - 30
src/views/wel/index.vue

@@ -43,17 +43,17 @@
             {{userInfo.userName}} 欢迎回来
           </el-card> -->
 
-          <el-card header="基础数据统计" v-if="permission.basic_static">
+          <!--<el-card header="基础数据统计" v-if="permission.basic_static">
             <avue-data-rotate :option="optionMusic"></avue-data-rotate>
-          </el-card>
-          <br>
-          <el-card header="用户数增长曲线" v-if="permission.user_increase">
+          </el-card>-->
+<!--          <br>-->
+          <!--<el-card header="用户数增长曲线" v-if="permission.user_increase">
             <div id="userStatistics" :style="{ width: '100%', height: '450px' }"></div>
-          </el-card>
-          <accountstatic head="用户财务账本" :data="useraccountData" v-if="permission.account_static"></accountstatic>
-          <accountstatic head="广告商财务账本" :data="bussinessaccountData" v-if="permission.account_static"></accountstatic>
-          <accountstatic head="代理商财务账本" :data="agenteraccountData" v-if="permission.account_static"></accountstatic>
-          <el-card header="音乐之声-佣金结算统计" v-if="permission.ordercommission_static">
+          </el-card>-->
+<!--          <accountstatic head="用户财务账本" :data="useraccountData" v-if="permission.account_static"></accountstatic>-->
+          <accountstatic head="广告商财务账本" :statData="bussinessaccountData" v-if="permission.account_static"></accountstatic>
+<!--          <accountstatic head="代理商财务账本" :data="agenteraccountData" v-if="permission.account_static"></accountstatic>-->
+          <!--<el-card header="音乐之声-佣金结算统计" v-if="permission.ordercommission_static">
 
             <el-button-group>
               <el-col :span="12">
@@ -82,9 +82,9 @@
                 </div>
               </el-col>
             </el-row>
-            <!-- 图形 -->
+            &lt;!&ndash; 图形 &ndash;&gt;
 
-          </el-card>
+          </el-card>-->
 
 
         </el-col>
@@ -190,7 +190,7 @@
         </div>
       </el-row>
 
-      <el-row :gutter="50">
+      <!--<el-row :gutter="50">
         <el-col span="12">
           <el-card style="background-color: #f2f2f2;border-radius: 30px;">
             <div slot="header">
@@ -207,7 +207,7 @@
             <avue-data-display :option="tgOption"></avue-data-display>
           </el-card>
         </el-col>
-      </el-row>
+      </el-row>-->
     </el-card>
 
   </basic-container>
@@ -240,7 +240,12 @@
       return {
         agenteraccountData:{},
         useraccountData: {},
-        bussinessaccountData: {},
+        bussinessaccountData: {
+          todayIn: null,
+          todayOut:null,
+          historyIn:null,
+          historyOut:null
+        },
         loading: true,
         editBussinessVisible: false,
         moneyChina: "壹拾万元整",
@@ -905,15 +910,16 @@
         this.dataPlace = "选择月份";
       },
       getAccoutStatic() {
+        let that = this;
         request({
           url: '/api/cyzh-static/staticAccountStatic',
           method: "get",
         }).then(res => {
-          //今日提现
+          //今日分润
           let todayOut = res.data.data.todayOut;
-          this.useraccountData.todayOut = todayOut.userOut;
-          this.agenteraccountData.todayOut = todayOut.proxyOut;
-          this.bussinessaccountData.todayOut = todayOut.adsOut;
+          that.useraccountData.todayOut = todayOut.userOut;
+          that.agenteraccountData.todayOut = todayOut.proxyOut;
+          that.bussinessaccountData.todayOut = todayOut.adsOut;
           // this.optionTodayOut.series[0].data[0].value = todayOut.userOut;
           // this.optionTodayOut.series[0].data[1].value = todayOut.proxyOut;
           // this.optionTodayOut.series[0].data[2].value = todayOut.adsOut;
@@ -922,9 +928,9 @@
           // this.option.data[0].count = todayOut.total;
           //历史提现
           let historyOut = res.data.data.totalOut;
-         this.useraccountData.historyOut = historyOut.userOut;
-         this.agenteraccountData.historyOut = historyOut.proxyOut;
-         this.bussinessaccountData.historyOut = historyOut.adsOut;
+          that.useraccountData.historyOut = historyOut.userOut;
+          that.agenteraccountData.historyOut = historyOut.proxyOut;
+          that.bussinessaccountData.historyOut = historyOut.adsOut;
           // this.optionHistoryOut.series[0].data[0].value = historyOut.userOut;
           // this.optionHistoryOut.series[0].data[1].value = historyOut.proxyOut;
           // this.optionHistoryOut.series[0].data[2].value = historyOut.adsOut;
@@ -932,11 +938,11 @@
           // this.optionHistoryOut.series[0].data[4].value = historyOut.sponsorOut;
           // this.option.data[1].count = historyOut.total;
 
-          //今日收入
+          //今日充值
           let todayIn = res.data.data.todayIn;
-          this.useraccountData.todayIn = todayIn.userOut;
-          this.agenteraccountData.todayIn = todayIn.proxyOut;
-          this.bussinessaccountData.todayIn = todayIn.adsOut;
+          that.useraccountData.todayIn = todayIn.userIn;
+          that.agenteraccountData.todayIn = todayIn.proxyIn;
+          that.bussinessaccountData.todayIn = todayIn.adsIn;
           // this.optionTodayIn.series[0].data[0].value = todayIn.userIn;
           // this.optionTodayIn.series[0].data[1].value = todayIn.proxyIn;
           // this.optionTodayIn.series[0].data[2].value = todayIn.adsIn;
@@ -944,17 +950,17 @@
           // this.option.data[2].count = todayIn.total;
           //历史收入
           let historyIn = res.data.data.totalIn;
-          this.useraccountData.historyIn = historyIn.userOut;
-          this.agenteraccountData.historyIn = historyIn.proxyOut;
-          this.bussinessaccountData.historyIn = historyIn.adsOut;
+          that.useraccountData.historyIn = historyIn.userIn;
+          that.agenteraccountData.historyIn = historyIn.proxyIn;
+          that.bussinessaccountData.historyIn = historyIn.adsIn;
           // this.optionHistoryIn.series[0].data[0].value = historyIn.userIn;
           // this.optionHistoryIn.series[0].data[1].value = historyIn.proxyIn;
           // this.optionHistoryIn.series[0].data[2].value = historyIn.adsIn;
-
+          that.$forceUpdate()
           // this.option.data[3].count = historyIn.total;
 
 
-          this.drawPie();
+          that.drawPie();
         })
       },
       getOrderCommissionData() {