Ver código fonte

添加代扣签约功能x

Handy_Cao 1 ano atrás
pai
commit
cfdd2ce6e1

+ 11 - 2
src/business/bank/index.ts

@@ -417,12 +417,20 @@ export function useDoYJF_WithholdSignOut() {
 export function useDoYJF_WithholdInApply() {
     /// 获取UserId
     const loading = shallowRef(false)
+    /// 判断是否有签约信息
+    const bankaccountno = shallowRef('')
     /// 表单信息
     const formData = reactive<Partial<Proto.YJF_WithholdInApplyReq>>({
         AccountID: accountStore.currentAccountId,
         UserID: useStore.userInfo.userid,
         LoginID: loginStore.loginId,
-        ClientSerialNo: v4()
+        ClientSerialNo: v4(),
+        BillAmount: "0"
+    })
+
+    /// 判断是否有签约信息
+    queryBankAccountSign().then((res) => {
+        bankaccountno.value = res.data.filter(obj => { return ![SignStatus.Rescinded].includes(obj.signstatus) })[0].bankaccountno
     })
 
     const onSubmit = async () => {
@@ -440,7 +448,8 @@ export function useDoYJF_WithholdInApply() {
     return {
         loading,
         onSubmit,
-        formData
+        formData,
+        bankaccountno
     }
 }
 

+ 1 - 0
src/constants/bank.ts

@@ -10,6 +10,7 @@ export enum SignStatus {
     Audit = 2,  // 签约待审核
     Signing = 3,  // 签约中
     Signed = 4,  // 已签约
+    Rescinding = 6,  //  解约中
     Rescinded = 7,  // 已解约
     Refuse = 10, // 审核拒绝
 }

+ 39 - 1
src/filters/index.ts

@@ -367,4 +367,42 @@ export function getIdCardAge(cardnum: string) {
     // 需要根据月份和具体日子判断下 
     if ((idMonth > month) || idMonth == month && idDay > day) { age-- }
     return age
-}
+}
+
+// 金额转大写
+export function numberToChinese(num: undefined | string) {  
+    /// 数据错误
+    if (num === null) { return ''  }
+    
+    const chineseNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
+    const unitSection = ['', '拾', '佰', '仟'];
+    const bigSection = ['', '万', '亿'];
+  
+    // 将金额转换为字符串并确保去除前导零
+    let amountStr = String(num).replace(/^0*(\d+)/, '$1')
+  
+    // 处理小数部分(可选)
+    let decimalPart = ''
+    if (amountStr.includes('.')) {
+      const parts = amountStr.split('.')
+      amountStr = parts[0]
+      decimalPart = '.' + parts[1].padEnd(2, '0') // 假设最多两位小数
+    }
+  
+    // 遍历整数部分进行转换
+    let result = '';
+    for (let i = amountStr.length - 1; i >= 0; i--) {
+      result = chineseNums[parseInt(amountStr[i])] + unitSection[amountStr.length - 1 - i] + result
+      // 在万和亿的分隔处添加单位
+      if ((amountStr.length - i - 1) % 4 === 0 && i !== 0) {
+        result = bigSection[(amountStr.length - i - 1) / 4] + result
+      }
+    }
+  
+    // 去除末尾的零
+    result = result.replace(/零+$/, '零')
+    // 添加分隔符“元”和小数部分的大写
+    result = result.replace(/亿万/, '亿零') + '元' + decimalPart.replace(/\./, '点').replace(/零/g, '零').replace(/零+元/g, '元').replace(/零+角/g, '角').replace(/零+分/g, '分')
+  
+    return result.trim()
+  }

+ 16 - 0
src/packages/gstj/router/index.ts

@@ -155,6 +155,22 @@ const routes: Array<RouteRecordRaw> = [
     ]
   },
   {
+    path: '/holdbank',
+    component: Page,
+    children: [
+      {
+        path: 'holdsign',
+        name: 'hold-sign',
+        component: () => import('../views/holdbank/holdsign/Index.vue'),
+      },
+      {
+        path: 'holddeposit',
+        name: 'hold-deposit',
+        component: () => import('../views/holdbank/holddeposit/Index.vue'),
+      }
+    ]
+  },
+  {
     path: '/order',
     component: Page,
     children: [

+ 109 - 0
src/packages/gstj/views/holdbank/holddeposit/Index.vue

@@ -0,0 +1,109 @@
+<template>
+    <app-view class="bank-sign g-form">
+        <template #header>
+            <app-navbar title="代扣申请查询" >
+                <template #right>
+                    <div class="button-more" v-if="signStatus === SignStatus.Signed" @click="openComponent('apply')">
+                        <span>新增</span>
+                    </div>
+                </template>
+            </app-navbar>
+            <Cell title="查询日期" :value="dateRange.join('-')" @click="showCalendar = true" is-link />
+        </template>
+        <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" 
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+            <div class="g-order-list">
+                <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
+                    <div class="g-order-list__content">
+                        <ul>
+                            <li>
+                                <span>代扣金额</span>
+                                <span>{{ formatDecimal(item.billamount) }}</span>
+                            </li>
+                            <li>
+                                <span>扣费账号</span>
+                                <span>{{ item.dgjfhm }}</span>
+                            </li>
+                            <li>
+                                <span>流水号</span>
+                                <span>{{ handleNoneValue(item.billingsnum) }}</span>
+                            </li>
+                            <li>
+                                <span>申请时间</span>
+                                <span>{{ formatDate(item.trantime, 'MM/DD HH:mm:ss') }}</span>
+                            </li>
+                            <li>
+                                <span>备注</span>
+                                <span>{{ handleNoneValue(item.message) }}</span>
+                            </li>
+                            <li>
+                                <span>状态</span>
+                                <span>{{ item.billresult }}</span>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+        </app-pull-refresh>
+        <Calendar v-model:show="showCalendar" type="range" :max-date="new Date()" :min-date="moment().subtract(1, 'years').toDate()" @confirm="onConfirm" />
+        <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent"
+            v-if="componentId" />
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { defineAsyncComponent, shallowRef, ref } from 'vue'
+import { formatDate, formatDecimal, handleNoneValue } from '@/filters'
+import { useComponent } from '@/hooks/component'
+import { useRequest } from '@/hooks/request'
+import { SignStatus } from '@/constants/bank'
+import { Calendar, Cell } from 'vant'
+import { queryGtwithholddepositapply, queryGetGtwithholdsigninfo } from '@/services/api/bank'
+import moment from 'moment'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+const componentMap = new Map<string, unknown>([
+    ['apply', defineAsyncComponent(() => import('./components/apply/Index.vue'))],
+])
+
+const error = shallowRef(false)
+const pullRefreshRef = shallowRef()
+const signStatus = shallowRef(SignStatus.Unsigned)
+// 是否显示日期选择器
+const showCalendar = shallowRef(false) 
+// 日期范围
+const dateRange = ref<string[]>([]) 
+
+// 查询已经入金代扣申请签约
+useRequest(queryGetGtwithholdsigninfo, {
+    onSuccess: (res) => {
+        /// 签约状态
+        if (res.data.length != 0) {
+            signStatus.value = res.data[0].accountsignstatus
+        }
+    }
+})
+
+const { loading, pageIndex, pageCount, run, dataList } = useRequest(queryGtwithholddepositapply)
+
+// 选择日期
+const onConfirm = ([start, end]: Date[]) => {
+    showCalendar.value = false
+    dateRange.value = [formatDate(start.toISOString(), 'YYYY-MM-DD'), formatDate(end.toISOString(), 'YYYY-MM-DD')]
+    pageIndex.value = 1
+    pullRefreshRef.value?.refresh()
+}
+
+const onRefresh = () => {
+    const [begindate, enddate] = dateRange.value
+    run({
+        begindate: begindate,
+        enddate: enddate,
+    })
+}
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 80 - 0
src/packages/gstj/views/holdbank/holddeposit/components/apply/Index.vue

@@ -0,0 +1,80 @@
+<template>
+    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title='入金代扣申请' @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="formSubmit">
+                <CellGroup inset>
+                    <Field label="扣费账号">
+                        <template #input>
+                            <span>{{ bankaccountno }}</span>
+                        </template>
+                    </Field>
+                    <Field type="number" v-model="formData.BillAmount" label="入金金额" placeholder="请填写入金金额"
+                    :rules="formRules.BillAmount" />
+                    <Field readonly label="金额大写">
+                        <template #input>
+                            <span>{{ numberToChinese(formData.BillAmount) }}</span>
+                        </template>
+                    </Field>
+                    <Field v-model="Remark" label="备注" placeholder="请输入备注" />
+                </CellGroup>
+            </Form>
+            <template #footer>
+            <div class="g-form__footer inset">
+                <Button round block type="danger" @click="formRef?.submit()">确定</Button>
+            </div>
+        </template>
+        </app-view>
+    </app-modal>           
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, ref } from 'vue'
+import { Form, Field, CellGroup, Button, FieldRule, FormInstance } from 'vant'
+import { useDoYJF_WithholdInApply } from '@/business/bank'
+import { numberToChinese } from '@/filters'
+import { fullloading, dialog } from '@/utils/vant'
+import AppModal from '@/components/base/modal/index.vue'
+
+const { formData, onSubmit, bankaccountno } = useDoYJF_WithholdInApply()
+const showModal = shallowRef(true)
+// 是否刷新父组件数据
+const refresh = shallowRef(false) 
+const formRef = shallowRef<FormInstance>()
+/// 备注
+const Remark = ref('')
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+
+// 表单验证规则
+const formRules: { [key: string]: FieldRule[] } = {
+    BillAmount: [{
+        required: true,
+        message: '请填写入金金额',
+    }]
+}
+
+const formSubmit = () => {
+    fullloading((hideLoading) => {
+        onSubmit().then(() => {
+            hideLoading()
+            dialog('提交成功,请稍后确认结果。').then(() => {
+                closed(true)
+            })
+        }).catch((err) => {
+            hideLoading(err, 'fail')
+        })
+    })
+}
+</script>

+ 0 - 0
src/packages/gstj/views/holdbank/holddeposit/components/apply/index.less


+ 0 - 0
src/packages/gstj/views/holdbank/holddeposit/index.less


+ 93 - 0
src/packages/gstj/views/holdbank/holdsign/Index.vue

@@ -0,0 +1,93 @@
+<template>
+    <app-view class="bank-sign g-form">
+        <template #header>
+            <app-navbar title="代扣签约申请" />
+        </template>
+        <div class="bank-sign__container" v-if="signinfo">
+            <CellGroup>
+                <Cell title="用户编号" :value="signinfo?.jfhm" />
+                <Cell title="账户签约状态" :value="getSignStatusName(signinfo?.accountsignstatus ?? 1)" />
+                <Cell title="一次扣费限额" :value="handleNoneValue(signinfo?.yckfxe)" />
+                <Cell title="协议签署日期" :value="handleNoneValue(signinfo?.xyqsrq)" />
+                <Cell title="协议生效日期" :value="handleNoneValue(signinfo?.xysxrq)" />
+                <Cell title="扣款单位时间" :value="handleNoneValue(signinfo?.kksjdw)" />
+                <Cell title="扣款时间步长" :value="handleNoneValue(signinfo?.kksjbc)" />
+                <Cell title="扣款周期内扣费限额" :value="handleNoneValue(signinfo?.kkzqnkfxe)" />
+                <Cell title="扣费周期内限制笔数" :value="handleNoneValue(signinfo?.kkzqnxzbs)" />
+            </CellGroup>
+        </div>
+        <div class="bank-sign__empty" v-else>
+            <Empty description="您还未添加签约账户" />
+        </div>
+        <template #footer>
+            <div class="g-form__footer inset">
+                <Button type="warning" round block @click="onCancelSumit"
+                    v-if="signStatus === SignStatus.Signed">解约</Button>
+                <Button type="danger" round block @click="openComponent('apply')"
+                    v-if="[SignStatus.Unsigned, SignStatus.Rescinded, SignStatus.Rescinding].includes(signStatus)">添加代扣签约账户</Button>
+            </div>
+        </template>
+        <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent"
+            v-if="componentId" />
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { defineAsyncComponent, shallowRef } from 'vue'
+import { CellGroup, Cell, Button, Empty, showFailToast } from 'vant'
+import { useComponent } from '@/hooks/component'
+import { queryGetGtwithholdsigninfo } from '@/services/api/bank'
+import { useRequest } from '@/hooks/request'
+import { getSignStatusName, SignStatus } from '@/constants/bank'
+import { fullloading, dialog } from '@/utils/vant'
+import { useNavigation } from '@mobile/router/navigation'
+import { useDoYJF_WithholdSignOut } from '@/business/bank'
+import { handleNoneValue } from '@/filters'
+
+const componentMap = new Map<string, unknown>([
+    ['apply', defineAsyncComponent(() => import('./components/apply/Index.vue'))],
+])
+
+const { router } = useNavigation()
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    run()
+})
+const signStatus = shallowRef(SignStatus.Unsigned)
+const { onSubmit } = useDoYJF_WithholdSignOut()
+const signinfo = shallowRef<Model.GTWithHoldSignInfoRsp>()
+
+const { run } = useRequest(queryGetGtwithholdsigninfo, {
+    onSuccess: (res) => {
+        /// 签约状态
+        if (res.data.length != 0) {
+            signStatus.value = res.data[0].accountsignstatus
+            console.log(signStatus.value)
+            /// 签约信息
+            signinfo.value = res.data[0]
+        }
+    }
+})
+
+const onCancelSumit = () => {
+    dialog({
+        message: '确认解约?',
+        showCancelButton: true
+    }).then(() => {
+        fullloading((hideLoading) => {
+            onSubmit().then(() => {
+                hideLoading()
+                dialog('提交成功,请稍后确认结果。').then(() => {
+                    router.back()
+                })
+            }).catch((err) => {
+                showFailToast(err)
+            })
+        })
+    })
+}
+
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 72 - 0
src/packages/gstj/views/holdbank/holdsign/components/SMSCode/Index.vue

@@ -0,0 +1,72 @@
+<template>
+    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title='验证码' @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="formSubmit">
+                <CellGroup inset>
+                    <Field type="number" name="VCode" label="验证码" maxlength=" 6" v-model.trim="formData.VCode"
+                        placeholder="请输入银行卡账号" :rules="formRules.VCode" />
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <div class="g-form__footer inset">
+                    <Button type="danger" round block @click="formRef?.submit()">提交</Button>
+                </div>
+            </template>
+        </app-view>
+    </app-modal>           
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { CellGroup, Field, Button, showFailToast, FormInstance, Form, FieldRule } from 'vant'
+import { fullloading, dialog } from '@/utils/vant'
+import { useDoYJF_WithholdSignInSMS } from '@/business/bank'
+
+
+// 是否显示日期选择器
+const formRef = shallowRef<FormInstance>()
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+const { formData: formData, onSubmit } = useDoYJF_WithholdSignInSMS()
+
+// 表单验证规则
+const formRules: { [key in keyof Proto.YJF_WithholdSignInSMS]?: FieldRule[] } = {
+    VCode: [{
+        message: '请输入一次扣费限额',
+        validator: () => {
+            return !!formData.Yckfxe
+        }
+    }]
+}
+
+// 获取验证码
+const formSubmit = () => {
+    formRef.value?.validate('VCode').then(() => {
+        fullloading((hideLoading) => {
+            onSubmit().then(() => {
+                dialog('提交成功,请稍候查看').then(() => {
+                    hideLoading()
+                    /// 返回上层
+                    closed(true)
+                })
+            }).catch((err) => {
+                showFailToast(err)
+            })
+        })
+    })
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 163 - 0
src/packages/gstj/views/holdbank/holdsign/components/apply/Index.vue

@@ -0,0 +1,163 @@
+<template>
+    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title='代扣签约申请' @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="formSubmit">
+                <CellGroup inset>
+                    <Field readonly name="bankaccountno" label="扣费账号" v-model="bankaccountno" />
+                    <Field type="number" name="Yckfxe" label="一次扣费限额" maxlength="30" v-model.trim="formData.Yckfxe"
+                        placeholder="请输入银行卡账号" :rules="formRules.Yckfxe" />
+                    <Field name="Xysxrq" readonly label="协议生效期" maxlength="30" v-model.trim="formData.Xysxrq"
+                        placeholder="请选择协议生效期" :rules="formRules.Xysxrq" is-link @click="showCalendar = true"/>
+                    <Field name="Xydqrq" readonly label="协议到期日" maxlength="30" v-model.trim="formData.Xydqrq"
+                        placeholder="请选择协议到期日" :rules="formRules.Xydqrq" is-link @click="showCalendar = true" />
+                    <Field type="number" name="Kksjdw" label="扣款单位" maxlength="30" v-model.trim="formData.Kksjdw" :rules="formRules.Kksjdw" is-link>
+                        <template #input>
+                            <app-select v-model="formData.Kksjdw" placeholder="请选择扣款单位" :options="getGt_kksjdwList()" />
+                        </template>
+                    </Field>
+                    <Field type="number" name="Kkzqnkfxe" label="扣费周期内扣款限额" maxlength="30" v-model.trim="formData.Kkzqnkfxe"
+                        placeholder="请输入扣费周期内扣款限额" :rules="formRules.Kkzqnkfxe" />
+                    <Field type="number" name="Kkzqnxzbs" label="扣费周期内限制笔数" maxlength="30" v-model.trim="formData.Kkzqnxzbs"
+                        placeholder="请输入扣费周期内限制笔数" :rules="formRules.Kkzqnxzbs" />
+                    <Field type="number" name="Lxdh" label="手机号码" maxlength="30" v-model.trim="formData.Lxdh"
+                        placeholder="请输入手机号码" :rules="formRules.Lxdh" />
+                    <Field name="Addr" label="联系地址" type="textarea" autosize maxlength="128" v-model.trim="formData.Addr" placeholder="请输入联系地址"/>
+                    <Field name="Addr" type="textarea" autosize label="备注" maxlength="128" v-model.trim="formData.Remark" placeholder="备注"/>
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <div class="g-form__footer inset">
+                    <Button type="danger" round block @click="formRef?.submit()">提交</Button>
+                </div>
+            </template>
+            <component ref="componentRef" :is="componentMap.get(componentId)"
+                @closed="closeComponent" v-if="componentId" />
+            <Calendar v-model:show="showCalendar" type="range" :max-date="moment().add(5, 'years').toDate()"
+                :min-date="new Date()" @confirm="onConfirm" />
+        </app-view>
+    </app-modal>           
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, ref, defineAsyncComponent } from 'vue'
+import { CellGroup, Field, Button, showFailToast, FormInstance, Form, FieldRule, Calendar } from 'vant'
+import { fullloading, dialog } from '@/utils/vant'
+import { getGt_kksjdwList } from "@/constants/bank"
+import { useDoYJFGetWithholdSignInSMSVCode } from '@/business/bank'
+import { validateRules } from '@/constants/regex'
+import { formatDate } from '@/filters'
+import { useComponent } from '@/hooks/component'
+import moment from 'moment'
+import AppModal from '@/components/base/modal/index.vue'
+import AppSelect from '@mobile/components/base/select/index.vue'
+
+// 是否显示日期选择器
+const showCalendar = shallowRef(false) 
+const formRef = shallowRef<FormInstance>()
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+const { formData, onSubmit, bankaccountno } = useDoYJFGetWithholdSignInSMSVCode()
+// 日期范围
+const dateRange = ref<string[]>([]) 
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    closed(true)
+})
+
+const componentMap = new Map<string, unknown>([
+    ['SMSCode', defineAsyncComponent(() => import('../SMSCode/Index.vue'))],
+])
+
+// 表单验证规则
+const formRules: { [key in keyof Proto.YJF_GetWithholdSignInSMSVCodeReq]?: FieldRule[] } = {
+    Yckfxe: [{
+        message: '请输入一次扣费限额',
+        validator: () => {
+            return !!formData.Yckfxe
+        }
+    }],
+    Xysxrq: [{
+        message: '请选择协议生效期',
+        validator: () => {
+            return !!formData.Xysxrq
+        }
+    }],
+    Xydqrq: [{
+        message: '请请选择协议到期日',
+        validator: () => {
+            return !!formData.Xydqrq
+        }
+    }],
+    Kksjdw: [{
+        message: '请选择扣款单位',
+        validator: () => {
+            return !!formData.Yckfxe
+        }
+    }],
+    Kkzqnkfxe: [{
+        message: '请输入扣费周期内扣款限额',
+        validator: () => {
+            return !!formData.Kkzqnkfxe
+        }
+    }],
+    Kkzqnxzbs: [{
+        message: '请输入扣费周期内限制笔数',
+        validator: () => {
+            return !!formData.Kkzqnxzbs
+        }
+    }],
+    Lxdh: [{
+        required: true,
+        message: '请输入手机号码',
+        validator: (val) => {
+            if (validateRules.phone.validate(val)) {
+                return true
+            }
+            return validateRules.phone.message
+        }
+    }]
+}
+
+// 选择日期
+const onConfirm = ([start, end]: Date[]) => {
+    showCalendar.value = false
+    dateRange.value = [formatDate(start.toISOString(), 'YYYYMMDD'), formatDate(end.toISOString(), 'YYYYMMDD')]
+    const [startDate, endDate] = dateRange.value
+    formData.Xysxrq = startDate
+    formData.Xydqrq = endDate
+}
+
+// 获取验证码
+const formSubmit = () => {
+    dialog({
+        message: '确认解约?',
+        showCancelButton: true
+    }).then(() => {
+        formRef.value?.validate('Lxdh').then(() => {
+            fullloading((hideLoading) => {
+                formData.Kksjbc = '99'
+                onSubmit().then(() => {
+                    hideLoading()
+                    openComponent('SMSCode')
+                }).catch((err) => {
+                    showFailToast(err)
+                })
+            })
+        })
+    })
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 19 - 0
src/packages/gstj/views/holdbank/holdsign/index.less

@@ -0,0 +1,19 @@
+.bank-sign {
+    &__container {
+        padding-top: 10px;
+
+        .van-cell {
+            &__title {
+                flex: initial;
+            }
+        }
+    }
+
+    &__empty {
+        text-align: center;
+
+        .van-button {
+            width: 50%;
+        }
+    }
+}

+ 10 - 0
src/packages/gstj/views/mine/Index.vue

@@ -98,6 +98,16 @@
                         <Iconfont icon="g-icon-sign">签约账户</Iconfont>
                     </template>
                 </Cell>
+                <Cell is-link :to="{ name: 'hold-sign' }" v-if="authStatus === AuthStatus.Certified">
+                    <template #title>
+                        <Iconfont icon="g-icon-sign"> 代扣签约申请</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'hold-deposit' }" v-if="authStatus === AuthStatus.Certified">
+                    <template #title>
+                        <Iconfont icon="g-icon-sign">入金代扣申请</Iconfont>
+                    </template>
+                </Cell>
                 <Cell is-link :to="{ name: 'mine-profile' }">
                     <template #title>
                         <Iconfont icon="g-icon-profile">个人信息</Iconfont>

+ 0 - 2
src/packages/mobile/views/bank/sign/Index.vue

@@ -102,8 +102,6 @@ const beforeShowComponent = () => {
         showComponent(true)
     }
 }
-
-formRefresh()
 </script>
 
 <style lang="less">

+ 26 - 103
src/packages/pc/views/account/holddeposit/components/deposit/index.vue

@@ -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)
+            })
         }
     })
 }

+ 11 - 5
src/packages/pc/views/account/holddeposit/index.vue

@@ -10,10 +10,6 @@
                 </template>
             </app-filter>
         </template>
-        <template #headerRight>
-            <el-button v-if="signStatus=== SignStatus.Signed" type="primary" size="small" 
-                       @click="openComponent('deposit')">入金代扣申请</el-button>
-        </template>
     </app-table>
     <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
         v-if="componentId" />
@@ -21,6 +17,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent } from 'vue'
+import { ElMessage } from 'element-plus'
 import { useDataFilter } from '@/hooks/datatable'
 import { useComponent } from '@/hooks/component'
 import { useComposeTable } from '@pc/components/base/table'
@@ -39,7 +36,8 @@ const filterDate = shallowRef<string[]>([])
 
 filterOptons.buttonList = [
     { lable: '重置', className: 'el-button--info', onClick: () => onSearch(true) },
-    { lable: '查询', className: 'el-button--info', onClick: () => onSearch() }
+    { lable: '查询', className: 'el-button--info', onClick: () => onSearch() },
+    { lable: '入金代扣申请', className: 'el-button--primary', onClick: () => showComponent() }
 ]
 
 filterOptons.selectList = [
@@ -67,6 +65,14 @@ useRequest(queryGetGtwithholdsigninfo, {
     }
 })
 
+const showComponent = () => {
+    if (signStatus.value != SignStatus.Signed) {
+        ElMessage.error('未进行入金代扣签约申请')
+        return
+    }
+    openComponent('deposit')
+}
+
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
     run()
 })

+ 32 - 11
src/packages/pc/views/account/holdsign/components/sign/index.vue

@@ -1,6 +1,6 @@
 <!-- 账户管理-入金代扣签约-代扣签约申请 -->
 <template>
-    <app-drawer title='代扣签约申请' :width="960" v-model:show="show" :loading="loading" :refresh="refresh">
+    <app-drawer title='代扣签约申请' :width="920" v-model:show="show" :loading="loading" :refresh="refresh">
         <el-form ref="formRef" class="el-form--horizontal" label-width="160px" :model="formData" :rules="formRules">
             <el-form-item label="扣费账号" prop="bankaccountno">
                 <el-input name="bankaccountno" readonly v-model="bankaccountno" />
@@ -24,20 +24,17 @@
                     <el-option :label="item.label" :value="item.value" v-for="(item, index) in getGt_kksjdwList()" :key="index" />
                 </el-select>
             </el-form-item>
-            <el-form-item label="扣款时间步长" prop="Kksjbc">
-                <el-input type="number" name="Kksjbc" placeholder="请输入扣费周期内扣款限额" v-model="formData.Kksjbc" :rules="formRules.Kksjbc" />
-            </el-form-item> 
             <el-form-item label="扣费周期内扣款限额" prop="Kkzqnkfxe">
                 <el-input type="number" name="Kkzqnkfxe" placeholder="请输入扣费周期内扣款限额" v-model="formData.Kkzqnkfxe" :rules="formRules.Kkzqnkfxe" />
             </el-form-item> 
             <el-form-item label="扣费周期内限制笔数" prop="Kkzqnxzbs">
                 <el-input type="number" name="Kkzqnxzbs" placeholder="请输入扣费周期内限制笔数" v-model="formData.Kkzqnxzbs" :rules="formRules.Kkzqnxzbs" />
             </el-form-item> 
-            <el-form-item class="el-form-item--row" label="手机号码" prop="Lxdh">
+            <el-form-item label="手机号码" prop="Lxdh">
                 <el-input type="number" name="Lxdh" maxlength="50" placeholder="请输入手机号码" v-model="formData.Lxdh" :rules="formRules.Lxdh" />
             </el-form-item> 
             <el-form-item class="el-form-item--row" label="地址" prop="Addr">
-                <el-input name="Addr" v-model="formData.Addr" placeholder="请输入联系地址" />
+                <el-input name="Addr" v-model="formData.Addr" maxlength="128" placeholder="请输入联系地址" />
             </el-form-item>
             <el-form-item class="el-form-item--row" label="备注" prop="Remark">
                 <el-input name="Remark" type="textarea" placeholder="请输入备注" :rows="3" v-model="formData.Remark" />
@@ -52,14 +49,16 @@
 
 <script lang="ts" setup>
 import { ref } from 'vue'
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
-import { getGt_kksjdwList } from "@/constants/bank";
-import { useDoYJFGetWithholdSignInSMSVCode } from '@/business/bank'
+import { ElMessage, FormInstance, FormRules, ElMessageBox } from 'element-plus'
+import { getGt_kksjdwList } from "@/constants/bank"
+import { useDoYJFGetWithholdSignInSMSVCode, useDoYJF_WithholdSignInSMS } from '@/business/bank'
 import { validateRules } from '@/constants/regex'
 import { useDateRange } from '@/hooks/date-picker'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 
 const { formData, onSubmit, loading, bankaccountno } = useDoYJFGetWithholdSignInSMSVCode()
+const { formData: signFormData, onSubmit: onSignSubmit } = useDoYJF_WithholdSignInSMS()
+
 const { visibleChange, calendarChange } = useDateRange()
 const show = ref(true)
 const refresh = ref(false)
@@ -114,17 +113,39 @@ const formRules: FormRules = {
     }]
 }
 
-
 const onCancel = (isRefresh = false) => {
     show.value = false
     refresh.value = isRefresh
 }
 
+// 最终提交
+const signSubmit = () => {
+    onSignSubmit().then(() => {
+        ElMessage.error('提交成功,请稍候查看')
+        /// 返回上层
+        onCancel()
+    }).catch((err) => {
+        ElMessage.error('提交失败:' + err)
+    })
+}
+
+// 获取验证码
 const formSubmit = () => {
     formRef.value?.validate((formValid) => {
         if (formValid) {
+            formData.Kksjbc = '99'
             onSubmit().then(() => {
-                ElMessage.success('验证码发送成功')
+                ElMessageBox.prompt('请输入验证码', '验证码', {
+                            confirmButtonText: '提交',
+                            cancelButtonText: '上一步',
+                            inputPattern: /^[0-9]{6}$/, 
+                            inputErrorMessage: '验证码必须6位',
+                            inputType: 'number' })
+                .then(({ value }) => {
+                    /// 提交验证码
+                    signFormData.VCode = value
+                    signSubmit()
+                })
             }).catch((err) => {
                 ElMessage.error('验证码发送失败:' + err)
             })

+ 1 - 1
src/packages/pc/views/account/holdsign/index.vue

@@ -14,7 +14,7 @@
         <!-- 展开行 -->
         <template #expand="{ row }">
             <div class="buttonbar">
-                <el-button v-if="row.signstatus === SignStatus.Signed" type="danger"
+                <el-button v-if="row.accountsignstatus === SignStatus.Signed" type="danger"
                     size="small" @click="openComponent('cancel')">解约</el-button>
             </div>
         </template>

+ 0 - 1
src/types/proto/bank.d.ts

@@ -315,6 +315,5 @@ declare global {
             LoginID: number; // 登录账号ID
             ClientSerialNo: string; // 客户端流水号-请求的流水号
         }
-
     }
 }