Ver código fonte

Merge branch 'v20' of http://47.101.159.18:3000/Muchinfo/MTP20_WEB_GLOBAL into v20

li.shaoyi 2 anos atrás
pai
commit
1fb6fea6d1

+ 7 - 0
public/config/router.json

@@ -196,6 +196,13 @@
                         "title": "资金流水",
                         "code": "bottom_capital_statement",
                         "component": "views/footer/capital/statement/index.vue"
+                    },
+                    {
+                        "authType": 2,
+                        "sort": 3,
+                        "title": "出入金明细",
+                        "code": "bottom_capital_inoutapply",
+                        "component": "views/footer/capital/inoutapply/index.vue"
                     }
                 ]
             }

+ 3 - 4
src/business/bank/index.ts

@@ -122,7 +122,7 @@ export function useDoDeposit(userid?: number) {
 
 /// 银行签约请求
 export function useDoBankSign() {
-    const { userInfo } = useUserStore()
+    const { userAccount, userInfo } = useUserStore()
     const loading = shallowRef(false)
     const bankInfo = shallowRef<Model.BankAccountSignRsp>()
 
@@ -154,7 +154,6 @@ export function useDoBankSign() {
                 currency: formData.Currency,
                 cusbankid: formData.CusBankID,
                 accountcode: formData.AccountCode,
-                accountname: formData.BankAccountName,
                 branchbankname: formData.OpenBankName,
                 bankaccountno: formData.BankAccountNo,
                 bankid: formData.OpenBankAccId,
@@ -172,9 +171,9 @@ export function useDoBankSign() {
         AccountCode: accountStore.currentAccountId.toString(),
         CertID: decryptAES(userInfo?.cardnum ?? ''),
         CertType: userInfo?.cardtypeid.toString(),
-        BankAccountName: userInfo?.customername,
+        BankAccountName: userAccount?.accountname,
         MobilePhone: userInfo?.mobile2,
-        AccountName: userInfo?.customername,
+        AccountName: userAccount?.accountname,
     })
 
     const onSubmit = async () => {

+ 34 - 0
src/constants/order.ts

@@ -232,6 +232,40 @@ export function getApplyStatusName(value: number) {
 }
 
 /**
+ * 获取出入金申请状态类型列表
+ * @returns 
+ */
+export function getInOutApplyStatusList() {
+    return getEnumTypeList('applystatus')
+}
+
+/**
+ * 获取出入金申请状态类型名称
+ * @returns 
+ */
+export function getInOutApplyStatusName(value: number) {
+    const enums = getInOutApplyStatusList()
+    return getEnumTypeName(enums, value)
+}
+
+/**
+ * 获取出入金申请类型列表
+ * @returns 
+ */
+export function getInOutExecuteTypeList() {
+    return getEnumTypeList('executetype')
+}
+
+/**
+ * 获取出入金申请类型名称
+ * @returns 
+ */
+export function getInOutExecuteTypeName(value: number) {
+    const enums = getInOutExecuteTypeList()
+    return getEnumTypeName(enums, value)
+}
+
+/**
  * 获取转让状态列表
  * @returns 
  */

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

@@ -94,7 +94,7 @@ const showComponent = (isEdit: boolean) => {
 
 const beforeShowComponent = () => {
     if (bankInfo.value?.cusbankid === 'jdjs') {
-        dialog('请先发函到结算中心修改信息后再修改,否则将会影响充值、出金。').then(() => {
+        dialog('请先发函到结算中心修改信息后再修改,否则将会影响入金、出金。').then(() => {
             showComponent(true)
         })
     } else {

+ 17 - 2
src/packages/mobile/views/bank/wallet/Index.vue

@@ -1,7 +1,13 @@
 <template>
     <app-view>
         <template #header>
-            <app-navbar title="入金出金" />
+            <app-navbar title="入金出金" >
+                <template #right>
+                    <div class="button-more" @click="openComponent('inoutapply')">
+                        <span>申请记录</span>
+                    </div>
+                </template>
+            </app-navbar>
         </template>
         <Tabs v-model:active="active">
             <Tab title="入金">
@@ -11,15 +17,24 @@
                 <app-withdraw />
             </Tab>
         </Tabs>
+        <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent"
+            v-if="componentId" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, defineAsyncComponent } from 'vue'
 import { Tab, Tabs } from 'vant'
 import { useNavigation } from '@mobile/router/navigation'
 import AppDeposit from './components/deposit/Index.vue'
 import AppWithdraw from './components/withdraw/Index.vue'
+import { useComponent } from '@/hooks/component'
+
+const componentMap = new Map<string, unknown>([
+    ['inoutapply', defineAsyncComponent(() => import('./components/inoutapply/Index.vue'))], // 申请流水
+])
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
 
 const { getQueryStringToNumber } = useNavigation()
 

+ 95 - 0
src/packages/mobile/views/bank/wallet/components/inoutapply/Index.vue

@@ -0,0 +1,95 @@
+<!-- 出入金- 申请流水 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="申请流水" @back="closed" />
+            </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__titlebar">
+                            <div class="left">
+                                <h4>{{ item.amount }}</h4>
+                            </div>
+                            <div class="right">
+                                <span>{{ item.updatetime  }}</span>
+                            </div>
+                        </div>
+                        <div class="g-order-list__content">
+                            <ul>
+                                <li>
+                                    <span>资金账号</span>
+                                    <span>{{ item.accountcode }}</span>
+                                </li>
+                                <li>
+                                    <span>姓名</span>
+                                    <span>{{ item.accountname }}</span>
+                                </li>
+                                <li>
+                                    <span>申请类型</span>
+                                    <span>{{ getInOutExecuteTypeName(item.executetype) }}</span>
+                                </li>
+                                <li>
+                                    <span>申请状态</span>
+                                    <span>{{ getInOutApplyStatusName(item.applystatus) }}</span>
+                                </li>
+                                <li>
+                                    <span>手续费</span>
+                                    <span>{{ item.charge }}</span>
+                                </li>
+                                <li>
+                                    <span>开户银行</span>
+                                    <span>{{ handleNoneValue(item.bankname) }}</span>
+                                </li>
+                                <li>
+                                    <span>卡号</span>
+                                    <span>{{ handleNoneValue(item.bankaccountno) }}</span>
+                                </li>
+                                <li>
+                                    <span>备注</span>
+                                    <span>{{ handleNoneValue(item.remark2) }}</span>
+                                </li>
+                            </ul>
+                        </div>
+                    </div>
+                </div>
+            </app-pull-refresh>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { useRequest } from '@/hooks/request'
+import { queryAccountInOutApply } from '@/services/api/bank'
+import { getInOutApplyStatusName, getInOutExecuteTypeName } from '@/constants/order'
+import AppModal from '@/components/base/modal/index.vue'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+import { handleNoneValue } from '@/filters'
+
+const showModal = shallowRef(true)
+const error = shallowRef(false)
+const pullRefreshRef = shallowRef()
+const refresh = shallowRef(false) // 是否刷新父组件数据
+
+const { loading, pageIndex, pageCount, run, dataList } = useRequest(queryAccountInOutApply, {
+
+})
+
+const onRefresh = () => {
+    run()
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

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

@@ -74,6 +74,9 @@ const formRules: { [key in keyof Proto.t2bBankWithdrawReq]?: FieldRule[] } = {
             if (val <= (fund.value.AvailableOutMoney ?? 0.0)) {
                 return true
             }
+            if (fund.value.AvailableOutMoney === 0.0) {
+                return '可出金额为0'
+            } 
             return '超过可出金额'
         }
     }]
@@ -112,7 +115,7 @@ const formSubmit = () => {
         const complete = () => {
             isComplete = true
             hideLoading()
-            dialog('提交成功,请稍后确认结果').then(() => {
+            dialog('提交成功,请勿重复提交,稍后确认结果').then(() => {
                 router.back()
             })
         }

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

@@ -96,7 +96,7 @@ const showComponent = ((componentName: string) => {
 
 const beforeShowComponent = (row: Model.BankAccountSignRsp) => {
     if (row.cusbankid === 'jdjs') {
-        ElMessageBox.alert('请先发函到结算中心修改信息后再修改,否则将会影响充值、出金。').finally(() => {
+        ElMessageBox.alert('请先发函到结算中心修改信息后再修改,否则将会影响入金、出金。').finally(() => {
             showComponent('sign')
         })
     } else {

+ 42 - 0
src/packages/pc/views/footer/capital/inoutapply/index.vue

@@ -0,0 +1,42 @@
+<!-- 资金信息-出入金申请信息 -->
+<template>
+    <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
+        <!-- 申请类型 -->
+        <template #executetype="{ value }">
+            {{ getInOutExecuteTypeName(value) }}
+        </template>
+        <!-- 状态 -->
+        <template #applystatus="{ value }">
+            {{ getInOutApplyStatusName(value) }}
+        </template>
+        <!-- 申请时间 -->
+        <template #updatetime="{ value }">
+            {{ formatDate(value) }}
+        </template>
+    </app-table>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { formatDate } from '@/filters'
+import { useRequest } from '@/hooks/request'
+import { queryAccountInOutApply } from '@/services/api/bank'
+import AppTable from '@pc/components/base/table/index.vue'
+import { getInOutApplyStatusName, getInOutExecuteTypeName } from '@/constants/order'
+
+const { loading, dataList } = useRequest(queryAccountInOutApply, {})
+
+const tableColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'extoperateid', label: '流水号' },
+    { prop: 'amount', label: '金额' },
+    { prop: 'executetype', label: '申请类型' },
+    { prop: 'applystatus', label: '状态' },
+    { prop: 'accountname', label: '姓名' },
+    { prop: 'accountcode', label: '资金账号' },
+    { prop: 'bankname', label: '开户银行' },
+    { prop: 'bankaccountno', label: '卡号' },
+    { prop: 'charge', label: '手续费' },
+    { prop: 'updatetime', label: '申请时间' },
+    { prop: 'remark2', label: '备注' }
+])
+</script>

+ 2 - 0
src/packages/pc/views/footer/capital/summary/withdraw/index.vue

@@ -62,6 +62,8 @@ const formRules: FormRules = {
         validator: (rule, value, callback) => {
             if (value <= (fund.value.AvailableOutMoney ?? 0.0)) {
                 callback()
+            } else if (fund.value.AvailableOutMoney === 0.0) {
+                callback(new Error('可出金额为0'))
             } else {
                 callback(new Error('超出可出金额'))
             }

+ 4 - 1
src/services/api/bank/index.ts

@@ -110,7 +110,10 @@ export function queryBankAccountSign(config: RequestConfig<Model.BankAccountSign
 export function queryAccountInOutApply(config: RequestConfig<Model.AccountInOutApplyReq> = {}) {
     return http.commonRequest<Model.AccountOutInApplyRsp[]>({
         url: '/Qhj/QueryAccountInOutApply',
-        params: config.data,
+        params: {
+            userid: loginStore.userId,
+            ...config.data
+        },
     })
 }
 

+ 1 - 1
src/stores/modules/enum.ts

@@ -12,7 +12,7 @@ export interface EnumType {
     disabled?: boolean;
 }
 
-const enumKeys = ['confirmStatus', 'deliveryPayMode', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus'] as const
+const enumKeys = ['confirmStatus', 'executetype', 'deliveryPayMode', 'applystatus', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus'] as const
 
 const enumMap = new Map<typeof enumKeys[number], ShallowRef<Model.EnumRsp[]>>()
 

+ 4 - 0
src/stores/modules/user.ts

@@ -27,6 +27,9 @@ export const useUserStore = defineStore(() => {
     // 用户信息
     const userInfo = computed(() => state.userData.userInfo)
 
+    // 用户信息
+    const userAccount = computed(() => state.userData.userAccount)
+
     // 登录机构名称
     const accountName = computed(() => {
         const { userAccount } = state.userData
@@ -97,6 +100,7 @@ export const useUserStore = defineStore(() => {
     return {
         ...toRefs(state),
         userInfo,
+        userAccount,
         accountName,
         userType,
         userAvatar,

+ 1 - 1
src/types/model/bank.d.ts

@@ -93,7 +93,7 @@ declare namespace Model {
 
     /** 查询充值出金 请求 */
     interface AccountInOutApplyReq {
-        userid: number;  // 用户ID
+        userid?: number;  // 用户ID
         begindate?: string;  //   申请起始日期(格式yyyymmdd)
         enddate?: string;    //   申请截止日期(格式yyyymmdd)
         likename?: string;   //   模糊搜索名称