yu.jie 4 éve
szülő
commit
acce9b294e

+ 1 - 1
src/services/proto/accountinfo/index.ts

@@ -60,7 +60,7 @@ export const bizGroupReq = (param: ErmcpBizGroupReq): Promise<ErmcpBizGroupRsp>
  * @param param
  */
 export const hedgeOutMainReq = (param: HedgeOutMainConfigReq): Promise<HedgeOutMainConfigRsp> => {
-    return protoMiddleware<HedgeOutMainConfigReq>(param, 'HedgeOutMainConfigReq', 'HedgeOutMainConfigRsp', 2)
+    return protoMiddleware<HedgeOutMainConfigReq>(param, 'HedgeOutMainConfigReq', 'HedgeOutMainConfigRsp', 3)
 }
 
 /**

+ 24 - 24
src/services/proto/accountinfo/interface.ts

@@ -90,30 +90,30 @@ export interface ErmcpBizGroupTAAccount {
 
 // 期货账户新增修改请求 0 29 146
 export interface HedgeOutMainConfigReq {
-    marketid: number; // uint64 内部市场ID(HedgeOutMainConfig)
-    hedgeaccountcode: string ; // string 对冲账号ID(HedgeOutMainConfig)
-    connectflag: number; // int32 是否联接外部交易 - 0:不连接 1:连接(HedgeOutMainConfig)
-    hedgeaccountpwd: string; // string 对冲账号密码(HedgeOutMainConfig)
-    appid: string; // string AppID(HedgeOutMainConfig)
-    authcode: string; // string 授权码(HedgeOutMainConfig)
-    limitnumber: number; // uint64 挂单笔数限额默认0(HedgeOutMainConfig)
-    status: number; // int32 渠道账号状态 1-可买入可卖出 2-可卖出不可买入默认1(HedgeOutMainConfig)
-    accountname: string; // string 账户名称accountname1(Taaccount)
-    accountid: number; // uint64 资金账户ID(Taaccount)
-    taaccounttype: number; // int32 账号类型 - 1:外部账号 2:内部账号 3:内部做市自营账号 4:内部做市接单账号(Taaccount)
-    currencyid: number; // int32 货币ID默认为1(Taaccount)
-    outthreshold: number; // double 出金阈值默认为0(Taaccount)
-    ismain: number; // int32 是否母账号 0:不是母账户 1:是母账户(Taaccount)
-    parentaccountid: number; // uint64 所属根账号(Taaccount)
-    relateduserid: number; // uint64 关联用户(Taaccount)
-    fromaccountid: number; // uint64 所属上级账户(Taaccount)
-    trademargintmpid: number; // uint64 保证金模板id(TAACCOUNTCONFIG)
-    tradefeetmpid: number; // uint64 手续费模板ID(TAACCOUNTCONFIG)
-    maxsubaccouts: number; // uint64 最大子账户数[最大99999][外部母账户用 默认0(TAACCOUNTCONFIG)
-    fcid: number; // uint64 期货公司
-    creatorid: number; // uint64 创建人
-    modifierid: number; // uint64 修改人
-    areauserid: number; // uint64 机构用户ID
+    marketid?: number; // uint64 内部市场ID(HedgeOutMainConfig)
+    hedgeaccountcode?: string ; // string 对冲账号ID(HedgeOutMainConfig)
+    connectflag?: number; // int32 是否联接外部交易 - 0:不连接 1:连接(HedgeOutMainConfig)
+    hedgeaccountpwd?: string; // string 对冲账号密码(HedgeOutMainConfig)
+    appid?: string; // string AppID(HedgeOutMainConfig)
+    authcode?: string; // string 授权码(HedgeOutMainConfig)
+    limitnumber?: number; // uint64 挂单笔数限额默认0(HedgeOutMainConfig)
+    status?: number; // int32 渠道账号状态 1-可买入可卖出 2-可卖出不可买入默认1(HedgeOutMainConfig)
+    accountname?: string; // string 账户名称accountname1(Taaccount)
+    accountid?: number; // uint64 资金账户ID(Taaccount)
+    taaccounttype?: number; // int32 账号类型 - 1:外部账号 2:内部账号 3:内部做市自营账号 4:内部做市接单账号(Taaccount)
+    currencyid?: number; // int32 货币ID默认为1(Taaccount)
+    outthreshold?: number; // double 出金阈值默认为0(Taaccount)
+    ismain?: number; // int32 是否母账号 0:不是母账户 1:是母账户(Taaccount)
+    parentaccountid?: number; // uint64 所属根账号(Taaccount)
+    relateduserid?: number; // uint64 关联用户(Taaccount)
+    fromaccountid?: number; // uint64 所属上级账户(Taaccount)
+    trademargintmpid?: number; // uint64 保证金模板id(TAACCOUNTCONFIG)
+    tradefeetmpid?: number; // uint64 手续费模板ID(TAACCOUNTCONFIG)
+    maxsubaccouts?: number; // uint64 最大子账户数[最大99999][外部母账户用 默认0(TAACCOUNTCONFIG)
+    fcid?: number; // uint64 期货公司
+    creatorid?: number; // uint64 创建人
+    modifierid?: number; // uint64 修改人
+    areauserid?: number; // uint64 机构用户ID
 }
 // 期货账户新增修改响应 0 29 157
 export interface HedgeOutMainConfigRsp {

+ 4 - 0
src/services/socket/protobuf/protoHeader.ts

@@ -7,6 +7,7 @@ export enum HeadEnum {
     common, // funcode uuid userID
     AccountID,  // funcode uuid userID AccountID
     MarketID18_GoodsID0, // funcode uuid userID, MarketID:18, GoodsID: 0
+    MarketID15101,
 }
 
 /**
@@ -34,6 +35,9 @@ export function getProtoHeadParam(funCodeName: string, type: HeadEnum = 0): IMes
                 GoodsID: 0,
             })
             break
+        case HeadEnum.MarketID15101:
+            result = Object.assign(result, {  MarketID: 15101,})
+            break;
     }
     return result
 }

+ 32 - 16
src/views/information/account_info/compoments/add-child-futures/index.vue

@@ -8,10 +8,16 @@
            :maskClosable="false"
            width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">完成</a-button>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="cancel">取消
+        </a-button>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="submit">新增
+        </a-button>
     </template>
     <a-form class="inlineForm"
             ref="formRef"
@@ -21,7 +27,7 @@
         <a-col :span="12">
           <a-form-item label="所属期货账户"
                        name="userinfotype">
-            <span class="white">{{selectedData.mainAcc.accountname}}/{{selectedData.mainAcc.accountid}}</span>
+            <span class="white">{{selectedData.mainAcc.accountname}}/{{selectedData.mainAcc.hedgeaccountcode}}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -87,13 +93,15 @@
 import { closeModal } from '@/common/setup/modal/index';
 import { defineComponent, PropType, ref, watchEffect } from 'vue';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { ErmcpBizGroupReq } from '@/services/proto/accountinfo/interface';
+import {ErmcpBizGroupReq, HedgeOutMainConfigReq} from '@/services/proto/accountinfo/interface';
 import { validateAction } from '@/common/setup/form';
 import { FormState } from './interface';
 import { handleBusinessForm, handleTradeTemplate } from './setup';
 import { hedgeOutMainReq } from '@/services/proto/accountinfo';
 import { ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import { handlerManagerList } from '@/common/setup/user';
+import {getLongTypeLoginID} from "@/services/bus/login";
+import {getUserId} from "@/services/bus/account";
 
 export default defineComponent({
     name: 'account_info_futures_btn_add',
@@ -121,16 +129,24 @@ export default defineComponent({
         });
         function submit() {
             validateAction<FormState>(formRef, formState).then((res) => {
-                let reqParam: ErmcpBizGroupReq = {
-                    // BizGroupID: number; // uint64 分组ID(修改/删除必填)
-                    // BizType: number; // int32 业务类型 - 1:套保 2:套利
-                    // Remark: string; // string 新增/修改备注
-                    // ApplySrc: number; // int32 新增/修改来源 - 1:管理端 2:终端
-                    // ApplyId: number; // uint64 新增/修改人
-                    // SpotGoods: ErmcpBizGroupSpotGoods[]; // ErmcpBizGroupSpotGoods 期货账户分组商品
-                    // TAAccount: ErmcpBizGroupTAAccount[]; // ErmcpBizGroupTAAccount 期货账户分组账户
-                    // OptType: number; // int32 操作类型 - 1:新增 2:修改 3:删除
-                    // AreaUserID: number; // uint64 所属机构
+                let reqParam: HedgeOutMainConfigReq = {
+                    marketid: 15101, // uint64 内部市场ID(HedgeOutMainConfig)
+                    limitnumber: 0, // uint64 挂单笔数限额默认0(HedgeOutMainConfig)
+                    status: 1, // int32 渠道账号状态 1-可买入可卖出 2-可卖出不可买入默认1(HedgeOutMainConfig)
+                    accountname: res.accountname, // string 账户名称accountname1(Taaccount)
+                    taaccounttype: 1, // int32 账号类型 - 1:外部账号 2:内部账号 3:内部做市自营账号 4:内部做市接单账号(Taaccount)
+                    currencyid: 1, // int32 货币ID默认为1(Taaccount)
+                    outthreshold: 0, // double 出金阈值默认为0(Taaccount)
+                    ismain: 0, // int32 是否母账号 0:不是母账户 1:是母账户(Taaccount)
+                    parentaccountid: props.selectedData.mainAcc.accountid, // uint64 所属根账号(Taaccount)
+                    relateduserid: res.traderUserId, // uint64 关联用户(Taaccount)
+                    fromaccountid: props.selectedData.mainAcc.accountid, // uint64 所属上级账户(Taaccount)
+                    trademargintmpid: res.trademargintmpid, // uint64 保证金模板id(TAACCOUNTCONFIG)
+                    tradefeetmpid: res.tradefeetmpid, // uint64 手续费模板ID(TAACCOUNTCONFIG)
+                    maxsubaccouts: 0, // uint64 最大子账户数[最大99999][外部母账户用 默认0(TAACCOUNTCONFIG)
+                    creatorid: Number(getLongTypeLoginID()), // uint64 创建人
+                    modifierid: Number(getLongTypeLoginID()), // uint64 修改人
+                    areauserid: getUserId(), // uint64 机构用户ID
                 };
 
                 requestResultLoadingAndInfo(hedgeOutMainReq, reqParam, loading, ['新增期货子账户成功', '新增期货子账户失败:']).then(() => {

+ 1 - 1
src/views/information/account_info/compoments/add-child-futures/interface.ts

@@ -2,5 +2,5 @@ export interface FormState {
     accountname: string; // string 账户名称accountname1(Taaccount)
     trademargintmpid: number | undefined; // uint64 保证金模板id(TAACCOUNTCONFIG)
     tradefeetmpid: number | undefined; // uint64 手续费模板ID(TAACCOUNTCONFIG)
-    traderUserId: number | undefined;
+    traderUserId: number | undefined;  // 指定交易用户
 }

+ 147 - 129
src/views/information/account_info/compoments/add-futures/index.vue

@@ -1,142 +1,160 @@
 <template>
-  <!-- 新增期货账户 -->
-  <a-modal class="commonModal add-futures"
-           title="新增期货账户"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           :maskClosable="false"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">完成</a-button>
-    </template>
-    <a-form class="inlineForm"
-            ref="formRef"
-            :model="formState"
-            :rules="rules">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="期货公司"
-                       name="fcid">
-            <a-select class="inlineFormSelect"
-                      style="width: 200px"
-                      v-model:value="formState.fcid"
-                      placeholder="请选择期货公司">
-              <a-select-option :value="item.fcid"
-                               :key="item.fcid"
-                               v-for="item in companyList">{{item.fcname}}
-              </a-select-option>
-            </a-select>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="accountname">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     v-model:value="formState.accountname"
-                     placeholder="请输入账户名称" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="期货登录账号"
-                       name="accountid">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     v-model:value="formState.accountid"
-                     placeholder="请输入期货登录账号" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="交易密码"
-                       name="password">
-            <a-input-password class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.password"
-                              placeholder="请输入登录密码" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="24">
-          <a-form-item label="指定交易用户"
-                       name="">
-            <span class="white">{{getUserName()}}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
-  </a-modal>
+    <!-- 新增期货账户 -->
+    <a-modal class="commonModal add-futures"
+             title="新增期货账户"
+             v-model:visible="visible"
+             @cancel="cancel"
+             centered
+             :maskClosable="false"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="cancel">取消
+            </a-button>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">新增
+            </a-button>
+        </template>
+        <a-form class="inlineForm"
+                ref="formRef"
+                :model="formState"
+                :rules="rules">
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="期货公司"
+                                 name="fcid">
+                        <a-select class="inlineFormSelect"
+                                  style="width: 200px"
+                                  v-model:value="formState.fcid"
+                                  placeholder="请选择期货公司">
+                            <a-select-option :value="item.fcid"
+                                             :key="item.fcid"
+                                             v-for="item in companyList">{{item.fcname}}
+                            </a-select-option>
+                        </a-select>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="账户名称"
+                                 name="accountname">
+                        <a-input class="dialogInput"
+                                 style="width: 200px"
+                                 v-model:value="formState.accountname"
+                                 placeholder="请输入账户名称"/>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="期货登录账号"
+                                 name="accountid">
+                        <a-input class="dialogInput"
+                                 style="width: 200px"
+                                 v-model:value="formState.accountid"
+                                 placeholder="请输入期货登录账号"/>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="交易密码"
+                                 name="password">
+                        <a-input-password class="dialogInput"
+                                          style="width: 200px"
+                                          v-model:value="formState.password"
+                                          placeholder="请输入登录密码"/>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="24">
+                    <a-form-item label="指定交易用户"
+                                 name="">
+                        <span class="white">{{getUserName()}}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, watchEffect } from 'vue';
-import { queryResultLoadingAndInfo, requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { hedgeOutMainReq } from '@/services/proto/accountinfo';
-import { ErmcpBizGroupReq } from '@/services/proto/accountinfo/interface';
-import { ErmcpFuturesCompany } from '@/services/go/ermcp/account/interface';
-import { QueryFuturesCompany } from '@/services/go/ermcp/account';
-import { getUserName } from '@/services/bus/user';
-import { validateAction } from '@/common/setup/form';
-import { handleAddOrModifyFuturesForm } from '../setup';
-import { AddFuturesFormState } from '../interface';
+    import {closeModal} from '@/common/setup/modal/index';
+    import {defineComponent, ref, watchEffect} from 'vue';
+    import {queryResultLoadingAndInfo, requestResultLoadingAndInfo} from '@/common/methods/request/resultInfo';
+    import {hedgeOutMainReq} from '@/services/proto/accountinfo';
+    import {ErmcpBizGroupReq, HedgeOutMainConfigReq} from '@/services/proto/accountinfo/interface';
+    import {ErmcpFuturesCompany} from '@/services/go/ermcp/account/interface';
+    import {QueryFuturesCompany} from '@/services/go/ermcp/account';
+    import {getUserName} from '@/services/bus/user';
+    import {validateAction} from '@/common/setup/form';
+    import {handleAddOrModifyFuturesForm} from '../setup';
+    import {AddFuturesFormState} from '../interface';
+    import {getLongTypeLoginID} from "@/services/bus/login";
+    import {LongType} from "@/services/socket/login/interface";
+    import {getUserId} from "@/services/bus/account";
 
-export default defineComponent({
-    name: 'account_info_futures_btn_add',
-    components: {},
-    setup(props, context) {
-        // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_futures_btn_add');
-        const loading = ref<boolean>(false);
-        const companyList = ref<ErmcpFuturesCompany[]>([]);
-        const { rules, formState, formRef } = handleAddOrModifyFuturesForm();
-        watchEffect(() => {
-            if (visible.value) {
-                queryResultLoadingAndInfo(QueryFuturesCompany, loading).then((res) => {
-                    companyList.value = res;
+    export default defineComponent({
+        name: 'account_info_futures_btn_add',
+        components: {},
+        setup(props, context) {
+            // 控制关闭弹窗
+            const {visible, cancel} = closeModal('account_info_futures_btn_add');
+            const loading = ref<boolean>(false);
+            const companyList = ref<ErmcpFuturesCompany[]>([]);
+            const {rules, formState, formRef} = handleAddOrModifyFuturesForm();
+            watchEffect(() => {
+                if (visible.value) {
+                    queryResultLoadingAndInfo(QueryFuturesCompany, loading).then((res) => {
+                        companyList.value = res;
+                    });
+                }
+            });
+
+            function submit() {
+                validateAction<AddFuturesFormState>(formRef, formState).then((res) => {
+                    let reqParam: HedgeOutMainConfigReq = {
+                        marketid: 15101, // uint64 内部市场ID(HedgeOutMainConfig)
+                        hedgeaccountcode: res.accountid, // string 对冲账号ID(HedgeOutMainConfig)
+                        hedgeaccountpwd: res.password, // string 对冲账号密码(HedgeOutMainConfig)
+                        limitnumber: 0, // uint64 挂单笔数限额默认0(HedgeOutMainConfig)
+                        status: 1, // int32 渠道账号状态 1-可买入可卖出 2-可卖出不可买入默认1(HedgeOutMainConfig)
+                        accountname: res.accountname, // string 账户名称accountname1(Taaccount)
+                        // accountid: Number(res.accountid), // uint64 资金账户ID(Taaccount)
+                        taaccounttype: 1, // int32 账号类型 - 1:外部账号 2:内部账号 3:内部做市自营账号 4:内部做市接单账号(Taaccount)
+                        currencyid: 1, // int32 货币ID默认为1(Taaccount)
+                        outthreshold: 0, // double 出金阈值默认为0(Taaccount)
+                        ismain: 1, // int32 是否母账号 0:不是母账户 1:是母账户(Taaccount)
+                        relateduserid: getUserId(), // uint64 关联用户(Taaccount)
+                        maxsubaccouts: 0, // uint64 最大子账户数[最大99999][外部母账户用 默认0(TAACCOUNTCONFIG)
+                        fcid: res.fcid as number, // uint64 期货公司
+                        creatorid: Number(getLongTypeLoginID()), // uint64 创建人
+                        modifierid: Number(getLongTypeLoginID()), // uint64 修改人
+                        areauserid: getUserId(), // uint64 机构用户ID
+                    };
+                    // 期货账户主账户
+                    requestResultLoadingAndInfo(hedgeOutMainReq, reqParam, loading, ['新增账户成功', '新增账户失败:']).then(() => {
+                        cancel();
+                        context.emit('refresh');
+                    });
                 });
             }
-        });
-
-        function submit() {
-            validateAction<AddFuturesFormState>(formRef, formState).then((res) => {
-                let reqParam: ErmcpBizGroupReq = {
-                    // BizGroupID: number; // uint64 分组ID(修改/删除必填)
-                    // BizType: number; // int32 业务类型 - 1:套保 2:套利
-                    // Remark: string; // string 新增/修改备注
-                    // ApplySrc: number; // int32 新增/修改来源 - 1:管理端 2:终端
-                    // ApplyId: number; // uint64 新增/修改人
-                    // SpotGoods: ErmcpBizGroupSpotGoods[]; // ErmcpBizGroupSpotGoods 期货账户分组商品
-                    // TAAccount: ErmcpBizGroupTAAccount[]; // ErmcpBizGroupTAAccount 期货账户分组账户
-                    // OptType: number; // int32 操作类型 - 1:新增 2:修改 3:删除
-                    // AreaUserID: number; // uint64 所属机构
-                };
 
-                requestResultLoadingAndInfo(hedgeOutMainReq, reqParam, loading, ['新增账户成功', '新增账户失败:']).then(() => {
-                    cancel();
-                    context.emit('refresh');
-                });
-            });
-        }
-        return {
-            formState,
-            rules,
-            formRef,
-            visible,
-            cancel,
-            companyList,
-            getUserName,
-            submit,
-            loading,
-        };
-    },
-});
+            return {
+                formState,
+                rules,
+                formRef,
+                visible,
+                cancel,
+                companyList,
+                getUserName,
+                submit,
+                loading,
+            };
+        },
+    });
 </script>
 
 <style lang="less">
-.add-futures {
-}
+    .add-futures {
+    }
 </style
 >;

+ 1 - 1
src/views/information/account_info/list/account_info_futures/index.vue

@@ -33,7 +33,7 @@
       <a-collapse-panel>
         <template #header>
           <a-row class="headRow">
-            <a-col :span="12">{{item.mainAcc.accountname}}({{item.subacclist.length}})</a-col>
+            <a-col :span="12">{{item.mainAcc.accountname}}({{item.mainAcc.hedgeaccountcode}})</a-col>
             <a-col :span="12">
               <BtnList :selectedData="item"
                        :btnList="secondBtn"