li.shaoyi 2 år sedan
förälder
incheckning
26f76a55a3

+ 13 - 7
src/packages/mobile/views/bank/wallet/components/deposit/Index.vue

@@ -123,13 +123,13 @@ const doDepositWarning = () => {
             showCancelButton: true,
             confirmButtonText: '确认',
             cancelButtonText: '取消',
-          }).then(() => {
+        }).then(() => {
             /// 提交
             formSubmit()
-          }).catch(() => {
+        }).catch(() => {
             /// 返回上一层
             router.back()
-          })
+        })
     } else {
         /// 提交
         formSubmit()
@@ -146,13 +146,19 @@ const formSubmit = () => {
         })
         obj['certificate_photo_url'] = certificate_photo_url.value
         formData.extend_info = JSON.stringify(obj)
-        onSubmit().then(() => {
+
+        const complete = () => {
             hideLoading()
-            dialog('充值申请提交成功,请等待审核。').then(() => {
+            dialog('提交成功,请稍后确认结果').then(() => {
                 router.back()
             })
-        }).catch(() => {
-            hideLoading('充值失败', 'fail')
+        }
+
+        const t = setTimeout(() => complete(), 2000)
+
+        onSubmit().then(() => complete()).finally(() => {
+            hideLoading()
+            window.clearTimeout(t)
         })
     })
 }

+ 9 - 4
src/packages/mobile/views/bank/wallet/components/withdraw/Index.vue

@@ -87,13 +87,18 @@ const formSubmit = () => {
     })
     formData.extend_info = JSON.stringify(obj)
     fullloading((hideLoading) => {
-        onSubmit().then(() => {
+        const complete = () => {
             hideLoading()
-            dialog('出金提交申请成功,请耐心等待审核。').then(() => {
+            dialog('提交成功,请稍后确认结果').then(() => {
                 router.back()
             })
-        }).catch(() => {
-            hideLoading('出金失败', 'fail')
+        }
+
+        const t = setTimeout(() => complete(), 2000)
+
+        onSubmit().then(() => complete()).finally(() => {
+            hideLoading()
+            window.clearTimeout(t)
         })
     })
 }

+ 32 - 25
src/packages/pc/views/footer/capital/summary/deposit/index.vue

@@ -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('未签约')

+ 24 - 18
src/packages/pc/views/footer/capital/summary/withdraw/index.vue

@@ -1,7 +1,8 @@
 <!-- 资金信息-资金汇总-出金申请 -->
 <template>
-    <app-drawer title="提现申请" :width="500" v-model:show="show" :loading="loading" :refresh="refresh">
-        <el-form ref="formRef" v-if="cusBank.canoutamount === 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.canoutamount === 1" class="el-form--vertical" label-width="120px"
+            :model="formData" :rules="formRules">
             <el-form-item label="资金账号">
                 <span>{{ accountStore.currentAccountId }}</span>
             </el-form-item>
@@ -13,17 +14,18 @@
                 <el-button type="danger" @click="formData.Amount = fund.AvailableOutMoney">全部提现</el-button>
             </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-item class="el-form-item--row" label="备注" prop="Remark">
                 <el-input type="textarea" :maxlength="50" :rows="3" v-model="formData.Remark" />
             </el-form-item>
-            </el-form>
+        </el-form>
         <span v-if="cusBank.canoutamount === 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="formSubmit">提交</el-button>
         </template>
     </app-drawer>
@@ -40,7 +42,6 @@ const { loading, formData, onSubmit } = useDoWithdraw()
 const accountStore = useAccountStore()
 const formRef = ref<FormInstance>()
 const show = ref(true)
-const refresh = ref(false)
 const userStore = useUserStore()
 const { configs, cusBank } = useDoCusBankExtendConfigs(3)
 /// 资金账户信息
@@ -62,18 +63,17 @@ const formRules: FormRules = {
     }],
 }
 
-const onCancel = (isRefresh = false) => {
+const onCancel = () => {
     show.value = false
-    refresh.value = isRefresh
 }
 
 const formSubmit = () => {
     formRef.value?.validate((valid) => {
         if (valid) {
-            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
                 }
                 if (e.fieldcode === 'bank_branch_name') {
                     formData.BranchBankName = e.value
@@ -81,12 +81,18 @@ const formSubmit = () => {
             })
             formData.extend_info = JSON.stringify(obj)
             if (formData.CusBankID) {
-                onSubmit().then(() => {
-                    ElMessage.success('提交成功')
-                }).catch((err) => {
-                    ElMessage.warning(err)
-                }).finally(() => {
-                    onCancel(true)
+                const complete = () => {
+                    ElMessage.success('提交成功,请稍后确认结果')
+                    onCancel()
+                }
+
+                const t = setTimeout(() => {
+                    loading.value = false
+                    complete()
+                }, 2000)
+
+                onSubmit().then(() => complete()).finally(() => {
+                    window.clearTimeout(t)
                 })
             } else {
                 ElMessage.error('未签约')