瀏覽代碼

增加成交汇总查询

Handy_Cao 1 年之前
父節點
當前提交
99dde99e6e
共有 3 個文件被更改,包括 190 次插入1 次删除
  1. 112 1
      src/packages/pc/views/query/order/tradesumm/index.vue
  2. 14 0
      src/services/api/order/index.ts
  3. 64 0
      src/types/model/order.d.ts

+ 112 - 1
src/packages/pc/views/query/order/tradesumm/index.vue

@@ -1,7 +1,118 @@
 <!-- 查询管理-内部订单查询-成交汇总查询 -->
 <template>
-    <app-view></app-view>
+    <app-view>
+        <template #header>
+            <app-filter :options="filterOptons" />
+        </template>
+        <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
+            <template #headerLeft>
+                <app-operation :data-list="getFilteredButtons(['query_order_goodstrade_export'])"
+                    @click="openComponentOnClick" />
+            </template>
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <app-operation size="small" :data-list="getFilteredButtons(['query_order_goodstrade_details'])"
+                    @click="(code: string) => openComponent(code, row)" circle />
+            </template>
+            <template #footer>
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
+                    @change="onSearch" />
+            </template>
+        </app-table>
+        <component :is="componentMap.get(componentId)" v-bind="{ selectedRow, queryParams }" @closed="closeComponent"
+            v-if="componentId" />
+    </app-view>
 </template>
 
 <script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useMarket } from '@/hooks/market'
+import { useRequest } from '@/hooks/request'
+import { useDataFilter } from '@/hooks/datatable'
+import { useOperation } from '@/hooks/operation'
+import { queryGoodsTrade } from '@/services/api/order'
+import AppTable from '@pc/components/base/table/index.vue'
+import AppFilter from '@pc/components/base/table-filter/index.vue'
+import AppPagination from '@pc/components/base/pagination/index.vue'
+import AppOperation from '@pc/components/base/operation/index.vue'
+
+const { marketOptions, registerMarketReadyCallback } = useMarket()
+const queryParams = shallowRef<Model.GoodsTradeReq>()
+
+const { filterOptons, getQueryParams } = useDataFilter<Model.GoodsTradeReq>()
+
+const { componentMap, componentId, selectedRow, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.GoodsTradeReq>({
+    onClose: () => onSearch()
+})
+
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryGoodsTrade, {
+    manual: true,
+    params: {
+        pageNum: 1,
+        pageSize: 20,
+    }
+})
+
+const tableColumns = shallowRef<Model.TableColumn[]>([
+    { field: 'tradeDate', label: '交易日' },
+    { field: 'goodsfullname', label: '商品代码名称' },
+    { field: 'tradeqtysum	', label: '总成交量' },
+    { field: 'tradeamountsum', label: '总成交额' },
+    { field: 'closeplsum', label: '总转让损益' },
+    { field: 'chargesum', label: '总手续费' }
+])
+
+filterOptons.inputList = [
+    { label: '商品', keys: ['goodsid'] },
+    { label: '排除资金账户', keys: ['excludeaccountidsstr'] },
+]
+
+filterOptons.selectList = [
+    {
+        key: 'marketid',
+        label: '市场',
+        locked: true,
+        options: [],
+    },
+    {
+        key: 'summode',
+        label: '汇总方式',
+        selectedValue: 0,
+        locked: true,
+        options: [
+            { label: '按商品汇总', value: 0 },
+            { label: '按商品+日期汇总', value: 1 },
+        ],
+    },
+]
+
+filterOptons.buttonList = [
+    { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() },
+    { lable: '重置', className: 'el-button--primary', onClick: () => onSearch(true) }
+]
+
+const onSearch = (clear = false) => {
+    processRequiredParams((qs) => run(qs), clear)
+}
+
+const openComponentOnClick = (code: string) => {
+    processRequiredParams(() => openComponent(code))
+}
+
+// 处理请求参数
+const processRequiredParams = (callback: (params: Model.GoodsTradeReq) => void, clear = false) => {
+    const qs = getQueryParams(clear)
+    if (qs.marketid) {
+        queryParams.value = qs
+        callback(qs)
+    } else {
+        ElMessage.warning('请选择市场')
+    }
+}
+
+registerMarketReadyCallback(() => {
+    filterOptons.selectList[0].options = marketOptions.value.filter((e) => ![15, 97, 99].includes(e.value))
+})
+
 </script>

+ 14 - 0
src/services/api/order/index.ts

@@ -85,4 +85,18 @@ export function queryPositionSumSheet(options: CommonFetchOptions<{ request: Mod
  */
 export function positionSumSheetExport(options: CommonFetchOptions<{ request: Model.PositionSumSheetReq; response: string; }>) {
     return httpClient.commonRequest('/query/positionSumSheetExport', 'get', options)
+}
+
+/**
+ * 内部订单查询--> 商品成交汇总 --> 获取列表
+ */
+export function queryGoodsTrade(options: CommonFetchOptions<{ request: Model.GoodsTradeReq; response: Model.GoodsTradeRsp[]; }>) {
+    return httpClient.commonRequest('/query/queryGoodsTrade', 'get', options)
+}
+
+/**
+ * 内部订单查询--> 商品成交汇总 --> 导出
+ */
+export function queryGoodsTradeExport(options: CommonFetchOptions<{ request: Model.PositionSumSheetReq; response: string; }>) {
+    return httpClient.commonRequest('/query/queryGoodsTradeExport', 'get', options)
 }

+ 64 - 0
src/types/model/order.d.ts

@@ -360,4 +360,68 @@ declare namespace Model {
         sellcurholderamount: number; // 卖持仓总金额
         sellcurpositionqty: number; // 卖持仓总数量
     }
+
+     /** 内部订单查询--> 商品成交汇总 --> 获取列表 请求 */
+     interface GoodsTradeReq {
+        // 结束时间
+        enddate?: string; 
+        //
+        excludeAccountIds?: string[] 
+        // 排除资金账户
+        excludeaccountidsstr?: string; 
+        // 商品id
+        goodsid?: number; 
+        // 市场id
+        marketid?: number; 
+        // 页码
+        pageNum?: number; 
+        // 页大小
+        pageSize?: number; 
+        // 汇总方式
+        summode?: number; 
+        // 开始时间
+        startdate?: string; 
+        // 
+        userid?: number;
+    }
+
+    /** 内部订单查询--> 商品成交汇总 --> 获取列表 响应 */
+    interface GoodsTradeRsp {
+        // 总手续费
+        chargesum: number
+        // 总转让损益
+        closeplsum: number
+        // 商品代码名称
+        goodsfullname: string
+        // 交易日
+        tradeDate: string
+        // 总成交额
+        tradeamountsum: number
+        // 总成交量
+        tradeqtysum: number
+    }
+
+    /** 内部订单查询--> 商品成交汇总 --> 导出 请求 */
+    interface GoodsTradeExportReq {
+        // 结束时间
+        enddate?: string; 
+        //
+        excludeAccountIds?: string[] 
+        // 排除资金账户
+        excludeaccountidsstr?: string; 
+        // 商品id
+        goodsid?: number; 
+        // 市场id
+        marketid?: number; 
+        // 页码
+        pageNum?: number; 
+        // 页大小
+        pageSize?: number; 
+        // 汇总方式
+        summode?: number; 
+        // 开始时间
+        startdate?: string; 
+        // 
+        userid?: number;
+    }
 }