|
|
@@ -1,14 +1,13 @@
|
|
|
<!-- 账户管理-入金代扣申请-入金代扣申请 -->
|
|
|
<template>
|
|
|
<app-drawer title="入金代扣申请" :width="500" v-model:show="show" :loading="loading">
|
|
|
- <el-form ref="formRef" class="el-form--vertical" label-width="80px"
|
|
|
- :model="formData" :rules="formRules">
|
|
|
+ <el-form ref="formRef" class="el-form--vertical" label-width="80px" :model="formData" :rules="formRules">
|
|
|
<el-form-item label="扣费账号" prop="bankaccountno">
|
|
|
<el-input name="bankaccountno" readonly v-model="bankaccountno" />
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="Amount" label="入金金额">
|
|
|
- <el-input-number placeholder="请输入入金金额" :max="500000" :min="0.0" :precision="2" :step="0.01" v-model="billAmount"
|
|
|
- :rules="formRules.BillAmount" />
|
|
|
+ <el-input-number placeholder="请输入入金金额" :max="500000" :min="0.0" :precision="2" :step="0.01"
|
|
|
+ v-model="billAmount" :rules="formRules.BillAmount" />
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item>
|
|
|
<span>{{ numberToChinese(formatDecimal(billAmount)) }}</span>
|
|
|
@@ -18,8 +17,9 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<fieldset class="g-fieldset">
|
|
|
- <legend class="g-fieldset__legend">交易日</legend>
|
|
|
- <span class="tips">操作时间:交易日</span>
|
|
|
+ <legend class="g-fieldset__legend">提示</legend>
|
|
|
+ <span class="tips" style="display: block;color: #b8c3cd;">入金时间:交易日 {{ startTime }} - {{ endTime }}</span>
|
|
|
+ <span class="tips" style="color: #b8c3cd;">节假日以通知、公告为准,非交易日请勿操作!</span>
|
|
|
</fieldset>
|
|
|
<template #footer>
|
|
|
<el-button type="info" @click="onCancel">取消</el-button>
|
|
|
@@ -30,9 +30,11 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { ref } from 'vue'
|
|
|
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
-import { useDoYJF_WithholdInApply } from '@/business/bank'
|
|
|
-import { formatDecimal } from '@/filters';
|
|
|
+import { ElMessage, ElMessageBox, FormInstance, FormRules } from 'element-plus'
|
|
|
+import { formatDecimal } from '@/filters'
|
|
|
+import { useDoYJF_WithholdInApply, useDoCusBankExtendConfigs } from '@/business/bank'
|
|
|
+import { getServerTime } from '@/services/api/common'
|
|
|
+import moment from 'moment'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
|
|
|
const { formData, onSubmit, loading, bankaccountno } = useDoYJF_WithholdInApply()
|
|
|
@@ -40,19 +42,21 @@ const show = ref(true)
|
|
|
const formRef = ref<FormInstance>()
|
|
|
const billAmount = ref(0.0)
|
|
|
|
|
|
+const { startTime, endTime } = useDoCusBankExtendConfigs(2)
|
|
|
+
|
|
|
/// 备注
|
|
|
const Remark = ref('')
|
|
|
const formRules: FormRules = {
|
|
|
- BillAmount: [{
|
|
|
- required: true,
|
|
|
+ BillAmount: [{
|
|
|
+ required: true,
|
|
|
message: '请输入代扣金额',
|
|
|
- validator: (rule, value, callback) => {
|
|
|
- if (value > 500000) {
|
|
|
- callback(new Error('代扣金额不能超过50万'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- }
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (value > 500000) {
|
|
|
+ callback(new Error('代扣金额不能超过50万'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
}],
|
|
|
}
|
|
|
|
|
|
@@ -63,12 +67,26 @@ const onCancel = () => {
|
|
|
const formSubmit = () => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- formData.BillAmount = formatDecimal(billAmount.value)
|
|
|
- onSubmit().then(() => {
|
|
|
- ElMessage.success('提交成功,请稍后确认结果')
|
|
|
- onCancel()
|
|
|
- }).catch((err) => {
|
|
|
- ElMessage.error('提交失败:' + err)
|
|
|
+ loading.value = true
|
|
|
+ getServerTime().then((res) => {
|
|
|
+ const n = moment(res.data)
|
|
|
+ const s = moment(startTime.value, 'HH:mm')
|
|
|
+ const e = moment(endTime.value, 'HH:mm')
|
|
|
+ if (n.isSameOrAfter(s) && n.isBefore(e)) {
|
|
|
+ formData.BillAmount = formatDecimal(billAmount.value)
|
|
|
+ onSubmit().then(() => {
|
|
|
+ ElMessage.success('提交成功,请稍后确认结果')
|
|
|
+ onCancel()
|
|
|
+ }).catch((err) => {
|
|
|
+ ElMessage.error('提交失败:' + err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessageBox.confirm('入金不在时间范围内', '提示', { confirmButtonText: '我知道了', showCancelButton: false })
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ ElMessage.error('获取服务器时间失败')
|
|
|
+ }).finally(() => {
|
|
|
+ loading.value = false
|
|
|
})
|
|
|
}
|
|
|
})
|