li.shaoyi 4 tahun lalu
induk
melakukan
617c9c7e57

+ 56 - 0
src/views/business/search/list/plan/index.vue

@@ -0,0 +1,56 @@
+<template>
+    <!-- 现货查询: 购销计划-->
+    <div class="search-plan" :loading="loading">
+        <filterCustomTable @search="updateColumn"></filterCustomTable>
+        <a-table :columns="columns" class="srcollYTable" :pagination="false" rowKey="key" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList" :scroll="{ x: 'calc(100% - 160px)', y: 'calc(100vh - 163px)' }">
+            <template #index="{ index }">
+                <span>{{ index + 1 }}</span>
+            </template>
+        </a-table>
+        <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
+    </div>
+</template>
+
+<script lang="ts">
+import { queryTableList, MtpTableButton, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
+import filterCustomTable from '../../components/filter/index.vue';
+import { formatTime, formatValue } from '@/common/methods';
+import { columns } from './setup';
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
+import { QueryHedgePlan } from '@/services/go/ermcp/plan';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+
+export default defineComponent({
+    name: 'search-plan',
+    components: {
+        filterCustomTable,
+        MtpTableButton,
+    },
+    setup() {
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3HedgePlan>();
+
+        // 获取列表数据
+        const queryTableAction = () => queryTable(QueryHedgePlan, '0,1,2,3,4,5,6');
+
+        // 表格通用逻辑
+        const param: ComposeTableParam = {
+            queryFn: queryTableAction,
+            menuType: EnumRouterName.spot_contract_checkpending,
+            tableName: 'table_pcweb_hedging_plan',
+            tableFilterKey: ['contracttype', 'hedgeplanno', 'deliverygoodsname'],
+            isDetail: true,
+        };
+
+        return {
+            ...handleComposeTable<Ermcp3HedgePlan>(param),
+            loading,
+            tableList,
+            queryTable,
+            formatTime,
+            formatValue,
+            columns,
+        };
+    },
+});
+</script>

+ 87 - 0
src/views/business/search/list/plan/setup.ts

@@ -0,0 +1,87 @@
+import { ColumnType } from '@/common/methods/table';
+import { getPlanContractType, getPlanStatusName } from '@/views/business/plan/setup';
+
+/**
+ * 表头对应字段
+ */
+export const columns: ColumnType[] = [
+    {
+        key: '0th',
+        dataIndex: 'index',
+        title: '序号',
+        align: 'center',
+        slots: {
+            customRender: 'index',
+        },
+        width: 120,
+    },
+    {
+        title: '状态',
+        dataIndex: 'hedgeplanstatus',
+        key: 'hedgeplanstatus',
+        align: 'center',
+        width: 120,
+        customRender: ({ text }: { text: number }) => {
+            return getPlanStatusName(text);
+        },
+    },
+    {
+        title: '计划名称',
+        dataIndex: 'hedgeplanno',
+        key: 'hedgeplanno',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '类型',
+        dataIndex: 'contracttype',
+        key: 'contracttype',
+        align: 'center',
+        width: 120,
+        customRender: ({ text }: { text: number }) => {
+            return getPlanContractType(text);
+        },
+    },
+    {
+        title: '现货品种',
+        dataIndex: 'deliverygoodsname',
+        key: 'deliverygoodsname',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '商品',
+        dataIndex: 'enumdicname',
+        key: 'enumdicname',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '计划量',
+        dataIndex: 'planqty',
+        key: 'planqty',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '交易用户',
+        dataIndex: 'tradeusername',
+        key: 'tradeusername',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '结算币种',
+        dataIndex: 'currencyname',
+        key: 'currencyname',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '备注',
+        dataIndex: 'remark',
+        key: 'remark',
+        align: 'center',
+        width: 120,
+    },
+];

+ 1 - 9
src/views/business/search/list/purchase/index.vue

@@ -7,14 +7,12 @@
                 <span>{{ index + 1 }}</span>
             </template>
         </a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="buttons"> </contextMenu>
         <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
     </div>
 </template>
 
 <script lang="ts">
-import { queryTableList, MtpTableButton, contextMenu, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
+import { queryTableList, MtpTableButton, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
 import filterCustomTable from '../../components/filter/index.vue';
 import { formatTime, formatValue } from '@/common/methods';
 import { columns } from './setup';
@@ -22,21 +20,16 @@ import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
 import { QueryPurchase } from '@/services/go/ermcp/purchase';
 import { QueryWareHouse } from '@/services/go/ermcp/sell';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { getTableButton } from '@/common/setup/table/button';
 import { useRoute } from 'vue-router';
 
 export default defineComponent({
     name: 'spot-contract-search',
     components: {
         filterCustomTable,
-        contextMenu,
         MtpTableButton,
     },
     setup() {
         const { name: routeName } = useRoute();
-        // 权限按钮
-        const buttons = getTableButton();
-
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<Ermcp3SellBuyContract>();
 
@@ -69,7 +62,6 @@ export default defineComponent({
             formatTime,
             formatValue,
             columns,
-            buttons,
         };
     },
 });