fix(币种配置): 修复币种配置相关页面请求异步导致列表部分字段不展示的问题

This commit is contained in:
woody 2025-04-23 17:10:58 +08:00
parent 4b9a079834
commit fe1d148dcd
5 changed files with 338 additions and 308 deletions

View File

@ -48,11 +48,12 @@
:formatter="stateFormat" :formatter="stateFormat"
prop="upperBound" prop="upperBound"
:label="`${'个税上界'}(${getUser.currency.symbol})`" :label="`${'个税上界'}(${getUser.currency.symbol})`"
min-width="140"
/> />
<el-table-column align="center" prop="ratio" :label="'个税扣除'+'(%)'" /> <el-table-column align="center" prop="ratio" :label="'个税扣除'+'(%)'" />
<el-table-column align="center" prop="kouchuType" :label="'扣除类型'" /> <el-table-column align="center" prop="kouchuType" :label="'扣除类型'" />
<el-table-column align="center" prop="effectiveDate" :label="'生效日期'" /> <el-table-column align="center" prop="effectiveDate" :label="'生效日期'" />
<el-table-column align="center" prop="creationTime" :label="'创建日期'" width="200" /> <el-table-column align="center" prop="creationTime" :label="'创建日期'" width="160" />
<el-table-column align="center" prop="time" :label="'操作'" fixed="right" width="100"> <el-table-column align="center" prop="time" :label="'操作'" fixed="right" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -62,7 +63,7 @@
class="button-s" class="button-s"
@click.native.prevent="update(scope.row)" @click.native.prevent="update(scope.row)"
> >
{{ '修改' }} 修改
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
@ -71,7 +72,7 @@
class="button-s" class="button-s"
@click.native.prevent="deleteRow(scope.row)" @click.native.prevent="deleteRow(scope.row)"
> >
{{ '删除' }} 删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -277,9 +278,11 @@ export default {
} }
}, },
created() { created() {
this.getWithdrawalList() // this.userCountryList()
this.userCountryList() // this.getcellTypeList()
this.getcellTypeList() this.initEnum().finally(() => {
this.getWithdrawalList()
})
}, },
methods: { methods: {
stateFormat, stateFormat,
@ -289,6 +292,24 @@ export default {
this.cellTypeList = res.data this.cellTypeList = res.data
}) })
}, },
initEnum() {
return new Promise((resolve, reject) => {
Promise.allSettled([
this.userCountryList(),
this.getcellTypeList()
]).then(([countryList, cellTypeList]) => {
if (countryList.status === 'fulfilled') {
this.countryList = countryList.value.data
}
if (cellTypeList.status === 'fulfilled') {
this.cellTypeList = cellTypeList.value.data
}
resolve()
}).catch((err) => {
reject(err)
})
})
},
addList() { addList() {
this.form.withdrawalTaxDetailsList.push({ this.form.withdrawalTaxDetailsList.push({
lowerBound: '', lowerBound: '',

View File

@ -438,9 +438,9 @@ export default {
...mapGetters(['getUser']) ...mapGetters(['getUser'])
}, },
mounted() { mounted() {
this.getOthers() this.getOthers().finally(() => {
// this.getDataList()
this.getDataList() })
}, },
methods: { methods: {
stateFormat, stateFormat,
@ -499,10 +499,6 @@ export default {
this.dialogVisible = true this.dialogVisible = true
}, },
getOthers() { getOthers() {
//
userCountryList().then((res) => {
this.countryList = res.data
})
// //
getPubEnumsAccount().then((res) => { getPubEnumsAccount().then((res) => {
this.pubEnumsAccountList = res.rows this.pubEnumsAccountList = res.rows
@ -511,9 +507,21 @@ export default {
api.pkBdAccountList().then((res) => { api.pkBdAccountList().then((res) => {
this.pkAccountList = res.rows this.pkAccountList = res.rows
}) })
// return new Promise((resolve, reject) => {
api.getCycle().then((res) => { Promise.allSettled([
this.cycleList = res.data userCountryList(),
api.getCycle()
]).then(([countryList, cycleList]) => {
if (countryList.status === 'fulfilled') {
this.countryList = countryList.value.data
}
if (cycleList.status === 'fulfilled') {
this.cycleList = cycleList.value.data
}
resolve()
}).catch((err) => {
reject(err)
})
}) })
}, },
getDataList() { getDataList() {

View File

@ -3,9 +3,9 @@
<div class="page"> <div class="page">
<topBar <topBar
v-if="topList.length > 0" v-if="topList.length > 0"
:topList="topList" :top-list="topList"
:moren="moren" :moren="moren"
></topBar> />
<div class="main"> <div class="main">
<div class="maintop"> <div class="maintop">
<div class="mainbtn"> <div class="mainbtn">
@ -17,48 +17,53 @@
</div> </div>
<div class="maintable"> <div class="maintable">
<el-table <el-table
:data="tableData"
v-loading="loading" v-loading="loading"
:data="tableData"
height="760px" height="760px"
style="width: 100%" style="width: 100%"
:header-cell-style="{ background: '#EEEEEE' }" :header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55"> </el-table-column> <el-table-column type="selection" width="55" />
<el-table-column <el-table-column
align="center" align="center"
prop="jxmc" prop="pkCountry"
:label="'国家'" :label="'国家'"
width="180" width="180"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tem"> <div class="tem">
<img :src="scope.row.pkCountryIcon" alt="" /> <template v-if="renderCountryName(scope.row.pkCountry)">
<div>{{ scope.row.pkCountryName }}</div> <img :src="renderCountryName(scope.row.pkCountry).icon" alt="">
<div>{{ renderCountryName(scope.row.pkCountry).name }}</div>
</template>
<template v-else>
-
</template>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="serviceTypeVal" :label="'手续费类型'"> <el-table-column align="center" prop="serviceType" label="手续费类型">
<template slot-scope="scope">
{{ renderCellType(scope.row.serviceType) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="serviceRatio" prop="serviceRatio"
:label="'手续费数值'" :label="'手续费数值'"
> />
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="effectiveDate" prop="effectiveDate"
:label="'生效日期'" :label="'生效日期'"
> />
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="creationTime" prop="creationTime"
:label="'创建日期'" :label="'创建日期'"
> />
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="time" prop="time"
@ -67,20 +72,20 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@click.native.prevent="update(scope.row)"
type="text" type="text"
size="small" size="small"
class="button-s" class="button-s"
style="color: #6962f6" style="color: #6962f6"
@click.native.prevent="update(scope.row)"
> >
{{ '修改' }} {{ '修改' }}
</el-button> </el-button>
<el-button <el-button
@click.native.prevent="deleteRow(scope.row)"
type="text" type="text"
size="small" size="small"
class="button-s" class="button-s"
style="color: #c73030" style="color: #c73030"
@click.native.prevent="deleteRow(scope.row)"
> >
{{ '删除' }} {{ '删除' }}
</el-button> </el-button>
@ -114,23 +119,23 @@
<el-row style="display: flex; justify-content: space-between"> <el-row style="display: flex; justify-content: space-between">
<el-col :span="11" style="margin-left: -10px"> <el-col :span="11" style="margin-left: -10px">
<el-form-item :label="'手续费类型'" prop="serviceType"> <el-form-item :label="'手续费类型'" prop="serviceType">
<el-select clearable v-model="form.serviceType" placeholder=""> <el-select v-model="form.serviceType" clearable placeholder="">
<el-option <el-option
v-for="item in cellTypeList" v-for="item in cellTypeList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item :label="'手续费数值'" prop="serviceRatio"> <el-form-item :label="'手续费数值'" prop="serviceRatio">
<el-input <el-input
clearable
v-model="form.serviceRatio" v-model="form.serviceRatio"
clearable
placeholder="" placeholder=""
></el-input> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -142,243 +147,232 @@
type="datetime" type="datetime"
:placeholder="'请选择'" :placeholder="'请选择'"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
> />
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="cancels" @click="handleClose"> <el-button class="cancels" @click="handleClose">
{{ '取消' }}</el-button {{ '取消' }}</el-button>
>
<el-button <el-button
class="submit" class="submit"
style="margin-left: 40px" style="margin-left: 40px"
type="primary" type="primary"
@click="onSubmit('form')" @click="onSubmit('form')"
>{{ '确定' }}</el-button >{{ '确定' }}</el-button>
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import topBar from "@/components/topBar"; import topBar from '@/components/topBar'
import { userCountryList } from "@/api/user"; import { userCountryList } from '@/api/user'
import { getcellTypeList } from "@/api/bonus"; import { getcellTypeList } from '@/api/bonus'
import { import {
getWithdrawalProcessList, getWithdrawalProcessList,
deleteWithdrawalProcess, deleteWithdrawalProcess,
saveWithdrawalProcess, saveWithdrawalProcess,
updateWithdrawalProcess, updateWithdrawalProcess,
getOneWithdrawalProcessList, getOneWithdrawalProcessList
} from "@/api/configManage"; } from '@/api/configManage'
export default { export default {
name: "Txsxf", name: 'Txsxf',
components: { components: {
topBar, topBar
}, },
filters: { filters: {
isAgree(val) { isAgree(val) {
if (!val) { if (!val) {
return '允许'; return '允许'
} else { } else {
return '禁止'; return '禁止'
} }
}, }
}, },
data() { data() {
return { return {
moren: "txsxf", moren: 'txsxf',
topList: [ topList: [
{ {
name: '币种配置', name: '币种配置',
path: "bzpz", path: 'bzpz'
}, },
{ {
name: '消费配置', name: '消费配置',
path: "xfpz", path: 'xfpz'
}, },
{ {
name: '转账配置', name: '转账配置',
path: "zzpz", path: 'zzpz'
}, },
{ {
name: '提现配置', name: '提现配置',
path: "txpz", path: 'txpz'
}, },
{ {
name: '提现个税', name: '提现个税',
path: "txgs", path: 'txgs'
}, },
{ {
name: '提现手续费', name: '提现手续费',
path: "txsxf", path: 'txsxf'
}, },
{ {
name: '特殊消费', name: '特殊消费',
path: "specialMoney", path: 'specialMoney'
}, }
], ],
countryList: [], // countryList: [], //
tableData: [], tableData: [],
loading:false, loading: false,
total: 0, total: 0,
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 50, pageSize: 50
}, },
cellTypeList: [], // cellTypeList: [], //
updateShow: false, updateShow: false,
addOrEdit: "", // true false addOrEdit: '', // true false
updateTitle: "", updateTitle: '',
form: { form: {
serviceType: "", // serviceType: '', //
serviceRatio: "", // serviceRatio: '', //
effectiveDate: "", // effectiveDate: '' //
}, },
rules: { rules: {
serviceRatio: [ serviceRatio: [
{ required: true, message: "请输入手续费值", trigger: "blur" }, { required: true, message: '请输入手续费值', trigger: 'blur' }
], ],
serviceType: [ serviceType: [
{ required: true, message: '请选择', trigger: "change" }, { required: true, message: '请选择', trigger: 'change' }
], ],
effectiveDate: [ effectiveDate: [
{ required: true, message: '请选择生效时间', trigger: "change" }, { required: true, message: '请选择生效时间', trigger: 'change' }
], ]
}, }
}; }
}, },
created() { created() {
this.getWithdrawalProcessList(); this.getWithdrawalProcessList()
this.userCountryList(); this.userCountryList()
this.getcellTypeList(); this.getcellTypeList()
}, },
methods: { methods: {
// //
getcellTypeList() { getcellTypeList() {
getcellTypeList().then((res) => { getcellTypeList().then((res) => {
this.cellTypeList = res.data; this.cellTypeList = res.data
}); })
},
renderCellType(serviceType) {
return this.cellTypeList.find((item) => item.value === serviceType)?.label
},
renderCountryName(country) {
const countryInfo = this.countryList.find((item) => item.pkCountry === country)
return countryInfo ? {
name: countryInfo.name,
icon: countryInfo.nationalFlag2
} : null
}, },
handleClose() { handleClose() {
this.updateShow = false; this.updateShow = false
this.$refs["form"].clearValidate(); this.$refs['form'].clearValidate()
this.$refs["form"].resetFields(); this.$refs['form'].resetFields()
}, },
// //
onSubmit(formName) { onSubmit(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
let url = ""; let url = ''
if (this.addOrEdit == true) { if (this.addOrEdit == true) {
url = saveWithdrawalProcess; url = saveWithdrawalProcess
} else { } else {
url = updateWithdrawalProcess; url = updateWithdrawalProcess
} }
url(this.form).then((res) => { url(this.form).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.updateShow = false; this.updateShow = false
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: "success", type: 'success'
}); })
this.getWithdrawalProcessList(); this.getWithdrawalProcessList()
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: "warning", type: 'warning'
}); })
} }
}); })
} }
}); })
}, },
// //
getWithdrawalProcessList() { getWithdrawalProcessList() {
this.loading = true this.loading = true
getWithdrawalProcessList(this.queryParams).then((res) => { getWithdrawalProcessList(this.queryParams).then((res) => {
res.rows.forEach((element) => { this.tableData = res.rows
this.countryList.forEach((child) => { this.total = res.total
if (element.pkCountry == child.pkCountry) {
element.pkCountryName = child.name;
element.pkCountryIcon = child.nationalFlag2;
}
});
this.cellTypeList.forEach((child2) => {
if (element.serviceType == child2.value) {
element.sxfType = child2.label;
}
});
});
this.tableData = res.rows;
this.total = res.total;
this.loading = false this.loading = false
}); })
}, },
// //
adddate() { adddate() {
this.updateShow = true; this.updateShow = true
this.updateTitle = '添加'; this.updateTitle = '添加'
this.addOrEdit = true; this.addOrEdit = true
if (this.$refs.form) { if (this.$refs.form) {
this.form.pkId = null; this.form.pkId = null
this.$refs.form.clearValidate(); this.$refs.form.clearValidate()
this.$refs.form.resetFields(); this.$refs.form.resetFields()
} }
}, },
// //
userCountryList() { userCountryList() {
userCountryList().then((res) => { userCountryList().then((res) => {
this.countryList = res.data; this.countryList = res.data
}); })
}, },
// //
update(row) { update(row) {
this.updateTitle = '修改'; this.updateTitle = '修改'
this.addOrEdit = false; this.addOrEdit = false
this.updateShow = true; this.updateShow = true
getOneWithdrawalProcessList(row.pkId).then((res) => { getOneWithdrawalProcessList(row.pkId).then((res) => {
this.form = res.data; this.form = res.data
}); })
}, },
// //
deleteRow(row) { deleteRow(row) {
this.$confirm('确定删除?').then((_) => { this.$confirm('确定删除?').then((_) => {
deleteWithdrawalProcess(row.pkId).then((res) => { deleteWithdrawalProcess(row.pkId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: "success", type: 'success'
}); })
this.getWithdrawalProcessList(); this.getWithdrawalProcessList()
} }
}); })
}); })
},
handleClose() {
this.updateShow = false;
this.$refs["form"].clearValidate();
this.$refs["form"].resetFields();
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) { if (rowIndex % 2 == 1) {
return "warning-row"; return 'warning-row'
} else if (rowIndex % 2 == 0) { } else if (rowIndex % 2 == 0) {
return "success-row"; return 'success-row'
} }
return ""; return ''
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -8,13 +8,13 @@
<div class="page"> <div class="page">
<topBar <topBar
v-if="topList.length > 0" v-if="topList.length > 0"
:topList="topList" :top-list="topList"
:moren="moren" :moren="moren"
></topBar> />
<div class="main"> <div class="main">
<div class="maintop"> <div class="maintop">
<div class="mainbtn"> <div class="mainbtn">
<el-button size="mini" @click="openDig" class="thebtn1">{{ <el-button size="mini" class="thebtn1" @click="openDig">{{
'添加' '添加'
}}</el-button> }}</el-button>
<el-button size="mini" class="thebtn2"> {{ '导出' }}</el-button> <el-button size="mini" class="thebtn2"> {{ '导出' }}</el-button>
@ -22,25 +22,34 @@
</div> </div>
<div class="maintable"> <div class="maintable">
<el-table <el-table
v-loading="loading"
:data="tableData" :data="tableData"
height="760px" height="760px"
v-loading="loading"
style="width: 100%" style="width: 100%"
:header-cell-style="{ background: '#EEEEEE' }" :header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55"> </el-table-column> <el-table-column type="selection" width="55" />
<el-table-column <el-table-column
align="center" align="center"
prop="specialAreaName" prop="specialArea"
:label="'所属专区'" label="所属专区"
width="140px"
> >
<template slot-scope="scope">
<span v-if="scope.row.specialArea">
{{ renderArea(scope.row.specialArea) }}
</span>
<span v-else>--</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="sort" prop="sort"
:label="'扣款顺序/比例(%)'" label="扣款顺序/比例(%)"
width="auto"
show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span <span
@ -55,39 +64,40 @@
<el-table-column <el-table-column
align="center" align="center"
prop="effectiveDate" prop="effectiveDate"
:label="'生效日期'" label="生效日期"
> width="160px"
</el-table-column> />
<el-table-column <el-table-column
align="center" align="center"
prop="creationTime" prop="creationTime"
:label="'创建日期'" label="创建日期"
> width="160px"
</el-table-column> />
<el-table-column <el-table-column
align="center" align="center"
prop="time" prop="time"
:label="'操作'" label="操作"
fixed="right" fixed="right"
width="100px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@click="toFixed(scope.row.pkId)"
class="button-s" class="button-s"
type="text" type="text"
size="small" size="small"
style="color: rgb(105, 98, 246)" style="color: rgb(105, 98, 246)"
@click="toFixed(scope.row.pkId)"
> >
{{ '修改' }} 修改
</el-button> </el-button>
<el-button <el-button
@click="handleDelete(scope.row.pkId)"
type="text" type="text"
class="button-s" class="button-s"
size="small" size="small"
style="color: #c73030" style="color: #c73030"
@click="handleDelete(scope.row.pkId)"
> >
{{ '删除' }} 删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -112,14 +122,14 @@
<el-form ref="form" :rules="rules" :model="form" label-width="auto"> <el-form ref="form" :rules="rules" :model="form" label-width="auto">
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<el-form-item :label="'所属专区'" prop="specialArea"> <el-form-item label="所属专区" prop="specialArea">
<el-select clearable v-model="form.specialArea"> <el-select v-model="form.specialArea" clearable>
<el-option <el-option
v-for="item in areaList" v-for="item in areaList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -131,13 +141,13 @@
:prop="`detailsList.${index}.pkAccount`" :prop="`detailsList.${index}.pkAccount`"
:rules="rules.pkAccount" :rules="rules.pkAccount"
> >
<el-select clearable v-model="item.pkAccount"> <el-select v-model="item.pkAccount" clearable>
<el-option <el-option
v-for="item in bdAccountList" v-for="item in bdAccountList"
:key="item.pkId" :key="item.pkId"
:label="item.accountName" :label="item.accountName"
:value="item.pkId" :value="item.pkId"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -153,8 +163,8 @@
placeholder="请输入扣款比例" placeholder="请输入扣款比例"
></el-input> --> ></el-input> -->
<el-input-number <el-input-number
:disabled="item.deductMaxRatio != 0"
v-model="item.deductRatio" v-model="item.deductRatio"
:disabled="item.deductMaxRatio != 0"
:max="100" :max="100"
:min="0" :min="0"
:controls="false" :controls="false"
@ -168,8 +178,8 @@
:rules="rules.deductMaxRatio" :rules="rules.deductMaxRatio"
> >
<el-input-number <el-input-number
:disabled="item.deductRatio != 0"
v-model="item.deductMaxRatio" v-model="item.deductMaxRatio"
:disabled="item.deductRatio != 0"
:max="100" :max="100"
:min="0" :min="0"
:controls="false" :controls="false"
@ -179,82 +189,78 @@
<el-col :span="3"> <el-col :span="3">
<div class="middle"> <div class="middle">
<div <div
@click="delKou(index)"
class="del"
v-if="form.detailsList.length > 1" v-if="form.detailsList.length > 1"
class="del"
@click="delKou(index)"
> >
{{ '删除' }} 删除
</div> </div>
<div v-if="form.detailsList.length == index + 1" @click="addKou"> <div v-if="form.detailsList.length == index + 1" @click="addKou">
<i class="el-icon-circle-plus"></i> <i class="el-icon-circle-plus" />
</div> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<el-form-item :label="'生效日期'" prop="effectiveDate"> <el-form-item label="生效日期" prop="effectiveDate">
<el-date-picker <el-date-picker
v-model="form.effectiveDate" v-model="form.effectiveDate"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="'请选择'" placeholder="请选择"
> />
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="cancels" @click="handleClose">{{ <el-button class="cancels" @click="handleClose">取消</el-button>
'取消'
}}</el-button>
<el-button <el-button
class="submit" class="submit"
style="margin-left: 40px" style="margin-left: 40px"
@click="onSubmit('form')" @click="onSubmit('form')"
>{{ '确认' }}</el-button >确认</el-button>
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import topBar from "@/components/topBar"; import topBar from '@/components/topBar'
import * as api from "@/api/configManage.js"; import * as api from '@/api/configManage.js'
import { areaCurrencySave, areaCurrencyUpdate } from "@/api/configManage.js"; import { areaCurrencySave, areaCurrencyUpdate } from '@/api/configManage.js'
import { userCountryList } from "@/api/user"; import { userCountryList } from '@/api/user'
import { getToken } from "@/utils/auth"; import { getToken } from '@/utils/auth'
export default { export default {
name: "Bzpz", name: 'Bzpz',
components: { components: {
topBar, topBar
}, },
filters: { filters: {
isAgree(val) { isAgree(val) {
if (!val) { if (!val) {
return '允许'; return '允许'
} else { } else {
return '禁止'; return '禁止'
} }
}, }
}, },
data() { data() {
return { return {
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 50, pageSize: 50
}, },
total: 0, total: 0,
showImg: true, // showImg: true, //
noneUploadImg: false, // noneUploadImg: false, //
openImg: false, openImg: false,
openImgUrl: "", openImgUrl: '',
uploadImgUrl: process.env.VUE_APP_BASE_API + "/system/upload", uploadImgUrl: process.env.VUE_APP_BASE_API + '/system/upload',
headers: { headers: {
Authorization: getToken(), Authorization: getToken()
}, },
dialogVisible: false, dialogVisible: false,
tableData: [], tableData: [],
@ -263,221 +269,217 @@ export default {
agreeList: [ agreeList: [
{ {
text: '允许', text: '允许',
val: 0, val: 0
}, },
{ {
text: '禁止', text: '禁止',
val: 1, val: 1
}, }
], ],
moren: "xfpz", moren: 'xfpz',
topList: [ topList: [
{ {
name: '币种配置', name: '币种配置',
path: "bzpz", path: 'bzpz'
}, },
{ {
name: "消费配置", name: '消费配置',
path: "xfpz", path: 'xfpz'
}, },
{ {
name: "转账配置", name: '转账配置',
path: "zzpz", path: 'zzpz'
}, },
{ {
name: '提现配置', name: '提现配置',
path: "txpz", path: 'txpz'
}, },
{ {
name: "提现个税", name: '提现个税',
path: "txgs", path: 'txgs'
}, },
{ {
name: "提现手续费", name: '提现手续费',
path: "txsxf", path: 'txsxf'
}, },
{ {
name: '特殊消费', name: '特殊消费',
path: "specialMoney", path: 'specialMoney'
}, }
], ],
form: { form: {
specialArea: "", specialArea: '',
detailsList: [ detailsList: [
{ {
pkAccount: "", pkAccount: '',
deductRatio: "", deductRatio: '',
deductMaxRatio: 0, deductMaxRatio: 0
}, }
], ]
}, },
rules: { rules: {
deductRatio: [ deductRatio: [
{ required: true, message: "请输入扣款比例", trigger: "blur" }, { required: true, message: '请输入扣款比例', trigger: 'blur' }
], ],
deductMaxRatio: [ deductMaxRatio: [
{ required: true, message: "请输入扣款最大比例", trigger: "blur" }, { required: true, message: '请输入扣款最大比例', trigger: 'blur' }
], ],
specialArea: [ specialArea: [
{ required: true, message: "请选择所属专区", trigger: "change" }, { required: true, message: '请选择所属专区', trigger: 'change' }
], ],
pkAccount: [ pkAccount: [
{ required: true, message: "请选择扣款顺序", trigger: "change" }, { required: true, message: '请选择扣款顺序', trigger: 'change' }
], ],
effectiveDate: [ effectiveDate: [
{ required: true, message: '请选择生效时间', trigger: "change" }, { required: true, message: '请选择生效时间', trigger: 'change' }
], ]
}, },
areaList: [], areaList: [],
bdAccountList: [], bdAccountList: [],
addOrEdit: true, addOrEdit: true,
dialogTitle: "", dialogTitle: ''
}; }
}, },
mounted() { mounted() {
// userCountryList // userCountryList
this.getCountry(); this.getCountry()
// //
this.getDataList(); this.getDataList()
// //
this.getArea(); this.getArea()
// //
this.getpkBdAccountList(); this.getpkBdAccountList()
}, },
methods: { methods: {
// //
delKou(index) { delKou(index) {
this.form.detailsList.splice(index, 1); this.form.detailsList.splice(index, 1)
}, },
// //
addKou() { addKou() {
this.form.detailsList.push({ this.form.detailsList.push({
pkAccount: "", pkAccount: '',
deductRatio: "", deductRatio: '',
deductMaxRatio: 0, deductMaxRatio: 0
}); })
}, },
// //
toFixed(id) { toFixed(id) {
this.dialogTitle = '修改'; this.dialogTitle = '修改'
this.addOrEdit = false; this.addOrEdit = false
this.dialogVisible = true; this.dialogVisible = true
api.getAreaCurrency(id).then((res) => { api.getAreaCurrency(id).then((res) => {
res.data.detailsList.forEach(item=>{ res.data.detailsList.forEach(item => {
if(item.deductMaxRatio == undefined){ if (item.deductMaxRatio == undefined) {
item.deductMaxRatio = 0 item.deductMaxRatio = 0
} }
}) })
this.form = res.data; this.form = res.data
}); })
}, },
// //
getpkBdAccountList() { getpkBdAccountList() {
api.pkBdAccountList().then((res) => { api.pkBdAccountList().then((res) => {
this.bdAccountList = res.rows; this.bdAccountList = res.rows
}); })
}, },
// //
getArea() { getArea() {
api.specialAreaConsume().then((res) => { api.specialAreaConsume().then((res) => {
this.areaList = res.data; this.areaList = res.data
}); })
},
renderArea(areaId) {
return this.areaList.find(item => item.value === areaId)?.label || '--'
}, },
resetData() { resetData() {
this.form = { this.form = {
specialArea: "", specialArea: '',
detailsList: [ detailsList: [
{ {
pkAccount: "", pkAccount: '',
deductRatio: "", deductRatio: '',
deductMaxRatio: 0, deductMaxRatio: 0
}, }
], ]
}; }
}, },
onSubmit(formName) { onSubmit(formName) {
this.form.detailsList.forEach((item, index) => { this.form.detailsList.forEach((item, index) => {
item.deductSort = index + 1; item.deductSort = index + 1
}); })
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
let url = ""; let url = ''
if (this.addOrEdit == true) { if (this.addOrEdit == true) {
url = areaCurrencySave; url = areaCurrencySave
} else { } else {
url = areaCurrencyUpdate; url = areaCurrencyUpdate
} }
url(this.form).then((res) => { url(this.form).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: "success", type: 'success'
}); })
this.dialogVisible = false; this.dialogVisible = false
// //
// this.$refs[formName].resetFields() // this.$refs[formName].resetFields()
this.resetData(); this.resetData()
// //
this.getDataList(); this.getDataList()
} }
}); })
} else { } else {
return false; return false
} }
}); })
}, },
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false
this.resetData(); this.resetData()
}, },
openDig() { openDig() {
this.dialogTitle = '添加'; this.dialogTitle = '添加'
this.dialogVisible = true; this.dialogVisible = true
this.addOrEdit = true; this.addOrEdit = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["form"].clearValidate(); this.$refs['form'].clearValidate()
}); })
}, },
getCountry() { getCountry() {
userCountryList().then((res) => { userCountryList().then((res) => {
this.countryList = res.data; this.countryList = res.data
}); })
}, },
getDataList() { getDataList() {
this.loading = true; this.loading = true
api.areaCurrencyList().then((res) => { api.areaCurrencyList().then((res) => {
res.rows.forEach((item) => { this.tableData = res.rows
this.areaList.forEach((child) => { this.total = res.total
if (item.specialArea == child.value) { this.loading = false
item.specialAreaName = child.label; })
}
});
});
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
}, },
// //
handleDelete(id) { handleDelete(id) {
api.delAreaCurrency(id).then((res) => { api.delAreaCurrency(id).then((res) => {
// //
this.getDataList(); this.getDataList()
}); })
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) { if (rowIndex % 2 == 1) {
return "warning-row"; return 'warning-row'
} else if (rowIndex % 2 == 0) { } else if (rowIndex % 2 == 0) {
return "success-row"; return 'success-row'
} }
return ""; return ''
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -373,9 +373,9 @@ export default {
} }
}, },
mounted() { mounted() {
this.getTransferList() this.userCountryList().finally(() => {
this.userCountryList() this.getTransferList()
// this.getcellTypeList(); })
}, },
methods: { methods: {
stateFormat, stateFormat,
@ -453,8 +453,13 @@ export default {
}, },
// //
userCountryList() { userCountryList() {
userCountryList().then((res) => { return new Promise((resolve, reject) => {
this.countryList = res.data userCountryList().then((res) => {
this.countryList = res.data
resolve(res.data)
}).catch((err) => {
reject(err)
})
}) })
}, },
// //