|
|
@@ -1,136 +1,59 @@
|
|
|
<!-- 账户管理-入金代扣申请-入金代扣申请 -->
|
|
|
<template>
|
|
|
- <app-drawer title="入金" :width="550" v-model:show="show" :loading="loading">
|
|
|
- <el-form ref="formRef" v-if="cusBank.caninamount === 1" class="el-form--vertical" label-width="120px"
|
|
|
+ <app-drawer title="入金代扣申请" :width="550" v-model:show="show" :loading="loading">
|
|
|
+ <el-form ref="formRef" class="el-form--vertical" label-width="120px"
|
|
|
: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="9999999999" :precision="2" v-model="formData.Amount"
|
|
|
- :rules="formRules.Amount" />
|
|
|
+ <el-input-number placeholder="请输入入金金额" :precision="2" :step="0.01" :max="9999999999" v-model="formData.BillAmount"
|
|
|
+ :rules="formRules.BillAmount" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="凭证" prop="filePath">
|
|
|
- <app-upload :file-types="['image']" type-message="请选择正确的图片类型" @change="onUploadChange" />
|
|
|
+ <el-form-item>
|
|
|
+ <span>{{ numberToChinese(formData.BillAmount) }}</span>
|
|
|
</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-input :name="item.fieldcode" placeholder="请输入" v-model="item.value" />
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- <el-form-item label="入金时间:">
|
|
|
- <span>{{ start }} - {{ end }}</span>
|
|
|
+ <el-form-item class="el-form-item--row" label="备注" prop="Remark">
|
|
|
+ <el-input name="Remark" type="textarea" placeholder="请输入备注" :rows="3" v-model="Remark" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <fieldset style="border: 1px solid #162534;padding: 20px;" v-if="cusBank.caninamount === 1">
|
|
|
- <legend>提示</legend>
|
|
|
- <span style="color: #ccc; font-size: 13px;" v-html="msg" />
|
|
|
- </fieldset>
|
|
|
- <span v-if="cusBank.caninamount === 0" v-html="msg" />
|
|
|
<template #footer>
|
|
|
<el-button type="info" @click="onCancel">取消</el-button>
|
|
|
- <el-button v-if="cusBank.caninamount === 1" type="primary" @click="doDepositWarning">提交</el-button>
|
|
|
+ <el-button type="primary" @click="formSubmit">提交</el-button>
|
|
|
</template>
|
|
|
</app-drawer>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, PropType } from 'vue'
|
|
|
-import { ElMessage, FormInstance, FormRules, ElMessageBox } from 'element-plus'
|
|
|
-import { useDoDeposit, useDoCusBankExtendConfigs } from '@/business/bank'
|
|
|
-import { useUserStore } from '@/stores'
|
|
|
+import { ref } from 'vue'
|
|
|
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
+import { useDoYJF_WithholdInApply } from '@/business/bank'
|
|
|
+import { numberToChinese } from '@/filters';
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
-import AppUpload from '@pc/components/base/upload/index.vue'
|
|
|
-import moment from 'moment'
|
|
|
-
|
|
|
-const props = defineProps({
|
|
|
- selectedRow: {
|
|
|
- type: Object as PropType<Model.TaAccountsRsp>,
|
|
|
- required: true
|
|
|
- }
|
|
|
-})
|
|
|
|
|
|
-const { formData, onSubmit, loading } = useDoDeposit(props.selectedRow.userid)
|
|
|
-const { configs, cusBank, end } = useDoCusBankExtendConfigs(2)
|
|
|
+const { formData, onSubmit, loading, bankaccountno } = useDoYJF_WithholdInApply()
|
|
|
const show = ref(true)
|
|
|
const formRef = ref<FormInstance>()
|
|
|
-const userStore = useUserStore()
|
|
|
-const certificate_photo_url = ref('')
|
|
|
-const { getSystemParamValue } = useUserStore()
|
|
|
-const msg = getSystemParamValue('302') ?? '系统错误'
|
|
|
-const start = getSystemParamValue('012') ?? ''
|
|
|
-const limitMsg = getSystemParamValue('1002') ?? '系统错误'
|
|
|
|
|
|
+/// 备注
|
|
|
+const Remark = ref('')
|
|
|
const formRules: FormRules = {
|
|
|
- Amount: [{ required: true, message: '请输入入金金额' }],
|
|
|
-}
|
|
|
-
|
|
|
-const onUploadChange = (file: { filePath: string }) => {
|
|
|
- certificate_photo_url.value = file.filePath
|
|
|
+ BillAmount: [{ required: true, message: '请输入入金金额' }],
|
|
|
}
|
|
|
|
|
|
const onCancel = () => {
|
|
|
show.value = false
|
|
|
}
|
|
|
|
|
|
-const doDepositWarning = () => {
|
|
|
- if (cusBank.value.cusbankid === 'jdjs') {
|
|
|
- formRef.value?.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- const now = moment(new Date().toISOString()).format('HH:mm')
|
|
|
- if (now > start && now < end.value) {
|
|
|
- ElMessageBox.confirm(
|
|
|
- '是否已在银行端进行入金转账?',
|
|
|
- '提示',
|
|
|
- { confirmButtonText: '确认', cancelButtonText: '取消', })
|
|
|
- .then(() => {
|
|
|
- formSubmit()
|
|
|
- }).catch(() => {
|
|
|
- onCancel()
|
|
|
- })
|
|
|
- } else {
|
|
|
- ElMessageBox.confirm(limitMsg, '提示', { confirmButtonText: '我知道了', showCancelButton: false })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- formSubmit()
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
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
|
|
|
- }
|
|
|
- })
|
|
|
- obj['certificate_photo_url'] = certificate_photo_url.value
|
|
|
- formData.extendInfo = JSON.stringify(obj)
|
|
|
-
|
|
|
- let isComplete = false // 请求是否结束
|
|
|
- const complete = () => {
|
|
|
- isComplete = true
|
|
|
- loading.value = false
|
|
|
- ElMessage.success('提交成功,请稍后确认结果')
|
|
|
- onCancel()
|
|
|
- }
|
|
|
-
|
|
|
- const t = setTimeout(() => complete(), 2000)
|
|
|
-
|
|
|
- onSubmit().then(() => {
|
|
|
- complete()
|
|
|
- }).catch((err) => {
|
|
|
- if(!isComplete){
|
|
|
- ElMessage.error('提交失败:' + err)
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- window.clearTimeout(t)
|
|
|
- })
|
|
|
- } else {
|
|
|
- ElMessage.error('未签约')
|
|
|
- }
|
|
|
+ onSubmit().then(() => {
|
|
|
+ ElMessage.success('提交成功,请稍后确认结果')
|
|
|
+ onCancel()
|
|
|
+ }).catch((err) => {
|
|
|
+ ElMessage.error('提交失败:' + err)
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|