Handy_Cao 1 gadu atpakaļ
vecāks
revīzija
0bb2193e1f

+ 122 - 1
src/packages/pc/views/query/order/accountsumm/index.vue

@@ -1,7 +1,128 @@
 <!-- 查询管理-内部订单查询-账户成交汇总 -->
 <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_trade_export'])"
+                    @click="openComponentOnClick" />
+            </template>
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <app-operation size="small" :data-list="getFilteredButtons(['query_order_trade_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 { useEnum } from '@/hooks/enum'
+import { useMarket } from '@/hooks/market'
+import { useRequest } from '@/hooks/request'
+import { useDataFilter } from '@/hooks/datatable'
+import { useOperation } from '@/hooks/operation'
+import { accountTransactions } 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 buildtypeEnum = useEnum('buildtype') // 单据类型
+const queryParams = shallowRef<Model.AccountTransactionsReq>()
+
+const { filterOptons, getQueryParams } = useDataFilter<Model.AccountTransactionsReq>()
+
+const { componentMap, componentId, selectedRow, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.AccountTransactionsReq>({
+    onClose: () => onSearch()
+})
+
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(accountTransactions, {
+    manual: true,
+    params: {
+        pageNum: 1,
+        pageSize: 20,
+        // isHis: 0,
+    }
+})
+
+const tableColumns = shallowRef<Model.TableColumn[]>([
+    { field: 'tradeDate', label: '交易日' },
+    { field: 'userfullname', label: '账户' },
+    { field: 'goodsfullname', label: '商品代码名称' },
+    { field: 'membername', label: '所属会员' },
+    { field: 'parentname', label: '所属机构' },
+    { field: 'tradeqtysum', label: '总成交量' },
+    { field: 'tradeamountsum', label: '总成交额' },
+    { field: 'closeplsum', label: '总转让损益' },
+    { field: 'chargesum', label: '总手续费' }
+])
+
+filterOptons.inputList = [
+    { label: '商品', keys: ['goodsid'] },
+    { label: '排除资金账户', keys: ['excludeaccountidsstr'] },
+    { label: '账户', keys: ['accountid'] },
+]
+
+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.AccountTransactionsReq) => 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))
+})
+
+buildtypeEnum.registerEnumReadyCallback(() => {
+    filterOptons.selectList[3].options = buildtypeEnum.enumOptions.value
+})
 </script>

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

@@ -447,6 +447,8 @@ declare namespace Model {
         summode?: number; 
         // 
         userid?: number;
+        // 市场id
+        marketid?: number; 
     }
 
     /** 内部订单查询--> 账户成交汇总 --> 获取列表 响应 */