Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

yu.jie 4 anni fa
parent
commit
c3ccf17a7f

+ 4 - 4
src/services/go/ermcp/account/index.ts

@@ -1,5 +1,6 @@
 /** ================================= 账户管理 ================================**/
 import APP from "@/services";
+import { getUserId } from "@/services/bus/account";
 import { commonSearch_go } from "@/services/go";
 import {
     ErmcpBizGroupEx,
@@ -7,7 +8,6 @@ import {
     ErmcpLoginUserEx, ErmcpRole, ErmcpRoleMenuEx,
     ErmcpTaAccountEx
 } from "@/services/go/ermcp/account/interface";
-import {getUserId} from "@/services/bus/account";
 
 /**
  * 查询业务类型分组(账户管理/账户设置) /Ermcp/QueryAccMgrBizGroupSet
@@ -25,7 +25,7 @@ export function QueryAccMgrBizGroupSet(req: ErmcpBizGroupReq): Promise<ErmcpBizG
  * 查询账户管理期货账号(账户管理/期货账号)  /Ermcp/QueryAccMgrTaaccount
  * @constructor
  */
-export function QueryAccMgrTaaccount(): Promise<ErmcpTaAccountEx> {
+export function QueryAccMgrTaaccount(): Promise<ErmcpTaAccountEx[]> {
     const userid = APP.get('userAccount').memberuserid;
     return commonSearch_go('/Ermcp/QueryAccMgrTaaccount', { userid }).catch((err) => {
         throw new Error(`查询账户管理期货账号: ${err.message}`);
@@ -63,7 +63,7 @@ export function QueryFuturesCompany(): Promise<ErmcpFuturesCompany> {
  */
 export function QueryAccMgrRoleMenu(roleid: string): Promise<ErmcpRoleMenuEx> {
     const userid = getUserId()
-    return commonSearch_go('/Ermcp/QueryAccMgrRoleMenu', {roleid, userid}).catch((err) => {
+    return commonSearch_go('/Ermcp/QueryAccMgrRoleMenu', { roleid, userid }).catch((err) => {
         throw new Error(`查询账户管理角色详情: ${err.message}`);
     });
 }
@@ -74,7 +74,7 @@ export function QueryAccMgrRoleMenu(roleid: string): Promise<ErmcpRoleMenuEx> {
  */
 export function QueryAccMgrRole(): Promise<ErmcpRole> {
     const userid = getUserId()
-    return commonSearch_go('/Ermcp/QueryAccMgrRole', {userid}).catch((err) => {
+    return commonSearch_go('/Ermcp/QueryAccMgrRole', { userid }).catch((err) => {
         throw new Error(`查询账户管理角色设置: ${err.message}`);
     });
 }

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

@@ -79,7 +79,7 @@ export default defineComponent({
     components: {},
     setup() {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_business_btn_add');
+        const { visible, cancel } = closeModal('account_info_manager_btn_add');
         // 证件类型
         // const cardTypeList = ref<AllEnums[]>(getCardType());
         // // 表单

+ 1 - 1
src/views/information/account_info/compoments/add-managers/index.vue

@@ -77,7 +77,7 @@ export default defineComponent({
     components: {},
     setup() {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_business_btn_add');
+        const { visible, cancel } = closeModal('account_info_manager_btn_add');
         // 证件类型
         // const cardTypeList = ref<AllEnums[]>(getCardType());
         // // 表单

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

@@ -97,7 +97,7 @@ export default defineComponent({
     components: {},
     setup() {
         // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_business_btn_add');
+        const { visible, cancel } = closeModal('account_info_trade_btn_add');
         // 证件类型
         // const cardTypeList = ref<AllEnums[]>(getCardType());
         // // 表单

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

@@ -95,7 +95,7 @@
 import { defineComponent, initData, getBtnList, contextMenu, BtnList } from '@/common/export/table';
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
 import { ref } from 'vue';
-import { handleAccountManager } from '../setup';
+import { handleBusinessAccount } from './setup';
 import { getLoginStatusEnumItemName } from '@/common/constants/enumsName';
 import Add from '../../compoments/add-business/index.vue';
 import Modify from '../../compoments/modify-business/index.vue';
@@ -118,7 +118,7 @@ export default defineComponent({
         Detail,
     },
     setup() {
-        const { businesserList, merchandiserList, getBusinesserList } = handleAccountManager();
+        const { businesserList, merchandiserList, getBusinesserList } = handleBusinessAccount();
 
         const { commonBtn, forDataBtn } = getBtnList('account_info_business', true);
         const loading = ref<boolean>(false);

+ 47 - 0
src/views/information/account_info/list/account_info_business/setup.ts

@@ -0,0 +1,47 @@
+import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
+import { ErmcpLoginUser } from "@/services/go/ermcp/account/interface";
+import { message } from "ant-design-vue";
+import { ref } from "vue";
+
+export function handleBusinessAccount() {
+    // 处理 跟单员 /  业务员 列表
+    function handleList(el: ErmcpLoginUser, type: string, set: Set<number>): ErmcpLoginUser | null {
+        const { userid, roletype } = el;
+        let result = null
+        if (roletype.includes(type)) {  // 过滤角色类型
+            if (!set.has(userid)) { // 去重
+                set.add(userid)
+                result = el
+            }
+        }
+        return result
+    }
+    // 业务员
+    const businesserList = ref<ErmcpLoginUser[]>([])
+    // 跟单员
+    const merchandiserList = ref<ErmcpLoginUser[]>([])
+    function getBusinesserList() {
+        QueryAccMgrLoginUser(1).then(res => {
+            const bSet = new Set<number>([]);
+            const mSet = new Set<number>([]);
+            const list: ErmcpLoginUser[] = []
+            res.forEach(e => {
+                // eslint-disable-next-line prefer-spread
+                list.push.apply(list, e.userlist)
+            })
+            list.forEach(el => {
+                // 业务员
+                const b = handleList(el, '22', bSet)
+                if (b) {
+                    businesserList.value.push(b)
+                }
+                // 跟单员
+                const m = handleList(el, '23', mSet)
+                if (m) {
+                    merchandiserList.value.push(m)
+                }
+            })
+        }).catch(err => message.error(err))
+    }
+    return { businesserList, merchandiserList, getBusinesserList }
+}

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

@@ -2,59 +2,96 @@
   <!-- 期货账户 -->
   <div class="account_info_futures"
        :loading="loading">
-    期货账户
+    <filterCustomTable @search="search"></filterCustomTable>
+    <div class="tltLeft">
+      <span class="blue">
+        <svg class="icon svg-icon"
+             aria-hidden="true">
+          <use xlink:href="#icon-shuzhuangtu"></use>
+        </svg>
+        {{getUserName()}}
+      </span>
+    </div>
+    <a-collapse class="spotCollapse"
+                v-for="(item, i) in futuresList"
+                :key="i + '11'"
+                :bordered="false">
+      <template #expandIcon="props">
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-if="props.isActive == 0">
+          <use xlink:href="#icon-shouqi1"></use>
+        </svg>
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-else>
+          <use xlink:href="#icon-shouqi2"></use>
+        </svg>
+      </template>
+      <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">
+              <BtnList :btnList="commonBtn" />
+            </a-col>
+          </a-row>
+        </template>
+        <a-collapse class="busyCollapse"
+                    v-for="(sub, i) in item.subacclist"
+                    :key="i + '11'"
+                    :bordered="false">
+          <a-collapse-panel :show-arrow="false">
+            <template #header>
+              <a-row class="contRow">
+                <a-col :span="12">{{sub.accountname}}</a-col>
+                <a-col :span="12">{{getAccountStatus(sub.tradestatus)}}</a-col>
+              </a-row>
+            </template>
+            <BtnList :btnList="forDataBtn" />
+          </a-collapse-panel>
+        </a-collapse>
+      </a-collapse-panel>
+    </a-collapse>
+    <Add />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-
-// import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom} from '../../compoments';
-// import {queryTableList,  QueryCustomInfoType} from '../index';
-import { getStatusName } from '@/views/information/custom/setup';
+import { defineComponent, initData, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
+import { ref } from 'vue';
+import { getAccountStatus } from '../setup';
+import { handleTradeAccount } from './setup';
+import { getUserName } from '@/services/bus/user';
+import Add from '../../compoments/add-futures/index.vue';
 
 export default defineComponent({
     name: 'account_info_futures',
     components: {
         contextMenu,
         BtnList,
+        Add,
     },
     setup() {
-        // // 表头数据
-        // const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
-        // // 表格事件
-        // const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QueryCustomInfoType>({});
-        // // 表格操作按钮列表
-        // const {commonBtn, forDataBtn} = getBtnList('custom_info_normal', true);
-        // // 表格列表数据
-        // const {loading, tableList, queryTable} = queryTableList(3);
-        // initData(() => {
-        //     // 获取列表数据
-        //     queryTable();
-        //     // 注册表头信息 过滤
-        //     registerColumn('table_pcweb_userinfo', );
-        // });
+        const { futuresList, getRoleList } = handleTradeAccount();
+        const { commonBtn, forDataBtn } = getBtnList('account_info_manager', true);
+        const loading = ref<boolean>(false);
+        initData(() => {
+            getRoleList();
+        });
 
-        // // 查询
-        // function search(value: any) {
-        //     filteredInfo.value = value;
-        //     // 更新表信息
-        //     updateColumn();
-        // }
+        // 查询
+        function search(value: any) {}
 
         return {
-            // columns,
-            // filteredInfo,
-            // expandedRowKeys,
-            // selectedRow,
-            // Rowclick,
-            // commonBtn,
-            // forDataBtn,
-            // loading,
-            // tableList,
-            // search,
-            // getStatusName,
-            // queryTable,
+            commonBtn,
+            forDataBtn,
+            loading,
+            search,
+            futuresList,
+            getAccountStatus,
+            getUserName,
         };
     },
 });

+ 26 - 0
src/views/information/account_info/list/account_info_futures/setup.ts

@@ -0,0 +1,26 @@
+import { QueryAccMgrTaaccount } from "@/services/go/ermcp/account";
+import { ErmcpTaAccountEx } from "@/services/go/ermcp/account/interface";
+import { message } from "ant-design-vue";
+import { ref } from "vue";
+
+export function handleTradeAccount() {
+    // 管理账户
+    const futuresList = ref<ErmcpTaAccountEx[]>([])
+    function getRoleList() {
+        QueryAccMgrTaaccount().then(res => {
+            futuresList.value = res;
+            // const set = new Set<number>([])
+            console.log('期货账户', res);
+
+            // managersList.value.length = 0;
+            // res.forEach(e => {
+            //     const { roleid } = e;
+            //     if (!set.has(roleid)) { // 去重
+            //         set.add(roleid)
+            //         managersList.value.push(e)
+            //     }
+            // })
+        }).catch(err => message.error(err))
+    }
+    return { futuresList, getRoleList }
+}

+ 76 - 38
src/views/information/account_info/list/account_info_manager/index.vue

@@ -2,59 +2,97 @@
   <!-- 管理账户 -->
   <div class="account_info_manager"
        :loading="loading">
-    管理账户
+    <filterCustomTable @search="search"></filterCustomTable>
+    <div class="tltLeft">
+      <span class="blue">
+        <svg class="icon svg-icon"
+             aria-hidden="true">
+          <use xlink:href="#icon-shuzhuangtu"></use>
+        </svg>
+        {{getUserName()}}
+      </span>
+    </div>
+    <a-collapse class="spotCollapse"
+                v-for="(item, i) in managersList"
+                :key="i + '11'"
+                :bordered="false">
+      <template #expandIcon="props">
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-if="props.isActive == 0">
+          <use xlink:href="#icon-shouqi1"></use>
+        </svg>
+        <svg class="icon svg-icon"
+             aria-hidden="true"
+             v-else>
+          <use xlink:href="#icon-shouqi2"></use>
+        </svg>
+      </template>
+      <a-collapse-panel>
+        <template #header>
+          <a-row class="headRow">
+            <a-col :span="12">{{item.rolename}}({{item.userlist.length}})</a-col>
+            <a-col :span="12">
+              <BtnList :btnList="commonBtn" />
+            </a-col>
+          </a-row>
+        </template>
+        <!-- <a-collapse class="busyCollapse"
+                    v-for="(item, i) in managersList"
+                    :key="i + '11'"
+                    :bordered="false">
+          <a-collapse-panel :show-arrow="false">
+            <template #header>
+              <a-row class="contRow">
+                <a-col :span="12">{{item.rolename}}</a-col>
+                <a-col :span="12">{{getAccountStatus(item.accountstatus)}}</a-col>
+              </a-row>
+            </template>
+            <BtnList :btnList="forDataBtn" />
+          </a-collapse-panel>
+        </a-collapse> -->
+      </a-collapse-panel>
+    </a-collapse>
+    <Add />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-
-// import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom} from '../../compoments';
-// import {queryTableList,  QueryCustomInfoType} from '../index';
-import { getStatusName } from '@/views/information/custom/setup';
+import { defineComponent, initData, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
+import { ref } from 'vue';
+import { getAccountStatus } from '../setup';
+import { handleTradeAccount } from './setup';
+import { getUserName } from '@/services/bus/user';
+import Add from '../../compoments/add-managers/index.vue';
 
 export default defineComponent({
     name: 'account_info_manager',
     components: {
         contextMenu,
         BtnList,
+        filterCustomTable,
+        Add,
     },
     setup() {
-        // // 表头数据
-        // const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
-        // // 表格事件
-        // const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QueryCustomInfoType>({});
-        // // 表格操作按钮列表
-        // const {commonBtn, forDataBtn} = getBtnList('custom_info_normal', true);
-        // // 表格列表数据
-        // const {loading, tableList, queryTable} = queryTableList(3);
-        // initData(() => {
-        //     // 获取列表数据
-        //     queryTable();
-        //     // 注册表头信息 过滤
-        //     registerColumn('table_pcweb_userinfo', );
-        // });
+        const { managersList, getRoleList } = handleTradeAccount();
+        const { commonBtn, forDataBtn } = getBtnList('account_info_manager', true);
+        const loading = ref<boolean>(false);
+        initData(() => {
+            getRoleList();
+        });
 
-        // // 查询
-        // function search(value: any) {
-        //     filteredInfo.value = value;
-        //     // 更新表信息
-        //     updateColumn();
-        // }
+        // 查询
+        function search(value: any) {}
 
         return {
-            // columns,
-            // filteredInfo,
-            // expandedRowKeys,
-            // selectedRow,
-            // Rowclick,
-            // commonBtn,
-            // forDataBtn,
-            // loading,
-            // tableList,
-            // search,
-            // getStatusName,
-            // queryTable,
+            commonBtn,
+            forDataBtn,
+            loading,
+            search,
+            managersList,
+            getAccountStatus,
+            getUserName,
         };
     },
 });

+ 26 - 0
src/views/information/account_info/list/account_info_manager/setup.ts

@@ -0,0 +1,26 @@
+import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
+import { ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
+import { message } from "ant-design-vue";
+import { ref } from "vue";
+
+export function handleTradeAccount() {
+    // 管理账户
+    const managersList = ref<ErmcpLoginUserEx[]>([])
+    function getRoleList() {
+        QueryAccMgrLoginUser(3).then(res => {
+            managersList.value = res;
+            // const set = new Set<number>([])
+            console.log('管理账户', res);
+
+            // managersList.value.length = 0;
+            // res.forEach(e => {
+            //     const { roleid } = e;
+            //     if (!set.has(roleid)) { // 去重
+            //         set.add(roleid)
+            //         managersList.value.push(e)
+            //     }
+            // })
+        }).catch(err => message.error(err))
+    }
+    return { managersList, getRoleList }
+}

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

@@ -52,6 +52,7 @@
       </a-collapse-panel>
     </a-collapse>
     <Modify />
+    <Add />
   </div>
 </template>
 
@@ -59,9 +60,11 @@
 import { defineComponent, initData, getBtnList, contextMenu, BtnList } from '@/common/export/table';
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
 import { ref } from 'vue';
-import { handleAccountManager, getAccountStatus } from '../setup';
+import { getAccountStatus } from '../setup';
+import { handleTradeAccount } from './setup';
 import { getUserName } from '@/services/bus/user';
 import Modify from '../../compoments/modify-traders/index.vue';
+import Add from '../../compoments/add-traders/index.vue';
 
 export default defineComponent({
     name: 'account_info_trade',
@@ -70,11 +73,10 @@ export default defineComponent({
         BtnList,
         filterCustomTable,
         Modify,
+        Add,
     },
     setup() {
-        const { traderList, getRoleList } = handleAccountManager();
-        console.log('traderList', traderList);
-
+        const { traderList, getRoleList } = handleTradeAccount();
         const { commonBtn, forDataBtn } = getBtnList('account_info_trade', true);
         const loading = ref<boolean>(false);
         initData(() => {

+ 23 - 0
src/views/information/account_info/list/account_info_trade/setup.ts

@@ -0,0 +1,23 @@
+import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
+import { ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
+import { message } from "ant-design-vue";
+import { ref } from "vue";
+
+export function handleTradeAccount() {
+    // 交易用户
+    const traderList = ref<ErmcpLoginUserEx[]>([])
+    function getRoleList() {
+        QueryAccMgrLoginUser(2).then(res => {
+            const set = new Set<number>([])
+            traderList.value.length = 0;
+            res.forEach(e => {
+                const { roleid } = e;
+                if (!set.has(roleid)) { // 去重
+                    set.add(roleid)
+                    traderList.value.push(e)
+                }
+            })
+        }).catch(err => message.error(err))
+    }
+    return { traderList, getRoleList }
+}

+ 19 - 7
src/views/information/account_info/list/setup.ts

@@ -15,29 +15,24 @@ export function handleAccountManager() {
             const set = new Set<number>([])
             traderList.value.length = 0;
             res.forEach(e => {
-                const { roleid, rolename, accountstatus } = e;
-                // if (accountstatus === 4) {  // 账户的状态 - 4 正常
+                const { roleid } = e;
                 if (!set.has(roleid)) { // 去重
                     set.add(roleid)
-                    // traderList.value.push({ id: roleid, name: rolename })
                     traderList.value.push(e)
                 }
-                // }
             })
         }).catch(err => message.error(err))
     }
     // 处理 跟单员 /  业务员 列表
     function handleList(el: ErmcpLoginUser, type: string, set: Set<number>): ErmcpLoginUser | null {
-        const { loginstatus, userid, accountname, logincode, roletype } = el;
+        const { userid, roletype } = el;
         let result = null
-        // if (loginstatus === 1) {// 登录账户状态 - 1:正常 
         if (roletype.includes(type)) {  // 过滤角色类型
             if (!set.has(userid)) { // 去重
                 set.add(userid)
                 result = el
             }
         }
-        // }
         return result
     }
     // 业务员
@@ -67,6 +62,23 @@ export function handleAccountManager() {
             })
         }).catch(err => message.error(err))
     }
+    // 管理账户
+    const managersList = ref<ErmcpLoginUser[]>([])
+    function getManagersList() {
+        QueryAccMgrLoginUser(3).then(res => {
+            // const set = new Set<number>([])
+            console.log('managersList', res);
+
+            // traderList.value.length = 0;
+            // res.forEach(e => {
+            //     const { roleid } = e;
+            //     if (!set.has(roleid)) { // 去重
+            //         set.add(roleid)
+            //         traderList.value.push(e)
+            //     }
+            // })
+        }).catch(err => message.error(err))
+    }
     return { traderList, businesserList, merchandiserList, getRoleList, getBusinesserList }
 }