Ver código fonte

修改资金账户提现可提现金额

li.shaoyi 3 anos atrás
pai
commit
222e183803

+ 1 - 1
public/config/app.config.json

@@ -1,4 +1,4 @@
 {
-    "apiUrl": "http://47.104.141.54:38280/cfg?key=mtp_20",
+    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139",
     "icoTitle": "云融"
 }

+ 19 - 0
public/proto/mtp.proto

@@ -2085,4 +2085,23 @@ message t2bBankDepositRsp {
 	optional string CenterErrMsg = 11; // string 中心返回结果说明
 	optional string CerterCheckDate = 12; // string 中心对账日期
 	optional string NetAddr = 13; // string 网络地址(当这里有网址时,应自动跳转网页)
+}
+
+// 账户资金信息请求 0 4 6
+message AccountFundInfoReq {
+	optional MessageHead Header = 1; // MessageHead
+	optional uint64 OrderId = 2; // uint64 查询委托单号
+	optional uint64 AccountId = 3; // uint64 查询资金账号
+	optional uint32 QueryBitMask = 4; // uint32 查询位掩码
+}
+// 账户资金信息响应 0 4 7
+message AccountFundInfoRsp {
+	optional MessageHead Header = 1; // MessageHead 消息头
+	optional int32 RetCode = 2; // int32 返回码
+	optional string RetDesc = 3; // string 描述信息
+	optional uint64 OrderId = 4; // uint64 查询委托单号
+	optional uint64 AccountId = 5; // uint64 查询资金账号
+	optional double AvailableMargin = 6; // double 可用保证金,查询位掩码: 1
+	optional double AvailableOutMoney = 7; // double 可出资金,查询位掩码: 2
+	optional int32 IsCleanAccount = 8; // int32 是否是干净账户,查询位掩码: 4
 }

+ 3 - 0
src/services/funcode/index.ts

@@ -148,6 +148,9 @@ export const funCode: Code = {
     CustomerInfoOperateReq: 1900731,  // 客户资料操作请求
     CustomerInfoOperateRsp: 1900732,  // 客户资料操作响应
 
+    AccountFundInfoReq: 262150, // 账户资金信息请求
+    AccountFundInfoRsp: 262151, // 账户资金信息响应
+
 
     // 之前管理端的一些接口
 

+ 17 - 2
src/services/proto/accountinfo/index.ts

@@ -1,5 +1,7 @@
 import { getUserId } from "@/services/bus/account";
 import { geLoginID_number } from "@/services/bus/login";
+import { getTimeValue } from "@/utils/time";
+import { getSelectedAccountId } from '@/services/bus/account';
 import {
     AuditWskhUserInfoReq, AuditWskhUserInfoRsp,
     CustomerInfoOperateReq, CustomerInfoOperateRsp,
@@ -17,7 +19,9 @@ import {
     TaaccountTransfersxmoneyReq,
     TaaccountTransfersxmoneyRsp,
     UserInfoCheckMangeReq,
-    UserInfoCheckMangeRsp
+    UserInfoCheckMangeRsp,
+    AccountFundInfoReq,
+    AccountFundInfoRsp,
 } from "@/services/proto/accountinfo/interface";
 import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
 
@@ -106,5 +110,16 @@ export const friendOperate = (param: FriendOperateReq): Promise<AuditWskhUserInf
     return protoMiddleware<FriendOperateReq>(param, 'FriendOperateReq', 'FriendOperateRsp', 2)
 }
 
-
+/**
+ * 账户资金信息请求
+ * @param param
+ */
+export const accountFundInfo = (): Promise<AccountFundInfoRsp> => {
+    const param: AccountFundInfoReq = {
+        orderId: getTimeValue(),
+        accountId: getSelectedAccountId(),
+        queryBitMask: 2,
+    }
+    return protoMiddleware(param, 'AccountFundInfoReq', 'AccountFundInfoRsp', 2)
+}
 

+ 18 - 0
src/services/proto/accountinfo/interface.ts

@@ -213,4 +213,22 @@ export interface FriendOperateReq {
     auditorid?: number; // 审核人用户ID
     auditsrc?: number; // 审核来源 - 1:管理端 2:终端
     auditremark?: number; // 审核备注
+}
+
+// 账户资金信息请求 0 4 6
+export interface AccountFundInfoReq {
+    orderId: number; // uint64 查询委托单号
+    accountId: number; // uint64 查询资金账号
+    queryBitMask: number; // uint32 查询位掩码
+}
+
+// 账户资金信息响应 0 4 7
+export interface AccountFundInfoRsp {
+    RetCode: number; // int32 返回码
+    RetDesc: string; // string 描述信息
+    OrderId: number; // uint64 查询委托单号
+    AccountId: number; // uint64 查询资金账号
+    AvailableMargin: number; // double 可用保证金,查询位掩码: 1
+    AvailableOutMoney: number; // double 可出资金,查询位掩码: 2
+    IsCleanAccount: number; // int32 是否是干净账户,查询位掩码: 4
 }

+ 17 - 13
src/views/order/funding_information/components/funding_information_funding_summary/components/funding_information_funding_summary_withdraw/index.vue

@@ -11,7 +11,7 @@
             </a-col>
             <a-col :span="24">
               <a-form-item label="可提现金额">
-                <span class="white ml8"> {{canUseMoney}} <span class="blue" @click="chooseAll" style="cursor:pointer;">全部</span></span>
+                <span class="white ml8"> {{canOutMoney}} <span class="blue" @click="chooseAll" style="cursor:pointer;">全部</span></span>
               </a-form-item>
             </a-col>
             <a-col :span="24">
@@ -68,6 +68,7 @@ import { getApplyInOrOutTime, useSignBank } from '../setup';
 import { FormState } from './interface';
 import { handleForm } from './setup';
 import Bus from '@/utils/eventBus/index';
+import { accountFundInfo } from '@/services/proto/accountinfo';
 
 export default defineComponent({
   name: 'funding_information_funding_summary_withdraw',
@@ -77,27 +78,32 @@ export default defineComponent({
     selectedRow: {
       type: Object as PropType<Taaccount>,
       default: {},
-    },
-    canUseMoney: {
-      type: Number,
-      default: 0,
-    },
+    }
   },
   setup(props, context) {
     const { visible, cancel } = _closeModal(context);
-    const loading = ref<boolean>(false);
+    const loading = ref(false);
+    const canOutMoney = ref(0); // 可提现金额
     const { rules, formState, formRef } = handleForm();
     // 签约银行
     const { hasSignBank, getSignBank, getItemSignBankValue } = useSignBank();
+
+    accountFundInfo().then((res) => {
+      canOutMoney.value = res.AvailableOutMoney;
+    }).catch((err) => {
+      message.error(err);
+    })
+
     function chooseAll() {
-      formState.price = props.canUseMoney;
+      formState.price = canOutMoney.value;
     }
+
     function submit() {
       if (!hasSignBank()) {
         message.error('请先签约银行!');
         return;
       }
-      const max = props.canUseMoney;
+      const max = canOutMoney.value;
       if (max) {
         if (formState.price && formState.price > max) {
           message.error(`提现金额不能超过${max}`);
@@ -130,6 +136,7 @@ export default defineComponent({
       submit,
       loading,
       rules,
+      canOutMoney,
       formState,
       formRef,
       getApplyInOrOutTime,
@@ -138,7 +145,4 @@ export default defineComponent({
     };
   },
 });
-</script>
-
-<style lang="less" scoped>
-</style>;
+</script>

+ 2 - 3
src/views/order/funding_information/components/funding_information_funding_summary/index.vue

@@ -35,7 +35,7 @@
       </a-table>
     </template>
   </mtp-table-scroll>
-  <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :canUseMoney="canUseMoney(selectedRow)" @cancel="closeComponent"></component>
+  <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
 </template>
 
 <script lang="ts">
@@ -49,7 +49,7 @@ import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { handleQuotePriceColor } from '@/common/setup/table/tableQuote';
-import { getCanUseMoney, getFreeze } from '@/services/bus/account';
+import { getFreeze } from '@/services/bus/account';
 import { geLoginID_number } from '@/services/bus/login';
 import { getTaAccounts } from '@/services/go/TaAccount';
 import { GetTaAccountsReq, Taaccount } from '@/services/go/TaAccount/interface';
@@ -120,7 +120,6 @@ export default defineComponent({
     return {
       loading,
       tableList,
-      getCanUseMoney,
       getFreeze,
       expandIcon,
       handleProfitloss,