Kaynağa Gözat

修改期货子账户

huangbin 4 yıl önce
ebeveyn
işleme
aaddb7e371

+ 28 - 24
src/views/information/account_info/compoments/modify-futures-son/index.vue

@@ -8,10 +8,10 @@
            :maskClosable="false"
            width="890px">
     <template #footer>
-        <a-button key="cancel"
-                  type="primary"
-                  :loading="loading"
-                  @click="cancel">取消</a-button>
+      <a-button key="cancel"
+                type="primary"
+                :loading="loading"
+                @click="cancel">取消</a-button>
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
@@ -95,8 +95,9 @@ 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 { ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
+import { ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import { mergeTwoObj } from '@/utils/objHandle';
+import { ErmcpTradeConfigTMP } from '@/services/go/ermcp/business-review/interface';
 
 export default defineComponent({
     name: 'account_info_futures_btn_child_modify',
@@ -110,6 +111,18 @@ export default defineComponent({
             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: [],
+        },
     },
     setup(props, context) {
         // 控制关闭弹窗
@@ -117,27 +130,21 @@ export default defineComponent({
 
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleBusinessForm();
-        // 交易用户
-        const { tableList, queryTable } = handlerManagerList(loading, 2);
-        // 交易模板
-        const { marginList, feeList, queryTemplate } = handleTradeTemplate();
         watchEffect(() => {
             if (visible.value) {
               // 默认第一个 服务只放回一个,这里是个坑
-                queryTable().then(() => {
-                  if(tableList.value.length) {
-                    formState.traderUserId = tableList.value[0].roleid
-                  }
-                });
-                queryTemplate().then(() => {
-                  if(marginList.value.length) {
-                    formState.trademargintmpid = marginList.value[0].tradeconfigtmpid
+              const {userList, secondeData, marginList,
+            feeList} = props
+            if (userList.length) {
+              formState.traderUserId = userList[0].roleid
+            }
+                if(marginList.length) {
+                    formState.trademargintmpid = marginList[0].tradeconfigtmpid
                   }
-                  if(feeList.value.length) {
-                    formState.tradefeetmpid = feeList.value[0].tradeconfigtmpid
+                  if(feeList.length) {
+                    formState.tradefeetmpid = feeList[0].tradeconfigtmpid
                   }
-                });
-                mergeTwoObj(formState, props.secondeData);
+                mergeTwoObj(formState, secondeData);
             }
             
         });
@@ -178,9 +185,6 @@ export default defineComponent({
             formRef,
             visible,
             cancel,
-            tableList,
-            marginList,
-            feeList,
             submit,
             loading,
         };

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

@@ -67,6 +67,9 @@
     <Modify :selectedData="firstData"
             @refresh="queryTable" />
     <ModifyChild @refresh="queryTable"
+                 :userList="userList"
+                 :marginList="marginList"
+                 :feeList="feeList"
                  :secondeData="secondeData"
                  :selectedData="firstData" />
     <Detail :selectedData="firstData"