feat(bonusCount): 奖金计算添加loading

This commit is contained in:
woody 2025-08-28 11:34:12 +08:00
parent e8e0cf246d
commit 3bb0fea82d
1 changed files with 79 additions and 62 deletions

View File

@ -20,23 +20,23 @@
>
<el-row>
<!-- 一层 -->
<el-col :span="4" >
<el-col :span="4">
<el-form-item :label="$t('MN_F_T_930')">
<div style="display: flex">
<div>
<el-input v-model="select.period" clearable />
</div>
<!-- <span style="margin: 0 10px"></span>-->
<!-- <div>-->
<!-- <el-input v-model="select.endPeriod" clearable />-->
<!-- </div>-->
<!-- <span style="margin: 0 10px"></span>-->
<!-- <div>-->
<!-- <el-input v-model="select.endPeriod" clearable />-->
<!-- </div>-->
</div>
</el-form-item>
</el-col>
<el-collapse-transition>
<div v-show="isActive">
<el-col :span="4" >
<el-col :span="4">
<el-form-item :label="$t('MN_F_T_931')">
<el-select
v-model="select.isRetry"
@ -111,8 +111,8 @@
:range-separator="$t('w_0139')"
:start-placeholder="$t('CK_KS_4')"
:end-placeholder="$t('CK_KS_5')"
@change="changeTime"
format="yyyy-MM-dd"
@change="changeTime"
/>
</el-form-item>
</el-col>
@ -120,7 +120,7 @@
<el-button
class="my_search"
type="primary"
@click="openFullScreen"
@click="searchHandle"
> {{ $t('MN_T_2') }}</el-button>
<el-button
class="my_reset"
@ -142,42 +142,47 @@
<div class="maintop">
<div class="mainbtn">
<el-button
v-has-buttons="['bonusCountSettlement']"
size="small"
style="background-color: #48B2FD;"
class="thebtn2"
:loading="calculateOperatorLoading"
@click="balance"
v-has-buttons="['bonusCountSettlement']"
>{{ $t('MN_F_T_934') }}</el-button>
<el-button
v-has-buttons="['bonusCountPublish']"
size="small"
class="thebtn2"
:loading="calculateOperatorLoading"
@click="publish"
v-has-buttons="['bonusCountPublish']"
>{{ $t('MN_F_T_935') }}</el-button>
<el-button
size="small"
class="thebtn2"
:loading="calculateOperatorLoading"
@click="publish1"
>{{ $t('MN_F_T_936') }}</el-button>
<el-button
v-has-buttons="['bonusCountGrant']"
size="small"
style="background-color: #009B58"
class="thebtn2"
v-has-buttons="['bonusCountGrant']"
:loading="calculateOperatorLoading"
@click="grant"
>{{ $t('MN_F_T_937') }}</el-button>
<el-button
v-has-buttons="['bonusCountCash']"
size="small"
style="background-color: #48B2FD"
class="thebtn2"
:loading="calculateOperatorLoading"
@click="withdraw"
v-has-buttons="['bonusCountCash']"
>{{ $t('MN_F_T_938') }}</el-button>
</div>
<div>
<el-dropdown :hide-on-click="false">
<span class="el-dropdown-link kuang">
{{$t('MN_F_T_939')}}<i class="el-icon-arrow-down el-icon--right" />
{{ $t('MN_F_T_939') }}<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
@ -205,7 +210,7 @@
:summary-method="getSummaries"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection"> </el-table-column>
<el-table-column type="selection" />
<el-table-column
align="center"
prop="pkId"
@ -275,15 +280,15 @@
:label="$t('MN_F_T_945')+'(%)'"
:formatter="stateFormat"
/>
<!-- <el-table-column-->
<!-- v-for="item in menuList"-->
<!-- v-if="item.checked&&item.id != 0&&item.id < 5"-->
<!-- :key="item.id"-->
<!-- align="center"-->
<!-- width="130"-->
<!-- :prop="item.prop"-->
<!-- :label="item.text"-->
<!-- />-->
<!-- <el-table-column-->
<!-- v-for="item in menuList"-->
<!-- v-if="item.checked&&item.id != 0&&item.id < 5"-->
<!-- :key="item.id"-->
<!-- align="center"-->
<!-- width="130"-->
<!-- :prop="item.prop"-->
<!-- :label="item.text"-->
<!-- />-->
<el-table-column
align="center"
prop="isSettleVal"
@ -354,17 +359,17 @@
<!-- </el-table-column>-->
</el-table>
</div>
<!-- <div class="heji">-->
<!-- <div-->
<!-- v-for="item in menuList"-->
<!-- v-if="item.checked&&item.id != 0&&item.id > 13"-->
<!-- :key="item.id"-->
<!-- class="dis"-->
<!-- >-->
<!-- <div>{{ item.text }}</div>-->
<!-- <div>{{ tableData[item.prop] }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="heji">-->
<!-- <div-->
<!-- v-for="item in menuList"-->
<!-- v-if="item.checked&&item.id != 0&&item.id > 13"-->
<!-- :key="item.id"-->
<!-- class="dis"-->
<!-- >-->
<!-- <div>{{ item.text }}</div>-->
<!-- <div>{{ tableData[item.prop] }}</div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
<pagination
@ -384,23 +389,23 @@ import * as api from '@/api/settle.js'
import { classifyUpdate, classifySave } from '@/api/product'
import * as log from '@/api/logistics'
import { getcountryAllList } from '@/api/exchangerate'
import {getDealerYesno, settleBonus, publishBonus, grantBonus, withdrawalBonus, noPublishBonus,} from '@/api/member'
import { getDealerYesno, settleBonus, publishBonus, grantBonus, withdrawalBonus, noPublishBonus } from '@/api/member'
import { listPeriod } from '@/api/bonus'
import { Message } from 'element-ui'
import {isLocal, isLocalSymbol, stateFormat} from "@/utils/numberToCurrency";
import {mapGetters} from "vuex";
import { Loading } from 'element-ui';
import { isLocal, isLocalSymbol, stateFormat } from '@/utils/numberToCurrency'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui'
export default {
name: 'Bzpz',
components: {
topBar
},
filters: {
isAgree(val) {
isAgree(val) {
if (!val) {
return this.$t('ENU_POPUP_TYPE_1');
return this.$t('ENU_POPUP_TYPE_1')
} else {
return this.$t('ENU_POPUP_TYPE_2');
return this.$t('ENU_POPUP_TYPE_2')
}
}
},
@ -421,18 +426,18 @@ export default {
digList: [
{
value: 0,
label: this.$t('ENU_POPUP_TYPE_1'),
label: this.$t('ENU_POPUP_TYPE_1')
},
{
value: 1,
label: this.$t('ENU_POPUP_TYPE_2'),
},
label: this.$t('ENU_POPUP_TYPE_2')
}
],
menuList: [
{
id: 0,
text: this.$t('MN_F_T_948'),
checked: true,
checked: true
},
{
id: 1,
@ -444,19 +449,19 @@ export default {
id: 2,
text: `${this.$t('MN_F_T_843')}(${isLocalSymbol()})`,
checked: true,
prop: 'upgradeAmountDollar',
prop: 'upgradeAmountDollar'
},
{
id: 3,
text: `${this.$t('MN_F_T_854')}(${isLocalSymbol()})`,
checked: true,
prop: 'repurchaseAmountDollar',
prop: 'repurchaseAmountDollar'
},
{
id: 4,
text: `${this.$t('MN_F_T_943')}(${isLocalSymbol()})`,
checked: true,
prop: 'fansAmountDollar',
prop: 'fansAmountDollar'
}
],
creationTime: [],
@ -495,10 +500,7 @@ export default {
yieldStatus: [],
countryList: [],
orderTypeList: [],
button1Flag:false,
button2Flag:false,
button3Flag:false,
button4Flag:false,
calculateOperatorLoading: false
}
},
mounted() {
@ -529,6 +531,7 @@ export default {
const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) {
this.calculateOperatorLoading = true
settleBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) {
Message({
@ -541,6 +544,8 @@ export default {
type: 'error'
})
}
}).finally(() => {
this.calculateOperatorLoading = false
})
}
},
@ -549,6 +554,7 @@ export default {
const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) {
this.calculateOperatorLoading = true
noPublishBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) {
Message({
@ -561,6 +567,8 @@ export default {
type: 'error'
})
}
}).finally(() => {
this.calculateOperatorLoading = false
})
}
},
@ -569,6 +577,7 @@ export default {
const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) {
this.calculateOperatorLoading = true
publishBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) {
Message({
@ -581,6 +590,8 @@ export default {
type: 'error'
})
}
}).finally(() => {
this.calculateOperatorLoading = false
})
}
},
@ -589,6 +600,7 @@ export default {
const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) {
this.calculateOperatorLoading = true
grantBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) {
Message({
@ -601,6 +613,8 @@ export default {
type: 'error'
})
}
}).finally(() => {
this.calculateOperatorLoading = false
})
}
},
@ -609,6 +623,7 @@ export default {
const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) {
this.calculateOperatorLoading = true
withdrawalBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) {
Message({
@ -621,6 +636,8 @@ export default {
type: 'error'
})
}
}).finally(() => {
this.calculateOperatorLoading = false
})
}
},
@ -654,7 +671,7 @@ export default {
})
},
changeTime(val) {
if(val){
if (val) {
this.select.startDate = val[0]
this.select.endDate = val[1]
}
@ -675,7 +692,7 @@ export default {
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = this.$t('MN_F_T_951') +'(¥)'
sums[index] = this.$t('MN_F_T_951') + '(¥)'
return
}
if (index === 1) {
@ -750,36 +767,36 @@ export default {
})
},
getDataList() {
if(this.select.period){
this.select.period=parseInt(this.select.period)
if (this.select.period) {
this.select.period = parseInt(this.select.period)
}
if (this.creationTime == '' || this.creationTime == null) {
this.select.startDate = ''
this.select.endDate = ''
}
Number(this.select)
listPeriod(Object.assign({}, this.select),`?pageNum=${this.queryParams.pageNum}&pageSize=${this.queryParams.pageSize}`)
listPeriod(Object.assign({}, this.select), `?pageNum=${this.queryParams.pageNum}&pageSize=${this.queryParams.pageSize}`)
.then((res) => {
this.tableData.censusSummaryList = res.rows
this.total = res.total
})
},
openFullScreen(){
const loading = Loading.service({
searchHandle() {
const loading = Loading.service({
lock: true,
text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)',
background: 'rgba(0, 0, 0, 0.7)'
})
setTimeout(() => {
loading.close()
this.getDataList()
this.getDataList()
}, 1000)
},
handleSelectionChange(val) {},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm( this.$t('MN_F_T_407'), this.$t('MN_F_T_304'), {
this.$confirm(this.$t('MN_F_T_407'), this.$t('MN_F_T_304'), {
confirmButtonText: this.$t('w_0035'),
cancelButtonText: this.$t('ENU_P_TYPE0'),
type: 'warning'