Commit 09ebe248 by 陈婉清

Merge branch 'feature/585/cwq' into 'SAAS+V5.8.5'

Feature/585/cwq

See merge request !941
2 parents fa01745f 96234391
...@@ -208,7 +208,8 @@ export function queryMarketTransferFee(data) { ...@@ -208,7 +208,8 @@ export function queryMarketTransferFee(data) {
// 市场费转账-收款账户 // 市场费转账-收款账户
export function getMarketTransferBankAccounts(data) { export function getMarketTransferBankAccounts(data) {
data.method = "dj.api.smartcarlife.merchantBankEnterpriseAccount.listWithPage"; // data.method = "dj.api.smartcarlife.merchantBankEnterpriseAccount.listWithPage";
data.method = "dj.api.smartcarlife.merchantBankEnterpriseAccount.listBankAccount";
return request(data, "post"); return request(data, "post");
} }
......
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");
}
...@@ -121,3 +121,21 @@ export function checkPermission(data) { ...@@ -121,3 +121,21 @@ export function checkPermission(data) {
data.method = "dj.smartcarlife.api.nbcb.acc.summary.report.download.preview"; data.method = "dj.smartcarlife.api.nbcb.acc.summary.report.download.preview";
return request(data, RequestMethods.POST); return request(data, RequestMethods.POST);
} }
// 查询资金日报推送邮箱
export function nbcbAccFinancialReportEmailConfig(data) {
data.method = "dj.smartcarlife.api.nbcb.acc.push.email.get";
return request(data, RequestMethods.POST);
}
// 保存资金日报推送邮箱
export function nbcbAccFinancialReportEmailConfigSave(data) {
data.method = "dj.smartcarlife.api.nbcb.acc.push.email.save";
return request(data, RequestMethods.POST);
}
// 推送资金日报
export function nbcbAccFinancialReportPush(data) {
data.method = "dj.smartcarlife.api.nbcb.acc.financial.report.push";
return request(data, RequestMethods.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"),
},
}; };
...@@ -54,6 +54,12 @@ export function buildMarketTransferFormData() { ...@@ -54,6 +54,12 @@ export function buildMarketTransferFormData() {
optionsName: "bankAccountList", optionsName: "bankAccountList",
}, },
{ {
label: "费用调整",
name: "adjustmentFee",
type: "input",
maxlength: 20,
},
{
label: "转账金额", label: "转账金额",
name: "transferTotalAmount", name: "transferTotalAmount",
type: "showTxt", type: "showTxt",
...@@ -105,10 +111,12 @@ export function normalizeApprovedMarketTransferFees(list = []) { ...@@ -105,10 +111,12 @@ export function normalizeApprovedMarketTransferFees(list = []) {
const expenseCategoryIds = []; const expenseCategoryIds = [];
(list || []).forEach((item) => { (list || []).forEach((item) => {
const id = item && item.expenseCategoryId; const id = item && item.expenseCategoryId;
if (id === undefined || id === null) if (id === undefined || id === null) {
return; return;
if (!expenseCategoryIds.includes(id)) }
if (!expenseCategoryIds.includes(id)) {
expenseCategoryIds.push(id); expenseCategoryIds.push(id);
}
amountMap[id] = item.expenseCategoryResult; amountMap[id] = item.expenseCategoryResult;
}); });
......
...@@ -174,6 +174,7 @@ export default { ...@@ -174,6 +174,7 @@ export default {
billType: "", billType: "",
billMerchantName: "", billMerchantName: "",
expenseCategoryIds: [], expenseCategoryIds: [],
adjustmentFee: "",
transferTotalAmount: "", transferTotalAmount: "",
rcvMerchantId: "", rcvMerchantId: "",
invoiceRemark: "", invoiceRemark: "",
...@@ -185,9 +186,11 @@ export default { ...@@ -185,9 +186,11 @@ export default {
}, },
transferRules: { transferRules: {
expenseCategoryIds: [{ required: true, type: "array", min: 1, message: "请选择费用类型", trigger: "change" }], expenseCategoryIds: [{ required: true, type: "array", min: 1, message: "请选择费用类型", trigger: "change" }],
adjustmentFee: [{ validator: (rule, value, callback) => this.validateAdjustmentFee(rule, value, callback), trigger: ["change", "blur"] }],
rcvMerchantId: [{ required: true, message: "请选择收款账户", trigger: "change" }], rcvMerchantId: [{ required: true, message: "请选择收款账户", trigger: "change" }],
invoiceRemark: [{ required: true, message: "请输入发票及其他说明", trigger: "change" }], invoiceRemark: [{ required: true, message: "请输入发票及其他说明", trigger: "change" }],
fileUrlList: [{ required: true, type: "array", min: 1, message: "请选择转账凭证", trigger: "change" }], fileUrlList: [{ required: true, type: "array", min: 1, message: "请选择转账凭证", trigger: "change" }],
remark: [{ required: false, message: "请输入备注", trigger: "change" }],
}, },
}; };
}, },
...@@ -228,8 +231,13 @@ export default { ...@@ -228,8 +231,13 @@ export default {
const formData = buildMarketTransferFormData().map(item => ({ ...item })); const formData = buildMarketTransferFormData().map(item => ({ ...item }));
const billMerchant = formData.find(item => item.name === "billMerchantName"); const billMerchant = formData.find(item => item.name === "billMerchantName");
const bankAccount = formData.find(item => item.name === "rcvMerchantId"); const bankAccount = formData.find(item => item.name === "rcvMerchantId");
const adjustmentFee = formData.find(item => item.name === "adjustmentFee");
billMerchant.label = this.billMerchantLabel; billMerchant.label = this.billMerchantLabel;
bankAccount.optionList = this.bankAccountList; bankAccount.optionList = this.bankAccountList;
adjustmentFee.inputFn = this.handleAdjustmentFeeInput;
adjustmentFee.listeners = {
blur: this.handleAdjustmentFeeBlur,
};
const expenseIndex = formData.findIndex(item => item.name === "expenseCategoryIds"); const expenseIndex = formData.findIndex(item => item.name === "expenseCategoryIds");
formData.splice(expenseIndex + 1, 0, ...amountFields); formData.splice(expenseIndex + 1, 0, ...amountFields);
...@@ -246,6 +254,7 @@ export default { ...@@ -246,6 +254,7 @@ export default {
expenseCategoryIds: [], expenseCategoryIds: [],
fileUrlList: [], fileUrlList: [],
}; };
this.syncRemarkRequired();
this.getPlatformMerchantList(); this.getPlatformMerchantList();
}, },
methods: { methods: {
...@@ -288,10 +297,15 @@ export default { ...@@ -288,10 +297,15 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 10000, pageSize: 10000,
}).then((res) => { }).then((res) => {
this.bankAccountList = (res.list || []).map(item => ({ this.bankAccountList = res.map(item => ({
// value: item.merchantId || item.id || item.bankAccountNo, /**
// label: this.formatBankAccountLabel(item), * 数据来源:银企账号、特殊银行账号
value: item.merchantId, * id+item.bankAccountType才是唯一值,避免不同类型的账号id相同导致的选中问题
*/
value: item.id + "" + item.bankAccountType,
bankAccountId: item.id,
bankAccountType: item.bankAccountType,
merchantId: item.merchantId,
label: item.bankAccountName + " / " + item.bankAccountNo, label: item.bankAccountName + " / " + item.bankAccountNo,
})); }));
}); });
...@@ -304,8 +318,9 @@ export default { ...@@ -304,8 +318,9 @@ export default {
handleConfirm() { handleConfirm() {
if (this.step === 1) { if (this.step === 1) {
this.$refs.platformFormRef.$refs[this.platformChildRef].validate((valid) => { this.$refs.platformFormRef.$refs[this.platformChildRef].validate((valid) => {
if (!valid) if (!valid) {
return; return;
}
this.transferForm.platformMerchantId = this.platformForm.platformMerchantId; this.transferForm.platformMerchantId = this.platformForm.platformMerchantId;
this.transferForm.platformMerchantName = this.platformForm.platformMerchantName; this.transferForm.platformMerchantName = this.platformForm.platformMerchantName;
// this.getTransferDetail(); // this.getTransferDetail();
...@@ -324,17 +339,87 @@ export default { ...@@ -324,17 +339,87 @@ export default {
const formRef = this.$refs.transferFormRef?.$refs?.[this.transferChildRef]; const formRef = this.$refs.transferFormRef?.$refs?.[this.transferChildRef];
formRef && formRef.clearValidate(field); formRef && formRef.clearValidate(field);
}, },
validateTransferField(field) {
const formRef = this.$refs.transferFormRef?.$refs?.[this.transferChildRef];
formRef && formRef.validateField(field);
},
validateTransferFieldWithCallback(field, callback) {
const formRef = this.$refs.transferFormRef?.$refs?.[this.transferChildRef];
formRef && formRef.validateField(field, callback);
},
clearTransferValidateAfterLayout() { clearTransferValidateAfterLayout() {
this.$nextTick(() => { this.$nextTick(() => {
this.clearTransferValidate(["expenseCategoryIds", "rcvMerchantId", "invoiceRemark", "fileUrlList"]); this.clearTransferValidate(["expenseCategoryIds", "adjustmentFee", "rcvMerchantId", "invoiceRemark", "fileUrlList", "remark"]);
}); });
}, },
refreshTransferFormValidateLayout() { refreshTransferFormValidateLayout() {
this.clearTransferValidate(["expenseCategoryIds", "rcvMerchantId", "invoiceRemark", "fileUrlList"]); this.clearTransferValidate(["expenseCategoryIds", "adjustmentFee", "rcvMerchantId", "invoiceRemark", "fileUrlList", "remark"]);
this.$nextTick(() => { this.$nextTick(() => {
this.transferFormKey += 1; this.transferFormKey += 1;
}); });
}, },
isAdjustmentFeeFilled() {
const adjustmentFee = this.transferForm.adjustmentFee;
return adjustmentFee !== undefined && adjustmentFee !== null && `${adjustmentFee}`.trim() !== "";
},
getAdjustedTransferTotalAmount(totalAmount) {
const adjustmentFee = Number(this.transferForm.adjustmentFee) || 0;
return ((Number(totalAmount) || 0) + adjustmentFee).toFixed(2);
},
getAmountMapTotal(amountMap = {}) {
return Object.keys(amountMap).reduce((total, key) => total + (Number(amountMap[key]) || 0), 0);
},
getLocalTransferTotalAmount(expenseCategoryIds = []) {
if (!expenseCategoryIds.length && !this.isAdjustmentFeeFilled()) {
return "";
}
const totalAmount = expenseCategoryIds.length ? this.getAmountMapTotal(this.lockedExpenseAmountMap) : 0;
return this.getAdjustedTransferTotalAmount(totalAmount);
},
syncRemarkRequired() {
this.$set(this.transferRules.remark[0], "required", this.isAdjustmentFeeFilled());
},
normalizeAdjustmentFeeInput(value) {
let nextValue = `${value || ""}`.replace(/[^\d.-]/g, "");
const isNegative = nextValue.startsWith("-");
nextValue = nextValue.replace(/-/g, "");
if (isNegative) {
nextValue = `-${nextValue}`;
}
const dotIndex = nextValue.indexOf(".");
if (dotIndex !== -1) {
nextValue = `${nextValue.slice(0, dotIndex + 1)}${nextValue.slice(dotIndex + 1).replace(/\./g, "")}`;
const parts = nextValue.split(".");
nextValue = `${parts[0]}.${parts[1].slice(0, 2)}`;
}
return nextValue.slice(0, 20);
},
handleAdjustmentFeeInput(value) {
this.transferForm.adjustmentFee = this.normalizeAdjustmentFeeInput(value);
this.syncRemarkRequired();
this.$nextTick(() => {
if (this.isAdjustmentFeeFilled()) {
this.validateTransferField("remark");
return;
}
this.clearTransferValidate("remark");
});
},
handleAdjustmentFeeBlur() {
this.validateTransferFieldWithCallback("adjustmentFee", (message) => {
if (message) {
return;
}
this.handleExpenseChange(this.transferForm.expenseCategoryIds, false);
});
},
validateAdjustmentFee(rule, value, callback) {
const adjustmentFee = `${value || ""}`.trim();
const error = adjustmentFee && !/^-?\d+(?:\.\d{1,2})?$/.test(adjustmentFee)
? new Error("费用调整仅支持数字、负数和两位小数")
: undefined;
callback(error);
},
isExpenseCategoryDisabled(id) { isExpenseCategoryDisabled(id) {
return this.lockedExpenseCategoryIds.includes(id); return this.lockedExpenseCategoryIds.includes(id);
}, },
...@@ -369,18 +454,14 @@ export default { ...@@ -369,18 +454,14 @@ export default {
}); });
this.transferForm.transferTotalAmount = totalAmount || 0; this.transferForm.transferTotalAmount = totalAmount || 0;
}, },
handleExpenseChange(value) { handleExpenseChange(value, refreshLayout = true) {
const expenseCategoryIds = this.mergeLockedExpenseCategoryIds(value); const expenseCategoryIds = this.mergeLockedExpenseCategoryIds(value);
if (expenseCategoryIds.length !== value.length) if (expenseCategoryIds.length !== value.length) {
this.transferForm.expenseCategoryIds = expenseCategoryIds; this.transferForm.expenseCategoryIds = expenseCategoryIds;
this.refreshTransferFormValidateLayout();
const unlockedExpenseCategoryIds = this.getUnlockedExpenseCategoryIds(expenseCategoryIds);
if (!expenseCategoryIds.length) {
this.transferForm.transferTotalAmount = "";
return;
} }
const unlockedExpenseCategoryIds = this.getUnlockedExpenseCategoryIds(expenseCategoryIds);
if (!unlockedExpenseCategoryIds.length) { if (!unlockedExpenseCategoryIds.length) {
this.applyExpenseAmountMap(this.lockedExpenseAmountMap); this.applyExpenseAmountMap(this.lockedExpenseAmountMap, this.getLocalTransferTotalAmount(expenseCategoryIds));
return; return;
} }
getMarketTransferFeeShow({ getMarketTransferFeeShow({
...@@ -391,8 +472,10 @@ export default { ...@@ -391,8 +472,10 @@ export default {
this.applyExpenseAmountMap({ this.applyExpenseAmountMap({
...result.amountMap, ...result.amountMap,
...this.lockedExpenseAmountMap, ...this.lockedExpenseAmountMap,
}, result.totalAmount); }, this.getAdjustedTransferTotalAmount(result.totalAmount));
this.refreshTransferFormValidateLayout(); if (refreshLayout) {
this.refreshTransferFormValidateLayout();
}
}); });
}, },
handleDownloadDetail() { handleDownloadDetail() {
...@@ -418,8 +501,9 @@ export default { ...@@ -418,8 +501,9 @@ export default {
submitTransfer() { submitTransfer() {
this.$refs.transferFormRef.$refs[this.transferChildRef].validate((valid) => { this.$refs.transferFormRef.$refs[this.transferChildRef].validate((valid) => {
this.transferForm.payName = this.transferForm.platformMerchantName; this.transferForm.payName = this.transferForm.platformMerchantName;
if (!valid) if (!valid) {
return; return;
}
const params = buildMarketTransferSubmitParams(deepClone(this.transferForm), this.lockedExpenseCategoryIds); const params = buildMarketTransferSubmitParams(deepClone(this.transferForm), this.lockedExpenseCategoryIds);
if (!params.expenseCategoryIds.length) { if (!params.expenseCategoryIds.length) {
this.$message.error("请选择新的费用类型"); this.$message.error("请选择新的费用类型");
...@@ -429,6 +513,10 @@ export default { ...@@ -429,6 +513,10 @@ export default {
this.$message.error("请等待转账凭证上传完成"); this.$message.error("请等待转账凭证上传完成");
return; return;
} }
const accountObj = this.bankAccountList.find(item => item.value === params.rcvMerchantId) || {};
params.bankAccountId = accountObj.bankAccountId;
params.bankAccountType = accountObj.bankAccountType;
params.rcvMerchantId = accountObj.merchantId;
submitMarketTransferFee(params).then(() => { submitMarketTransferFee(params).then(() => {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.$emit("handleConfirm"); this.$emit("handleConfirm");
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class="privacyDailog" class="privacyDailog"
no-cancel="true" no-cancel="true"
title="转账记录" title="转账记录"
width="1080px" width="1380px"
:is-visible="recordTransferVisible" :is-visible="recordTransferVisible"
@closeDialog="handleClose" @closeDialog="handleClose"
@confirmDialog="handleConfirm"> @confirmDialog="handleConfirm">
...@@ -151,7 +151,7 @@ export default { ...@@ -151,7 +151,7 @@ export default {
label: "操作项", label: "操作项",
prop: "oprType", prop: "oprType",
formatter: (cellValue) => { formatter: (cellValue) => {
return { 1: "新增应付转账", 2: "推送企微OA", 3: "新增市场费转账" }[cellValue.oprType] || ""; return { 1: "新增应付转账", 2: "推送企微OA", 3: "新增市场费转账", 4: "调整费用" }[cellValue.oprType] || "";
}, },
}, },
{ {
...@@ -187,17 +187,20 @@ export default { ...@@ -187,17 +187,20 @@ export default {
return Array.isArray(record.expenseCategoryList); return Array.isArray(record.expenseCategoryList);
}, },
getBillMerchantLabel(record = {}) { getBillMerchantLabel(record = {}) {
if (!this.isMarketTransferRecord(record)) if (!this.isMarketTransferRecord(record)) {
return "对账服务商"; return "对账服务商";
}
return record.billType == "1" ? "所属流量方" : "所属服务商"; return record.billType == "1" ? "所属流量方" : "所属服务商";
}, },
buildEditFormData(record = {}) { buildEditFormData(record = {}) {
const formData = deepClone(this.baseEditFormData); const formData = deepClone(this.baseEditFormData);
const billMerchant = formData.find(item => item.name === "billMerchantName"); const billMerchant = formData.find(item => item.name === "billMerchantName");
if (billMerchant) if (billMerchant) {
billMerchant.label = this.getBillMerchantLabel(record); billMerchant.label = this.getBillMerchantLabel(record);
if (!this.isMarketTransferRecord(record)) }
if (!this.isMarketTransferRecord(record)) {
return formData; return formData;
}
const amountIndex = formData.findIndex(item => item.name === "amount"); const amountIndex = formData.findIndex(item => item.name === "amount");
const expenseFields = [ const expenseFields = [
...@@ -312,7 +315,7 @@ export default { ...@@ -312,7 +315,7 @@ export default {
} }
.record-transfer-text { .record-transfer-text {
display: inline-block; display: inline-block;
width: 616px; width: 1000px;
margin-top: 6px; margin-top: 6px;
line-height: 22px; line-height: 22px;
color: #333; color: #333;
......
...@@ -104,7 +104,24 @@ ...@@ -104,7 +104,24 @@
<span style="margin-right: 10px"> <span style="margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9050910', '9050911', '9050912']" /> <auth-button category="Button" :show-btn-ids="['9050910', '9050911', '9050912']" />
</span> </span>
<auth-button category="Button" :show-btn-ids="['9050901', '9050902', '9050903', '9050907', '9050908', '9050909']" /> <auth-button category="Button" :show-btn-ids="['9050901', '9050902', '9050903', '9050908', '9050909']" />
<el-dropdown class="fund-report-dropdown"
trigger="click"
@command="handleFundReportCommand">
<el-button size="mini"
type="primary"
plain>
资金日报<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown"
class="fund-report-menu">
<el-dropdown-item v-for="item in fundReportMenuList"
:key="item.command"
:command="item.command">
{{ item.label }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</d2-table-header> </d2-table-header>
<d2-table ref="recordTable" <d2-table ref="recordTable"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
...@@ -218,11 +235,22 @@ ...@@ -218,11 +235,22 @@
:selected-list="batchEditTagList" :selected-list="batchEditTagList"
:visible.sync="batchEditTagVisible" :visible.sync="batchEditTagVisible"
@confirm="handleBatchEditTagConfirm" /> @confirm="handleBatchEditTagConfirm" />
<glsk-form-dialog v-if="fundEmailVisible"
dialog-width="620px"
label-width="120px"
:dialog-config="fundEmailDialogConfig"
:edit-data="fundEmailForm"
:edit-form-data="fundEmailFormData"
:form-rules="fundEmailRules"
:select-visible="fundEmailVisible"
@handleClose="handleFundEmailClose"
@handleConfirm="handleFundEmailConfirm">
</glsk-form-dialog>
</div> </div>
</template> </template>
<script> <script>
import { batchPrinting, checkPermission, getImportTask, nbcbAccDetailBatchSync, nbcbAccDetailConfig, nbcbAccDetailPage, nbcbReceiptPdfUrl } from "@api/theAssetData"; import { batchPrinting, checkPermission, getImportTask, nbcbAccDetailBatchSync, nbcbAccDetailConfig, nbcbAccDetailPage, nbcbAccFinancialReportEmailConfig, nbcbAccFinancialReportEmailConfigSave, nbcbAccFinancialReportPush, nbcbReceiptPdfUrl } from "@api/theAssetData";
// import { rangePickerOptions } from '@/common/format' // import { rangePickerOptions } from '@/common/format'
import { mapActions, mapMutations, mapState } from "vuex"; import { mapActions, mapMutations, mapState } from "vuex";
import { cdSignOpt, dataSourceOpt, jdSyncOpt, receiptStatusOpt } from "@/common/constants.js"; import { cdSignOpt, dataSourceOpt, jdSyncOpt, receiptStatusOpt } from "@/common/constants.js";
...@@ -243,6 +271,33 @@ export default { ...@@ -243,6 +271,33 @@ export default {
BatchEditTagDialog: batchEditTagDialog, BatchEditTagDialog: batchEditTagDialog,
}, },
data() { data() {
const validateFundEmails = (rule, value, callback) => {
const emails = value ? value.trim() : "";
if (!emails) {
callback();
return;
}
if (emails.includes(",")) {
callback(new Error("多个邮箱请使用英文逗号隔开"));
return;
}
const emailList = emails.split(",").map(item => item.trim());
if (emailList.length > 5) {
callback(new Error("最多支持 5 个邮箱地址"));
return;
}
if (emailList.some(item => !item)) {
callback(new Error("邮箱地址不能为空"));
return;
}
const emailReg = /^[\w.%+-]+@[\w.-]+\.[a-z]{2,}$/i;
const invalidEmails = emailList.filter(item => !emailReg.test(item));
if (invalidEmails.length) {
callback(new Error(`邮箱格式不正确:${invalidEmails.join(",")}`));
return;
}
callback();
};
return { return {
// pickerOption: { // pickerOption: {
// rangePickerOptions: rangePickerOptions // rangePickerOptions: rangePickerOptions
...@@ -627,6 +682,40 @@ export default { ...@@ -627,6 +682,40 @@ export default {
checkStrictly: true, checkStrictly: true,
emitPath: true, emitPath: true,
}, },
fundEmailVisible: false,
fundEmailDialogConfig: {
title: "配置推送邮件",
okText: "确认",
hideClose: false,
},
fundEmailForm: {
emails: "",
},
fundReportMenuList: [{
label: "配置推送邮箱",
command: "config",
}, {
label: "推送资金日报",
command: "push",
}, {
label: "下载资金日报",
command: "download",
}],
fundEmailFormData: [{
label: "邮箱地址",
name: "emails",
type: "textarea",
maxlength: 200,
showLimit: true,
width: "360px",
placeholder: "最多 5 个邮箱地址,以英文逗号隔开",
}],
fundEmailRules: {
emails: [
{ min: 1, max: 200, message: "长度 1-200 字符", trigger: "blur" },
{ validator: validateFundEmails, trigger: "blur" },
],
},
}; };
}, },
computed: { computed: {
...@@ -948,6 +1037,53 @@ export default { ...@@ -948,6 +1037,53 @@ export default {
]; ];
this.actionSetDownloadList({ list, type: "dowloadList" }); this.actionSetDownloadList({ list, type: "dowloadList" });
}, },
handleFundReportCommand(command) {
const commandMap = {
config: this.handleFundEmailOpen,
push: this.handleFundReportPush,
download: this.handleFundExport,
};
commandMap[command]?.();
},
handleFundEmailOpen() {
nbcbAccFinancialReportEmailConfig({}).then((res) => {
this.fundEmailForm = {
emails: res,
};
this.handleFundEmailClose();
});
},
handleFundEmailConfirm(data) {
const emails = data.emails.trim().split(",").map(item => item.trim()).join(",");
nbcbAccFinancialReportEmailConfigSave({ emails }).then(() => {
this.$message({
message: "配置成功",
type: "success",
});
this.handleFundEmailClose();
});
},
handleFundEmailClose() {
this.fundEmailVisible = !this.fundEmailVisible;
},
handleFundReportPush() {
this.$confirm("是否推送资金日报?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
nbcbAccFinancialReportPush({}).then(() => {
this.$message({
message: "已手动触发推送资金日报,系统将生成精简版XLS并发送至配置邮箱",
type: "success",
});
});
}).catch(() => {});
},
handleImportDetailAndReceipt() { handleImportDetailAndReceipt() {
if (this.taskId) { if (this.taskId) {
...@@ -1177,6 +1313,20 @@ export default { ...@@ -1177,6 +1313,20 @@ export default {
.tag-search-cascader { .tag-search-cascader {
width: 100%; width: 100%;
} }
.fund-report-dropdown {
margin-left: 10px;
.el-button {
font-size: 14px;
}
}
.fund-report-menu {
.el-dropdown-menu__item {
color: #409eff;
font-size: 14px;
line-height: 38px;
}
}
.importResult-1 { .importResult-1 {
width: 100%; width: 100%;
height: 40px; height: 40px;
......
<!-- 特殊银行账号 - 列表 -->
<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"
:has-num="false"
: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 { 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: {
accountType: "",
merchantName: "",
openAccBankName: "",
bankAccountNo: "",
bankAccountName: "",
enterDate: [],
remark: "",
},
searchFormSearch: {},
showFormData: [{
label: "账号类型",
name: "accountType",
type: "select",
optionId: "value",
optionLabel: "name",
optionList: [],
optionsName: "accountTypeList",
}, {
label: "商户名称",
name: "merchantName",
type: "input",
maxlength: "20",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "开户银行",
name: "openAccBankName",
type: "input",
maxlength: "20",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "银行账号",
name: "bankAccountNo",
type: "input",
maxlength: "20",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "账户名称",
name: "bankAccountName",
type: "input",
maxlength: "20",
isClear: true,
keyFn: this.keyDowmGetList,
}, {
label: "录入时间",
name: "enterDate",
type: "datePicker",
isClear: true,
// pickerOptions: "rangePickerOptions",
}, {
label: "备注",
name: "remark",
type: "input",
maxlength: "20",
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: "",
formatter: (cellValue) => {
return this.baseData.accountTypeShow[cellValue.accountType] || "";
},
}, {
label: "商户名称",
prop: "merchantName",
}, {
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");
},
}, {
label: "备注",
prop: "remark",
}],
},
baseData: {
accountTypeList: [{
name: "灵工平台",
value: "1",
}, {
name: "个体工商户",
value: "2",
}, {
name: "其他",
value: "3",
}],
accountTypeShow: {
1: "灵工平台",
2: "个体工商户",
3: "其他",
},
},
modeDialogConfig: {
config: {
title: "新增特殊银行账号",
width: "1080px",
},
},
};
},
mounted() {
this.getOptionsList("showFormData");
this.onPageShow();
},
beforeDestroy() {
this.onPageHide();
},
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList,
}),
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
let item = this[formName].find(k => k.name == refreshSigle);
let index = this[formName].findIndex(k => k.name == refreshSigle);
this.$set(this[formName][index], "optionList", deepClone(this.baseData[item.optionsName]));
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== "全部") {
const temp = {};
temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp);
}
} else {
this[formName].forEach((item, index) => {
if (item.type === "select" && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], "optionList", deepClone(this.baseData[item.optionsName]));
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== "全部") {
const temp = {};
temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp);
}
}
});
}
},
openDialog(title, type, row = null) {
this.modeDialogConfig.config.title = title;
this.bankOprType = type;
this.merchantRow = row;
this.handleBankClose();
},
handleAdd() {
this.openDialog("新增特殊银行账号", "add");
},
handleDetail(row) {
this.openDialog("查看特殊银行账号", "detail", row);
},
// 修改特殊银行账号
handleEdit(row) {
this.openDialog("修改特殊银行账号", "edit", row);
},
// 修改到账模式确认
handleBankConfirm() {
this.$refs.editBankAccountRef.submitForm();
},
handleBankClose(isRefreshTable = false) {
this.bankVisible = !this.bankVisible;
if (isRefreshTable) {
this.$refs.merchantTable.resetRefreshTable();
}
},
handleReset() {
this.searchForm = {
accountType: "",
merchantName: "",
openAccBankName: "",
bankAccountNo: "",
bankAccountName: "",
enterDate: [],
remark: "",
};
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 = { id: row.id };
deleteBankAccount(params).then((res) => {
this.$message.success("删除成功");
this.handleReset();
});
}).catch(() => { });
},
handleExport() {
const params = {};
params.method = "dj.api.smartcarlife.specialBankAccount.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!