Parcourir la source

Merge remote-tracking branch 'origin/master'

yu.jie il y a 4 ans
Parent
commit
67b3f6d47f

+ 1 - 0
src/App.vue

@@ -9,6 +9,7 @@
         <router-view />
       </a-spin>
     </a-config-provider>
+
   </div>
 </template>
 

+ 6 - 0
src/services/go/ermcp/account/interface.ts

@@ -63,6 +63,12 @@ export interface ErmcpTaAccount {
     relateduserid: number;//关联userid
     tradestatus: number;//交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销
     userid: number;//用户id
+    tradefeetmpid: number;//手续费模板id
+    tradefeetmpname: string;//手续费模板名称
+    trademargintmpid: number;//保证金模板id
+    trademargintmpname: string;//保证金模板名称
+    traderatetmpid: number;//汇率模板id
+    traderatetmpname: string;//汇率模板名称
 }
 
 /**

+ 60 - 116
src/views/information/account_info/compoments/cancel-futures/index.vue

@@ -19,129 +19,73 @@
                 @click="submit">注销
       </a-button>
     </template>
-    <a-form class="inlineForm">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="所属期货账户"
-                       name="userinfotype">
-            <span class="white">{{selectedData.mainAcc.accountname}}/{{selectedData.mainAcc.hedgeaccountcode}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="accountname">
-            <span class="white">{{secondeData.accountname}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="期货保证金"
-                       name="trademargintmpid">
-            <span class="white"
-                  v-if="marginList.length">{{marginList[0].tradeconfigtmpname}}</span>
-            <span class="white"
-                  v-else>--</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="期货手续费"
-                       name="tradefeetmpid">
-            <span class="white"
-                  v-if="feeList.length">{{feeList[0].tradeconfigtmpname}}</span>
-            <span class="white"
-                  v-else>--</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="24">
-          <a-form-item label="指定交易用户"
-                       name="traderUserId">
-            <span class="white">{{getRoleName()}}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
+    <Detail :selectedData="selectedData"
+            :userList="userList"
+            :secondeData="secondeData" />
   </a-modal>
 </template>
 
 <script lang="ts">
-    import {closeModal} from '@/common/setup/modal/index';
-    import {defineComponent, ref, PropType, watchEffect} from 'vue';
-    import {Modal} from 'ant-design-vue';
-    import {LoginaccountOperateReq, TaaccountOperateReq} from '@/services/proto/accountinfo/interface';
-    import {requestResultLoadingAndInfo} from '@/common/methods/request/resultInfo';
-    import {loginAccountOperate, taAccountOperateReq} from '@/services/proto/accountinfo';
-    import {
-        ErmcpLoginUser,
-        ErmcpLoginUserEx,
-        ErmcpTaAccount,
-        ErmcpTaAccountEx
-    } from '@/services/go/ermcp/account/interface';
-    import {getLongTypeLoginID} from "@/services/bus/login";
-    import {ErmcpTradeConfigTMP} from '@/services/go/ermcp/business-review/interface';
-
-    export default defineComponent({
-        name: 'account_info_futures_btn_child_cancel',
-        components: {},
-        props: {
-            selectedData: {
-                type: Object as PropType<ErmcpTaAccountEx>,
-                default: {},
-            },
-            secondeData: {
-                default: {},
-                type: Object as PropType<ErmcpTaAccount>,
-            },
-            userList: {
-                type: Array as PropType<ErmcpLoginUserEx[]>,
-                default: [],
-            },
-            marginList: {
-                type: Array as PropType<ErmcpTradeConfigTMP[]>,
-                default: [],
-            },
-            feeList: {
-                type: Array as PropType<ErmcpTradeConfigTMP[]>,
-                default: [],
-            },
+import { closeModal } from '@/common/setup/modal/index';
+import { defineComponent, ref, PropType } from 'vue';
+import { Modal } from 'ant-design-vue';
+import { TaaccountOperateReq } from '@/services/proto/accountinfo/interface';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { taAccountOperateReq } from '@/services/proto/accountinfo';
+import { ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
+import { getLongTypeLoginID } from '@/services/bus/login';
+import Detail from '../detail-commom-futures/index.vue';
+export default defineComponent({
+    name: 'account_info_futures_btn_child_cancel',
+    components: { Detail },
+    props: {
+        selectedData: {
+            type: Object as PropType<ErmcpTaAccountEx>,
+            default: {},
+        },
+        secondeData: {
+            default: {},
+            type: Object as PropType<ErmcpTaAccount>,
+        },
+        userList: {
+            type: Array as PropType<ErmcpLoginUserEx[]>,
+            default: [],
         },
-        setup(props, context) {
-            // 控制关闭弹窗
-            const {visible, cancel} = closeModal('account_info_futures_btn_child_cancel');
-            const loading = ref<boolean>(false);
+    },
+    setup(props, context) {
+        // 控制关闭弹窗
+        const { visible, cancel } = closeModal('account_info_futures_btn_child_cancel');
+        const loading = ref<boolean>(false);
 
-            function submit() {
-                Modal.confirm({
-                    title: '是否确认注销该账户',
-                    okText: '确认注销',
-                    cancelText: '取消',
-                    onOk() {
-                        let reqParam: TaaccountOperateReq = {
-                            accountid: props.secondeData.accountid,  // uint64 期货账户ID
-                            tradestatus: 7, // uint32 7注销
-                            modifierid: Number(getLongTypeLoginID()), // uint64 修改人
-                            areauserid: Number(props.secondeData.relateduserid), // uint64 机构用户ID
-                        };
-                        requestResultLoadingAndInfo(taAccountOperateReq, reqParam, loading, ['账户注销成功', '账户注销失败:']).then(() => {
-                            cancel();
-                            context.emit('refresh');
-                        });
-                    },
-                    onCancel() {
-                    },
-                });
-            }
-                        function getRoleName() {
-          const item = props.userList.find(e => e.roleid === props.secondeData.relateduserid)
-          return item ? item.rolename : '--'
+        function submit() {
+            Modal.confirm({
+                title: '是否确认注销该账户',
+                okText: '确认注销',
+                cancelText: '取消',
+                onOk() {
+                    let reqParam: TaaccountOperateReq = {
+                        accountid: props.secondeData.accountid, // uint64 期货账户ID
+                        tradestatus: 7, // uint32 7注销
+                        modifierid: Number(getLongTypeLoginID()), // uint64 修改人
+                        areauserid: Number(props.secondeData.relateduserid), // uint64 机构用户ID
+                    };
+                    requestResultLoadingAndInfo(taAccountOperateReq, reqParam, loading, ['账户注销成功', '账户注销失败:']).then(() => {
+                        cancel();
+                        context.emit('refresh');
+                    });
+                },
+                onCancel() {},
+            });
         }
-            return {
-                visible,
-                cancel,
-                submit,
-                loading,
-                getRoleName,
-            };
-        },
-    });
+
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
 </script>
 
 <style lang="less">

+ 57 - 0
src/views/information/account_info/compoments/detail-commom-futures/index.vue

@@ -0,0 +1,57 @@
+<template>
+  <!-- 交易账号通用详情-->
+  <Des :list="desList"></Des>
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType, watchEffect } from 'vue';
+import { ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
+import { Des, handleDesList } from '@/common/components/commonDes';
+
+export default defineComponent({
+    name: 'futures-comom-detail',
+    components: {
+        Des,
+    },
+    props: {
+        selectedData: {
+            type: Object as PropType<ErmcpTaAccountEx>,
+            default: {},
+        },
+        secondeData: {
+            default: {},
+            type: Object as PropType<ErmcpTaAccount>,
+        },
+        userList: {
+            type: Array as PropType<ErmcpLoginUserEx[]>,
+            default: [],
+        },
+    },
+    setup(props) {
+        const { desList, getDesList } = handleDesList();
+        function getRoleName() {
+            const item = props.userList.find((e) => e.roleid === props.secondeData?.relateduserid);
+            return item ? item.rolename : '--';
+        }
+        watchEffect(() => {
+            if (props.selectedData) {
+                const { secondeData, selectedData } = props;
+                const data = props.selectedData;
+                getDesList([
+                    { label: '所属期货账户', value: selectedData.mainAcc?.accountname },
+                    { label: '账户名称', value: secondeData.accountname },
+                    { label: '期货保证金', value: secondeData.trademargintmpname },
+                    { label: '期货手续费', value: secondeData.tradefeetmpname },
+                    { label: '指定交易用户', value: getRoleName() },
+                ]);
+            }
+        });
+        return {
+            desList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 9 - 63
src/views/information/account_info/compoments/detail-futures/index.vue

@@ -12,68 +12,27 @@
                 type="primary"
                 @click="cancel">关闭</a-button>
     </template>
-    <a-form class="inlineForm">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="所属期货账户"
-                       name="userinfotype">
-            <span class="white">{{selectedData.mainAcc.accountname}}/{{selectedData.mainAcc.hedgeaccountcode}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="accountname">
-            <span class="white">{{secondeData.accountname}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="期货保证金"
-                       name="trademargintmpid">
-            <span class="white"
-                  v-if="marginList.length">{{marginList[0].tradeconfigtmpname}}</span>
-            <span class="white"
-                  v-else>--</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="期货手续费"
-                       name="tradefeetmpid">
-            <span class="white"
-                  v-if="feeList.length">{{feeList[0].tradeconfigtmpname}}</span>
-            <span class="white"
-                  v-else>--</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="24">
-          <a-form-item label="指定交易用户"
-                       name="traderUserId">
-            <span class="white">{{getRoleName()}}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
+    <Detail :selectedData="selectedData"
+            :userList="userList"
+            :secondeData="secondeData" />
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, watchEffect } from 'vue';
+import { defineComponent, PropType, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { mergeTwoObj } from '@/utils/objHandle';
-import { handleBusinessForm } from '../add-child-futures/setup';
-import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
-import { handlerManagerList } from '@/common/setup/user';
-import { handleTradeTemplate } from '../add-child-futures/setup';
-import { ErmcpTradeConfigTMP } from '@/services/go/ermcp/business-review/interface';
+import { ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
+import Detail from '../detail-commom-futures/index.vue';
 
 export default defineComponent({
     name: 'trader-detail',
-    components: {},
-        props: {
+    components: { Detail },
+    props: {
         selectedData: {
             type: Object as PropType<ErmcpTaAccountEx>,
             default: {},
         },
-                secondeData: {
+        secondeData: {
             default: {},
             type: Object as PropType<ErmcpTaAccount>,
         },
@@ -81,27 +40,14 @@ export default defineComponent({
             type: Array as PropType<ErmcpLoginUserEx[]>,
             default: [],
         },
-        marginList: {
-            type: Array as PropType<ErmcpTradeConfigTMP[]>,
-            default: [],
-        },
-        feeList: {
-            type: Array as PropType<ErmcpTradeConfigTMP[]>,
-            default: [],
-        },
     },
     setup(props) {
         const { visible, cancel } = closeModal('detail');
         const loading = ref<boolean>(false);
-        function getRoleName() {
-          const item = props.userList.find(e => e.roleid === props.secondeData.relateduserid)
-          return item ? item.rolename : '--'
-        }
         return {
             visible,
             cancel,
             loading,
-            getRoleName,
         };
     },
 });

+ 17 - 29
src/views/information/account_info/compoments/modify-futures-son/index.vue

@@ -80,17 +80,15 @@
 
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, reactive, toRaw, UnwrapRef, watchEffect, PropType } from 'vue';
-import {validateAction} from "@/common/setup/form";
-import {FormState} from "@/views/information/account_info/compoments/add-child-futures/interface";
-import {HedgeOutMainConfigReq} from "@/services/proto/accountinfo/interface";
-import {getLongTypeLoginID} from "@/services/bus/login";
-import {getUserId} from "@/services/bus/account";
-import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
-import {hedgeOutMainReq} from "@/services/proto/accountinfo";
-import { handleAddOrModifyFuturesForm } from '../setup';
-import { handlerManagerList } from '@/common/setup/user';
-import { handleBusinessForm, handleTradeTemplate } from '../add-child-futures/setup';
+import { defineComponent, ref, watchEffect, PropType } from 'vue';
+import { validateAction } from '@/common/setup/form';
+import { FormState } from '@/views/information/account_info/compoments/add-child-futures/interface';
+import { HedgeOutMainConfigReq } from '@/services/proto/accountinfo/interface';
+import { getLongTypeLoginID } from '@/services/bus/login';
+import { getUserId } from '@/services/bus/account';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { hedgeOutMainReq } from '@/services/proto/accountinfo';
+import { handleBusinessForm } from '../add-child-futures/setup';
 import { ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import { mergeTwoObj } from '@/utils/objHandle';
 import { ErmcpTradeConfigTMP } from '@/services/go/ermcp/business-review/interface';
@@ -98,7 +96,7 @@ import { ErmcpTradeConfigTMP } from '@/services/go/ermcp/business-review/interfa
 export default defineComponent({
     name: 'account_info_futures_btn_child_modify',
     components: {},
-        props: {
+    props: {
         selectedData: {
             default: {},
             type: Object as PropType<ErmcpTaAccountEx>,
@@ -107,7 +105,7 @@ export default defineComponent({
             default: {},
             type: Object as PropType<ErmcpTaAccount>,
         },
-                userList: {
+        userList: {
             type: Array as PropType<ErmcpLoginUserEx[]>,
             default: [],
         },
@@ -128,25 +126,15 @@ export default defineComponent({
         const { rules, formState, formRef } = handleBusinessForm();
         watchEffect(() => {
             if (visible.value) {
-              // 默认第一个 服务只放回一个,这里是个坑
-              const {userList, secondeData, marginList,
-            feeList} = props
-            if (userList.length) {
-              formState.traderUserId = userList[0].roleid
-            }
-                if(marginList.length) {
-                    formState.trademargintmpid = marginList[0].tradeconfigtmpid
-                  }
-                  if(feeList.length) {
-                    formState.tradefeetmpid = feeList[0].tradeconfigtmpid
-                  }
+                // 默认第一个 服务只放回一个,这里是个坑
+                const { secondeData } = props;
+                formState.traderUserId = secondeData.relateduserid;
                 mergeTwoObj(formState, secondeData);
             }
-            
         });
         function getRoleName() {
-          const item = props.userList.find(e => e.roleid === props.secondeData.relateduserid)
-          return item ? item.rolename : '--'
+            const item = props.userList.find((e) => e.roleid === props.secondeData.relateduserid);
+            return item ? item.rolename : '--';
         }
         // 增加accountid 就是修改
         function submit() {
@@ -171,7 +159,7 @@ export default defineComponent({
                     modifierid: Number(getLongTypeLoginID()), // uint64 修改人
                     areauserid: getUserId(), // uint64 机构用户ID
                 };
-        
+
                 requestResultLoadingAndInfo(hedgeOutMainReq, reqParam, loading, ['修改期货子账户成功', '修改期货子账户失败:']).then(() => {
                     cancel();
                     context.emit('refresh');