This commit is contained in:
weiwei committed 2025-04-09 11:10:42 +08:00
1 parent a689e035b3
commit 65b2b4acba
1 file changed
+25 -20
+25 -20
View File
@@ -80,12 +80,15 @@ const openDialog = async (id: string) => {
form.id = "" form.id = ""
// 重置表单数据 // 重置表单数据
dataFormRef.value?.resetFields() nextTick(() => {
dataFormRef.value?.resetFields()
form.walletTypeId = ""
})
// 获取walletRechargeApply信息 // 获取walletRechargeApply信息
if (id) { if (id) {
form.id = id form.id = id
getwalletRechargeApplyData(id) await getwalletRechargeApplyData(id)
} }
const res = await getWalletTypeSimple() const res = await getWalletTypeSimple()
@@ -102,30 +105,32 @@ const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => {}) const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return false if (!valid) return false
try { // try {
loading.value = true // loading.value = true
form.id ? await putObj(form) : await addObj(form) // form.id ? await putObj(form) : await addObj(form)
useMessage().success(form.id ? "修改成功" : "添加成功") // useMessage().success(form.id ? "修改成功" : "添加成功")
visible.value = false // visible.value = false
emit("refresh") // emit("refresh")
} catch (err: any) { // } catch (err: any) {
useMessage().error(err.msg) // useMessage().error(err.msg)
} finally { // } finally {
loading.value = false // loading.value = false
} // }
} }
// 初始化表单数据 // 初始化表单数据
const getwalletRechargeApplyData = (id: string) => { const getwalletRechargeApplyData = async (id: string) => {
// 获取数据 // 获取数据
loading.value = true loading.value = true
getObj(id) try {
.then((res: any) => { const res = await getObj(id)
if (res.code == 0) {
Object.assign(form, res.data) Object.assign(form, res.data)
}) }
.finally(() => { } catch (err: any) {
loading.value = false } finally {
}) loading.value = false
}
} }
// 暴露变量 // 暴露变量