|
|
@@ -0,0 +1,394 @@
|
|
|
+<template>
|
|
|
+ <div v-loading="loading">
|
|
|
+ <div v-if="permission.hasPermission(`config/bonus`)" class="panel">
|
|
|
+ <div class="panel-heading">{{ $t('config.baseConfig') }}</div>
|
|
|
+ <div class="panel-wrapper">
|
|
|
+ <div class="panel-body">
|
|
|
+ <el-form ref="form" :model="form" label-width="250px" :label-position="labelPosition">
|
|
|
+ <template v-for="item in configData">
|
|
|
+ <div v-if="item.SORT==='101'" class="hr-tip"><span>{{ $t('config.repeatAbout') }}</span></div>
|
|
|
+ <el-form-item :key="item.CONFIG_NAME" :label="item.TITLE">
|
|
|
+ <template v-if="item.INPUT_TYPE==='2'">
|
|
|
+ <el-select v-model="item.VALUE" placeholder="请选择">
|
|
|
+ <el-option v-for="optionItem in item.OPTIONS" :key="optionItem.label" :label="optionItem.label" :value="optionItem.value" />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.INPUT_TYPE==='3'">
|
|
|
+ <el-select v-model="item.VALUE" placeholder="请选择" multiple style="width: 100%;">
|
|
|
+ <el-option v-for="optionItem in item.OPTIONS" :key="optionItem.label" :label="optionItem.label" :value="optionItem.value" />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.INPUT_TYPE==='4'">
|
|
|
+ <el-date-picker v-model="item.VALUE" type="year" placeholder="选择年" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.INPUT_TYPE==='5'">
|
|
|
+ <el-date-picker v-model="item.VALUE" type="datetime" placeholder="Select date" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.INPUT_TYPE==='6'">
|
|
|
+ <el-date-picker v-model="item.VALUE" type="date" placeholder="Select date" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.INPUT_TYPE==='7'">
|
|
|
+ <el-time-select v-model="item.VALUE" :picker-options="{start: item.OPTIONS.start, end: item.OPTIONS.end, step: item.OPTIONS.step}" placeholder="选择时间" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.INPUT_TYPE==='8'">
|
|
|
+ <el-switch v-model="item.VALUE" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.INPUT_TYPE==='10'">
|
|
|
+ <el-table :data="item.VALUE" stripe style="width: 100%;">
|
|
|
+ <el-table-column prop="outTitle" :label="$t('config.sort')">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.sort }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="outTitle" :label="$t('config.bonusAmount')">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.salesCondition" placeholder="请输入内容" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="outTitle" :label="$t('config.saleAmountCap')">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.awardAmount" placeholder="请输入内容" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-input v-model="item.VALUE" placeholder="请输入内容">
|
|
|
+ <template v-if="!!item.UNIT" slot="append">{{ item.UNIT }}</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="panel-footer">
|
|
|
+ <el-button type="primary" :loading="submitButtonStat" style="float: right;" @click="onSubmit">{{ $t('table.confirm') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="permission.hasPermission(`config/bonus-dec-level`)" class="panel">
|
|
|
+ <div class="panel-heading">{{ $t('config.teamBonusConfig') }}</div>
|
|
|
+ <div class="panel-wrapper">
|
|
|
+ <div class="panel-body">
|
|
|
+ <el-table :data="decLevelTableData" stripe style="width: 100%;">
|
|
|
+ <el-table-column prop="LEVEL_NAME" :label="$t('config.levelName')" min-width="100px" />
|
|
|
+ <el-table-column :label="$t('config.bonusPercent')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.QY_PERCENT" min="0" max="100">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.capBonus')" min-width="170px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.INCOME_CAP" min="0">
|
|
|
+ <template slot="append">$</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="panel-footer">
|
|
|
+ <el-button type="primary" :loading="qySubmitButtonStat" style="float: right;" @click="onQYSubmit">{{ $t('table.confirm') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="permission.hasPermission(`config/bonus-emp-level`)" class="panel">
|
|
|
+ <div class="panel-heading">{{ $t('config.manageStarConfig') }}</div>
|
|
|
+ <div class="panel-wrapper">
|
|
|
+ <div class="panel-body">
|
|
|
+ <el-table :data="empLevelTableData" stripe style="width: 100%;">
|
|
|
+ <el-table-column prop="LEVEL_NAME" :label="$t('config.levelName')" min-width="120px" />
|
|
|
+ <el-table-column :label="$t('config.achieveMemberNo')" min-width="100px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.ACHIEVE_MEMBER_NUM" type="number" min="0" max="1000" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.achievePerfBV')" min-width="120px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.ACHIEVE_PERF_PV" type="number" min="0" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.achieveBV')" min-width="120px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.ACHIEVE_PV" type="number" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.manageBonusPercent')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.BS_PERCENT" min="0" max="100">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.tourBonusPercent')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.TOURISM_PERCENT" min="0" max="100">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.carFundBonusPercent')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.GARAGE_PERCENT" min="0" max="100">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="panel-footer">
|
|
|
+ <el-button type="primary" :loading="ycSubmitButtonStat" style="float: right;" @click="onYCSubmit">{{ $t('table.confirm') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="permission.hasPermission(`config/bonus-star-level`)" class="panel">
|
|
|
+ <div class="panel-heading">{{ $t('config.crownStarConfig') }}</div>
|
|
|
+ <div class="panel-wrapper">
|
|
|
+ <div class="panel-body">
|
|
|
+ <el-table :data="crownLevelTableData" stripe style="width: 100%;">
|
|
|
+ <el-table-column prop="LEVEL_NAME" :label="$t('config.levelName')" min-width="110px" />
|
|
|
+ <el-table-column :label="$t('config.levelScore')" min-width="180px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.LEVEL_SCORE" min="0">
|
|
|
+ <template slot="append">{{ $t('config.score') }}</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.upgradeScore')" min-width="180px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.UPGRADE_SCORE" min="0">
|
|
|
+ <template slot="append">{{ $t('config.score') }}</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.tourBonusPercent')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.TOURISM_PERCENT" min="0" max="100">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.carFundBonusPercent')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.GARAGE_PERCENT" min="0" max="100">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('config.villaFundBonusPercent')" min-width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.VILLA_PERCENT" min="0" max="100">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="panel-footer">
|
|
|
+ <el-button type="primary" :loading="starSubmitButtonStat" style="float: right;" @click="onStarSubmit">{{ $t('table.confirm') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import permission from '@/utils/permission'
|
|
|
+import { getScreenWidth } from '@/utils'
|
|
|
+import {
|
|
|
+ fetchBonusConfig,
|
|
|
+ updateBonusConfig,
|
|
|
+ updateBonusCrownLevelConfig,
|
|
|
+ updateBonusDecLevelConfig,
|
|
|
+ updateBonusEmpLevelConfig
|
|
|
+} from '@/api/config'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'ConfigBonusOpt',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ decLevelTableData: null,
|
|
|
+ empLevelTableData: null,
|
|
|
+ crownLevelTableData: null,
|
|
|
+ loading: true,
|
|
|
+ submitButtonStat: false,
|
|
|
+ qySubmitButtonStat: false,
|
|
|
+ glSubmitButtonStat: false,
|
|
|
+ ycSubmitButtonStat: false,
|
|
|
+ starSubmitButtonStat: false,
|
|
|
+ configData: null,
|
|
|
+ permission: permission,
|
|
|
+ screenWidth: getScreenWidth() > 600 ? '500px' : getScreenWidth() + 'px',
|
|
|
+ labelPosition: getScreenWidth() > 600 ? 'right' : 'top'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ form: function() {
|
|
|
+ const result = {}
|
|
|
+ for (const i in this.configData) {
|
|
|
+ result[i] = this.configData[i].VALUE
|
|
|
+ }
|
|
|
+ return result
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.fetchBonusConfig()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ fetchBonusConfig() {
|
|
|
+ this.loading = true
|
|
|
+ fetchBonusConfig().then(response => {
|
|
|
+ this.configData = response.data.config
|
|
|
+ this.decLevelTableData = response.data.decLevel
|
|
|
+ this.empLevelTableData = response.data.empLevel
|
|
|
+ this.crownLevelTableData = response.data.crownLevel
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSubmit() {
|
|
|
+ this.submitButtonStat = true
|
|
|
+ updateBonusConfig(this.form).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response.data,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.submitButtonStat = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ this.submitButtonStat = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onQYSubmit() {
|
|
|
+ this.qySubmitButtonStat = true
|
|
|
+ updateBonusDecLevelConfig({ data: this.decLevelTableData }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response.data,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.qySubmitButtonStat = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ this.qySubmitButtonStat = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onGLSubmit() {
|
|
|
+ this.glSubmitButtonStat = true
|
|
|
+ updateBonusDecLevelConfig({ data: this.decLevelTableData }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response.data,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.glSubmitButtonStat = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ this.glSubmitButtonStat = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onYCSubmit() {
|
|
|
+ this.ycSubmitButtonStat = true
|
|
|
+ updateBonusEmpLevelConfig({ data: this.empLevelTableData }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response.data,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.ycSubmitButtonStat = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ this.ycSubmitButtonStat = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onStarSubmit() {
|
|
|
+ this.starSubmitButtonStat = true
|
|
|
+ updateBonusCrownLevelConfig({ data: this.crownLevelTableData }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response.data,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.starSubmitButtonStat = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ this.starSubmitButtonStat = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+.app-main {
|
|
|
+ padding: 15px !important;
|
|
|
+}
|
|
|
+.app-container {
|
|
|
+ padding: 0;
|
|
|
+}
|
|
|
+.white-box {
|
|
|
+ padding: 15px;
|
|
|
+}
|
|
|
+.form-page {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+ .hr-tip {
|
|
|
+ font-size: 12px;
|
|
|
+ position: relative;
|
|
|
+ text-align: center;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ color: #999;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hr-tip:before {
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ top: 14px;
|
|
|
+ border-bottom: 1px dashed #ddd;
|
|
|
+ height: 1px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hr-tip span {
|
|
|
+ display: inline-block;
|
|
|
+ background: #fff;
|
|
|
+ position: relative;
|
|
|
+ padding: 0 10px;
|
|
|
+ }
|
|
|
+</style>
|