Browse Source

新增交易员

huangbin 4 năm trước cách đây
mục cha
commit
42d36acf65

+ 156 - 0
src/views/information/account_info/compoments/add-child-traders/index.vue

@@ -0,0 +1,156 @@
+<template>
+  <!-- 新增交易员 -->
+  <a-modal class="commonModal add-traders"
+           title="新增交易员"
+           v-model:visible="visible"
+           @cancel="cancel"
+           centered
+           :loading="loading"
+           :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="">
+            <span class="white">{{selectedData.rolename}}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="账户名称"
+                       name="logincode">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     v-model:value="formState.logincode"
+                     placeholder="请输入账户名称" />
+          </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="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="mobile">
+            <a-input class="dialogInput"
+                     v-model:value="formState.mobile"
+                     style="width: 200px"
+                     placeholder="请输入手机号码" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="24">
+          <a-form-item label="授权期货账户"
+                       class="checkboxGroupItem"
+                       name="logintaaccounts">
+            <a-checkbox-group class="commonCheckboxGroup"
+                              v-model:value="formState.logintaaccounts">
+              <a-row>
+                <a-col :span="12"
+                       v-for="(item, index) in accountList"
+                       :key="index"
+                       :class="[index > 1 ? 'mt10' : '']">
+                  <a-checkbox :value="item.accountid">{{item.accountname}}/{{item.accountid}}</a-checkbox>
+                </a-col>
+              </a-row>
+            </a-checkbox-group>
+          </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, PropType } from 'vue';
+import { ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { handleBusinessForm } from '../setup';
+import { validateAction } from '@/common/setup/form';
+import { BusinessFormState } from '../interface';
+import { loginAccountOperate } from '@/services/proto/accountinfo';
+import { LoginaccountOperateReq, LoginTaaccount } from '@/services/proto/accountinfo/interface';
+
+export default defineComponent({
+    name: 'account_info_trade_btn_add',
+    components: {},
+    props: {
+        selectedData: {
+            default: {},
+            type: Object as PropType<ErmcpLoginUserEx>,
+        },
+        accountList: {
+            default: {},
+            type: Object as PropType<ErmcpTaAccount>,
+        },
+    },
+    setup(props, context) {
+        const loading = ref<boolean>(false);
+        // 控制关闭弹窗
+        const { visible, cancel } = closeModal('account_info_trade_btn_add');
+        const { rules, formState, formRef } = handleBusinessForm();
+        function submit() {
+            validateAction<BusinessFormState>(formRef, formState).then((res) => {
+                const reqParam: LoginaccountOperateReq = {
+                    operatetype: 10, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
+                    logincode: res.logincode, // string 登录账号
+                    accountname: res.accountname, // string 账户名称
+                    password: res.password, // string 登录密码(明文)
+                    mobile: res.mobile, // string 手机号码(明文)
+                    roleids: [props.selectedData.roleid], // uint64 账号角色
+                    userid: props.selectedData.roleid,
+                    logintaaccounts: res.logintaaccounts.map((res) => {
+                        const taAccount: LoginTaaccount = {
+                            accountid: res,
+                        };
+                        return taAccount;
+                    }), // LoginTaaccount 期货账户(勾选交易员必填)
+                };
+                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增交易员成功', '新增交易员失败:']).then(() => {
+                    cancel();
+                    context.emit('refresh');
+                });
+            });
+        }
+        return {
+            formState,
+            rules,
+            formRef,
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.add-traders {
+}
+</style
+>;
+

+ 33 - 80
src/views/information/account_info/compoments/add-traders/index.vue

@@ -1,11 +1,10 @@
 <template>
-  <!-- 新增交易 -->
+  <!-- 新增交易用户 -->
   <a-modal class="commonModal add-traders"
-           title="新增交易"
+           title="新增交易用户"
            v-model:visible="visible"
            @cancel="cancel"
            centered
-           :loading="loading"
            :maskClosable="false"
            width="890px">
     <template #footer>
@@ -20,62 +19,21 @@
             :rules="rules">
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="所属用户"
-                       name="">
-            <span class="white">{{selectedData.rolename}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="logincode">
+          <a-form-item label="用户名称"
+                       name="rolename">
             <a-input class="dialogInput"
                      style="width: 200px"
-                     v-model:value="formState.logincode"
+                     v-model:value="formState.rolename"
                      placeholder="请输入账户名称" />
           </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="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="mobile">
             <a-input class="dialogInput"
-                     v-model:value="formState.mobile"
                      style="width: 200px"
-                     placeholder="请输入手机号码" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="24">
-          <a-form-item label="授权期货账户"
-                       class="checkboxGroupItem"
-                       name="logintaaccounts">
-            <a-checkbox-group class="commonCheckboxGroup"
-                              v-model:value="formState.logintaaccounts">
-              <a-row>
-                <a-col :span="12"
-                       v-for="(item, index) in accountList"
-                       :key="index"
-                       :class="[index > 1 ? 'mt10' : '']">
-                  <a-checkbox :value="item.accountid">{{item.accountname}}/{{item.accountid}}</a-checkbox>
-                </a-col>
-              </a-row>
-            </a-checkbox-group>
+                     v-model:value="formState.mobile"
+                     placeholder="请输入登录账号" />
           </a-form-item>
         </a-col>
       </a-row>
@@ -85,51 +43,47 @@
 
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, PropType } from 'vue';
-import { ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
+import { defineComponent, ref, PropType, watchEffect } from 'vue';
+import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
+import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { handleBusinessForm } from '../setup';
-import { validateAction } from '@/common/setup/form';
-import { BusinessFormState } from '../interface';
 import { loginAccountOperate } from '@/services/proto/accountinfo';
-import { LoginaccountOperateReq, LoginTaaccount } from '@/services/proto/accountinfo/interface';
+import { mergeTwoObj } from '@/utils/objHandle';
+import { validateAction } from '@/common/setup/form';
+import { handleTradeForm } from '../setup';
+import { TraderFormState } from '../interface';
 
 export default defineComponent({
-    name: 'account_info_trade_btn_add',
-    components: {},
+    name: 'account_info_trade_btn_modify',
     props: {
         selectedData: {
-            default: {},
             type: Object as PropType<ErmcpLoginUserEx>,
-        },
-        accountList: {
             default: {},
-            type: Object as PropType<ErmcpTaAccount>,
         },
     },
     setup(props, context) {
-        const loading = ref<boolean>(false);
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_add');
-        const { rules, formState, formRef } = handleBusinessForm();
+        const { visible, cancel } = closeModal('account_info_trade_btn_modify');
+        const loading = ref<boolean>(false);
+        const { rules, formState, formRef } = handleTradeForm();
+        watchEffect(() => {
+            if (visible.value) {
+                const { selectedData } = props;
+                mergeTwoObj(formState, selectedData);
+                console.log('selectedData', selectedData);
+            }
+        });
         function submit() {
-            validateAction<BusinessFormState>(formRef, formState).then((res) => {
+            validateAction<TraderFormState>(formRef, formState).then((res) => {
                 const reqParam: LoginaccountOperateReq = {
-                    operatetype: 10, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
-                    logincode: res.logincode, // string 登录账号
-                    accountname: res.accountname, // string 账户名称
-                    password: res.password, // string 登录密码(明文)
-                    mobile: res.mobile, // string 手机号码(明文)
-                    roleids: [props.selectedData.roleid], // uint64 账号角色
+                    operatetype: 1, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
                     userid: props.selectedData.roleid,
-                    logintaaccounts: res.logintaaccounts.map((res) => {
-                        const taAccount: LoginTaaccount = {
-                            accountid: res,
-                        };
-                        return taAccount;
-                    }), // LoginTaaccount 期货账户(勾选交易员必填)
+                    roleids: [24],
+                    logintaaccounts: [],
+                    mobile: res.mobile, // string 手机号码(明文)
+                    accountname: res.rolename,
                 };
-                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增交易员成功', '新增交易员失败:']).then(() => {
+                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改成功', '修改失败:']).then(() => {
                     cancel();
                     context.emit('refresh');
                 });
@@ -152,5 +106,4 @@ export default defineComponent({
 .add-traders {
 }
 </style
->;
-
+>;

+ 5 - 0
src/views/information/account_info/compoments/interface.ts

@@ -17,4 +17,9 @@ export interface ResetPasswordFormState {
     comfirePassword: string
     mobile?: string // 手机号码(明文)
     roleids?: number[]; // uint64 账号角色
+}
+
+export interface TraderFormState {
+    rolename: string; // 角色名称(交易账户->用户名称)
+    mobile: string; // 手机号
 }

+ 163 - 0
src/views/information/account_info/compoments/modify-child-traders/index.vue

@@ -0,0 +1,163 @@
+<template>
+  <!-- 修改交易员 -->
+  <a-modal class="commonModal add-traders"
+           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="">
+            <span class="white">{{rolename}}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="账户名称"
+                       name="logincode">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     v-model:value="formState.logincode"
+                     placeholder="请输入账户名称" />
+          </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="mobile">
+            <a-input class="dialogInput"
+                     v-model:value="formState.mobile"
+                     style="width: 200px"
+                     placeholder="请输入手机号码" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="24">
+          <a-form-item label="授权期货账户"
+                       class="checkboxGroupItem"
+                       name="logintaaccounts">
+            <a-checkbox-group class="commonCheckboxGroup"
+                              v-model:value="formState.logintaaccounts">
+              <a-row>
+                <a-col :span="12"
+                       v-for="(item, index) in accountList"
+                       :key="index"
+                       :class="[index > 1 ? 'mt10' : '']">
+                  <a-checkbox :value="item.accountid">{{item.accountname}}/{{item.accountid}}</a-checkbox>
+                </a-col>
+              </a-row>
+            </a-checkbox-group>
+          </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, PropType, watchEffect } from 'vue';
+import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
+import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { loginAccountOperate } from '@/services/proto/accountinfo';
+import { handleBusinessForm, handleRoleName } from '../setup';
+import { mergeTwoObj } from '@/utils/objHandle';
+import { validateAction } from '@/common/setup/form';
+import { BusinessFormState } from '../interface';
+
+export default defineComponent({
+    name: 'account_info_trade_btn_child_modify',
+    props: {
+        selectedData: {
+            type: Object as PropType<ErmcpLoginUser>,
+            default: {},
+        },
+        tableList: {
+            type: Array as PropType<ErmcpLoginUserEx[]>,
+            default: [],
+        },
+        accountList: {
+            default: [],
+            type: Object as PropType<ErmcpTaAccount[]>,
+        },
+    },
+    setup(props, context) {
+        // 控制关闭弹窗
+        const { visible, cancel } = closeModal('account_info_trade_btn_child_modify');
+        const loading = ref<boolean>(false);
+        const { rules, formState, formRef } = handleBusinessForm();
+        const { rolename, getRoleName } = handleRoleName();
+        watchEffect(() => {
+            if (visible.value) {
+                const { selectedData, tableList } = props;
+                mergeTwoObj(formState, selectedData);
+                getRoleName(tableList, selectedData);
+                formState.logintaaccounts = selectedData.acclist.map((e) => e.accountid);
+                formState.accountname = props.selectedData.loginname;
+            }
+        });
+        function submit() {
+            validateAction<BusinessFormState>(formRef, formState).then((res) => {
+                const reqParam: LoginaccountOperateReq = {
+                    operatetype: 13, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
+                    // logincode: res.logincode, // string 登录账号
+                    // accountname: res.accountname, // string 账户名称
+                    // password: res.password, // string 登录密码(明文)
+                    // mobile: res.mobile, // string 手机号码(明文)
+                    // roleids: [props.selectedData.roleid], // uint64 账号角色
+                    // loginid = obj.loginid
+                    // userid = obj.userid
+                    // logintaaccounts: res.logintaaccounts.map(res => {
+                    //     const taAccount: LoginTaaccount = {
+                    //         accountid: res
+                    //     };
+                    //     return taAccount
+                    // }), // LoginTaaccount 期货账户(勾选交易员必填)
+                };
+                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改交易员成功', '修改交易员失败:']).then(() => {
+                    cancel();
+                    context.emit('refresh');
+                });
+            });
+        }
+        return {
+            formState,
+            rules,
+            formRef,
+            rolename,
+            // cardTypeList,
+            // isPersonal,
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.add-traders {
+}
+</style
+>;

+ 0 - 113
src/views/information/account_info/compoments/modify-traders-self/index.vue

@@ -1,113 +0,0 @@
-<template>
-  <!-- 修改交易用户 -->
-  <a-modal class="commonModal add-traders"
-           title="修改交易用户"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           :maskClosable="false"
-           width="890px">
-    <template #footer>
-      <a-button key="cancel"
-                type="primary"
-                @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="rolename">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     v-model:value="formState.rolename"
-                     placeholder="请输入账户名称" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="手机号码"
-                       name="mobile">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     v-model:value="formState.mobile"
-                     placeholder="请输入登录账号" />
-          </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, PropType, watchEffect } from 'vue';
-import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
-import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { loginAccountOperate } from '@/services/proto/accountinfo';
-import { handleForm } from './setup';
-import { mergeTwoObj } from '@/utils/objHandle';
-import { validateAction } from '@/common/setup/form';
-import { FormState } from './interface';
-import { getLongTypeLoginID } from '@/services/bus/login';
-
-export default defineComponent({
-    name: 'account_info_trade_btn_modify',
-    props: {
-        selectedData: {
-            type: Object as PropType<ErmcpLoginUserEx>,
-            default: {},
-        },
-    },
-    setup(props, context) {
-        // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_modify');
-        const loading = ref<boolean>(false);
-        const { rules, formState, formRef } = handleForm();
-        watchEffect(() => {
-            if (visible.value) {
-                const { selectedData } = props;
-                mergeTwoObj(formState, selectedData);
-                console.log('selectedData', selectedData);
-            }
-        });
-        function submit() {
-            validateAction<FormState>(formRef, formState).then((res) => {
-                const reqParam: LoginaccountOperateReq = {
-                    operatetype: 2, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
-                    userid: props.selectedData.roleid,
-                    roleids: [24],
-                    logintaaccounts: [],
-                    mobile: res.mobile, // string 手机号码(明文)
-                    accountname: res.rolename,
-                };
-                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改成功', '修改失败:']).then(() => {
-                    cancel();
-                    context.emit('refresh');
-                });
-            });
-        }
-        return {
-            formState,
-            rules,
-            formRef,
-            visible,
-            cancel,
-            submit,
-            loading,
-        };
-    },
-});
-</script>
-
-<style lang="less">
-.add-traders {
-}
-</style
->;

+ 0 - 4
src/views/information/account_info/compoments/modify-traders-self/interface.ts

@@ -1,4 +0,0 @@
-export interface FormState {
-    rolename: string; // 角色名称(交易账户->用户名称)
-    mobile: string; // 手机号
-}

+ 0 - 19
src/views/information/account_info/compoments/modify-traders-self/setup.ts

@@ -1,19 +0,0 @@
-import { reactive, ref, UnwrapRef } from "vue";
-import { FormState } from "./interface";
-
-/**
- * 表单
- * @returns 
- */
-export function handleForm() {
-    const formRef = ref();
-    const formState: UnwrapRef<FormState> = reactive({
-        rolename: '',
-        mobile: '',
-    })
-    const rules = {
-        rolename: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
-        mobile: [{ required: true, message: '请输入手机号码', trigger: 'blur' }],
-    }
-    return { rules, formState, formRef }
-}

+ 28 - 79
src/views/information/account_info/compoments/modify-traders/index.vue

@@ -1,17 +1,20 @@
 <template>
-  <!-- 修改交易 -->
+  <!-- 修改交易用户 -->
   <a-modal class="commonModal add-traders"
-           title="修改交易"
+           title="修改交易用户"
            v-model:visible="visible"
            @cancel="cancel"
            centered
            :maskClosable="false"
            width="890px">
     <template #footer>
+      <a-button key="cancel"
+                type="primary"
+                @click="cancel">取消</a-button>
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">完成</a-button>
+                @click="submit">修改</a-button>
     </template>
     <a-form class="inlineForm"
             ref="formRef"
@@ -19,53 +22,21 @@
             :rules="rules">
       <a-row :gutter="24">
         <a-col :span="12">
-          <a-form-item label="所属用户"
-                       name="">
-            <span class="white">{{rolename}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="logincode">
+          <a-form-item label="用户名称"
+                       name="rolename">
             <a-input class="dialogInput"
                      style="width: 200px"
-                     v-model:value="formState.logincode"
+                     v-model:value="formState.rolename"
                      placeholder="请输入账户名称" />
           </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="mobile">
             <a-input class="dialogInput"
-                     v-model:value="formState.mobile"
                      style="width: 200px"
-                     placeholder="请输入手机号码" />
-          </a-form-item>
-        </a-col>
-        <a-col :span="24">
-          <a-form-item label="授权期货账户"
-                       class="checkboxGroupItem"
-                       name="logintaaccounts">
-            <a-checkbox-group class="commonCheckboxGroup"
-                              v-model:value="formState.logintaaccounts">
-              <a-row>
-                <a-col :span="12"
-                       v-for="(item, index) in accountList"
-                       :key="index"
-                       :class="[index > 1 ? 'mt10' : '']">
-                  <a-checkbox :value="item.accountid">{{item.accountname}}/{{item.accountid}}</a-checkbox>
-                </a-col>
-              </a-row>
-            </a-checkbox-group>
+                     v-model:value="formState.mobile"
+                     placeholder="请输入登录账号" />
           </a-form-item>
         </a-col>
       </a-row>
@@ -76,65 +47,46 @@
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
 import { defineComponent, ref, PropType, watchEffect } from 'vue';
-import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount } from '@/services/go/ermcp/account/interface';
+import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import { LoginaccountOperateReq } from '@/services/proto/accountinfo/interface';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { loginAccountOperate } from '@/services/proto/accountinfo';
-import { handleBusinessForm, handleRoleName } from '../setup';
 import { mergeTwoObj } from '@/utils/objHandle';
 import { validateAction } from '@/common/setup/form';
-import { BusinessFormState } from '../interface';
+import { handleTradeForm } from '../setup';
+import { TraderFormState } from '../interface';
 
 export default defineComponent({
-    name: 'account_info_trade_btn_child_modify',
+    name: 'account_info_trade_btn_modify',
     props: {
         selectedData: {
-            type: Object as PropType<ErmcpLoginUser>,
+            type: Object as PropType<ErmcpLoginUserEx>,
             default: {},
         },
-        tableList: {
-            type: Array as PropType<ErmcpLoginUserEx[]>,
-            default: [],
-        },
-        accountList: {
-            default: [],
-            type: Object as PropType<ErmcpTaAccount[]>,
-        },
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_child_modify');
+        const { visible, cancel } = closeModal('account_info_trade_btn_modify');
         const loading = ref<boolean>(false);
-        const { rules, formState, formRef } = handleBusinessForm();
-        const { rolename, getRoleName } = handleRoleName();
+        const { rules, formState, formRef } = handleTradeForm();
         watchEffect(() => {
             if (visible.value) {
-                const { selectedData, tableList } = props;
+                const { selectedData } = props;
                 mergeTwoObj(formState, selectedData);
-                getRoleName(tableList, selectedData);
-                formState.logintaaccounts = selectedData.acclist.map((e) => e.accountid);
-                formState.accountname = props.selectedData.loginname;
+                console.log('selectedData', selectedData);
             }
         });
         function submit() {
-            validateAction<BusinessFormState>(formRef, formState).then((res) => {
+            validateAction<TraderFormState>(formRef, formState).then((res) => {
                 const reqParam: LoginaccountOperateReq = {
-                    operatetype: 13, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
-                    // logincode: res.logincode, // string 登录账号
-                    // accountname: res.accountname, // string 账户名称
-                    // password: res.password, // string 登录密码(明文)
-                    // mobile: res.mobile, // string 手机号码(明文)
-                    // roleids: [props.selectedData.roleid], // uint64 账号角色
-                    // loginid = obj.loginid
-                    // userid = obj.userid
-                    // logintaaccounts: res.logintaaccounts.map(res => {
-                    //     const taAccount: LoginTaaccount = {
-                    //         accountid: res
-                    //     };
-                    //     return taAccount
-                    // }), // LoginTaaccount 期货账户(勾选交易员必填)
+                    operatetype: 2, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
+                    userid: props.selectedData.roleid,
+                    roleids: [24],
+                    logintaaccounts: [],
+                    mobile: res.mobile, // string 手机号码(明文)
+                    accountname: res.rolename,
                 };
-                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改交易员成功', '修改交易员失败:']).then(() => {
+                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改成功', '修改失败:']).then(() => {
                     cancel();
                     context.emit('refresh');
                 });
@@ -144,9 +96,6 @@ export default defineComponent({
             formState,
             rules,
             formRef,
-            rolename,
-            // cardTypeList,
-            // isPersonal,
             visible,
             cancel,
             submit,

+ 18 - 1
src/views/information/account_info/compoments/setup.ts

@@ -1,6 +1,6 @@
 import { ErmcpLoginUser, ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
 import { reactive, ref, UnwrapRef } from "vue";
-import { BusinessFormState, ResetPasswordFormState } from './interface';
+import { BusinessFormState, ResetPasswordFormState, TraderFormState } from './interface';
 
 
 /**
@@ -80,4 +80,21 @@ export function handlePasswordForm() {
 
     }
     return { rules, formState, formRef }
+}
+
+/**
+ * 
+ * @returns 交易用户
+ */
+export function handleTradeForm() {
+    const formRef = ref();
+    const formState: UnwrapRef<TraderFormState> = reactive({
+        rolename: '',
+        mobile: '',
+    })
+    const rules = {
+        rolename: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
+        mobile: [{ required: true, message: '请输入手机号码', trigger: 'blur' }],
+    }
+    return { rules, formState, formRef }
 }

+ 9 - 9
src/views/information/account_info/list/account_info_trade/index.vue

@@ -59,9 +59,9 @@
         </a-collapse>
       </a-collapse-panel>
     </a-collapse>
-    <Add @refresh="handleBtnAction"
-         :accountList="accountList"
-         :selectedData="addModelData" />
+    <AddChild @refresh="handleBtnAction"
+              :accountList="accountList"
+              :selectedData="addModelData" />
     <Modify @refresh="handleBtnAction"
             :accountList="accountList"
             :tableList="tableList"
@@ -85,8 +85,8 @@
     <Detail :selectedData="moreModelData"
             :accountList="accountList"
             :tableList="tableList" />
-    <ModifySelf @refresh="handleBtnAction"
-                :selectedData="addModelData" />
+    <ModifyChild @refresh="handleBtnAction"
+                 :selectedData="addModelData" />
   </div>
 </template>
 
@@ -96,13 +96,13 @@ import filterCustomTable from '@/views/information/goods/components/filterTable/
 import { getRoleTypeName } from '../setup';
 import { getUserName } from '@/services/bus/user';
 import Modify from '../../compoments/modify-traders/index.vue';
-import Add from '../../compoments/add-traders/index.vue';
+import AddChild from '../../compoments/add-child-traders/index.vue';
 import Locked from '../../compoments/locked-trader/index.vue';
 import Unlocked from '../../compoments/unlocked-trader/index.vue';
 import Cancel from '../../compoments/cancel-trader/index.vue';
 import Reset from '../../compoments/reset-trader/index.vue';
 import Detail from '../../compoments/detail-trader/index.vue';
-import ModifySelf from '../../compoments/modify-traders-self/index.vue';
+import ModifyChild from '../../compoments/modify-child-traders/index.vue';
 import { handleModalData, handleTableList } from '../setup';
 import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import { ref } from 'vue';
@@ -117,13 +117,13 @@ export default defineComponent({
         BtnList,
         filterCustomTable,
         Modify,
-        Add,
+        AddChild,
         Locked,
         Unlocked,
         Cancel,
         Reset,
         Detail,
-        ModifySelf,
+        ModifyChild,
     },
     setup() {
         // 加载状态