huangbin 4 роки тому
батько
коміт
56a758a7bf

+ 7 - 0
src/enums/routerName.ts

@@ -23,4 +23,11 @@ export const enum WarehouseInfo {
     normal = 'warehouse-info-normal', // 正常
     stop = 'warehouse-info-stop',  // 停用
 }
+// 采购
+export const enum Purchase {
+    realTime = 'purchase-real-time', // 实时敞口
+    spot = 'purchase-spot-position',  // 现货头寸
+    forward = 'purchase-forward-position',  // 期货头寸
+    history = 'purchase-history',  // 历史敞口
+}
 

+ 35 - 0
src/router/index.ts

@@ -205,6 +205,41 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
+                redirect: to => { return { name: EnumType.Purchase.realTime } },
+                children: [
+                    {
+                        path: '/purchase/forward',
+                        name: EnumType.Purchase.forward,
+                        component: () => import('@/views/business/purchase/list/forward/index.vue'),
+                        meta: {
+                            requireAuth: true
+                        },
+                    },
+                    {
+                        path: '/purchase/history',
+                        name: EnumType.Purchase.history,
+                        component: () => import('@/views/business/purchase/list/history/index.vue'),
+                        meta: {
+                            requireAuth: true
+                        },
+                    },
+                    {
+                        path: '/purchase/real-time',
+                        name: EnumType.Purchase.realTime,
+                        component: () => import('@/views/business/purchase/list/real-time/index.vue'),
+                        meta: {
+                            requireAuth: true
+                        },
+                    },
+                    {
+                        path: '/purchase/spot',
+                        name: EnumType.Purchase.spot,
+                        component: () => import('@/views/business/purchase/list/spot/index.vue'),
+                        meta: {
+                            requireAuth: true
+                        },
+                    },
+                ]
             },
             {
                 path: '/sell',

+ 27 - 3
src/views/business/purchase/index.vue

@@ -1,18 +1,42 @@
 <template>
   <!-- 采购 -->
   <div class="purchase">
-    采购
+    <firstMenu :list="list"
+               :value="'value'"
+               @selectMenu="selectMenu" />
+    <router-view />
   </div>
 </template>
 
 <script lang="ts">
 import { defineComponent } from 'vue';
+import firstMenu from '@/components/firstMenu/index.vue';
+import { useRouter } from 'vue-router';
+import { Purchase } from '@/enums/routerName';
+
+// 处理菜单
+function handleMenu() {
+    const router = useRouter();
+    const list = [
+        { key: Purchase.realTime, value: '实时敞口' },
+        { key: Purchase.spot, value: '现货头寸' },
+        { key: Purchase.forward, value: '期货头寸' },
+        { key: Purchase.history, value: '历史敞口' },
+    ];
+    function selectMenu(item: any) {
+        router.push({ name: item.key });
+    }
+    return { list, selectMenu };
+}
 
 export default defineComponent({
     name: 'purchase',
-    components: {},
+    components: {
+        firstMenu,
+    },
     setup() {
-        return {};
+        const { list, selectMenu } = handleMenu();
+        return { list, selectMenu };
     },
 });
 </script>

+ 83 - 0
src/views/business/purchase/list/forward/index.vue

@@ -0,0 +1,83 @@
+<template>
+  <!-- 采购: 现货头寸-->
+  <div class="spot-contract-peddding">
+    采购: 现货头寸
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { QueryCustomInfo } from '@/goServiceAPI/ermcp/customInfo/index';
+import { QueryCustomInfoType } from '@/goServiceAPI/ermcp/customInfo/interface';
+import { message } from 'ant-design-vue';
+import { initData } from '@/setup/methods/index';
+
+// 查询客户资料列表
+function getCustomList() {
+    // const filteredInfo = ref();
+    // const sortedInfo = ref();
+    // const columns = computed(() => {
+    //     const filtered = filteredInfo.value || {};
+    //     const sorted = sortedInfo.value || {};
+    //     return [
+    //         {
+    //             title: '序号',
+    //             dataIndex: 'index',
+    //             key: 'index',
+    //             align: 'center',
+    //             width: 50,
+    //             customRender: (param: any) => `${param.index + 1}`,
+    //         },
+    //         {
+    //             title: 'Age',
+    //             dataIndex: 'age',
+    //             key: 'age',
+    //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
+    //             sortOrder: sorted.columnKey === 'age' && sorted.order,
+    //         },
+    //         {
+    //             title: 'Address',
+    //             dataIndex: 'address',
+    //             key: 'address',
+    //             filters: [
+    //                 { text: 'London', value: 'London' },
+    //                 { text: 'New York', value: 'New York' },
+    //             ],
+    //             filteredValue: filtered.address || null,
+    //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
+    //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
+    //             sortOrder: sorted.columnKey === 'address' && sorted.order,
+    //             ellipsis: true,
+    //         },
+    //     ];
+    // });
+    const customList = ref<QueryCustomInfoType[]>([]);
+    function actionQuery() {
+        QueryCustomInfo(4)
+            .then((res) => {
+                console.log('L', res);
+            })
+            .catch((err) => message.error(err));
+    }
+
+    return { customList, actionQuery };
+}
+
+export default defineComponent({
+    name: 'spot-contract-peddding',
+    components: {},
+    setup() {
+        const { customList, actionQuery } = getCustomList();
+        initData(() => {
+            actionQuery();
+            // 加载数据在这里
+        });
+        return { customList };
+    },
+});
+</script>
+
+<style lang="less">
+.spot-contract-peddding {
+}
+</style>;

+ 83 - 0
src/views/business/purchase/list/history/index.vue

@@ -0,0 +1,83 @@
+<template>
+  <!-- 采购: 历史敞口-->
+  <div class="purchase-history">
+    采购:历史敞口
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { QueryCustomInfo } from '@/goServiceAPI/ermcp/customInfo/index';
+import { QueryCustomInfoType } from '@/goServiceAPI/ermcp/customInfo/interface';
+import { message } from 'ant-design-vue';
+import { initData } from '@/setup/methods/index';
+
+// 查询客户资料列表
+function getCustomList() {
+    // const filteredInfo = ref();
+    // const sortedInfo = ref();
+    // const columns = computed(() => {
+    //     const filtered = filteredInfo.value || {};
+    //     const sorted = sortedInfo.value || {};
+    //     return [
+    //         {
+    //             title: '序号',
+    //             dataIndex: 'index',
+    //             key: 'index',
+    //             align: 'center',
+    //             width: 50,
+    //             customRender: (param: any) => `${param.index + 1}`,
+    //         },
+    //         {
+    //             title: 'Age',
+    //             dataIndex: 'age',
+    //             key: 'age',
+    //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
+    //             sortOrder: sorted.columnKey === 'age' && sorted.order,
+    //         },
+    //         {
+    //             title: 'Address',
+    //             dataIndex: 'address',
+    //             key: 'address',
+    //             filters: [
+    //                 { text: 'London', value: 'London' },
+    //                 { text: 'New York', value: 'New York' },
+    //             ],
+    //             filteredValue: filtered.address || null,
+    //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
+    //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
+    //             sortOrder: sorted.columnKey === 'address' && sorted.order,
+    //             ellipsis: true,
+    //         },
+    //     ];
+    // });
+    const customList = ref<QueryCustomInfoType[]>([]);
+    function actionQuery() {
+        QueryCustomInfo(4)
+            .then((res) => {
+                console.log('L', res);
+            })
+            .catch((err) => message.error(err));
+    }
+
+    return { customList, actionQuery };
+}
+
+export default defineComponent({
+    name: 'purchase-history',
+    components: {},
+    setup() {
+        const { customList, actionQuery } = getCustomList();
+        initData(() => {
+            actionQuery();
+            // 加载数据在这里
+        });
+        return { customList };
+    },
+});
+</script>
+
+<style lang="less">
+.purchase-history {
+}
+</style>;

+ 83 - 0
src/views/business/purchase/list/real-time/index.vue

@@ -0,0 +1,83 @@
+<template>
+  <!-- 采购: 实时敞口-->
+  <div class="purchase-real-time">
+    采购: 实时敞口
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { QueryCustomInfo } from '@/goServiceAPI/ermcp/customInfo/index';
+import { QueryCustomInfoType } from '@/goServiceAPI/ermcp/customInfo/interface';
+import { message } from 'ant-design-vue';
+import { initData } from '@/setup/methods/index';
+
+// 查询客户资料列表
+function getCustomList() {
+    // const filteredInfo = ref();
+    // const sortedInfo = ref();
+    // const columns = computed(() => {
+    //     const filtered = filteredInfo.value || {};
+    //     const sorted = sortedInfo.value || {};
+    //     return [
+    //         {
+    //             title: '序号',
+    //             dataIndex: 'index',
+    //             key: 'index',
+    //             align: 'center',
+    //             width: 50,
+    //             customRender: (param: any) => `${param.index + 1}`,
+    //         },
+    //         {
+    //             title: 'Age',
+    //             dataIndex: 'age',
+    //             key: 'age',
+    //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
+    //             sortOrder: sorted.columnKey === 'age' && sorted.order,
+    //         },
+    //         {
+    //             title: 'Address',
+    //             dataIndex: 'address',
+    //             key: 'address',
+    //             filters: [
+    //                 { text: 'London', value: 'London' },
+    //                 { text: 'New York', value: 'New York' },
+    //             ],
+    //             filteredValue: filtered.address || null,
+    //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
+    //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
+    //             sortOrder: sorted.columnKey === 'address' && sorted.order,
+    //             ellipsis: true,
+    //         },
+    //     ];
+    // });
+    const customList = ref<QueryCustomInfoType[]>([]);
+    function actionQuery() {
+        QueryCustomInfo(4)
+            .then((res) => {
+                console.log('L', res);
+            })
+            .catch((err) => message.error(err));
+    }
+
+    return { customList, actionQuery };
+}
+
+export default defineComponent({
+    name: 'purchase-real-time',
+    components: {},
+    setup() {
+        const { customList, actionQuery } = getCustomList();
+        initData(() => {
+            actionQuery();
+            // 加载数据在这里
+        });
+        return { customList };
+    },
+});
+</script>
+
+<style lang="less">
+.purchase-real-time {
+}
+</style>;

+ 83 - 0
src/views/business/purchase/list/spot/index.vue

@@ -0,0 +1,83 @@
+<template>
+  <!-- 采购: 现货头寸-->
+  <div class="purchase-spot-position">
+    采购: 现货头寸
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { QueryCustomInfo } from '@/goServiceAPI/ermcp/customInfo/index';
+import { QueryCustomInfoType } from '@/goServiceAPI/ermcp/customInfo/interface';
+import { message } from 'ant-design-vue';
+import { initData } from '@/setup/methods/index';
+
+// 查询客户资料列表
+function getCustomList() {
+    // const filteredInfo = ref();
+    // const sortedInfo = ref();
+    // const columns = computed(() => {
+    //     const filtered = filteredInfo.value || {};
+    //     const sorted = sortedInfo.value || {};
+    //     return [
+    //         {
+    //             title: '序号',
+    //             dataIndex: 'index',
+    //             key: 'index',
+    //             align: 'center',
+    //             width: 50,
+    //             customRender: (param: any) => `${param.index + 1}`,
+    //         },
+    //         {
+    //             title: 'Age',
+    //             dataIndex: 'age',
+    //             key: 'age',
+    //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
+    //             sortOrder: sorted.columnKey === 'age' && sorted.order,
+    //         },
+    //         {
+    //             title: 'Address',
+    //             dataIndex: 'address',
+    //             key: 'address',
+    //             filters: [
+    //                 { text: 'London', value: 'London' },
+    //                 { text: 'New York', value: 'New York' },
+    //             ],
+    //             filteredValue: filtered.address || null,
+    //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
+    //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
+    //             sortOrder: sorted.columnKey === 'address' && sorted.order,
+    //             ellipsis: true,
+    //         },
+    //     ];
+    // });
+    const customList = ref<QueryCustomInfoType[]>([]);
+    function actionQuery() {
+        QueryCustomInfo(4)
+            .then((res) => {
+                console.log('L', res);
+            })
+            .catch((err) => message.error(err));
+    }
+
+    return { customList, actionQuery };
+}
+
+export default defineComponent({
+    name: 'purchase-spot-position',
+    components: {},
+    setup() {
+        const { customList, actionQuery } = getCustomList();
+        initData(() => {
+            actionQuery();
+            // 加载数据在这里
+        });
+        return { customList };
+    },
+});
+</script>
+
+<style lang="less">
+.purchase-spot-position {
+}
+</style>;