huangbin 4 éve
szülő
commit
42b25f0c45

+ 26 - 0
src/enums/routerName.ts

@@ -0,0 +1,26 @@
+/** ============ 路由名字枚举 ============= */
+// 控制路由跳转时候根据路由名字来,定义枚举方便理解
+
+// 客户资料
+export const enum CustomInfo {
+    normal = 'custom_info_normal', // 正常
+    stop = 'custom_info_stop',  // 停用
+}
+// 商品信息
+export const enum GoodsInfo {
+    spot = 'goods_info_spot', // 现货品种
+    hedging = 'goods_info_hedging',  // 套保品种
+}
+// 现货合同
+export const enum SpotContract {
+    notCommit = 'spot_contract-not-commit', // 未提交
+    peddding = 'spot_contract-peddding',  // 待审核
+    performance = 'spot_contract-performance',  // 履约中
+    done = 'spot_contract-done',  // 已完成
+}
+// 仓库信息
+export const enum WarehouseInfo {
+    normal = 'warehouse-info-normal', // 正常
+    stop = 'warehouse-info-stop',  // 停用
+}
+

+ 32 - 11
src/router/index.ts

@@ -1,7 +1,9 @@
+import * as EnumType from '@/enums/routerName';
 import Layout from '@/layout/index.vue';
 import { isLogin } from '@/services/bus/login';
 import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
 import eventBus from '../utils/eventBus';
+
 const routes: Array<RouteRecordRaw> = [
     {
         path: '/login',
@@ -47,11 +49,11 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
-                redirect: to => { return { name: 'custom_info_normal' } },
+                redirect: to => { return { name: EnumType.CustomInfo.normal } },
                 children: [
                     {
                         path: '/custom_info/normal',
-                        name: 'custom_info_normal',
+                        name: EnumType.CustomInfo.normal,
                         component: () => import('@/views/information/custom/list/normal-use/index.vue'),
                         meta: {
                             requireAuth: true
@@ -59,7 +61,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/custom_info/stop',
-                        name: 'custom_info_stop',
+                        name: EnumType.CustomInfo.stop,
                         component: () => import('@/views/information/custom/list/stop-use/index.vue'),
                         meta: {
                             requireAuth: true
@@ -74,11 +76,11 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
-                redirect: to => { return { name: 'goods_info_spot' } },
+                redirect: to => { return { name: EnumType.GoodsInfo.spot } },
                 children: [
                     {
                         path: '/goods_info/spot',
-                        name: 'goods_info_spot',
+                        name: EnumType.GoodsInfo.spot,
                         component: () => import('@/views/information/goods/list/spot-variety/index.vue'),
                         meta: {
                             requireAuth: true
@@ -86,7 +88,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/goods_info/hedging',
-                        name: 'goods_info_hedging',
+                        name: EnumType.GoodsInfo.hedging,
                         component: () => import('@/views/information/goods/list/hedging-variety/index.vue'),
                         meta: {
                             requireAuth: true
@@ -117,11 +119,11 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
-                redirect: to => { return { name: 'spot_contract-not-commit' } },
+                redirect: to => { return { name: EnumType.SpotContract.notCommit } },
                 children: [
                     {
                         path: '/spot_contract/not-commit',
-                        name: 'spot_contract-not-commit',
+                        name: EnumType.SpotContract.notCommit,
                         component: () => import('@/views/information/spot-contract/list/not-commit/index.vue'),
                         meta: {
                             requireAuth: true
@@ -129,7 +131,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/spot_contract/done',
-                        name: 'spot_contract-done',
+                        name: EnumType.SpotContract.done,
                         component: () => import('@/views/information/spot-contract/list/done/index.vue'),
                         meta: {
                             requireAuth: true
@@ -137,7 +139,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/spot_contract/peddding',
-                        name: 'spot_contract-peddding',
+                        name: EnumType.SpotContract.peddding,
                         component: () => import('@/views/information/spot-contract/list/peddding/index.vue'),
                         meta: {
                             requireAuth: true
@@ -145,7 +147,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/spot_contract/performance',
-                        name: 'spot_contract-performance',
+                        name: EnumType.SpotContract.performance,
                         component: () => import('@/views/information/spot-contract/list/performance/index.vue'),
                         meta: {
                             requireAuth: true
@@ -160,6 +162,25 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true
                 },
+                redirect: to => { return { name: EnumType.WarehouseInfo.normal } },
+                children: [
+                    {
+                        path: '/warehouse_info/normal',
+                        name: EnumType.WarehouseInfo.normal,
+                        component: () => import('@/views/information/warehouse-info/list/normal-use/index.vue'),
+                        meta: {
+                            requireAuth: true
+                        },
+                    },
+                    {
+                        path: '/warehouse_info/stop',
+                        name: EnumType.WarehouseInfo.stop,
+                        component: () => import('@/views/information/warehouse-info/list/stop-use/index.vue'),
+                        meta: {
+                            requireAuth: true
+                        },
+                    },
+                ]
             },
             {
                 path: '/exposure',

+ 3 - 2
src/views/information/custom/index.vue

@@ -12,13 +12,14 @@
 import { defineComponent } from 'vue';
 import firstMenu from '@/components/firstMenu/index.vue';
 import { useRouter } from 'vue-router';
+import { CustomInfo } from '@/enums/routerName';
 
 // 处理菜单
 function handleMenu() {
     const router = useRouter();
     const list = [
-        { key: 'custom_info_normal', value: '正常' },
-        { key: 'custom_info_stop', value: '停用' },
+        { key: CustomInfo.normal, value: '正常' },
+        { key: CustomInfo.stop, value: '停用' },
     ];
     function selectMenu(item: any) {
         router.push({ name: item.key });

+ 3 - 2
src/views/information/goods/index.vue

@@ -12,13 +12,14 @@
 import { defineComponent } from 'vue';
 import firstMenu from '@/components/firstMenu/index.vue';
 import { useRouter } from 'vue-router';
+import { GoodsInfo } from '@/enums/routerName';
 
 // 处理菜单
 function handleMenu() {
     const router = useRouter();
     const list = [
-        { key: 'goods_info_spot', value: '现货品种' },
-        { key: 'goods_info_hedging', value: '套保品种' },
+        { key: GoodsInfo.spot, value: '现货品种' },
+        { key: GoodsInfo.hedging, value: '套保品种' },
     ];
     function selectMenu(item: any) {
         router.push({ name: item.key });

+ 5 - 4
src/views/information/spot-contract/index.vue

@@ -12,15 +12,16 @@
 import { defineComponent } from 'vue';
 import firstMenu from '@/components/firstMenu/index.vue';
 import { useRouter } from 'vue-router';
+import { SpotContract } from '@/enums/routerName';
 
 // 处理菜单
 function handleMenu() {
     const router = useRouter();
     const list = [
-        { key: 'spot_contract-not-commit', value: '未提交' },
-        { key: 'spot_contract-peddding', value: '待审核' },
-        { key: 'spot_contract-performance', value: '履约中' },
-        { key: 'spot_contract-done', value: '已完成' },
+        { key: SpotContract.notCommit, value: '未提交' },
+        { key: SpotContract.peddding, value: '待审核' },
+        { key: SpotContract.performance, value: '履约中' },
+        { key: SpotContract.done, value: '已完成' },
     ];
     function selectMenu(item: any) {
         router.push({ name: item.key });

+ 25 - 3
src/views/information/warehouse-info/index.vue

@@ -1,18 +1,40 @@
 <template>
   <!-- 仓库信息 -->
   <div class="warehouse-info">
-    "仓库信息"
+    <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 { WarehouseInfo } from '@/enums/routerName';
+
+// 处理菜单
+function handleMenu() {
+    const router = useRouter();
+    const list = [
+        { key: WarehouseInfo.normal, value: '正常' },
+        { key: WarehouseInfo.stop, value: '停用' },
+    ];
+    function selectMenu(item: any) {
+        router.push({ name: item.key });
+    }
+    return { list, selectMenu };
+}
 
 export default defineComponent({
     name: 'warehouse-info',
-    components: {},
+    components: {
+        firstMenu,
+    },
     setup() {
-        return {};
+        const { list, selectMenu } = handleMenu();
+        return { list, selectMenu };
     },
 });
 </script>

+ 92 - 0
src/views/information/warehouse-info/list/normal-use/index.vue

@@ -0,0 +1,92 @@
+<template>
+  <!-- 仓库信息: 正常 -->
+  <div class="warehouse-info-normal">
+    仓库信息: 正常
+    <div class="table-operations">
+      <a-button>查询</a-button>
+      <a-button>重置</a-button>
+      <a-button>新增</a-button>
+    </div>
+    <!-- <a-table :columns="columns"
+             :data-source="data"
+             @change="handleChange" /> -->
+  </div>
+</template>
+
+<script lang="ts">
+import { computed, defineComponent, ref } from 'vue';
+
+import { initData } from '@/setup/methods/index';
+import { QueryCustomInfo } from '@/goServiceAPI/ermcp/customInfo/index';
+import { QueryCustomInfoType } from '@/goServiceAPI/ermcp/customInfo/interface';
+import { message } from 'ant-design-vue';
+
+// 查询客户资料列表
+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(3)
+            .then((res) => {
+                console.log('L', res);
+            })
+            .catch((err) => message.error(err));
+    }
+
+    return { customList, actionQuery };
+}
+
+export default defineComponent({
+    name: 'warehouse-info-normal',
+    components: {},
+    setup() {
+        const { customList, actionQuery } = getCustomList();
+        initData(() => {
+            actionQuery();
+            // 加载数据在这里
+        });
+        return { customList };
+    },
+});
+</script>
+
+<style lang="less">
+.warehouse-info-normal {
+}
+</style>;

+ 83 - 0
src/views/information/warehouse-info/list/stop-use/index.vue

@@ -0,0 +1,83 @@
+<template>
+  <!-- 仓库信息: 停用 -->
+  <div class="warehouse-info-stop">
+    仓库信息: 停用
+  </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: 'warehouse-info-stop',
+    components: {},
+    setup() {
+        const { customList, actionQuery } = getCustomList();
+        initData(() => {
+            actionQuery();
+            // 加载数据在这里
+        });
+        return { customList };
+    },
+});
+</script>
+
+<style lang="less">
+.warehouse-info-stop {
+}
+</style>;