Commit 27bf777b by chenwq

feat: 优化市场转账表单数据处理,添加格式化函数

1 parent eaa2dc26
...@@ -57,6 +57,7 @@ export function buildMarketTransferFormData() { ...@@ -57,6 +57,7 @@ export function buildMarketTransferFormData() {
label: "转账金额", label: "转账金额",
name: "transferTotalAmount", name: "transferTotalAmount",
type: "showTxt", type: "showTxt",
formatter: row => row.transferTotalAmount,
}, },
{ {
label: "发票及其他说明", label: "发票及其他说明",
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
:form-ref="transferChildRef" :form-ref="transferChildRef"
:form-rules="transferRules" :form-rules="transferRules"
:is-block="isBlock"> :is-block="isBlock">
<template #expenseCategoryHtml> <template slot="expenseCategoryHtml">
<el-checkbox-group v-model="transferForm.expenseCategoryIds" <el-checkbox-group v-model="transferForm.expenseCategoryIds"
class="expense-category-group" class="expense-category-group"
@change="handleExpenseChange"> @change="handleExpenseChange">
...@@ -214,6 +214,7 @@ export default { ...@@ -214,6 +214,7 @@ export default {
label: item.amountLabel, label: item.amountLabel,
name: `amount_${item.id}`, name: `amount_${item.id}`,
type: "showTxt", type: "showTxt",
formatter: row => `${row[`amount_${item.id}`]}`,
})); }));
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");
...@@ -237,8 +238,6 @@ export default { ...@@ -237,8 +238,6 @@ export default {
fileUrlList: [], fileUrlList: [],
}; };
this.getPlatformMerchantList(); this.getPlatformMerchantList();
this.getTransferDetail();
this.getBankAccountList();
}, },
methods: { methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]), ...mapActions("d2admin/user", ["actionSetDownloadList"]),
...@@ -300,6 +299,8 @@ export default { ...@@ -300,6 +299,8 @@ export default {
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.getBankAccountList();
this.step = 2; this.step = 2;
}); });
return; return;
...@@ -350,10 +351,6 @@ export default { ...@@ -350,10 +351,6 @@ export default {
this.$refs.transferFormRef.$refs[this.transferChildRef].validate((valid) => { this.$refs.transferFormRef.$refs[this.transferChildRef].validate((valid) => {
if (!valid) if (!valid)
return; return;
if (!(Number(this.transferForm.transferTotalAmount) > 0)) {
this.$message.warning("转账金额必须大于0");
return;
}
const params = deepClone(this.transferForm); const params = deepClone(this.transferForm);
params.fileUrlList = params.fileUrlList.map(item => item.fileUrl); params.fileUrlList = params.fileUrlList.map(item => item.fileUrl);
submitMarketTransferFee(params).then(() => { submitMarketTransferFee(params).then(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!