Jelajahi Sumber

实时敞口、持仓头寸查询新增用户过滤

li.shaoyi 3 tahun lalu
induk
melakukan
7ef7148b17

+ 18 - 22
src/services/go/ermcp/exposure/index.ts

@@ -9,10 +9,9 @@ import { Ermcp3AreaSpot, Ermcp3AreaSpotDetail, Ermcp3AreaSpotDetailReq, Ermcp3Ex
  * 请求实时敞口 (敞口 -> 实时敞口) /Ermcp/QueryRealtimeExposure
  * @constructor
  */
-export function QueryActualExposure(): Promise<ErmcpRealExposureModel[]> {
-    const userid = getUserId(); // 所属机构id
-    const usertype = getUserAccountType()
-    return commonSearch_go('/Ermcp/QueryRealtimeExposure', { userid, usertype }).catch((err) => {
+export function QueryActualExposure(userid = 0): Promise<ErmcpRealExposureModel[]> {
+    const id = userid || getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryRealtimeExposure', { userid: id }).catch((err) => {
         throw new Error(`查询敞口 -> 实时敞口: ${err}`);
     });
 }
@@ -23,9 +22,9 @@ export function QueryActualExposure(): Promise<ErmcpRealExposureModel[]> {
  * @constructor
  */
 export function QueryActualExposureDetail(req: Ermcp3ExposureReq): Promise<Ermcp3ExposureDetail[]> {
-    const userid = getAreaUserId(); // 用户id
+    req.userid = req.userid || getAreaUserId(); // 用户id
     req.usertype = getUserAccountType()
-    return commonSearch_go('/Ermcp3/QueryExposureDetail', { userid, ...req }).catch((err) => {
+    return commonSearch_go('/Ermcp3/QueryExposureDetail', req).catch((err) => {
         throw new Error(`查询敞口 ->实时敞口 -> 现货明细: ${err}`);
     });
 }
@@ -36,9 +35,8 @@ export function QueryActualExposureDetail(req: Ermcp3ExposureReq): Promise<Ermcp
  * @constructor
  */
 export function QueryAutualExposurePosition(req: ErmcpExposurePostionReq): Promise<ErmcpExposurePostion[]> {
-    const userid = getUserId(); // 所属机构id
-    const usertype = getUserAccountType()
-    return commonSearch_go('/Ermcp/QueryRealtimeExposurePosition', { userid, usertype, ...req }).catch((err) => {
+    req.userid = req.userid || getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryRealtimeExposurePosition', req).catch((err) => {
         throw new Error(`查询敞口 ->实时敞口 -> 期货明细: ${err}`);
     });
 }
@@ -47,10 +45,10 @@ export function QueryAutualExposurePosition(req: ErmcpExposurePostionReq): Promi
  * 请求敞口现货头寸 (敞口 -> 现货头寸) /Ermcp3/QueryExposureSpot
  * @constructor
  */
-export function QuerySpotPosition(): Promise<Ermcp3AreaSpot[]> {
-    const userid = getUserId(); // 用户id
+export function QuerySpotPosition(userid = 0): Promise<Ermcp3AreaSpot[]> {
+    const id = userid || getUserId(); // 用户id
     const usertype = getUserAccountType();  // 用户类型 2-机构 7-企业成员
-    return commonSearch_go('/Ermcp3/QueryExposureSpot', { userid, usertype }).catch((err) => {
+    return commonSearch_go('/Ermcp3/QueryExposureSpot', { userid: id, usertype }).catch((err) => {
         throw new Error(`查询敞口 -> 现货头寸: ${err}`);
     });
 }
@@ -61,9 +59,9 @@ export function QuerySpotPosition(): Promise<Ermcp3AreaSpot[]> {
  * @constructor
  */
 export function QuerySpotPositionDetail(req: Ermcp3AreaSpotDetailReq): Promise<Ermcp3AreaSpotDetail[]> {
-    const userid = getUserId(); // 用户id
-    const usertype = getUserAccountType();  // 用户类型 2-机构 7-企业成员
-    return commonSearch_go('/Ermcp3/QueryExposureSpotDetail', { userid, usertype, ...req }).catch((err) => {
+    req.userid = req.userid || getUserId(); // 用户id
+    req.usertype = getUserAccountType(); // 用户类型 2-机构 7-企业成员
+    return commonSearch_go('/Ermcp3/QueryExposureSpotDetail', req).catch((err) => {
         throw new Error(`查询敞口 -> 现货头寸 -> 现货明细: ${err}`);
     });
 }
@@ -72,10 +70,9 @@ export function QuerySpotPositionDetail(req: Ermcp3AreaSpotDetailReq): Promise<E
  * 查询敞口期货头寸(菜单:敞口-> 期货头寸) /Ermcp/QueryExposureHedgePosition
  * @constructor
  */
-export function QueryExposureHedgePosition(): Promise<ErmcpHedgePosition[]> {
-    const userid = getUserId(); // 所属机构id
-    const usertype = getUserAccountType()
-    return commonSearch_go('/Ermcp/QueryExposureHedgePosition', { userid, usertype }).catch((err) => {
+export function QueryExposureHedgePosition(userid = 0): Promise<ErmcpHedgePosition[]> {
+    const id = userid || getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureHedgePosition', { userid: id }).catch((err) => {
         throw new Error(`查询敞口 -> 期货头寸: ${err}`);
     });
 }
@@ -86,9 +83,8 @@ export function QueryExposureHedgePosition(): Promise<ErmcpHedgePosition[]> {
  * @constructor
  */
 export function QueryExposureHedgePositionDetail(req: ErmcpHedgePositionDetailReq): Promise<ErmcpHedgePositionDetail[]> {
-    const userid = getUserId(); // 所属机构id
-    const usertype = getUserAccountType()
-    return commonSearch_go('/Ermcp/QueryExposureHedgePositionDetail', { userid, usertype, ...req }).catch((err) => {
+    req.userid = req.userid || getUserId(); // 所属机构id
+    return commonSearch_go('/Ermcp/QueryExposureHedgePositionDetail', req).catch((err) => {
         throw new Error(`查询敞口->期货头寸->期货明细: ${err}`);
     });
 }

+ 16 - 11
src/services/go/ermcp/exposure/interface.ts

@@ -53,8 +53,9 @@ export interface ErmcpRealExposureModel {
  * 查询实时敞口现货明细请求
  */
 export interface Ermcp3ExposureReq {
-    middlegoodsid: number  //    套保商品
-    usertype?: number //         用户类型 2-机构 7-企业成员
+    userid: number; // 用户id
+    middlegoodsid: number;  //    套保商品
+    usertype?: number; //         用户类型 2-机构 7-企业成员
 }
 
 /**
@@ -73,23 +74,24 @@ export interface Ermcp3ExposureDetail {
     enumdicname: string;//现货商品单位名称
     logtype: number;//类型 - 1:套保计划 2:现货合同
     middlegoodsId: number;//套保商品id
-    mgunitidname:string;//套保品种单位名称
-    mgunitid:number;//套保品种单位id
+    mgunitidname: string;//套保品种单位名称
+    mgunitid: number;//套保品种单位id
     middlegoodscode: string;//套保商品代码
     middlegoodsname: string;//套保商品名称
     qty: number;//数量
     relateNo: string;//现货合同/套保计划编号
-    unitid:number;//现货商品单位id
-    wrstandardcode:string;//现货商品代码
-    wrstandardid:number;//现货商品ID(SEQ_WRSTANDARD)
-    wrstandardname:string;//现货商品名称
+    unitid: number;//现货商品单位id
+    wrstandardcode: string;//现货商品代码
+    wrstandardid: number;//现货商品ID(SEQ_WRSTANDARD)
+    wrstandardname: string;//现货商品名称
 }
 
 /**
  * 实时敞口期货明细请求
  */
 export interface ErmcpExposurePostionReq {
-    middleGoodsId: number //套保商品ID
+    userid: number; // 用户id
+    middleGoodsId: number; //套保商品ID
 }
 
 /**
@@ -132,7 +134,9 @@ export interface Ermcp3AreaSpot {
  * 敞口现货头寸明细请求
  */
 export interface Ermcp3AreaSpotDetailReq {
-    deliverygoodsid: number  // 现货品种ID
+    userid: number; // 用户ID
+    usertype?: number; // 用户类型 2-机构 7-企业成员
+    wrstandardid: number;  // 现货商品ID
 }
 
 /**
@@ -188,7 +192,8 @@ export interface ErmcpHedgePosition {
  * 查询敞口期货头寸期货明细 请求
  */
 export interface ErmcpHedgePositionDetailReq {
-    goodsId: number // 商品id
+    userid: number; // 所属机构ID
+    goodsId: number; // 商品id
 }
 
 /**

+ 1 - 1
src/services/go/ermcp/report/interface.ts

@@ -80,7 +80,7 @@ export interface AreaSpotplReportReq {
     querytype: number, //     查询类型 1-报表 2-报表明细
     cycletime: string,//      周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
     cycletype: number,//      周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
-
+    sumflag: number, // 目前pcweb的日/周/月现货报表与手机端的汇总维度不同,所以增加了可选参数sumflag参数, pcweb请填1
     deliverygoodsid?: number,//  现货品种id(明细必填)
     wrstandardid?: number,//     品类id(明细必填)
     currencyid?: number,//       币种id(明细必填)

+ 1 - 0
src/services/go/wrtrade/interface.ts

@@ -1160,6 +1160,7 @@ export interface QueryPermancePlanTmpReq {
     userid?: number; // 用户id
     tmptype?: string; // 模板类型(逗号隔开), 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
     includepub?: number; // 是否包含公共模板(用户id为空的) 1-包含
+    marketid?: number; // 市场id(天津麦顿指定此参数,其它不用)
 }
 export interface QueryPermancePlanTmpRsp {
     autoid: number;//AutoID 模板id

+ 48 - 3
src/views/business/exposure/list/futures/filter.vue

@@ -1,14 +1,26 @@
 <template>
   <div class="filterTable">
-    <FilterOption :inputList="inputList" :buttonList="buttonList" />
+    <FilterOption :inputList="inputList" :buttonList="buttonList">
+      <template #before>
+        <a-select class="conditionSelect" v-model:value="selectedUser" @change="userChange" placeholder="请选择交易用户">
+          <a-select-option v-for="item in userList" :value="item.value" :key="item.value">
+            {{ item.lable }}
+          </a-select-option>
+        </a-select>
+      </template>
+    </FilterOption>
     <slot></slot>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent } from 'vue';
+import { defineComponent, ref } from 'vue';
 import { ErmcpHedgePosition } from '@/services/go/ermcp/exposure/interface';
 import { useFilter } from '@/common/components/filter/setup';
+import { initData } from '@/common/methods';
+import { getUserId } from '@/services/bus/user'
+import { handlerManagerList } from '@/common/setup/user';
+import { getAreaUserName } from '@/services/bus/user';
 import FilterOption from '@/common/components/filter/index.vue';
 
 export default defineComponent({
@@ -17,15 +29,48 @@ export default defineComponent({
     FilterOption
   },
   setup(props, context) {
-    const { inputList, buttonList } = useFilter<ErmcpHedgePosition>(context);
+    const { inputList, buttonList, search } = useFilter<ErmcpHedgePosition>(context);
+    // 交易用户
+    const userList = ref<{ value: number; lable: string; }[]>([]);
+    const loading = ref(false);
+    const selectedUser = ref<number | undefined>(undefined);
 
     inputList.value = [
       { keys: ['goodsname', 'goodscode'], alias: 'goodsid', value: '', placeholder: '模糊搜索期货合约' },
     ]
 
+    const userChange = (userid: number) => {
+      context.emit('update', userid);
+      search();
+    }
+
+    const { queryTable } = handlerManagerList(loading, 2);
+
+    initData(() => {
+      queryTable().then((res) => {
+        const id = getUserId();
+        const has = res.find((e) => e.roleid === id);
+        userList.value = [];
+
+        if (has) {
+          userList.value.push({ value: id, lable: has.rolename });
+        } else {
+          // 没有找到代表着是机构,可以查看所有交易用户,不能查看交易员
+          userList.value.push({ value: id, lable: getAreaUserName() });
+          res.forEach((e) => {
+            userList.value.push({ value: e.roleid, lable: e.rolename });
+          });
+        }
+        selectedUser.value = getUserId();
+      });
+    })
+
     return {
       inputList,
       buttonList,
+      userList,
+      selectedUser,
+      userChange,
     }
   },
 })

+ 13 - 8
src/views/business/exposure/list/futures/index.vue

@@ -2,7 +2,7 @@
   <!-- 敞口: 期货头寸-->
   <mtp-table-scroll>
     <template #header>
-      <filterCustomTable @search="updateColumn"></filterCustomTable>
+      <filterCustomTable @search="updateColumn" @update="queryTableAction"></filterCustomTable>
     </template>
     <template #default="{ scroll }">
       <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :pagination="false" :rowKey="(record,index)=>index" :data-source="tableList"></a-table>
@@ -50,12 +50,17 @@ export default defineComponent({
     const { loading, tableList, queryTable } = queryTableList<ErmcpHedgePosition>();
     // 控制明细显示/隐藏
     const visible = ref(true);
+    // 用户id
+    const userId = ref(0);
     // 获取列表数据
-    const queryTableAction = () => queryTable(QueryExposureHedgePosition).then((res) => {
-      if (res.length) {
-        selectedRow.value = res[0];
-      }
-    });
+    const queryTableAction = (userid = 0) => {
+      userId.value = userid;
+      queryTable(QueryExposureHedgePosition, userid).then((res) => {
+        if (res.length) {
+          selectedRow.value = res[0];
+        }
+      })
+    }
     const param: ComposeTableDetailParam = {
       queryFn: queryTableAction, // 查询表格数据
       tableName: 'table_pcweb_exposure_futuresposition', // 表头key
@@ -93,7 +98,7 @@ export default defineComponent({
       if (selectedRow.value) {
         const goodsId = selectedRow.value.goodsid;
         if (goodsId) {
-          queryResultLoadingAndInfo(QueryExposureHedgePositionDetail, loading, { goodsId }).then((res) => {
+          queryResultLoadingAndInfo(QueryExposureHedgePositionDetail, loading, { userid: userId.value, goodsId }).then((res) => {
             // 日期降序排序
             detailTableList.value = res.sort((a, b) => moment(b.tradetime).valueOf() - moment(a.tradetime).valueOf());
           });
@@ -103,7 +108,7 @@ export default defineComponent({
 
     watch(selectedRow, () => changeTab(tabIndex.value))
 
-    return { ...useColumn(), loading, tableList, visible, changeTab, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, getBuyOrSellName, getChannelBuildName };
+    return { ...useColumn(), queryTableAction, loading, tableList, visible, changeTab, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, getBuyOrSellName, getChannelBuildName };
   },
 });
 </script>

+ 48 - 3
src/views/business/exposure/list/realTime/filter.vue

@@ -1,14 +1,26 @@
 <template>
   <div class="filterTable">
-    <FilterOption :inputList="inputList" :buttonList="buttonList" />
+    <FilterOption :inputList="inputList" :buttonList="buttonList">
+      <template #before>
+        <a-select class="conditionSelect" v-model:value="selectedUser" @change="userChange" placeholder="请选择交易用户">
+          <a-select-option v-for="item in userList" :value="item.value" :key="item.value">
+            {{ item.lable }}
+          </a-select-option>
+        </a-select>
+      </template>
+    </FilterOption>
     <slot></slot>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent } from 'vue';
+import { defineComponent, ref } from 'vue';
 import { ErmcpRealExposureModel } from '@/services/go/ermcp/exposure/interface';
 import { useFilter } from '@/common/components/filter/setup';
+import { initData } from '@/common/methods';
+import { getUserId } from '@/services/bus/user'
+import { handlerManagerList } from '@/common/setup/user';
+import { getAreaUserName } from '@/services/bus/user';
 import FilterOption from '@/common/components/filter/index.vue';
 
 export default defineComponent({
@@ -17,15 +29,48 @@ export default defineComponent({
     FilterOption
   },
   setup(props, context) {
-    const { inputList, buttonList } = useFilter<ErmcpRealExposureModel>(context);
+    const { inputList, buttonList, search } = useFilter<ErmcpRealExposureModel>(context);
+    // 交易用户
+    const userList = ref<{ value: number; lable: string; }[]>([]);
+    const loading = ref(false);
+    const selectedUser = ref<number | undefined>(undefined);
 
     inputList.value = [
       { keys: ['MiddleGoodsName'], value: '', placeholder: '模糊搜索套保品种' },
     ]
 
+    const userChange = (userid: number) => {
+      context.emit('update', userid);
+      search();
+    }
+
+    const { queryTable } = handlerManagerList(loading, 2);
+
+    initData(() => {
+      queryTable().then((res) => {
+        const id = getUserId();
+        const has = res.find((e) => e.roleid === id);
+        userList.value = [];
+
+        if (has) {
+          userList.value.push({ value: id, lable: has.rolename });
+        } else {
+          // 没有找到代表着是机构,可以查看所有交易用户,不能查看交易员
+          userList.value.push({ value: id, lable: getAreaUserName() });
+          res.forEach((e) => {
+            userList.value.push({ value: e.roleid, lable: e.rolename });
+          });
+        }
+        selectedUser.value = getUserId();
+      });
+    })
+
     return {
       inputList,
       buttonList,
+      userList,
+      selectedUser,
+      userChange,
     }
   },
 })

+ 18 - 14
src/views/business/exposure/list/realTime/index.vue

@@ -12,7 +12,7 @@
         <span class="dialogSpan">刷新一次,倒计时 </span> <span class="red">{{ num }}</span>
         <a-button type="button" class="operBtn ant-btn" @click="setTimerAction">{{ isStart ? '停止监控' : '开始监控' }}</a-button>
       </div>
-      <filterCustomTable @search="updateColumn" v-else> </filterCustomTable>
+      <filterCustomTable @search="updateColumn" @update="queryTableAction" v-else> </filterCustomTable>
     </template>
     <template #default="{ scroll }">
       <a-table :columns="columns" class="srcollYTable" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :rowKey="(record,index)=>index" :data-source="tableList" :scroll="scroll">
@@ -80,21 +80,25 @@ export default defineComponent({
       { id: 2, name: '5秒' },
       { id: 3, name: '10秒' },
     ];
-    const timer = ref<number>(1);
-    const num = ref<number>(3);
-    const isStart = ref<boolean>(false);
+    const userId = ref(0);
+    const timer = ref(1);
+    const num = ref(3);
+    const isStart = ref(false);
     // 表格列表数据
     const { loading, tableList, queryTable } = queryTableList<ErmcpRealExposureModel>(true, 2);
     // 控制明细显示/隐藏
     const visible = ref(true);
     // 获取列表数据
-    const queryTableAction = () => queryTable(QueryActualExposure).then((res) => {
-      if (res.length) {
-        selectedRow.value = res[0];
-      } else {
-        changeTab(tabIndex.value)
-      }
-    });
+    const queryTableAction = (userid = 0) => {
+      userId.value = userid;
+      queryTable(QueryActualExposure, userid).then((res) => {
+        if (res.length) {
+          selectedRow.value = res[0];
+        } else {
+          changeTab(tabIndex.value)
+        }
+      })
+    }
     const param: ComposeTableDetailParam = {
       queryFn: queryTableAction, // 查询表格数据
       // tableName: 'table_pcweb_exposure', // 表头key
@@ -191,7 +195,7 @@ export default defineComponent({
         }
 
         if (selectedRow.value) {
-          queryResultLoadingAndInfo(QueryActualExposureDetail, loading, { middlegoodsid: selectedRow.value.MiddleGoodsID }).then((res) => {
+          queryResultLoadingAndInfo(QueryActualExposureDetail, loading, { userid: userId.value, middlegoodsid: selectedRow.value.MiddleGoodsID }).then((res) => {
             detailTableList.value = res;
           });
         }
@@ -201,7 +205,7 @@ export default defineComponent({
         registerColumnDetail('table_pcweb_exposure_futures_detail');
 
         if (selectedRow.value) {
-          queryResultLoadingAndInfo(QueryAutualExposurePosition, loading, { middleGoodsId: selectedRow.value.MiddleGoodsID }).then((res) => {
+          queryResultLoadingAndInfo(QueryAutualExposurePosition, loading, { userid: userId.value, middleGoodsId: selectedRow.value.MiddleGoodsID }).then((res) => {
             detailTableList.value = res;
           });
         }
@@ -212,7 +216,7 @@ export default defineComponent({
     }
     watch(selectedRow, () => changeTab(tabIndex.value))
 
-    return { loading, tableList, visible, columns, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab, formatNumber, getBizTypeName, getPlanContractType, getLogType, diffTimes, timer, timerChange, isStart, setTimerAction, isPingAnOem, num };
+    return { loading, tableList, visible, columns, queryTableAction, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab, formatNumber, getBizTypeName, getPlanContractType, getLogType, diffTimes, timer, timerChange, isStart, setTimerAction, isPingAnOem, num };
   },
 });
 </script>

+ 48 - 3
src/views/business/exposure/list/spot/filter.vue

@@ -1,14 +1,26 @@
 <template>
   <div class="filterTable">
-    <FilterOption :inputList="inputList" :buttonList="buttonList" />
+    <FilterOption :inputList="inputList" :buttonList="buttonList">
+      <template #before>
+        <a-select class="conditionSelect" v-model:value="selectedUser" @change="userChange" placeholder="请选择交易用户">
+          <a-select-option v-for="item in userList" :value="item.value" :key="item.value">
+            {{ item.lable }}
+          </a-select-option>
+        </a-select>
+      </template>
+    </FilterOption>
     <slot></slot>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent } from 'vue';
+import { defineComponent, ref } from 'vue';
 import { Ermcp3AreaSpot } from '@/services/go/ermcp/exposure/interface';
 import { useFilter } from '@/common/components/filter/setup';
+import { initData } from '@/common/methods';
+import { getUserId } from '@/services/bus/user'
+import { handlerManagerList } from '@/common/setup/user';
+import { getAreaUserName } from '@/services/bus/user';
 import FilterOption from '@/common/components/filter/index.vue';
 
 export default defineComponent({
@@ -17,15 +29,48 @@ export default defineComponent({
     FilterOption
   },
   setup(props, context) {
-    const { inputList, buttonList } = useFilter<Ermcp3AreaSpot>(context);
+    const { inputList, buttonList, search } = useFilter<Ermcp3AreaSpot>(context);
+    // 交易用户
+    const userList = ref<{ value: number; lable: string; }[]>([]);
+    const loading = ref(false);
+    const selectedUser = ref<number | undefined>(undefined);
 
     inputList.value = [
       { keys: ['wrstandardname'], value: '', placeholder: '模糊搜索现货商品' },
     ]
 
+    const userChange = (userid: number) => {
+      context.emit('update', userid);
+      search();
+    }
+
+    const { queryTable } = handlerManagerList(loading, 2);
+
+    initData(() => {
+      queryTable().then((res) => {
+        const id = getUserId();
+        const has = res.find((e) => e.roleid === id);
+        userList.value = [];
+
+        if (has) {
+          userList.value.push({ value: id, lable: has.rolename });
+        } else {
+          // 没有找到代表着是机构,可以查看所有交易用户,不能查看交易员
+          userList.value.push({ value: id, lable: getAreaUserName() });
+          res.forEach((e) => {
+            userList.value.push({ value: e.roleid, lable: e.rolename });
+          });
+        }
+        selectedUser.value = getUserId();
+      });
+    })
+
     return {
       inputList,
       buttonList,
+      userList,
+      selectedUser,
+      userChange,
     }
   },
 })

+ 13 - 7
src/views/business/exposure/list/spot/index.vue

@@ -2,7 +2,7 @@
   <!-- 敞口: 现货头寸-->
   <mtp-table-scroll>
     <template #header>
-      <filterCustomTable @search="updateColumn"> </filterCustomTable>
+      <filterCustomTable @search="updateColumn" @update="queryTableAction"></filterCustomTable>
     </template>
     <template #default="{ scroll }">
       <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :pagination="false" :rowKey="(record,index)=>index" :data-source="tableList"></a-table>
@@ -44,12 +44,17 @@ export default defineComponent({
     const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaSpot>(true, 2);
     // 控制明细显示/隐藏
     const visible = ref(true);
+    // 用户id
+    const userId = ref(0);
     // 获取列表数据
-    const queryTableAction = () => queryTable(QuerySpotPosition).then((res) => {
-      if (res.length) {
-        selectedRow.value = res[0];
-      }
-    });
+    const queryTableAction = (userid = 0) => {
+      userId.value = userid;
+      queryTable(QuerySpotPosition, userid).then((res) => {
+        if (res.length) {
+          selectedRow.value = res[0];
+        }
+      })
+    }
     const param: ComposeTableDetailParam = {
       queryFn: queryTableAction, // 查询表格数据
       tableName: 'table_pcweb_exposure_spotposition', // 表头key
@@ -87,7 +92,7 @@ export default defineComponent({
       if (selectedRow.value) {
         const wrstandardid = selectedRow.value.wrstandardid;
         if (wrstandardid) {
-          queryResultLoadingAndInfo(QuerySpotPositionDetail, loading, { wrstandardid }).then((res) => {
+          queryResultLoadingAndInfo(QuerySpotPositionDetail, loading, { userid: userId.value, wrstandardid }).then((res) => {
             detailTableList.value = res;
           })
         }
@@ -99,6 +104,7 @@ export default defineComponent({
       loading,
       tableList,
       visible,
+      queryTableAction,
       changeTab,
       detailTableList,
       expandedRowKeys,