feat(bonusCount): operator btn add loading

This commit is contained in:
ywk 2025-04-10 10:08:04 +08:00
parent 99ae5a99fb
commit 8e79b93744
1 changed files with 51 additions and 86 deletions

View File

@ -20,23 +20,19 @@
> >
<el-row> <el-row>
<!-- 一层 --> <!-- 一层 -->
<el-col :span="4" > <el-col :span="4">
<el-form-item :label="'奖金期数'"> <el-form-item label="奖金期数">
<div style="display: flex"> <div style="display: flex">
<div> <div>
<el-input v-model="select.period" clearable /> <el-input v-model="select.period" clearable />
</div> </div>
<!-- <span style="margin: 0 10px"></span>-->
<!-- <div>-->
<!-- <el-input v-model="select.endPeriod" clearable />-->
<!-- </div>-->
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-collapse-transition> <el-collapse-transition>
<div v-show="isActive"> <div v-show="isActive">
<el-col :span="4" > <el-col :span="4">
<el-form-item :label="'重算状态'"> <el-form-item :label="'重算状态'">
<el-select <el-select
v-model="select.isRetry" v-model="select.isRetry"
@ -111,8 +107,8 @@
:range-separator="'至'" :range-separator="'至'"
:start-placeholder="'开始日期'" :start-placeholder="'开始日期'"
:end-placeholder="'结束日期'" :end-placeholder="'结束日期'"
@change="changeTime"
format="yyyy-MM-dd" format="yyyy-MM-dd"
@change="changeTime"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -133,51 +129,51 @@
</el-row> </el-row>
<!-- <div class="openClose" @click="changeActive">-->
<!-- <i :class="isActive ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>-->
<!-- <div>{{ isActive ? '点击收起' : '点击展开' }}</div>-->
<!-- </div>-->
</el-form> </el-form>
<div class="maintop"> <div class="maintop">
<div class="mainbtn"> <div class="mainbtn">
<el-button <el-button
v-has-buttons="['bonusCountSettlement']"
size="small" size="small"
style="background-color: #48B2FD;" style="background-color: #48B2FD;"
class="thebtn2" class="thebtn2"
:loading="operatorLoading"
@click="balance" @click="balance"
v-has-buttons="['bonusCountSettlement']"
>{{ '结算' }}</el-button> >{{ '结算' }}</el-button>
<el-button <el-button
v-has-buttons="['bonusCountPublish']"
size="small" size="small"
class="thebtn2" class="thebtn2"
:loading="operatorLoading"
@click="publish" @click="publish"
v-has-buttons="['bonusCountPublish']"
>{{ '公布' }}</el-button> >{{ '公布' }}</el-button>
<el-button <el-button
size="small" size="small"
class="thebtn2" class="thebtn2"
:loading="operatorLoading"
@click="publish1" @click="publish1"
>{{ '不公布' }}</el-button> >{{ '不公布' }}</el-button>
<el-button <el-button
v-has-buttons="['bonusCountGrant']"
size="small" size="small"
style="background-color: #009B58" style="background-color: #009B58"
class="thebtn2" class="thebtn2"
v-has-buttons="['bonusCountGrant']" :loading="operatorLoading"
@click="grant" @click="grant"
>{{ '发放' }}</el-button> >{{ '发放' }}</el-button>
<el-button <el-button
v-has-buttons="['bonusCountCash']"
size="small" size="small"
style="background-color: #48B2FD" style="background-color: #48B2FD"
class="thebtn2" class="thebtn2"
:loading="operatorLoading"
@click="withdraw" @click="withdraw"
v-has-buttons="['bonusCountCash']"
>{{ '提现' }}</el-button> >{{ '提现' }}</el-button>
</div> </div>
<div> <div>
<el-dropdown :hide-on-click="false"> <el-dropdown :hide-on-click="false">
<span class="el-dropdown-link kuang"> <span class="el-dropdown-link kuang">
{{'筛选字段'}}<i class="el-icon-arrow-down el-icon--right" /> {{ '筛选字段' }}<i class="el-icon-arrow-down el-icon--right" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item <el-dropdown-item
@ -196,9 +192,9 @@
<div class="itemTrading"> <div class="itemTrading">
<el-table <el-table
ref="multipleTable" ref="multipleTable"
v-loading="loading"
height="690px" height="690px"
class="content" class="content"
v-loading="loading"
:data="tableData.censusSummaryList" :data="tableData.censusSummaryList"
style="width: 100%;" style="width: 100%;"
:header-cell-style="{ background: '#EEEEEE' }" :header-cell-style="{ background: '#EEEEEE' }"
@ -206,7 +202,7 @@
:summary-method="getSummaries" :summary-method="getSummaries"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection"> </el-table-column> <el-table-column type="selection" />
<el-table-column <el-table-column
align="center" align="center"
prop="pkId" prop="pkId"
@ -276,15 +272,6 @@
:label="'当月复购拨比'+'(%)'" :label="'当月复购拨比'+'(%)'"
:formatter="stateFormat" :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 <el-table-column
align="center" align="center"
prop="isSettleVal" prop="isSettleVal"
@ -331,41 +318,8 @@
width="auto" width="auto"
label="" label=""
/> />
<!-- <el-table-column align="center"-->
<!-- prop="time"-->
<!-- :label="'操作'" fixed="right" >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button @click="toFixed(scope.row.pkId)"-->
<!-- type="text"-->
<!-- size="small">-->
<!-- 修改-->
<!-- </el-button>-->
<!-- <el-button @click="toFixed(scope.row.pkId)"-->
<!-- type="text"-->
<!-- size="small">-->
<!-- 查看-->
<!-- </el-button>-->
<!-- <el-button @click="handleDelete(scope.row.pkId)"-->
<!-- type="text"-->
<!-- size="small"-->
<!-- style="color: #c73030">-->
<!-- 删除-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table> </el-table>
</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>
</div> </div>
<pagination <pagination
@ -385,11 +339,11 @@ import * as api from '@/api/settle.js'
import { classifyUpdate, classifySave } from '@/api/product' import { classifyUpdate, classifySave } from '@/api/product'
import * as log from '@/api/logistics' import * as log from '@/api/logistics'
import { getcountryAllList } from '@/api/exchangerate' 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 { listPeriod } from '@/api/bonus'
import { Message } from 'element-ui' import { Message } from 'element-ui'
import {isLocal, isLocalSymbol, stateFormat} from "@/utils/numberToCurrency"; import { isLocal, isLocalSymbol, stateFormat } from '@/utils/numberToCurrency'
import {mapGetters} from "vuex"; import { mapGetters } from 'vuex'
export default { export default {
name: 'Bzpz', name: 'Bzpz',
components: { components: {
@ -398,9 +352,9 @@ export default {
filters: { filters: {
isAgree(val) { isAgree(val) {
if (!val) { if (!val) {
return '允许'; return '允许'
} else { } else {
return '禁止'; return '禁止'
} }
} }
}, },
@ -421,18 +375,18 @@ export default {
digList: [ digList: [
{ {
value: 0, value: 0,
label: '允许', label: '允许'
}, },
{ {
value: 1, value: 1,
label: '禁止', label: '禁止'
}, }
], ],
menuList: [ menuList: [
{ {
id: 0, id: 0,
text: '全选', text: '全选',
checked: true, checked: true
}, },
{ {
id: 1, id: 1,
@ -444,19 +398,19 @@ export default {
id: 2, id: 2,
text: `${'复购金额'}(${isLocalSymbol()})`, text: `${'复购金额'}(${isLocalSymbol()})`,
checked: true, checked: true,
prop: 'upgradeAmountDollar', prop: 'upgradeAmountDollar'
}, },
{ {
id: 3, id: 3,
text: `${'首购金额'}(${isLocalSymbol()})`, text: `${'首购金额'}(${isLocalSymbol()})`,
checked: true, checked: true,
prop: 'repurchaseAmountDollar', prop: 'repurchaseAmountDollar'
}, },
{ {
id: 4, id: 4,
text: `${'当月首购拨比'}(${isLocalSymbol()})`, text: `${'当月首购拨比'}(${isLocalSymbol()})`,
checked: true, checked: true,
prop: 'fansAmountDollar', prop: 'fansAmountDollar'
} }
], ],
creationTime: [], creationTime: [],
@ -472,7 +426,7 @@ export default {
addOrEdit: '', addOrEdit: '',
total: 0, total: 0,
dialogVisible: false, dialogVisible: false,
loading:false, loading: false,
tableData: { tableData: {
censusSummaryList: [] censusSummaryList: []
}, },
@ -496,10 +450,7 @@ export default {
yieldStatus: [], yieldStatus: [],
countryList: [], countryList: [],
orderTypeList: [], orderTypeList: [],
button1Flag:false, operatorLoading: false
button2Flag:false,
button3Flag:false,
button4Flag:false,
} }
}, },
mounted() { mounted() {
@ -530,6 +481,7 @@ export default {
const verify = this.verifySelect() const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) { if (verify) {
this.operatorLoading = true
settleBonus({ 'settleDate': time }).then((res) => { settleBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
Message({ Message({
@ -542,6 +494,8 @@ export default {
type: 'error' type: 'error'
}) })
} }
}).finally(() => {
this.operatorLoading = false
}) })
} }
}, },
@ -550,6 +504,7 @@ export default {
const verify = this.verifySelect() const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) { if (verify) {
this.operatorLoading = true
noPublishBonus({ 'settleDate': time }).then((res) => { noPublishBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
Message({ Message({
@ -562,6 +517,8 @@ export default {
type: 'error' type: 'error'
}) })
} }
}).finally(() => {
this.operatorLoading = false
}) })
} }
}, },
@ -570,6 +527,7 @@ export default {
const verify = this.verifySelect() const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) { if (verify) {
this.operatorLoading = true
publishBonus({ 'settleDate': time }).then((res) => { publishBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
Message({ Message({
@ -582,6 +540,8 @@ export default {
type: 'error' type: 'error'
}) })
} }
}).finally(() => {
this.operatorLoading = false
}) })
} }
}, },
@ -602,6 +562,8 @@ export default {
type: 'error' type: 'error'
}) })
} }
}).finally(() => {
this.operatorLoading = false
}) })
} }
}, },
@ -610,6 +572,7 @@ export default {
const verify = this.verifySelect() const verify = this.verifySelect()
const time = this.$refs.multipleTable.selection[0].settleDate const time = this.$refs.multipleTable.selection[0].settleDate
if (verify) { if (verify) {
this.operatorLoading = true
withdrawalBonus({ 'settleDate': time }).then((res) => { withdrawalBonus({ 'settleDate': time }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
Message({ Message({
@ -622,6 +585,8 @@ export default {
type: 'error' type: 'error'
}) })
} }
}).finally(() => {
this.operatorLoading = false
}) })
} }
}, },
@ -655,7 +620,7 @@ export default {
}) })
}, },
changeTime(val) { changeTime(val) {
if(val){ if (val) {
this.select.startDate = val[0] this.select.startDate = val[0]
this.select.endDate = val[1] this.select.endDate = val[1]
} }
@ -676,7 +641,7 @@ export default {
const sums = [] const sums = []
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (index === 0) { if (index === 0) {
sums[index] = '小计' +'(¥)' sums[index] = '小计' + '(¥)'
return return
} }
if (index === 1) { if (index === 1) {
@ -752,15 +717,15 @@ export default {
}, },
getDataList() { getDataList() {
this.loading = true this.loading = true
if(this.select.period){ if (this.select.period) {
this.select.period=parseInt(this.select.period) this.select.period = parseInt(this.select.period)
} }
if (this.creationTime == '' || this.creationTime == null) { if (this.creationTime == '' || this.creationTime == null) {
this.select.startDate = '' this.select.startDate = ''
this.select.endDate = '' this.select.endDate = ''
} }
Number(this.select) 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) => { .then((res) => {
this.loading = false this.loading = false
this.tableData.censusSummaryList = res.rows this.tableData.censusSummaryList = res.rows
@ -771,7 +736,7 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams const queryParams = this.queryParams
this.$confirm( '是否确认导出所有数据项?', '警告', { this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'