Commit a0b067cc by chenwq

优化市场转账表单验证逻辑,增加表单刷新机制;调整记录转账组件样式

1 parent 3515f7dd
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
:is-block="isBlock" /> :is-block="isBlock" />
<glsx-combi-form v-else <glsx-combi-form v-else
:key="transferFormKey"
ref="transferFormRef" ref="transferFormRef"
class="market-transfer-form" class="market-transfer-form"
default-width="360px" default-width="360px"
...@@ -150,6 +151,7 @@ export default { ...@@ -150,6 +151,7 @@ export default {
return { return {
isBlock: true, isBlock: true,
step: 1, step: 1,
transferFormKey: 0,
platformChildRef: "platformChildRef", platformChildRef: "platformChildRef",
transferChildRef: "transferChildRef", transferChildRef: "transferChildRef",
platformMerchantList: [], platformMerchantList: [],
...@@ -322,6 +324,17 @@ export default { ...@@ -322,6 +324,17 @@ 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);
}, },
clearTransferValidateAfterLayout() {
this.$nextTick(() => {
this.clearTransferValidate(["expenseCategoryIds", "rcvMerchantId", "invoiceRemark", "fileUrlList"]);
});
},
refreshTransferFormValidateLayout() {
this.clearTransferValidate(["expenseCategoryIds", "rcvMerchantId", "invoiceRemark", "fileUrlList"]);
this.$nextTick(() => {
this.transferFormKey += 1;
});
},
isExpenseCategoryDisabled(id) { isExpenseCategoryDisabled(id) {
return this.lockedExpenseCategoryIds.includes(id); return this.lockedExpenseCategoryIds.includes(id);
}, },
...@@ -360,7 +373,7 @@ export default { ...@@ -360,7 +373,7 @@ export default {
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.clearTransferValidate("expenseCategoryIds"); this.refreshTransferFormValidateLayout();
const unlockedExpenseCategoryIds = this.getUnlockedExpenseCategoryIds(expenseCategoryIds); const unlockedExpenseCategoryIds = this.getUnlockedExpenseCategoryIds(expenseCategoryIds);
if (!expenseCategoryIds.length) { if (!expenseCategoryIds.length) {
this.transferForm.transferTotalAmount = ""; this.transferForm.transferTotalAmount = "";
...@@ -379,6 +392,7 @@ export default { ...@@ -379,6 +392,7 @@ export default {
...result.amountMap, ...result.amountMap,
...this.lockedExpenseAmountMap, ...this.lockedExpenseAmountMap,
}, result.totalAmount); }, result.totalAmount);
this.refreshTransferFormValidateLayout();
}); });
}, },
handleDownloadDetail() { handleDownloadDetail() {
......
...@@ -305,7 +305,8 @@ export default { ...@@ -305,7 +305,8 @@ export default {
} }
.record-transfer-text { .record-transfer-text {
display: inline-block; display: inline-block;
width: 314px; width: 616px;
margin-top: 6px;
line-height: 22px; line-height: 22px;
color: #333; color: #333;
vertical-align: top; vertical-align: top;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!