huangbin vor 4 Jahren
Ursprung
Commit
e2868c72e6

+ 6 - 6
src/router/index.ts

@@ -197,11 +197,11 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true,
                 },
-                redirect: { name: EnumType.Purchase.pending },
+                redirect: { name: 'purchase_pending' },
                 children: [
                     {
                         path: '/purchase/pending',
-                        name: EnumType.Purchase.pending,
+                        name: 'purchase_pending',
                         component: () => import('@/views/business/purchase/list/pending/index.vue'),
                         meta: {
                             requireAuth: true,
@@ -209,7 +209,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/purchase/performance',
-                        name: EnumType.Purchase.performance,
+                        name: 'purchase_performance',
                         component: () => import('@/views/business/purchase/list/performance/index.vue'),
                         meta: {
                             requireAuth: true,
@@ -217,7 +217,7 @@ const routes: Array<RouteRecordRaw> = [
                     },
                     {
                         path: '/purchase/all',
-                        name: EnumType.Purchase.all,
+                        name: 'purchase_all',
                         component: () => import('@/views/business/purchase/list/all/index.vue'),
                         meta: {
                             requireAuth: true,
@@ -232,11 +232,11 @@ const routes: Array<RouteRecordRaw> = [
                 meta: {
                     requireAuth: true,
                 },
-                redirect: { name: EnumType.Sell.pending },
+                redirect: { name: 'sell_pending' },
                 children: [
                     {
                         path: '/sell/pending',
-                        name: EnumType.Sell.pending,
+                        name: 'sell_pending',
                         component: () => import('@/views/business/sell/list/pending/index.vue'),
                         meta: {
                             requireAuth: true,

+ 16 - 4
src/views/business/sell/index.vue

@@ -1,18 +1,30 @@
 <template>
   <!-- 销售-->
   <div class="sell">
-    销售
+    <firstMenu :list="list"
+               :value="'title'"
+               @selectMenu="selectMenu" />
+    <router-view />
   </div>
 </template>
 
 <script lang="ts">
 import { defineComponent } from 'vue';
-
+import firstMenu from '@/common/components/firstMenu/index.vue';
+import { handleRouterMenu } from '@/common/setup/router/index';
+import { initData } from '@/common/methods';
 export default defineComponent({
     name: 'sell',
-    components: {},
+    components: {
+        firstMenu,
+    },
     setup() {
-        return {};
+        const { list, selectMenu, getMenuList } = handleRouterMenu();
+        initData(() => {
+            getMenuList();
+            console.log('list', list);
+        });
+        return { list, selectMenu };
     },
 });
 </script>

+ 81 - 74
src/views/information/spot-contract/list/done/index.vue

@@ -1,83 +1,90 @@
 <template>
-    <!-- 现货合同: 已完成-->
-    <div class="spot-contract-done">
-        客户信息: 已完成
-    </div>
+  <!-- 现货合同: 已完成-->
+  <div class="spot-contract-done">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-if="hasPermission('spot_contract_btn_add')"
+                @click="addAction">新增</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="contextMenuList"
+                 :tableList="spotContractList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="spotContractList">
+        <!-- <template #userinfotype="{ text }">
+          <a>{{ text === '2' ? '企业' : '个人'}}</a>
+        </template> -->
+      </a-table>
+    </contextMenu>
+    <!-- 新增现货合同 -->
+    <AddSpotContract />
+    <!-- 现货合同: 详情 -->
+    <SpotContractDeatil />
+    <!-- 现货合同: 修改 -->
+    <ModifySpotContract />
+    <!-- 现货合同: 删除 -->
+    <DeleteSpotContract />
+    <!-- 现货合同: 重新提交 -->
+    <ResubmitSpotContract />
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, ref } from 'vue';
-    import { QueryCustomInfo } from '@/services/go/ermcp/customInfo/index';
-    import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-    import { message } from 'ant-design-vue';
-    import { initData } from '@/common/methods';
+import { defineComponent, onUnmounted, ref, watchEffect } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '@/views/information/spot-contract/components/filterTable/index.vue';
+import { getCustomList } from '../setup';
+import { openModal } from '@/common/setup/modal/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import { MenuItem } from '@/common/components/contextMenu/interface';
+import AddSpotContract from '@/views/information/spot-contract/components/add/index.vue';
+import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
+import SpotContractDeatil from '@/views/information/spot-contract/components/detail/index.vue';
+import ModifySpotContract from '@/views/information/spot-contract/components/modify/index.vue';
+import DeleteSpotContract from '@/views/information/spot-contract/components/delete/index.vue';
+import ResubmitSpotContract from '@/views/information/spot-contract/components/resubmit/index.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(4)
-                .then((res) => {
-                    console.log('L', res);
-                })
-                .catch((err) => message.error(err));
-        }
+export default defineComponent({
+    name: 'spot-contract-done',
+    components: {
+        filterCustomTable,
+        contextMenu,
+        AddSpotContract,
+        SpotContractDeatil,
+        ModifySpotContract,
+        DeleteSpotContract,
+        ResubmitSpotContract,
+    },
+    setup() {
+        const contextMenuList = ref<MenuItem[]>([]);
+        const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
+        const { hasPermission } = handlePermission('spot_contract_unsubmitted');
+        const { openAction: addAction } = openModal('addSpotContract');
 
-        return { customList, actionQuery };
-    }
-
-    export default defineComponent({
-        name: 'spot-contract-done',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+        detailButton('spotContractDetail', contextMenuList);
+        const { action: modifyAction } = permissionButton('modifySpotContract', '修改', contextMenuList);
+        const { action: deleteAction } = permissionButton('deleteSpotContract', '删除', contextMenuList);
+        const { action: resubmitAction } = permissionButton('resubmitSpotContract', '重新提交', contextMenuList);
+        const stop = watchEffect(() => {
+            hasPermission('spot_contract_btn_modify') && modifyAction();
+            hasPermission('spot_contract_btn_delete') && deleteAction();
+            hasPermission('spot_contract_btn_resubmit') && resubmitAction();
+        });
+        onUnmounted(() => {
+            stop();
+        });
+        initData(() => {
+            actionQuery(2);
+            getColumns();
+        });
+        return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
+    },
+});
 </script>
 
 <style lang="less">
-    .spot-contract-done {
-    }</style
->;
+.spot-contract-done {
+}
+</style>;