Pārlūkot izejas kodu

新增交易用户

huangbin 4 gadi atpakaļ
vecāks
revīzija
ea76979153

+ 2 - 1
src/common/constants/buttonType.ts

@@ -31,7 +31,8 @@ export interface ButtonType {
     account_info_business_btn_cancel: string; // 业务账户 注销
     account_info_business_btn_unlocked: string; // 业务账户 解锁
 
-    account_info_trade_btn_add: string; // 交易账户 新增
+    account_info_trade_btn_add: string; // 交易员 新增
+    account_info_trade_child_btn_add: string; // 交易账户 新增
     account_info_trade_btn_modify: string; // 交易账户 修改
     account_info_trade_btn_child_modify: string; // 交易子账户 修改
     account_info_trade_btn_child_locked: string; // 交易账户 锁定

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

@@ -95,7 +95,7 @@ import { loginAccountOperate } from '@/services/proto/accountinfo';
 import { LoginaccountOperateReq, LoginTaaccount } from '@/services/proto/accountinfo/interface';
 
 export default defineComponent({
-    name: 'account_info_trade_btn_add',
+    name: 'account_info_trade_child_btn_add',
     components: {},
     props: {
         selectedData: {
@@ -110,7 +110,7 @@ export default defineComponent({
     setup(props, context) {
         const loading = ref<boolean>(false);
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_add');
+        const { visible, cancel } = closeModal('account_info_trade_child_btn_add');
         const { rules, formState, formRef } = handleBusinessForm();
         function submit() {
             validateAction<BusinessFormState>(formRef, formState).then((res) => {

+ 4 - 11
src/views/information/account_info/compoments/add-traders/index.vue

@@ -43,18 +43,17 @@
 
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, PropType, watchEffect } from 'vue';
+import { defineComponent, ref, PropType } 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 { 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_modify',
+    name: 'account_info_trade_btn_add',
     props: {
         selectedData: {
             type: Object as PropType<ErmcpLoginUserEx>,
@@ -63,15 +62,9 @@ export default defineComponent({
     },
     setup(props, context) {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_trade_btn_modify');
+        const { visible, cancel } = closeModal('account_info_trade_btn_add');
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleTradeForm();
-        watchEffect(() => {
-            if (visible.value) {
-                const { selectedData } = props;
-                mergeTwoObj(formState, selectedData);
-            }
-        });
         function submit() {
             validateAction<TraderFormState>(formRef, formState).then((res) => {
                 const reqParam: LoginaccountOperateReq = {
@@ -82,7 +75,7 @@ export default defineComponent({
                     mobile: res.mobile, // string 手机号码(明文)
                     accountname: res.rolename,
                 };
-                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['修改成功', '修改失败:']).then(() => {
+                requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增成功', '新增失败:']).then(() => {
                     cancel();
                     context.emit('refresh');
                 });

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

@@ -11,6 +11,7 @@
         </svg>
         {{getUserName()}}
       </span>
+      <BtnList :btnList="firstBtn" />
     </div>
     <a-collapse class="spotCollapse"
                 v-for="(item, i) in tableList"
@@ -36,7 +37,7 @@
             </a-col>
             <a-col :span="12">
               <BtnList :selectedData="item"
-                       :btnList="firstBtn"
+                       :btnList="secondBtn"
                        @onClick="openAction" />
             </a-col>
           </a-row>
@@ -59,6 +60,8 @@
         </a-collapse>
       </a-collapse-panel>
     </a-collapse>
+    <Add @refresh="handleBtnAction"
+         :selectedData="addModelData" />
     <AddChild @refresh="handleBtnAction"
               :accountList="accountList"
               :selectedData="addModelData" />
@@ -96,6 +99,7 @@ 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';
@@ -117,6 +121,7 @@ export default defineComponent({
         BtnList,
         filterCustomTable,
         Modify,
+        Add,
         AddChild,
         Locked,
         Unlocked,
@@ -129,7 +134,7 @@ export default defineComponent({
         // 加载状态
         const loading = ref<boolean>(false);
         const { tableList, queryTable } = handlerManagerList(loading, 2);
-        const [firstBtn, secondBtn] = _getBtnList('account_info_trade', true).value;
+        const [firstBtn, secondBtn, thirdBtn] = _getBtnList('account_info_trade', true).value;
         // 新增弹窗
         const { selectedData: addModelData, openAction } = handleModalData<ErmcpLoginUserEx>();
         // 修改 重置密码、详情等弹窗
@@ -160,6 +165,7 @@ export default defineComponent({
         return {
             firstBtn,
             secondBtn,
+            thirdBtn,
             loading,
             search,
             tableList,