Просмотр исходного кода

历史累积奖金功能发布

kevin_zhangl 3 лет назад
Родитель
Сommit
ebbfcdccb8

+ 9 - 0
src/api/bonus.js

@@ -17,3 +17,12 @@ export function fetchBonusDetail(data) {
     params: data
   })
 }
+
+// 历史累积奖金
+export function fetchHistoricalCumulativeBonus() {
+  return request({
+    url: '/v1/bonus/historical-cumulative-bonus',
+    method: 'get',
+    params: {}
+  })
+}

+ 6 - 0
src/router/modules/bonus.js

@@ -16,6 +16,12 @@ const bonusRouter = {
       name: 'BonusList',
       meta: { title: 'bonusList', icon: 'el-icon-coin' }
     },
+    {
+      path: 'historical-cumulative-bonus',  // 历史奖金
+      component: () => import('@/views/bonus/historical-cumulative-bonus'),
+      name: 'HistoricalCumulativeBonus',
+      meta: { title: 'historicalCumulativeBonus', icon: 'el-icon-coin' }
+    },
   ]
 }
 export default bonusRouter

+ 0 - 4
src/views/bonus/bonus-list.vue

@@ -48,13 +48,9 @@
 
 <script>
 import {fetchBonusList, fetchBonusDetail} from '@/api/bonus'
-import waves from '@/directive/waves'
-import Pagination from '@/components/Pagination'
 
 export default {
   name: 'myBonusList',
-  components: { Pagination },
-  directives: { waves },
   data() {
     return {
 			tableData: [],

+ 54 - 0
src/views/bonus/historical-cumulative-bonus.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="app-container" v-loading="loading">
+    <el-table
+      :data="tableData"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%; margin-top: 25px;"
+    >
+			<el-table-column align="center" :label="$t('bonus.welcomeBonus')" prop="BONUS_TG.value" v-show="welcomeBonusSwitch === 1"></el-table-column>
+      <el-table-column align="center" :label="$t('bonus.teamBonus')" prop="ORI_BONUS_QY.value" v-show="teamBonusSwitch === 1"></el-table-column>
+      <el-table-column align="center" :label="$t('bonus.directorBonus')" prop="ORI_BONUS_BS.value"></el-table-column>
+      <el-table-column align="center" :label="$t('bonus.quarterlyBonus')" prop="ORI_BONUS_QUARTER.value"></el-table-column>
+			<el-table-column align="center" :label="$t('bonus.stockistCommission')" prop="BONUS_BD.value" v-show="stockistCommissionSwitch === 1"></el-table-column>
+			<el-table-column align="center" :label="$t('bonus.totalBonus')" prop="BONUS_TOTAL.value"></el-table-column>
+    </el-table>
+	</div>
+</template>
+
+<script>
+import {fetchHistoricalCumulativeBonus} from '@/api/bonus'
+
+export default {
+  name: 'historicalCumulativeBonus',
+  data() {
+    return {
+			tableData: [],
+      total: 0,
+			loading: true,
+
+			welcomeBonusSwitch: 0,
+			teamBonusSwitch: 0,
+			stockistCommissionSwitch: 0,
+    }
+  },
+  created() {
+    this.getList()
+  },
+	methods: {
+    getList() {
+      this.loading = true
+			fetchHistoricalCumulativeBonus().then(response => {
+				const {tableData, bonusSwitch} = response.data
+				this.tableData = tableData
+				this.welcomeBonusSwitch = bonusSwitch.welcomeBonusSwitch
+				this.teamBonusSwitch = bonusSwitch.teamBonusSwitch
+				this.stockistCommissionSwitch = bonusSwitch.stockistCommissionSwitch
+
+				this.loading = false
+      })
+    },
+  }
+}
+</script>