|
|
@@ -13,10 +13,11 @@
|
|
|
</Field>
|
|
|
<Field name="BillAmount" :rules="formRules.BillAmount" label="入金金额">
|
|
|
<template #input>
|
|
|
- <Stepper v-model="billAmount" theme="round" :min="0.00" :max="500000" :decimal-length="2" :auto-fixed="false" button-size="22" />
|
|
|
+ <Stepper v-model="billAmount" theme="round" :min="0.00" :max="500000" :decimal-length="2"
|
|
|
+ :auto-fixed="false" button-size="22" />
|
|
|
</template>
|
|
|
</Field>
|
|
|
-<!--
|
|
|
+ <!--
|
|
|
<Field readonly label="金额大写">
|
|
|
<template #input>
|
|
|
<span>{{ numberToChinese(formatDecimal(billAmount)) }}</span>
|
|
|
@@ -29,20 +30,21 @@
|
|
|
</div>
|
|
|
</Form>
|
|
|
<template #footer>
|
|
|
- <div class="g-form__footer inset">
|
|
|
- <Button round block type="danger" @click="formRef?.submit()">确定</Button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <div class="g-form__footer inset">
|
|
|
+ <Button round block type="danger" @click="formRef?.submit()">确定</Button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</app-view>
|
|
|
- </app-modal>
|
|
|
+ </app-modal>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, ref } from 'vue'
|
|
|
import { Form, Field, CellGroup, Button, FieldRule, FormInstance, Stepper } from 'vant'
|
|
|
-import { useDoYJF_WithholdInApply, useDoCusBankExtendConfigs } from '@/business/bank'
|
|
|
-import { formatDecimal } from '@/filters'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
+import { formatDecimal } from '@/filters'
|
|
|
+import { useDoYJF_WithholdInApply, useDoCusBankExtendConfigs } from '@/business/bank'
|
|
|
+import { getServerTime } from '@/services/api/common'
|
|
|
import { useUserStore } from '@/stores'
|
|
|
import AppModal from '@/components/base/modal/index.vue'
|
|
|
import moment from 'moment'
|
|
|
@@ -50,7 +52,7 @@ import moment from 'moment'
|
|
|
const { formData, onSubmit, bankaccountno } = useDoYJF_WithholdInApply()
|
|
|
const showModal = shallowRef(true)
|
|
|
// 是否刷新父组件数据
|
|
|
-const refresh = shallowRef(false)
|
|
|
+const refresh = shallowRef(false)
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
/// 备注
|
|
|
const Remark = ref('')
|
|
|
@@ -88,29 +90,33 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
}
|
|
|
|
|
|
const formSubmit = () => {
|
|
|
- const now = moment().format('HH:mm')
|
|
|
- const n = moment(now, 'HH:mm')
|
|
|
- const s = moment(start, 'HH:mm')
|
|
|
- const e = moment(end.value, 'HH:mm')
|
|
|
- if (n.isAfter(s) && n.isBefore(e)) {
|
|
|
- fullloading((hideLoading) => {
|
|
|
- formData.BillAmount = formatDecimal(billAmount.value)
|
|
|
- onSubmit().then(() => {
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ getServerTime().then((res) => {
|
|
|
+ const n = moment(res.data, 'HH:mm')
|
|
|
+ const s = moment(start, 'HH:mm')
|
|
|
+ const e = moment(end.value, 'HH:mm')
|
|
|
+ if (n.isSameOrBefore(s) && n.isBefore(e)) {
|
|
|
+ formData.BillAmount = formatDecimal(billAmount.value)
|
|
|
+ onSubmit().then(() => {
|
|
|
+ hideLoading()
|
|
|
+ dialog('提交成功,请稍后确认结果。').then(() => {
|
|
|
+ closed(true)
|
|
|
+ })
|
|
|
+ }).catch((err) => {
|
|
|
+ hideLoading(err, 'fail')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
hideLoading()
|
|
|
- dialog('提交成功,请稍后确认结果。').then(() => {
|
|
|
- closed(true)
|
|
|
+ dialog({
|
|
|
+ title: '提示',
|
|
|
+ message: '入金代扣操作不在时间范围内',
|
|
|
+ confirmButtonText: '我知道了'
|
|
|
})
|
|
|
- }).catch((err) => {
|
|
|
- hideLoading(err, 'fail')
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- dialog({
|
|
|
- title: '提示',
|
|
|
- message: '入金代扣操作不在时间范围内',
|
|
|
- confirmButtonText: '我知道了'
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ hideLoading('获取服务器时间失败', 'fail')
|
|
|
})
|
|
|
- }
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
|