|
|
@@ -1,8 +1,8 @@
|
|
|
<!-- 资金信息-资金汇总-充值 -->
|
|
|
<template>
|
|
|
- <app-drawer title="充值" :width="500" v-model:show="show" :loading="loading" :refresh="refresh">
|
|
|
- <el-form ref="formRef" v-if="cusBank.caninamount === 1" class="el-form--vertical" label-width="120px" :model="formData"
|
|
|
- :rules="formRules">
|
|
|
+ <app-drawer title="充值" :width="500" v-model:show="show" :loading="loading">
|
|
|
+ <el-form ref="formRef" v-if="cusBank.caninamount === 1" class="el-form--vertical" label-width="120px"
|
|
|
+ :model="formData" :rules="formRules">
|
|
|
<el-form-item prop="Amount" label="充值金额">
|
|
|
<el-input-number placeholder="请输入" :max="9999999999" :precision="2" v-model="formData.Amount"
|
|
|
:rules="formRules.Amount" />
|
|
|
@@ -11,14 +11,15 @@
|
|
|
<app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" />
|
|
|
</el-form-item>
|
|
|
<template v-for="(item, index) in configs" :key="index">
|
|
|
- <el-form-item :label="item.fieldname" :prop="item.fieldcode" v-if="item.usabletype === 1 || item.usabletype === userStore.userInfo?.userinfotype">
|
|
|
+ <el-form-item :label="item.fieldname" :prop="item.fieldcode"
|
|
|
+ v-if="item.usabletype === 1 || item.usabletype === userStore.userInfo?.userinfotype">
|
|
|
<el-input :name="item.fieldcode" placeholder="请输入" v-model="item.value" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-form>
|
|
|
<span v-if="cusBank.caninamount === 0">{{ msg }}</span>
|
|
|
<template #footer>
|
|
|
- <el-button type="info" @click="onCancel(false)">取消</el-button>
|
|
|
+ <el-button type="info" @click="onCancel">取消</el-button>
|
|
|
<el-button type="primary" @click="doDepositWarning">提交</el-button>
|
|
|
</template>
|
|
|
</app-drawer>
|
|
|
@@ -42,7 +43,6 @@ const props = defineProps({
|
|
|
const { formData, onSubmit, loading } = useDoDeposit(props.selectedRow.userid)
|
|
|
const { configs, cusBank } = useDoCusBankExtendConfigs(2)
|
|
|
const show = ref(true)
|
|
|
-const refresh = ref(false)
|
|
|
const formRef = ref<FormInstance>()
|
|
|
const userStore = useUserStore()
|
|
|
const certificate_photo_url = ref('')
|
|
|
@@ -57,9 +57,8 @@ const onUploadChange = (file: { filePath: string }) => {
|
|
|
certificate_photo_url.value = file.filePath
|
|
|
}
|
|
|
|
|
|
-const onCancel = (isRefresh = false) => {
|
|
|
+const onCancel = () => {
|
|
|
show.value = false
|
|
|
- refresh.value = isRefresh
|
|
|
}
|
|
|
|
|
|
const doDepositWarning = () => {
|
|
|
@@ -67,14 +66,14 @@ const doDepositWarning = () => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
ElMessageBox.confirm(
|
|
|
- '是否已在银行端进行入金转账?',
|
|
|
- '提示',
|
|
|
- { confirmButtonText: '确认', cancelButtonText: '取消',})
|
|
|
- .then(() => {
|
|
|
- formSubmit()
|
|
|
- }).catch(() => {
|
|
|
- onCancel(false)
|
|
|
- })
|
|
|
+ '是否已在银行端进行入金转账?',
|
|
|
+ '提示',
|
|
|
+ { confirmButtonText: '确认', cancelButtonText: '取消', })
|
|
|
+ .then(() => {
|
|
|
+ formSubmit()
|
|
|
+ }).catch(() => {
|
|
|
+ onCancel()
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
@@ -86,19 +85,27 @@ const formSubmit = () => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (formData.CusBankID) {
|
|
|
- const obj:{[key:string]:unknown}=Object.create({})
|
|
|
- configs.value.forEach((e)=>{
|
|
|
- if(e.value){
|
|
|
- obj[e.fieldcode]=e.value
|
|
|
+ const obj: { [key: string]: unknown } = Object.create({})
|
|
|
+ configs.value.forEach((e) => {
|
|
|
+ if (e.value) {
|
|
|
+ obj[e.fieldcode] = e.value
|
|
|
}
|
|
|
})
|
|
|
obj['certificate_photo_url'] = certificate_photo_url.value
|
|
|
formData.extend_info = JSON.stringify(obj)
|
|
|
- onSubmit().then(() => {
|
|
|
- ElMessage.success('提交成功')
|
|
|
- onCancel(true)
|
|
|
- }).catch((err) => {
|
|
|
- ElMessage.error('提交失败:' + err)
|
|
|
+
|
|
|
+ const complete = () => {
|
|
|
+ ElMessage.success('提交成功,请稍后确认结果')
|
|
|
+ onCancel()
|
|
|
+ }
|
|
|
+
|
|
|
+ const t = setTimeout(() => {
|
|
|
+ loading.value = false
|
|
|
+ complete()
|
|
|
+ }, 2000)
|
|
|
+
|
|
|
+ onSubmit().then(() => complete()).finally(() => {
|
|
|
+ window.clearTimeout(t)
|
|
|
})
|
|
|
} else {
|
|
|
ElMessage.error('未签约')
|