Browse Source

添加总代理明细,设置和取消总代理

song 10 months ago
parent
commit
db82cae3f5

+ 9 - 0
admin-web.iml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 17 - 1
src/api/account.js

@@ -44,6 +44,23 @@ export function shareholderOpen (query) {
   })
 }
 
+// 设置总代理
+export function generalSet (query) {
+  return request({
+    url: '/cms_api/account/set_general_proxy',
+    method: 'post',
+    data: query
+  })
+}
+
+export function cancelSet (query) {
+  return request({
+    url: '/cms_api/account/cancel_general_proxy',
+    method: 'post',
+    data: query
+  })
+}
+
 // 财务账号设置
 export function financeSet (query) {
   return request({
@@ -52,7 +69,6 @@ export function financeSet (query) {
     data: query
   })
 }
-
 // 财务账号充值
 export function financeRecharge (query) {
   return request({

+ 10 - 0
src/api/finance.js

@@ -1,4 +1,5 @@
 import request from '@/libs/request'
+import methods from 'codemirror/src/edit/methods'
 
 // 充值审核列表
 export function rechargeList (query) {
@@ -108,6 +109,15 @@ export function proxyInterestList (query) {
   })
 }
 
+//总代理提成明细列表
+export function generalProxyInterestList (query) {
+  return request({
+    url: '/cms_api/settle/general_proxy_list',
+    method: 'post',
+    data: query
+  })
+}
+
 // 购物宝明细
 export function transferAgileList (query) {
   return request({

+ 46 - 1
src/view/menu/account/accountFinance/index.vue

@@ -20,6 +20,14 @@
       :loading="loading"
     >
       <template slot-scope="{ row }" slot="do" >
+        <el-button v-if="row.isGeneral===1" class="marginrb" size="small" type="warning" @click="setCancel(row)">取消总代理</el-button>
+        <el-popconfirm v-if="row.isGeneral===0"
+                       title="确认设置该账号为总代理吗?"
+                       @confirm="setGeneral(row)"
+        >
+          <el-button class="marginrb" slot="reference" size="small" type="primary">设置总代理</el-button>
+        </el-popconfirm>
+
 <!--        <el-button size="small" class="marginrb" type="success"  @click="shareholderOpen(row)">股东转账开启</el-button>-->
         <el-button v-if="row.isTreasurer===1" class="marginrb" size="small" type="warning"  @click="financeRechargeShow(row)">财务账号充值</el-button>
         <el-popconfirm v-if="row.isTreasurer===0"
@@ -345,6 +353,8 @@ import {
   financeRecharge,
   financeSet,
   proxySet,
+  generalSet,
+  cancelSet,
   setRole,
   shareholderOpen,
   updatePromotion,
@@ -821,7 +831,42 @@ export default {
           this.dataEditingdio=false
         }
       })
-    }
+    },
+    setGeneral(row){
+      let data = {
+        id:row.id
+      }
+      let params = {
+        data:data
+      }
+      generalSet(params).then(res => {
+        if (res.rspCode === 0){
+          this.$message({
+            type: 'success',
+            message: '设置成功'
+          });
+          this.getTableData()
+          log.info(row.isGeneral)
+        }
+      })
+    },
+    setCancel(row) {
+      let data = {
+        id: row.id
+      }
+      let params = {
+        data: data
+      }
+      cancelSet(params).then(res => {
+        if (res.rspCode === 0) {
+          this.$message({
+            type: 'success',
+            message: '设置成功'
+          })
+          this.getTableData()
+        }
+      })
+    },
   }
 }
 </script>

+ 124 - 0
src/view/menu/financeManage/generalProxyInterestDetail/index.vue

@@ -0,0 +1,124 @@
+<template>
+  <div class="tran-detail">
+    结算日期:
+    <el-date-picker range-separator="-" style="margin-right: 15px;margin-left: 12px" start-placeholder="开始日期" end-placeholder="结束日期" type="daterange" v-model="createTime" ></el-date-picker>
+    <Button style="margin-bottom: 4px" type="primary" class="margin-right20" @click="search">查询</Button>
+    <Table
+      border
+      :columns="tableTitle"
+      :data="tableContent"
+      class="margin-bottom20 margin-top20"
+      :loading="loading"
+    >
+      <template slot-scope="{ row }" slot="contribution" >
+        <div>{{ parseFloat(row.proxyRebateDay+row.proxyGratitudeDay).toFixed(2) }}</div>
+      </template>
+    </Table>
+    <Page
+      :total="total"
+      @on-change="changePageNum"
+      :current="currentPage"
+      show-sizer
+      show-total
+      show-elevator
+      @on-page-size-change="changePageSize"
+    />
+  </div>
+</template>
+<script>
+import TableMinxin from '@/mixin/TableMixin'
+import {
+  generalProxyInterestList,
+  transferList
+} from "@/api/finance";
+import {Pass} from "codemirror/src/util/misc";
+import inputBlock from "_c/base/input/input-block.vue";
+export default {
+  name: 'rechargeExamine',
+  computed: {
+    Pass() {
+      return Pass
+    }
+  },
+  components: {
+    inputBlock
+  },
+  mixins: [TableMinxin],
+  data () {
+    return {
+      account: '',
+      realName: '',
+      total: 0,
+      outShowModal:false,
+      currentRow:{},
+      tableContent:[],
+      tableTitle: [
+        {
+          title: 'ID',
+          key: 'id',
+          align: 'center',
+          width:80
+        },
+        {
+          title: '代理手机号',
+          key: 'account',
+          align: 'center'
+        },
+        {
+          title: '代理姓名',
+          key: 'realName',
+          align: 'center'
+        },
+        {
+          title: '结算日期',
+          key: 'settleDate',
+          align: 'center'
+        },
+        {
+          title: '代理提成',
+          key: 'proxyRebateDay',
+          align: 'center',
+        },
+        {
+          title: '代理感恩收益',
+          key: 'proxyGratitudeDay',
+          align: 'center'
+        },
+        {
+          title: '累计收入',
+          slot: 'incomeTotal',
+          align: 'center'
+        }
+      ]
+    }
+  },
+  mounted () {
+    this.getTableData()
+  },
+  methods: {
+    // 获取表格数据
+    getTableData () {
+      this.loading = false
+      let data = {
+        startTime: this.v_formatYYYYMMDD(this.createTime && this.createTime[0]),
+        endTime: this.v_formatYYYYMMDD(this.createTime && this.createTime[1])
+      }
+      let params = {
+        data:data,
+        page: this.currentPage,
+        pageSize: this.pageSize
+      }
+      generalProxyInterestList(params).then(res => {
+        if (res.rspCode === 0) {
+          this.tableContent = res.data
+          this.total = res.total
+        }
+      })
+    }
+  }
+}
+</script>
+<style scoped>
+.tran-detail {
+}
+</style>