Sfoglia il codice sorgente

修改现货合同

huangbin 4 anni fa
parent
commit
2a4e491c35

+ 8 - 21
src/views/information/spot-contract/list/checkpending/index.vue

@@ -4,10 +4,11 @@
        :loading="loading">
     <filterCustomTable @search="search">
       <a-button class="operBtn"
-                v-if="hasPermission('spot_contract_btn_add')"
-                @click="addAction">新增</a-button>
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
     </filterCustomTable>
-    <contextMenu :contextMenuList="contextMenuList"
+    <contextMenu :contextMenuList="forDataBtn"
                  :tableList="spotContractList">
       <a-table :columns="columns"
                class="topTable"
@@ -29,18 +30,17 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, onUnmounted, ref, watchEffect } from 'vue';
+import { defineComponent, ref } 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';
+import { getBtnList } from '@/common/setup/contextMenu/index';
 
 export default defineComponent({
     name: 'spot-contract-peddding',
@@ -55,26 +55,13 @@ export default defineComponent({
     setup() {
         const contextMenuList = ref<MenuItem[]>([]);
         const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-        const { hasPermission } = handlePermission('spot_contract_checkpending');
-        function addAction() {}
-        // const { openAction: addAction } = openModal('addSpotContract');
+        const { commonBtn, forDataBtn } = getBtnList('spot_contract_checkpending');
 
-        // 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 };
+        return { spotContractList, columns, search, contextMenuList, commonBtn, forDataBtn, loading };
     },
 });
 </script>

+ 7 - 12
src/views/information/spot-contract/list/finished/index.vue

@@ -4,10 +4,11 @@
     <filterCustomTable @search="search"
                        :loading="loading">
       <a-button class="operBtn"
-                v-if="hasPermission('spot_contract_btn_add')"
-                @click="addAction">新增</a-button>
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
     </filterCustomTable>
-    <contextMenu :contextMenuList="contextMenuList"
+    <contextMenu :contextMenuList="forDataBtn"
                  :tableList="spotContractList">
       <a-table :columns="columns"
                class="topTable"
@@ -23,7 +24,6 @@
     <AddSpotContract />
     <!-- 现货合同: 详情 -->
     <SpotContractDeatil />
-
   </div>
 </template>
 
@@ -32,12 +32,11 @@ import { defineComponent, ref } 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, handlePermission } from '@/common/setup/buttonPermission/index';
 import SpotContractDeatil from '@/views/information/spot-contract/components/detail/index.vue';
+import { getBtnList } from '@/common/setup/contextMenu/index';
 
 export default defineComponent({
     name: 'spot-contract-done',
@@ -50,17 +49,13 @@ export default defineComponent({
     setup() {
         const contextMenuList = ref<MenuItem[]>([]);
         const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-        const { hasPermission } = handlePermission('spot_contract_finished');
-        function addAction() {}
-        // const { openAction: addAction } = openModal('addSpotContract');
-
-        // detailButton('spotContractDetail', contextMenuList);
+        const { commonBtn, forDataBtn } = getBtnList('spot_contract_finished');
 
         initData(() => {
             actionQuery(4);
             getColumns();
         });
-        return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
+        return { spotContractList, columns, search, contextMenuList, commonBtn, forDataBtn, loading };
     },
 });
 </script>

+ 8 - 19
src/views/information/spot-contract/list/performance/index.vue

@@ -4,10 +4,11 @@
     <filterCustomTable @search="search"
                        :loading="loading">
       <a-button class="operBtn"
-                v-if="hasPermission('spot_contract_btn_add')"
-                @click="addAction">新增</a-button>
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
     </filterCustomTable>
-    <contextMenu :contextMenuList="contextMenuList"
+    <contextMenu :contextMenuList="forDataBtn"
                  :tableList="spotContractList">
       <a-table :columns="columns"
                class="topTable"
@@ -27,17 +28,16 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, onUnmounted, ref, watchEffect } from 'vue';
+import { defineComponent, ref } 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 Finish from '@/views/information/spot-contract/components/finish/index.vue';
+import { getBtnList } from '@/common/setup/contextMenu/index';
 
 export default defineComponent({
     name: 'spot-contract-performance',
@@ -51,24 +51,13 @@ export default defineComponent({
     setup() {
         const contextMenuList = ref<MenuItem[]>([]);
         const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-        const { hasPermission } = handlePermission('spot_contract_performance');
-        function addAction() {}
-        // const { openAction: addAction } = openModal('addSpotContract');
+        const { commonBtn, forDataBtn } = getBtnList('spot_contract_performance');
 
-        // detailButton('spotContractDetail', contextMenuList);
-        // const { action: checkAction } = permissionButton('spotContractFinish', '正常完结', contextMenuList);
-
-        // const stop = watchEffect(() => {
-        //     hasPermission('spot_contract_btn_finish') && checkAction();
-        // });
-        // onUnmounted(() => {
-        //     stop();
-        // });
         initData(() => {
             actionQuery(3);
             getColumns();
         });
-        return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
+        return { spotContractList, columns, search, contextMenuList, commonBtn, forDataBtn, loading };
     },
 });
 </script>

+ 8 - 19
src/views/information/spot-contract/list/unsubmitted/index.vue

@@ -4,10 +4,11 @@
        :loading="loading">
     <filterCustomTable @search="search">
       <a-button class="operBtn"
-                v-if="hasPermission('spot_contract_btn_add')"
-                @click="addAction">新增</a-button>
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
     </filterCustomTable>
-    <contextMenu :contextMenuList="contextMenuList"
+    <contextMenu :contextMenuList="forDataBtn"
                  :tableList="spotContractList">
       <a-table :columns="columns"
                class="topTable"
@@ -33,20 +34,18 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, onUnmounted, ref, watchEffect } from 'vue';
+import { defineComponent, onUnmounted, ref } 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';
-
+import { getBtnList } from '@/common/setup/contextMenu/index';
 export default defineComponent({
     name: 'spot-contract-not-commit',
     components: {
@@ -61,18 +60,8 @@ export default defineComponent({
     setup() {
         const contextMenuList = ref<MenuItem[]>([]);
         const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-        const { hasPermission } = handlePermission('spot_contract_unsubmitted');
-        const { openAction: addAction } = openModal('spot_contract_btn_add');
+        const { commonBtn, forDataBtn } = getBtnList('spot_contract_unsubmitted');
 
-        detailButton('detail', 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();
         });
@@ -80,7 +69,7 @@ export default defineComponent({
             actionQuery(1);
             getColumns();
         });
-        return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
+        return { spotContractList, columns, search, contextMenuList, commonBtn, forDataBtn, loading };
     },
 });
 </script>