601 lines
15 KiB
Vue
601 lines
15 KiB
Vue
|
|
<!--
|
||
|
|
* @Descripttion:
|
||
|
|
* @version:
|
||
|
|
* @Author: kBank
|
||
|
|
* @Date: 2022-10-24 15:45:01
|
||
|
|
-->
|
||
|
|
<template>
|
||
|
|
<div class="page">
|
||
|
|
<topBar
|
||
|
|
v-if="topList.length > 0"
|
||
|
|
:topList="topList"
|
||
|
|
:moren="moren"
|
||
|
|
></topBar>
|
||
|
|
<div class="main">
|
||
|
|
<div class="maintop">
|
||
|
|
<div class="mainbtn">
|
||
|
|
<el-button size="mini" @click="openDig" class="thebtn1">{{
|
||
|
|
$t("w_0328")
|
||
|
|
}}</el-button>
|
||
|
|
<el-button size="mini" class="thebtn2"> {{ $t("MN_T_8") }}</el-button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="maintable">
|
||
|
|
<el-table
|
||
|
|
: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
|
||
|
|
align="center"
|
||
|
|
prop="specialAreaName"
|
||
|
|
:label="$t('MN_F_T_612')"
|
||
|
|
>
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
align="center"
|
||
|
|
prop="sort"
|
||
|
|
:label="$t('MN_F_T_1243')"
|
||
|
|
>
|
||
|
|
<template slot-scope="scope">
|
||
|
|
<span
|
||
|
|
v-for="(item, index) in scope.row.detailsList"
|
||
|
|
:key="index"
|
||
|
|
style="margin-right: 10px"
|
||
|
|
>
|
||
|
|
{{ item.accountName }}/{{ item.deductRatio }}
|
||
|
|
</span>
|
||
|
|
</template>
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
align="center"
|
||
|
|
prop="effectiveDate"
|
||
|
|
:label="$t('w_0445')"
|
||
|
|
>
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
align="center"
|
||
|
|
prop="creationTime"
|
||
|
|
:label="$t('PER_DA_9')"
|
||
|
|
>
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
align="center"
|
||
|
|
prop="time"
|
||
|
|
:label="$t('MY_ORD_14')"
|
||
|
|
fixed="right"
|
||
|
|
>
|
||
|
|
<template slot-scope="scope">
|
||
|
|
<el-button
|
||
|
|
@click="toFixed(scope.row.pkId)"
|
||
|
|
class="button-s"
|
||
|
|
type="text"
|
||
|
|
size="small"
|
||
|
|
style="color: rgb(105, 98, 246)"
|
||
|
|
>
|
||
|
|
{{ $t("ENU_CONTROL_TYPE_2") }}
|
||
|
|
</el-button>
|
||
|
|
<el-button
|
||
|
|
@click="handleDelete(scope.row.pkId)"
|
||
|
|
type="text"
|
||
|
|
class="button-s"
|
||
|
|
size="small"
|
||
|
|
style="color: #c73030"
|
||
|
|
>
|
||
|
|
{{ $t("CK_KS_47") }}
|
||
|
|
</el-button>
|
||
|
|
</template>
|
||
|
|
</el-table-column>
|
||
|
|
</el-table>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<pagination
|
||
|
|
v-show="total > 0"
|
||
|
|
:total="total"
|
||
|
|
:page.sync="queryParams.pageNum"
|
||
|
|
:limit.sync="queryParams.pageSize"
|
||
|
|
@pagination="getDataList"
|
||
|
|
/>
|
||
|
|
<el-dialog
|
||
|
|
:title="dialogTitle"
|
||
|
|
:close-on-click-modal="false"
|
||
|
|
:visible.sync="dialogVisible"
|
||
|
|
width="55%"
|
||
|
|
center
|
||
|
|
:before-close="handleClose"
|
||
|
|
>
|
||
|
|
<el-form ref="form" :rules="rules" :model="form" label-width="auto">
|
||
|
|
<el-row>
|
||
|
|
<el-col :span="14">
|
||
|
|
<el-form-item :label="$t('MN_F_T_612')" prop="specialArea">
|
||
|
|
<el-select clearable v-model="form.specialArea">
|
||
|
|
<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>
|
||
|
|
</el-row>
|
||
|
|
<el-row v-for="(item, index) in form.detailsList" :key="index">
|
||
|
|
<el-col :span="7">
|
||
|
|
<el-form-item
|
||
|
|
label="扣款顺序"
|
||
|
|
:prop="`detailsList.${index}.pkAccount`"
|
||
|
|
:rules="rules.pkAccount"
|
||
|
|
>
|
||
|
|
<el-select clearable v-model="item.pkAccount">
|
||
|
|
<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>
|
||
|
|
<el-col :span="7">
|
||
|
|
<el-form-item
|
||
|
|
label="扣款比例(%)"
|
||
|
|
:prop="`detailsList.${index}.deductRatio`"
|
||
|
|
:rules="rules.deductRatio"
|
||
|
|
>
|
||
|
|
<!-- <el-input
|
||
|
|
clearable
|
||
|
|
v-model="item.deductRatio"
|
||
|
|
placeholder="请输入扣款比例"
|
||
|
|
></el-input> -->
|
||
|
|
<el-input-number
|
||
|
|
:disabled="item.deductMaxRatio != 0"
|
||
|
|
v-model="item.deductRatio"
|
||
|
|
:max="100"
|
||
|
|
:min="0"
|
||
|
|
:controls="false"
|
||
|
|
/>
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="7">
|
||
|
|
<el-form-item
|
||
|
|
label="扣款最大比例(%)"
|
||
|
|
:prop="`detailsList.${index}.deductMaxRatio`"
|
||
|
|
:rules="rules.deductMaxRatio"
|
||
|
|
>
|
||
|
|
<el-input-number
|
||
|
|
:disabled="item.deductRatio != 0"
|
||
|
|
v-model="item.deductMaxRatio"
|
||
|
|
:max="100"
|
||
|
|
:min="0"
|
||
|
|
:controls="false"
|
||
|
|
/>
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="3">
|
||
|
|
<div class="middle">
|
||
|
|
<div
|
||
|
|
@click="delKou(index)"
|
||
|
|
class="del"
|
||
|
|
v-if="form.detailsList.length > 1"
|
||
|
|
>
|
||
|
|
{{ $t("CK_KS_47") }}
|
||
|
|
</div>
|
||
|
|
<div v-if="form.detailsList.length == index + 1" @click="addKou">
|
||
|
|
<i class="el-icon-circle-plus"></i>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</el-col>
|
||
|
|
</el-row>
|
||
|
|
<el-row>
|
||
|
|
<el-col :span="14">
|
||
|
|
<el-form-item :label="$t('w_0445')" prop="effectiveDate">
|
||
|
|
<el-date-picker
|
||
|
|
v-model="form.effectiveDate"
|
||
|
|
type="datetime"
|
||
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||
|
|
:placeholder="$t('CK_KS_38')"
|
||
|
|
>
|
||
|
|
</el-date-picker>
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
</el-row>
|
||
|
|
</el-form>
|
||
|
|
<span slot="footer" class="dialog-footer">
|
||
|
|
<el-button class="cancels" @click="handleClose">{{
|
||
|
|
$t("ENU_P_TYPE0")
|
||
|
|
}}</el-button>
|
||
|
|
<el-button
|
||
|
|
class="submit"
|
||
|
|
style="margin-left: 40px"
|
||
|
|
@click="onSubmit('form')"
|
||
|
|
>{{ $t("ENU_P_TYPE4") }}</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";
|
||
|
|
export default {
|
||
|
|
name: "Bzpz",
|
||
|
|
components: {
|
||
|
|
topBar,
|
||
|
|
},
|
||
|
|
filters: {
|
||
|
|
isAgree(val) {
|
||
|
|
if (!val) {
|
||
|
|
return this.$t("ENU_POPUP_TYPE_1");
|
||
|
|
} else {
|
||
|
|
return this.$t("ENU_POPUP_TYPE_2");
|
||
|
|
}
|
||
|
|
},
|
||
|
|
},
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
// 查询参数
|
||
|
|
queryParams: {
|
||
|
|
pageNum: 1,
|
||
|
|
pageSize: 50,
|
||
|
|
},
|
||
|
|
total: 0,
|
||
|
|
showImg: true, //默认展示
|
||
|
|
noneUploadImg: false, //
|
||
|
|
openImg: false,
|
||
|
|
openImgUrl: "",
|
||
|
|
uploadImgUrl: process.env.VUE_APP_BASE_API + "/system/upload",
|
||
|
|
headers: {
|
||
|
|
Authorization: getToken(),
|
||
|
|
},
|
||
|
|
dialogVisible: false,
|
||
|
|
tableData: [],
|
||
|
|
loading: false,
|
||
|
|
countryList: [],
|
||
|
|
agreeList: [
|
||
|
|
{
|
||
|
|
text: this.$t("ENU_POPUP_TYPE_1"),
|
||
|
|
val: 0,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
text: this.$t("ENU_POPUP_TYPE_2"),
|
||
|
|
val: 1,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
moren: "xfpz",
|
||
|
|
topList: [
|
||
|
|
{
|
||
|
|
name: this.$t("MN_F_T_101"),
|
||
|
|
path: "bzpz",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "消费配置",
|
||
|
|
path: "xfpz",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "转账配置",
|
||
|
|
path: "zzpz",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: this.$t("MN_F_T_104"),
|
||
|
|
path: "txpz",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "提现个税",
|
||
|
|
path: "txgs",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "提现手续费",
|
||
|
|
path: "txsxf",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: this.$t("MN_F_T_107"),
|
||
|
|
path: "specialMoney",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: this.$t("会员消费配置"),
|
||
|
|
path: "consumption",
|
||
|
|
},
|
||
|
|
],
|
||
|
|
form: {
|
||
|
|
specialArea: "",
|
||
|
|
detailsList: [
|
||
|
|
{
|
||
|
|
pkAccount: "",
|
||
|
|
deductRatio: "",
|
||
|
|
deductMaxRatio: 0,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
deductRatio: [
|
||
|
|
{ required: true, message: "请输入扣款比例", trigger: "blur" },
|
||
|
|
],
|
||
|
|
deductMaxRatio: [
|
||
|
|
{ required: true, message: "请输入扣款最大比例", trigger: "blur" },
|
||
|
|
],
|
||
|
|
specialArea: [
|
||
|
|
{ required: true, message: "请选择所属专区", trigger: "change" },
|
||
|
|
],
|
||
|
|
pkAccount: [
|
||
|
|
{ required: true, message: "请选择扣款顺序", trigger: "change" },
|
||
|
|
],
|
||
|
|
effectiveDate: [
|
||
|
|
{ required: true, message: this.$t("MN_F_T_402"), trigger: "change" },
|
||
|
|
],
|
||
|
|
},
|
||
|
|
areaList: [],
|
||
|
|
bdAccountList: [],
|
||
|
|
addOrEdit: true,
|
||
|
|
dialogTitle: "",
|
||
|
|
};
|
||
|
|
},
|
||
|
|
mounted() {
|
||
|
|
// 获取国家userCountryList
|
||
|
|
this.getCountry();
|
||
|
|
// 获取列表
|
||
|
|
this.getDataList();
|
||
|
|
// 获取专区
|
||
|
|
this.getArea();
|
||
|
|
// 账户列表
|
||
|
|
this.getpkBdAccountList();
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
// 删除扣款
|
||
|
|
delKou(index) {
|
||
|
|
this.form.detailsList.splice(index, 1);
|
||
|
|
},
|
||
|
|
// 添加扣款
|
||
|
|
addKou() {
|
||
|
|
this.form.detailsList.push({
|
||
|
|
pkAccount: "",
|
||
|
|
deductRatio: "",
|
||
|
|
deductMaxRatio: 0,
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 点击修改
|
||
|
|
toFixed(id) {
|
||
|
|
this.dialogTitle = this.$t("PER_DA_20");
|
||
|
|
this.addOrEdit = false;
|
||
|
|
this.dialogVisible = true;
|
||
|
|
api.getAreaCurrency(id).then((res) => {
|
||
|
|
res.data.detailsList.forEach((item) => {
|
||
|
|
if (item.deductMaxRatio == undefined) {
|
||
|
|
item.deductMaxRatio = 0;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
this.form = res.data;
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 账户列表
|
||
|
|
getpkBdAccountList() {
|
||
|
|
api.pkBdAccountList().then((res) => {
|
||
|
|
this.bdAccountList = res.rows;
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 获取专区
|
||
|
|
getArea() {
|
||
|
|
api.specialAreaConsume().then((res) => {
|
||
|
|
this.areaList = res.data;
|
||
|
|
});
|
||
|
|
},
|
||
|
|
resetData() {
|
||
|
|
this.form = {
|
||
|
|
specialArea: "",
|
||
|
|
detailsList: [
|
||
|
|
{
|
||
|
|
pkAccount: "",
|
||
|
|
deductRatio: "",
|
||
|
|
deductMaxRatio: 0,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
};
|
||
|
|
},
|
||
|
|
onSubmit(formName) {
|
||
|
|
this.form.detailsList.forEach((item, index) => {
|
||
|
|
item.deductSort = index + 1;
|
||
|
|
});
|
||
|
|
this.$refs[formName].validate((valid) => {
|
||
|
|
if (valid) {
|
||
|
|
let url = "";
|
||
|
|
if (this.addOrEdit == true) {
|
||
|
|
url = areaCurrencySave;
|
||
|
|
} else {
|
||
|
|
url = areaCurrencyUpdate;
|
||
|
|
}
|
||
|
|
url(this.form).then((res) => {
|
||
|
|
if (res.code == 200) {
|
||
|
|
this.$message({
|
||
|
|
message: res.msg,
|
||
|
|
type: "success",
|
||
|
|
});
|
||
|
|
this.dialogVisible = false;
|
||
|
|
// 充值数据
|
||
|
|
// this.$refs[formName].resetFields()
|
||
|
|
this.resetData();
|
||
|
|
// 获取列表
|
||
|
|
this.getDataList();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
} else {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
},
|
||
|
|
handleClose() {
|
||
|
|
this.dialogVisible = false;
|
||
|
|
this.resetData();
|
||
|
|
},
|
||
|
|
openDig() {
|
||
|
|
this.dialogTitle = this.$t("w_0328");
|
||
|
|
this.dialogVisible = true;
|
||
|
|
this.addOrEdit = true;
|
||
|
|
this.$nextTick(() => {
|
||
|
|
this.$refs["form"].clearValidate();
|
||
|
|
});
|
||
|
|
},
|
||
|
|
getCountry() {
|
||
|
|
userCountryList().then((res) => {
|
||
|
|
this.countryList = res.data;
|
||
|
|
});
|
||
|
|
},
|
||
|
|
getDataList() {
|
||
|
|
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;
|
||
|
|
});
|
||
|
|
},
|
||
|
|
handleSelectionChange(val) {
|
||
|
|
this.multipleSelection = val;
|
||
|
|
},
|
||
|
|
// 删除
|
||
|
|
handleDelete(id) {
|
||
|
|
api.delAreaCurrency(id).then((res) => {
|
||
|
|
// 获取列表
|
||
|
|
this.getDataList();
|
||
|
|
});
|
||
|
|
},
|
||
|
|
tableRowClassName({ row, rowIndex }) {
|
||
|
|
if (rowIndex % 2 == 1) {
|
||
|
|
return "warning-row";
|
||
|
|
} else if (rowIndex % 2 == 0) {
|
||
|
|
return "success-row";
|
||
|
|
}
|
||
|
|
return "";
|
||
|
|
},
|
||
|
|
},
|
||
|
|
};
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped lang="scss">
|
||
|
|
::v-deep .el-select {
|
||
|
|
width: 100%;
|
||
|
|
}
|
||
|
|
.submit {
|
||
|
|
width: 209px;
|
||
|
|
height: 48px;
|
||
|
|
background: #c8161d;
|
||
|
|
border-radius: 5px;
|
||
|
|
color: #fff;
|
||
|
|
font-size: 18px;
|
||
|
|
border-color: #c8161d;
|
||
|
|
margin-left: 20px;
|
||
|
|
}
|
||
|
|
.cancels {
|
||
|
|
width: 209px;
|
||
|
|
height: 48px;
|
||
|
|
background: #cccccc;
|
||
|
|
border-radius: 5px;
|
||
|
|
color: #fff;
|
||
|
|
font-size: 18px;
|
||
|
|
border-color: #ccc;
|
||
|
|
}
|
||
|
|
::v-deep .el-table .warning-row {
|
||
|
|
background: #f9f9f9;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .el-table .success-row {
|
||
|
|
background: #ffffff;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .el-table thead {
|
||
|
|
color: #000000;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .el-select {
|
||
|
|
width: 100%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.uploadIcon ::v-deep .el-upload--picture-card {
|
||
|
|
display: none !important;
|
||
|
|
/* 上传按钮隐藏 */
|
||
|
|
}
|
||
|
|
.button-s {
|
||
|
|
padding: 0 3px;
|
||
|
|
}
|
||
|
|
.page {
|
||
|
|
padding: 20px;
|
||
|
|
background: #f9f9f9;
|
||
|
|
font-size: 14px;
|
||
|
|
.main {
|
||
|
|
background: #f9f9f9;
|
||
|
|
//border-radius: 8px;
|
||
|
|
//box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
|
||
|
|
.maintop {
|
||
|
|
display: flex;
|
||
|
|
// padding: 10px 0;
|
||
|
|
justify-content: space-between;
|
||
|
|
align-items: center;
|
||
|
|
.mainbtn {
|
||
|
|
.thebtn1 {
|
||
|
|
color: #ffffff;
|
||
|
|
background: #3181e5;
|
||
|
|
}
|
||
|
|
.thebtn2 {
|
||
|
|
color: #ffffff;
|
||
|
|
background: #ffad41;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.maintitle {
|
||
|
|
font-size: 10px;
|
||
|
|
font-family: MicrosoftYaHei;
|
||
|
|
color: #999999;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.tem {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
img {
|
||
|
|
width: 28px;
|
||
|
|
height: 20px;
|
||
|
|
margin-right: 3px;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.isRed {
|
||
|
|
color: #ed1d25;
|
||
|
|
}
|
||
|
|
.isGreen {
|
||
|
|
color: #1ab62b;
|
||
|
|
}
|
||
|
|
.bgImg {
|
||
|
|
width: 48px;
|
||
|
|
height: 48px;
|
||
|
|
}
|
||
|
|
.middle {
|
||
|
|
line-height: 40px;
|
||
|
|
margin-left: 20px;
|
||
|
|
white-space: nowrap;
|
||
|
|
display: flex;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.del {
|
||
|
|
margin-right: 10px;
|
||
|
|
cursor: pointer;
|
||
|
|
}
|
||
|
|
::v-deep .el-date-editor.el-input {
|
||
|
|
width: 100%;
|
||
|
|
}
|
||
|
|
::v-deep .el-input-number {
|
||
|
|
width: auto !important;
|
||
|
|
}
|
||
|
|
</style>
|