瀏覽代碼

修改现货合同 待审核

huangbin 4 年之前
父節點
當前提交
cdfdef43ec

+ 3 - 0
src/common/setup/buttonPermission/interface.ts

@@ -20,5 +20,8 @@ export interface BtnType {
     spot_contract_btn_resubmit: string; // 现货合同 重新提交
     spot_contract_btn_modify: string; // 现货合同 修改
     spot_contract_btn_delete: string; // 现货合同 删除
+    spot_contract_btn_finish: string; // 现货合同 正常完结
+    spot_contract_btn_check: string; // 现货合同 审核
+    spot_contract_btn_cancel: string; // 现货合同 撤销
 
 }

+ 3 - 0
src/common/setup/modal/interface.ts

@@ -16,6 +16,9 @@ export interface ModalName {
     modifySpotContract: string; // 修改现货合同
     deleteSpotContract: string; // 删除现货合同
     spotContractDetail: string; // 现货合同详情
+    spotContractFinished: string; // 现货合同详情
+    spotContractCheck: string; // 现货合同 审核
+    spotContractCancel: string; // 现货合同 撤销
 
     addGoods: string; // 新增商品
 

+ 8 - 8
src/router/index.ts

@@ -112,33 +112,33 @@ const routes: Array<RouteRecordRaw> = [
                 },
                 children: [
                     {
-                        path: '/spot_contract/not-commit',
+                        path: '/spot_contract/unsubmitted',
                         name: 'spot_contract_unsubmitted',
-                        component: () => import('@/views/information/spot-contract/list/not-commit/index.vue'),
+                        component: () => import('@/views/information/spot-contract/list/unsubmitted/index.vue'),
                         meta: {
                             requireAuth: true,
                         },
                     },
                     {
-                        path: '/spot_contract/done',
+                        path: '/spot_contract/checkpending',
                         name: 'spot_contract_checkpending',
-                        component: () => import('@/views/information/spot-contract/list/done/index.vue'),
+                        component: () => import('@/views/information/spot-contract/list/checkpending/index.vue'),
                         meta: {
                             requireAuth: true,
                         },
                     },
                     {
-                        path: '/spot_contract/peddding',
+                        path: '/spot_contract/performance',
                         name: 'spot_contract_performance',
-                        component: () => import('@/views/information/spot-contract/list/peddding/index.vue'),
+                        component: () => import('@/views/information/spot-contract/list/performance/index.vue'),
                         meta: {
                             requireAuth: true,
                         },
                     },
                     {
-                        path: '/spot_contract/performance',
+                        path: '/spot_contract/finished',
                         name: 'spot_contract_finished',
-                        component: () => import('@/views/information/spot-contract/list/performance/index.vue'),
+                        component: () => import('@/views/information/spot-contract/list/finished/index.vue'),
                         meta: {
                             requireAuth: true,
                         },

+ 0 - 30
src/views/information/custom/index.vue

@@ -1,30 +0,0 @@
-<template>
-    <!-- 客户信息 -->
-    <div class="custom">
-        <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 { initData } from '@/common/methods';
-    import { handleRouterMenu } from '@/common/setup/router/index';
-
-    export default defineComponent({
-        name: 'custom',
-        components: {
-            firstMenu,
-        },
-        setup() {
-            const { list, selectMenu, getMenuList } = handleRouterMenu();
-            initData(() => {
-                getMenuList();
-            });
-            return { list, selectMenu };
-        },
-    });
-</script>
-
-<style lang="less"></style>;

+ 41 - 34
src/views/information/spot-contract/components/add/index.vue

@@ -1,42 +1,49 @@
 <template>
-    <!-- 新增客户资料 -->
-    <a-modal class="add-spot-contract" title="新增现货合同" v-model:visible="visible" @cancel="cancel" width="890px">
-        <template #footer>
-            <a-button key="submit" type="primary" :loading="loading" @click="submit">完成</a-button>
-        </template>
-    </a-modal>
+  <!-- 新增客户资料 -->
+  <a-modal class="add-spot-contract"
+           title="新增现货合同"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">完成</a-button>
+    </template>
+  </a-modal>
 </template>
 
 <script lang="ts">
-    import { defineComponent, ref } from 'vue';
-    import { closeModal } from '@/common/setup/modal/index';
-    import { initData } from '@/common/methods';
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+import { initData } from '@/common/methods';
 
-    export default defineComponent({
-        name: 'add-spot-contract',
-        components: {},
-        setup() {
-            const { visible, cancel } = closeModal('addSpotContract');
-            const loading = ref<boolean>(false);
-            function submit() {
-                loading.value = true;
-                setTimeout(() => {
-                    loading.value = false;
-                    cancel();
-                }, 2000);
-            }
-            initData(() => {});
-            return {
-                visible,
-                cancel,
-                submit,
-                loading,
-            };
-        },
-    });
+export default defineComponent({
+    name: 'add-spot-contract',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('addSpotContract');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        initData(() => {});
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .add-spot-contract {
-    }</style
->;
+.add-spot-contract {
+}
+</style>;

+ 46 - 0
src/views/information/spot-contract/components/cancel/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 现货合同撤销-->
+  <a-modal class="add-custom custom-detail"
+           title="现货合同撤销"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+    现货合同撤销
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'spot-contract-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('spotContractCancel');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 46 - 0
src/views/information/spot-contract/components/check/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 现货合同审核-->
+  <a-modal class="add-custom custom-detail"
+           title="现货合同审核"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+    现货合同审核
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'spot-contract-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('spotContractCheck');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 46 - 0
src/views/information/spot-contract/components/finish/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 现货合同正常完结-->
+  <a-modal class="add-custom custom-detail"
+           title="现货合同正常完结"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+    现货合同正常完结
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'spot-contract-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('spotContractFinished');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 0 - 33
src/views/information/spot-contract/index.vue

@@ -1,33 +0,0 @@
-<template>
-    <!-- 现货合同 -->
-    <div class="spot-contract">
-        <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: 'spot-contract',
-        components: {
-            firstMenu,
-        },
-        setup() {
-            const { list, selectMenu, getMenuList } = handleRouterMenu();
-            initData(() => {
-                getMenuList();
-            });
-            return { list, selectMenu };
-        },
-    });
-</script>
-
-<style lang="less">
-    .spot-contract {
-    }</style
->;

+ 84 - 0
src/views/information/spot-contract/list/checkpending/index.vue

@@ -0,0 +1,84 @@
+<template>
+  <!-- 现货合同: 待审核-->
+  <div class="spot-contract-peddding">
+    <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>
+    <!-- 现货合同: 详情 -->
+    <SpotContractDeatil />
+    <!-- 现货合同: 审核 -->
+    <Check />
+    <!-- 现货合同: 撤销 -->
+    <Cancel />
+  </div>
+</template>
+
+<script lang="ts">
+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 Check from '@/views/information/spot-contract/components/check/index.vue';
+import Cancel from '@/views/information/spot-contract/components/cancel/index.vue';
+
+export default defineComponent({
+    name: 'spot-contract-peddding',
+    components: {
+        filterCustomTable,
+        contextMenu,
+        AddSpotContract,
+        SpotContractDeatil,
+        Check,
+        Cancel,
+    },
+    setup() {
+        const contextMenuList = ref<MenuItem[]>([]);
+        const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
+        const { hasPermission } = handlePermission('spot_contract_checkpending');
+        const { openAction: addAction } = openModal('addSpotContract');
+
+        detailButton('spotContractDetail', contextMenuList);
+        const { action: checkAction } = permissionButton('spotContractCheck', '审核', contextMenuList);
+        const { action: cancelAction } = permissionButton('spotContractCancel', '撤销', contextMenuList);
+
+        const stop = watchEffect(() => {
+            hasPermission('spot_contract_btn_check') && checkAction();
+            hasPermission('spot_contract_btn_cancel') && cancelAction();
+        });
+        onUnmounted(() => {
+            stop();
+        });
+        initData(() => {
+            actionQuery(2);
+            getColumns();
+        });
+        return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
+    },
+});
+</script>
+
+<style lang="less">
+.spot-contract-peddding {
+}
+</style
+>;

+ 0 - 0
src/views/information/spot-contract/list/done/index.vue → src/views/information/spot-contract/list/finished/index.vue


+ 0 - 83
src/views/information/spot-contract/list/peddding/index.vue

@@ -1,83 +0,0 @@
-<template>
-    <!-- 现货合同: 待审核-->
-    <div class="spot-contract-peddding">
-        现货合同: 待审核
-    </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';
-
-    // 查询客户资料列表
-    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
->;

+ 73 - 72
src/views/information/spot-contract/list/performance/index.vue

@@ -1,83 +1,84 @@
 <template>
-    <!-- 现货合同: 履约中-->
-    <div class="spot-contract-performance">
-        客户信息: 履约中
-    </div>
+  <!-- 现货合同: 履约中-->
+  <div class="spot-contract-performance">
+    客户信息: 履约中
+  </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, 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';
 
-    // 查询客户资料列表
-    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 };
+// 查询客户资料列表
+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-performance',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+    return { customList, actionQuery };
+}
+
+export default defineComponent({
+    name: 'spot-contract-performance',
+    components: {},
+    setup() {
+        const { customList, actionQuery } = getCustomList();
+        initData(() => {
+            actionQuery();
+            // 加载数据在这里
+        });
+        return { customList };
+    },
+});
 </script>
 
 <style lang="less">
-    .spot-contract-performance {
-    }</style
+.spot-contract-performance {
+}
+</style
 >;

+ 0 - 0
src/views/information/spot-contract/list/not-commit/index.vue → src/views/information/spot-contract/list/unsubmitted/index.vue