Commit 106bba8d by chenwq

feat(systemConfig): 新增特殊银行账号管理功能

新增特殊银行账号相关API接口,包含分页查询、商户级联查询、增删改查;添加系统设置模块的路由配置;新增列表页面与编辑弹窗组件。
1 parent e63b3a84
import request from "./request";
const path = "dj.api.smartcarlife.";
const djPath = "dj.api.";
// 分页查询银企账号记录
export function getListApi(data) {
data.method = `${path}specialBankAccount.listWithPage`;
return request(data, "post");
}
// 渠道级联dj.api.smartcarlife.get.merchant.level
export function getMerchantLevelApi(data) {
data.method = `${djPath}smartcarlife.get.merchant.level`;
return request(data, "post");
}
// 银企账号 - 添加或修改记录
export function updateBankAccount(data) {
data.method = `${path}specialBankAccount.insertOrUpdate`;
return request(data, "post");
}
// 银企账号 - 根据商户号查询银企账号详细信息
export function getBankById(data) {
data.method = `${path}specialBankAccount.getById`;
return request(data, "post");
}
// 银企账号 - 删除
export function deleteBankAccount(data) {
data.method = `${path}specialBankAccount.delete`;
return request(data, "post");
}
...@@ -1603,4 +1603,51 @@ export const routerName = { ...@@ -1603,4 +1603,51 @@ export const routerName = {
], ],
component: _import("systemConfig/manageProjectGroup/storeManage"), component: _import("systemConfig/manageProjectGroup/storeManage"),
}, },
90635: {
path: "/specialBankAccount",
name: "specialBankAccount",
meta: {
title: "特殊银行账号",
authId: "90635",
parentId: "906",
cache: false,
},
auth: [
{
authId: "9063501",
parentId: "90635",
label: "新增特殊银行账号",
category: "Button",
type: "primary",
handle: "handleAdd",
},
{
authId: "9063502",
parentId: "90635",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport",
},
{
authId: "9063503",
parentId: "90635",
label: "详情",
handle: "handleDetail",
},
{
authId: "9063504",
parentId: "90635",
label: "修改",
handle: "handleEdit",
},
{
authId: "9063505",
parentId: "90635",
label: "删除",
handle: "handleDelete",
},
],
component: _import("systemConfig/specialBankAccount/index"),
},
}; };
<!-- 银企账号 - 列表 -->
<template>
<d2-container>
<div>
<div slot="header" class=" header">
<d2-search ref="showSearch"
:form-data="showFormData"
:search-form="searchForm">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="merchantTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
<d2-dialog :btn-ok-label="bankOprType == 'detail' ? '关闭' : '保存'"
:is-visible.sync="bankVisible"
:title="modeDialogConfig.config.title"
:width="modeDialogConfig.config.width"
@closeDialog="handleBankClose"
@confirmDialog="handleBankConfirm">
<EditBankDialog v-if="bankVisible"
ref="editBankAccountRef"
:merchant-row="merchantRow"
:opr-type="bankOprType"
@handleBankClose="handleBankClose" />
</d2-dialog>
</d2-container>
</template>
<script>
import { deleteBankAccount, getListApi } from "@api/specialBankAccount";
import { mapActions, mapState } from "vuex";
import { BaseData, merchantStoreServiceList } from "@/common/constants.js";
import { deepClone, Util } from "@/common/util";
import reportTrackFunMixin from "@/mixins/reportTrackFunMixin";
import EditBankDialog from "./components/EditBankDialog.vue";
export default {
name: "specialBankAccount",
components: {
EditBankDialog,
},
mixins: [reportTrackFunMixin], // 导入混入
data() {
return {
bankVisible: false,
merchantRow: {},
bankOprType: "add",
// 搜索
merchantLevelVal: [],
searchForm: {
merchantType: "",
channelType: "",
merchantName: "",
merchantId: "",
openAccBankName: "",
enterDate: [],
bankAccountNo: "",
bankAccountName: "",
},
searchFormSearch: {},
showFormData: [{
label: "商户分类",
name: "merchantType",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "merchantStoreServiceList",
}, {
label: "渠道",
name: "channelType",
type: "select",
optionList: [],
optionId: "value",
optionLabel: "name",
optionsName: "channelTypeList",
}, {
label: "商户名称",
name: "merchantName",
type: "input",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "商户号",
name: "merchantId",
type: "input",
inputType: "number",
maxlength: "50",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "开户行",
name: "openAccBankName",
type: "input",
maxlength: "50",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "录入时间",
name: "enterDate",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions",
}, {
label: "银行账号",
name: "bankAccountNo",
type: "input",
maxlength: "50",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "账户名称",
name: "bankAccountName",
type: "input",
maxlength: "50",
isClear: true,
keyFn: this.keyDowmGetList,
}],
// 表格
getListApi,
tableParams: {
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list",
tableOption: true,
mutiSelectUniqueKey: "merchantId",
mutiSelectName: "merchantId",
tableColumns: [{
label: "商户名称",
prop: "merchantName",
}, {
label: "商户号",
prop: "merchantId",
}, {
label: "渠道",
prop: "",
formatter: (cellValue) => {
return this.baseData.channelTypeShow[cellValue.channelType];
},
}, {
label: "开户行",
prop: "openAccBankName",
}, {
label: "银行账号",
prop: "bankAccountNo",
}, {
label: "账户名称",
prop: "bankAccountName",
}, {
label: "录入时间",
prop: "createdDate",
formatter: (cellValue) => {
return Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD HH:mm:ss");
},
}],
},
baseData: {
channelTypeList: [],
channelTypeShow: {
1: "嘀加",
2: "广汇",
8: "直营",
},
merchantStoreServiceList: deepClone(merchantStoreServiceList),
},
modeDialogConfig: {
config: {
title: "新增银企账号",
width: "1080px",
},
},
};
},
watch: {
"searchForm.bankAccountNo": function (value) {
// 只允许:数字 0-9、英文字母 A-Za-z、常见特殊字符(如 !@#$%^&*()_+-=[]{}|;:'",.<>/?`~)
// 排除:中文、空格、换行符、制表符等
const allowedPattern = /[^\w!@#$%^&*()+\-=[\]{}|;:'",.<>?/`~]/g;
const cleanedInput = value.replace(allowedPattern, "");
// 更新银行账号数据
this.searchForm.bankAccountNo = cleanedInput;
},
},
mounted() {
this.getBaseData();
this.onPageShow();
},
beforeDestroy() {
this.onPageHide();
},
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList,
}),
},
methods: {
...mapActions({
get: "d2admin/base/get",
}),
...mapActions("d2admin/user", ["actionSetDownloadList"]),
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType);
this.getOptionsList();
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== "全部") {
const temp = {};
temp[this.showFormData[index].optionId] = "";
temp[this.showFormData[index].optionLabel] = "全部";
this.baseData[item.optionsName].unshift(temp);
}
this.$set(this.showFormData[index], "optionList", this.baseData[item.optionsName]);
}
});
console.log(this.showFormData, "showFormData");
},
handleAdd() {
this.modeDialogConfig.config.title = "新增银企账号";
this.bankOprType = "add";
this.handleBankClose();
},
handleDetail(row) {
this.modeDialogConfig.config.title = "查看银企账号";
this.bankOprType = "detail";
this.merchantRow = row;
this.handleBankClose();
},
// 修改银企账号
handleEdit(row) {
this.modeDialogConfig.config.title = "编辑银企账号";
this.bankOprType = "edit";
this.merchantRow = row;
this.handleBankClose();
},
// 修改到账模式确认
handleBankConfirm() {
this.$refs.editBankAccountRef.submitForm();
},
handleBankClose(isRefreshTable = false) {
this.bankVisible = !this.bankVisible;
if (isRefreshTable) {
this.$refs.merchantTable.resetRefreshTable();
}
},
handleReset() {
this.searchForm = {
merchantType: "",
channelType: "",
merchantName: "",
merchantId: "",
openAccBankName: "",
enterDate: [],
bankAccountNo: "",
bankAccountName: "",
};
this.merchantLevelVal = [];
this.$refs.merchantTable.resetRefreshTable();
},
getParams() {
let params = deepClone(this.searchForm);
const dateFormatList = [{
attr: "enterDate",
startAttr: "startCreatedTime",
endAttr: "endCreatedTime",
}];
dateFormatList.forEach((item) => {
if (params[item.attr] && params[item.attr].length) {
params[item.startAttr] = Util.dateFormate(params[item.attr][0], "YYYY-MM-DD 00:00:00");
params[item.endAttr] = Util.dateFormate(params[item.attr][1], "YYYY-MM-DD 23:59:59");
delete params[item.attr];
}
});
return params;
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = this.getParams();
resolve();
});
},
keyDowmGetList() {
this.$refs.merchantTable.refreshTable();
},
handleDelete(row) {
this.$confirm("删除后不可恢复,确认是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
const params = { merchantId: row.merchantId };
deleteBankAccount(params).then((res) => {
this.$message.success("删除成功");
this.handleReset();
});
}).catch(() => { });
},
handleExport() {
const params = {};
params.method = "dj.api.smartcarlife.merchantBankEnterpriseAccount.export.async";
const list = [
...this.dowloadList,
{
name: "银企账号",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime(),
},
];
this.actionSetDownloadList({ list, type: "dowloadList" });
},
},
};
</script>
<style>
.header {
background-color: #fff;
}
.el-cascader-panel .el-cascader-menu {
width: 260px;
}
.btnClass span {
margin-right: 5px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!