wms-antdvue/.svn/pristine/f9/f95dae36f84adb086a08afcd9a8bd44ea9ff7dab.svn-base
2024-11-07 16:33:03 +08:00

76 lines
1.8 KiB
Plaintext

<template>
<a-form
ref="form2Ref"
:labelCol="{ lg: 5, sm: 5 }"
:model="formValue"
:rules="rules"
label-placement="left"
style="margin: 40px 0; width: 100%; padding-right: 10%"
>
<a-form-item label="付款账户" name="myAccount">
<span>NaiveUiAdmin@163.com</span>
</a-form-item>
<a-form-item label="收款账户" name="account">
<span>NaiveUiAdmin@qq.com</span>
</a-form-item>
<a-form-item label="收款人姓名" name="name">
<span>Ah jung</span>
</a-form-item>
<a-form-item label="转账金额" name="money">
<span>¥1280</span>
</a-form-item>
<a-divider />
<a-form-item label="支付密码" name="password">
<a-input v-model:value="formValue.password" type="password" />
</a-form-item>
<a-form-item :wrapperCol="{ offset: 5 }">
<a-space>
<a-button :loading="loading" type="primary" @click="formSubmit">提交</a-button>
<a-button @click="prevStep">上一步</a-button>
</a-space>
</a-form-item>
</a-form>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { message } from 'ant-design-vue';
const form2Ref: any = ref(null);
const loading = ref(false);
const formValue = ref({
password: '086611',
});
const rules = {
password: {
required: true,
message: '请输入支付密码',
trigger: 'blur',
},
};
const emit = defineEmits(['prevStep', 'nextStep']);
function prevStep() {
emit('prevStep');
}
function formSubmit() {
loading.value = true;
form2Ref.value
.validate()
.then(() => {
setTimeout(() => {
emit('nextStep');
}, 1000);
})
.catch((error) => {
console.log('error', error);
message.error('验证失败,请填写完整信息');
});
}
</script>