Commit a0b067cc by chenwq

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

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