|
|
@@ -1,125 +1,125 @@
|
|
|
<template>
|
|
|
- <div class="app-container" v-loading="loading">
|
|
|
+ <div v-loading="loading" class="app-container">
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
border
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
>
|
|
|
- <el-table-column align="center" min-width="100px" :label="$t('bonus.payCycle')" prop="PERIOD_NUM.value"></el-table-column>
|
|
|
- <el-table-column align="center" min-width="150px" :label="$t('bonus.welcomeBonus')" prop="BONUS_TG.value" v-show="welcomeBonusSwitch === 1">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{ row.BONUS_TG.value | toThousandFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" min-width="130px" :label="$t('bonus.teamBonus')" prop="ORI_BONUS_QY.value" v-show="teamBonusSwitch === 1">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{ row.ORI_BONUS_QY.value | toThousandFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="100px" :label="$t('bonus.payCycle')" prop="PERIOD_NUM.value" />
|
|
|
+ <el-table-column v-show="welcomeBonusSwitch === 1" align="center" min-width="150px" :label="$t('bonus.welcomeBonus')" prop="BONUS_TG.value">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ {{ row.BONUS_TG.value | toThousandFilter }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-show="teamBonusSwitch === 1" align="center" min-width="130px" :label="$t('bonus.teamBonus')" prop="ORI_BONUS_QY.value">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ {{ row.ORI_BONUS_QY.value | toThousandFilter }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="center" min-width="130px" :label="$t('bonus.directorBonus')" prop="ORI_BONUS_BS.value">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{ row.ORI_BONUS_BS.value | toThousandFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ {{ row.ORI_BONUS_BS.value | toThousandFilter }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="center" min-width="150px" :label="$t('bonus.quarterlyBonus')" prop="ORI_BONUS_QUARTER.value">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{ row.ORI_BONUS_QUARTER.value | toThousandFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" min-width="170px" :label="$t('bonus.stockistCommission')" prop="BONUS_BD.value" v-show="stockistCommissionSwitch === 1">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{ row.BONUS_BD.value | toThousandFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" min-width="120px" :label="$t('bonus.actualBonus')" prop="BONUS_REAL.value">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{ row.BONUS_REAL.value | toThousandFilter }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ {{ row.ORI_BONUS_QUARTER.value | toThousandFilter }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-show="stockistCommissionSwitch === 1" align="center" min-width="170px" :label="$t('bonus.stockistCommission')" prop="BONUS_BD.value">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ {{ row.BONUS_BD.value | toThousandFilter }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="120px" :label="$t('bonus.actualBonus')" prop="BONUS_REAL.value">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ {{ row.BONUS_REAL.value | toThousandFilter }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="center" min-width="100px" :label="$t('common.action')">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-button-group>
|
|
|
- <el-button type="primary" size="mini" @click="getOne(row.PERIOD_NUM.value)">{{ $t('common.view') }}</el-button>
|
|
|
- </el-button-group>
|
|
|
+ <el-button-group>
|
|
|
+ <el-button type="primary" size="mini" @click="getOne(row.PERIOD_NUM.value)">{{ $t('common.view') }}</el-button>
|
|
|
+ </el-button-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <el-dialog :title="bonusPayCycle" :visible.sync="dialog" :width="screenWidth" v-if="bonusData" style="margin-top: -80px">
|
|
|
- <el-descriptions title="" class="bonus-list" :column="column" border size="medium" style="width: 100%">
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('shop.memberCode')"><span style="white-space: nowrap;">{{ bonusData.USER_NAME.value }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.payCycle')"><span style="white-space: nowrap;">{{ bonusData.PERIOD_NUM.value }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('profile.memberLevel')"><span style="white-space: nowrap;">{{ bonusData.LAST_DEC_LV.value }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.whetherActive')"><span style="white-space: nowrap;">{{ bonusData.IS_ACTIVE.value === 1 ? $t('common.yes') : $t('common.no') }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('profile.latestDirector')"><span style="white-space: nowrap;">{{ bonusData.LAST_EMP_LV.value }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('profile.latestCrown')"><span style="white-space: nowrap;">{{ bonusData.LAST_CROWN_LV.value }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.directorPGSPerformance')"><span style="white-space: nowrap;">{{ bonusData.DIRECTOR_BONUS_PGS.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.directorBonus')"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_BS.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.welcomeBonus')" v-if="bonusData.ORI_BONUS_TG_SWITCH === 1"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_TG.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.teamBonus')" v-if="bonusData.ORI_BONUS_QY_SWITCH === 1"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_QY.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.quarterlyBonus')"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_QUARTER.value | amountFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.stockistCommission')" v-if="bonusData.BONUS_BD_SWITCH === 1"><span style="white-space: nowrap;">{{ bonusData.BONUS_BD.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.totalBonus')"><span style="white-space: nowrap;">{{ bonusData.BONUS_TOTAL.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.actualBonus')"><span style="white-space: nowrap;">{{ bonusData.BONUS_REAL.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.leftNewlyIncreasedPerformance')"><span style="white-space: nowrap;">{{ bonusData.PV_1L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.leftSurplusPerformance')"><span style="white-space: nowrap;">{{ bonusData.SURPLUS_1L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.rightNewlyIncreasedPerformance')"><span style="white-space: nowrap;">{{ bonusData.PV_2L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.rightSurplusPerformance')"><span style="white-space: nowrap;">{{ bonusData.SURPLUS_2L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
- </el-descriptions>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
+ <el-dialog v-if="bonusData" :title="bonusPayCycle" :visible.sync="dialog" :width="screenWidth" style="margin-top: -80px">
|
|
|
+ <el-descriptions title="" class="bonus-list" :column="column" border size="medium" style="width: 100%">
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('shop.memberCode')"><span style="white-space: nowrap;">{{ bonusData.USER_NAME.value }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.payCycle')"><span style="white-space: nowrap;">{{ bonusData.PERIOD_NUM.value }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('profile.memberLevel')"><span style="white-space: nowrap;">{{ bonusData.LAST_DEC_LV.value }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.whetherActive')"><span style="white-space: nowrap;">{{ bonusData.IS_ACTIVE.value === 1 ? $t('common.yes') : $t('common.no') }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('profile.latestDirector')"><span style="white-space: nowrap;">{{ bonusData.LAST_EMP_LV.value }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('profile.latestCrown')"><span style="white-space: nowrap;">{{ bonusData.LAST_CROWN_LV.value }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.directorPGSPerformance')"><span style="white-space: nowrap;">{{ bonusData.DIRECTOR_BONUS_PGS.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.directorBonus')"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_BS.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item v-if="bonusData.ORI_BONUS_TG_SWITCH === 1" label-class-name="labelClass" :label="$t('bonus.welcomeBonus')"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_TG.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item v-if="bonusData.ORI_BONUS_QY_SWITCH === 1" label-class-name="labelClass" :label="$t('bonus.teamBonus')"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_QY.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.quarterlyBonus')"><span style="white-space: nowrap;">{{ bonusData.ORI_BONUS_QUARTER.value | amountFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item v-if="bonusData.BONUS_BD_SWITCH === 1" label-class-name="labelClass" :label="$t('bonus.stockistCommission')"><span style="white-space: nowrap;">{{ bonusData.BONUS_BD.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.totalBonus')"><span style="white-space: nowrap;">{{ bonusData.BONUS_TOTAL.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.actualBonus')"><span style="white-space: nowrap;">{{ bonusData.BONUS_REAL.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.leftNewlyIncreasedPerformance')"><span style="white-space: nowrap;">{{ bonusData.PV_1L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.leftSurplusPerformance')"><span style="white-space: nowrap;">{{ bonusData.SURPLUS_1L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.rightNewlyIncreasedPerformance')"><span style="white-space: nowrap;">{{ bonusData.PV_2L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ <el-descriptions-item label-class-name="labelClass" :label="$t('bonus.rightSurplusPerformance')"><span style="white-space: nowrap;">{{ bonusData.SURPLUS_2L.value | toThousandFilter }}</span></el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {fetchBonusList, fetchBonusDetail} from '@/api/bonus'
|
|
|
-import {formatAmount, getOperatingSystem, getScreenWidth} from "@/utils";
|
|
|
+import { fetchBonusList, fetchBonusDetail } from '@/api/bonus'
|
|
|
+import { formatAmount, getOperatingSystem, getScreenWidth } from '@/utils'
|
|
|
|
|
|
export default {
|
|
|
- name: 'previousBonus',
|
|
|
+ name: 'PreviousBonus',
|
|
|
data() {
|
|
|
return {
|
|
|
- tableData: [],
|
|
|
+ tableData: [],
|
|
|
total: 0,
|
|
|
- loading: true,
|
|
|
+ loading: true,
|
|
|
|
|
|
- welcomeBonusSwitch: 0,
|
|
|
- teamBonusSwitch: 0,
|
|
|
- stockistCommissionSwitch: 0,
|
|
|
+ welcomeBonusSwitch: 0,
|
|
|
+ teamBonusSwitch: 0,
|
|
|
+ stockistCommissionSwitch: 0,
|
|
|
|
|
|
- dialog: false,
|
|
|
- bonusData: null,
|
|
|
- bonusPayCycle: '',
|
|
|
+ dialog: false,
|
|
|
+ bonusData: null,
|
|
|
+ bonusPayCycle: '',
|
|
|
|
|
|
- screenWidth: getScreenWidth() > 600 ? '70%' : getScreenWidth() + 'px',
|
|
|
- column: ['Android', 'ios'].includes(getOperatingSystem()) ? 1 : 2,
|
|
|
+ screenWidth: getScreenWidth() > 600 ? '70%' : getScreenWidth() + 'px',
|
|
|
+ column: ['Android', 'ios'].includes(getOperatingSystem()) ? 1 : 2
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
- fetchBonusList().then(response => {
|
|
|
- const {tableData, bonusSwitch} = response.data
|
|
|
- this.tableData = tableData
|
|
|
- this.welcomeBonusSwitch = bonusSwitch.welcomeBonusSwitch
|
|
|
- this.teamBonusSwitch = bonusSwitch.teamBonusSwitch
|
|
|
- this.stockistCommissionSwitch = bonusSwitch.stockistCommissionSwitch
|
|
|
+ fetchBonusList().then(response => {
|
|
|
+ const { tableData, bonusSwitch } = response.data
|
|
|
+ this.tableData = tableData
|
|
|
+ this.welcomeBonusSwitch = parseInt(bonusSwitch.welcomeBonusSwitch)
|
|
|
+ this.teamBonusSwitch = parseInt(bonusSwitch.teamBonusSwitch)
|
|
|
+ this.stockistCommissionSwitch = parseInt(bonusSwitch.stockistCommissionSwitch)
|
|
|
|
|
|
- this.loading = false
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
},
|
|
|
- getOne(periodNum) {
|
|
|
- this.loading = true
|
|
|
- this.bonusPayCycle = this.$t('bonus.periodBonus').replace('%s', periodNum)
|
|
|
- fetchBonusDetail({periodNum: periodNum}).then(response => {
|
|
|
- this.bonusData = response.data
|
|
|
- this.dialog = true
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
+ getOne(periodNum) {
|
|
|
+ this.loading = true
|
|
|
+ this.bonusPayCycle = this.$t('bonus.periodBonus').replace('%s', periodNum)
|
|
|
+ fetchBonusDetail({ periodNum: periodNum }).then(response => {
|
|
|
+ this.bonusData = response.data
|
|
|
+ this.dialog = true
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|