fix(xfpz): 消费配置-所属专区展示问题修复

This commit is contained in:
woody 2025-10-10 09:53:53 +08:00
parent 81fff13db5
commit b80a252404
1 changed files with 139 additions and 144 deletions

View File

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