Browse Source

修改文件 命名

huangbin 4 years ago
parent
commit
3bbe6954e2

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

@@ -1,6 +1,12 @@
 export interface MenuType {
     custom_info_normal: string; // 客户资料 正常
     custom_info_disabled: string; // 客户资料 停用
+
+    spot_contract_unsubmitted: string; // 现货合同 未提交
+    spot_contract_checkpending: string; // 现货合同 待审核
+    spot_contract_performance: string; // 现货合同 履约中
+    spot_contract_finished: string; // 现货合同 已完成
+
 }
 
 export interface BtnType {
@@ -9,4 +15,10 @@ export interface BtnType {
     custom_info_btn_disable: string; // 客户资料 停用
     custom_info_btn_recover: string; // 客户资料 恢复
     custom_info_btn_delete: string; // 客户资料 删除
+
+    spot_contract_btn_add: string; // 现货合同 添加
+    spot_contract_btn_resubmit: string; // 现货合同 重新提交
+    spot_contract_btn_modify: string; // 现货合同 修改
+    spot_contract_btn_delete: string; // 现货合同 删除
+
 }

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

@@ -16,4 +16,6 @@ export interface ModalName {
     modifySpotContract: string; // 修改现货合同
     deleteSpotContract: string; // 删除现货合同
     spotContractDetail: string; // 现货合同详情
+
+
 }

+ 0 - 0
src/views/information/custom/compoments/addCustom/index.vue → src/views/information/custom/compoments/add/index.vue


+ 0 - 0
src/views/information/custom/compoments/deleteCustom/index.vue → src/views/information/custom/compoments/delete/index.vue


+ 0 - 0
src/views/information/custom/compoments/customDetail/index.vue → src/views/information/custom/compoments/detail/index.vue


+ 0 - 0
src/views/information/custom/compoments/disableCustom/index.vue → src/views/information/custom/compoments/disable/index.vue


+ 0 - 0
src/views/information/custom/compoments/modifyCustom/index.vue → src/views/information/custom/compoments/modify/index.vue


+ 4 - 4
src/views/information/custom/list/normal-use/index.vue

@@ -39,10 +39,10 @@ import { MenuItem } from '@/common/components/contextMenu/interface';
 import contextMenu from '@/common/components/contextMenu/index.vue';
 import { getCustomList } from '../setup';
 import { openModal } from '@/common/setup/modal/index';
-import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
-import ModifyCustom from '@/views/information/custom/compoments/modifyCustom/index.vue';
-import DisableCustom from '@/views/information/custom/compoments/disableCustom/index.vue';
-import AddCustom from '@/views/information/custom/compoments/addCustom/index.vue';
+import CustomDetail from '@/views/information/custom/compoments/detail/index.vue';
+import ModifyCustom from '@/views/information/custom/compoments/modify/index.vue';
+import DisableCustom from '@/views/information/custom/compoments/disable/index.vue';
+import AddCustom from '@/views/information/custom/compoments/add/index.vue';
 import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
 
 export default defineComponent({

+ 3 - 3
src/views/information/custom/list/stop-use/index.vue

@@ -39,10 +39,10 @@ import { MenuItem } from '@/common/components/contextMenu/interface';
 import contextMenu from '@/common/components/contextMenu/index.vue';
 import { getCustomList } from '../setup';
 import { openModal } from '@/common/setup/modal/index';
-import CustomDetail from '@/views/information/custom/compoments/customDetail/index.vue';
-import DeleteCustom from '@/views/information/custom/compoments/deleteCustom/index.vue';
+import CustomDetail from '@/views/information/custom/compoments/detail/index.vue';
+import DeleteCustom from '@/views/information/custom/compoments/delete/index.vue';
 import RecoverCustom from '@/views/information/custom/compoments/recover/index.vue';
-import AddCustom from '@/views/information/custom/compoments/addCustom/index.vue';
+import AddCustom from '@/views/information/custom/compoments/add/index.vue';
 import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
 
 export default defineComponent({

+ 152 - 0
src/views/information/spot-contract/components/detail/index.vue

@@ -0,0 +1,152 @@
+<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-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="客户类型">
+            <span class="white">企业</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="企业名称">
+            <span class="white">深圳市前海矿业有限公司</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="企业简称">
+            <span class="white">前海矿业</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件类型">
+            <span class="white">营业执照</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="法定代表人">
+            <span class="white">李顺利</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件号码">
+            <span class="white">4328648236492432</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="纳税人识别号">
+            <span class="white">57465736DR46456</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="营业执照">
+            <div class="upload">
+              <a class="blue">查看附件</a>
+            </div>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="联系人">
+            <span class="white">王平</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="联系人手机号">
+            <span class="white">13745653421</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="联系电话">
+            <span class="white">0755-34342544</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="状态">
+            <span class="green">正常</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="通讯地址">
+            <span class="white">广东省深圳市南山区前海街道路平路1324号</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="备注">
+            <span class="white">深圳市前海矿业有限公司</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'custom-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('spotContractDetail');
+        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">
+.custom-detail {
+}
+.ant-form.inlineForm {
+    margin-top: 20px;
+}
+.white {
+    color: @m-white0;
+}
+.blue {
+    color: @m-blue0;
+}
+.green {
+    color: @m-green0;
+}
+</style
+>;

+ 24 - 27
src/views/information/spot-contract/list/not-commit/index.vue

@@ -4,7 +4,7 @@
     <filterCustomTable @search="search">
       <a-button class="operBtn"
                 v-if="hasPermission('spot_contract_btn_add')"
-                @click="openAction">新增</a-button>
+                @click="addAction">新增</a-button>
     </filterCustomTable>
     <contextMenu :contextMenuList="contextMenuList"
                  :tableList="spotContractList">
@@ -20,11 +20,13 @@
     </contextMenu>
     <!-- 新增现货合同 -->
     <AddSpotContract />
+    <!-- 现货合同: 详情 -->
+    <SpotContractDeatil />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, Ref, ref } from 'vue';
+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';
@@ -32,27 +34,8 @@ 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';
-
-// 处理现货合同详情
-function handleDetail(contextMenuList: Ref<MenuItem[]>) {
-    const { openAction } = openModal('spotContractDetail');
-    contextMenuList.value.push({ lable: '详情', callback: openAction });
-}
-// 重新提交现货合同
-function handleResubmit(contextMenuList: Ref<MenuItem[]>) {
-    const { openAction } = openModal('resubmitSpotContract');
-    contextMenuList.value.push({ lable: '重新提交', callback: openAction });
-}
-// 删除现货合同
-function handleDelete(contextMenuList: Ref<MenuItem[]>) {
-    const { openAction } = openModal('deleteSpotContract');
-    contextMenuList.value.push({ lable: '删除', callback: openAction });
-}
-// 修改现货合同
-function handleModify(contextMenuList: Ref<MenuItem[]>) {
-    const { openAction } = openModal('modifySpotContract');
-    contextMenuList.value.push({ lable: '修改', callback: openAction });
-}
+import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
+import SpotContractDeatil from '@/views/information/spot-contract/components/detail/index.vue';
 
 export default defineComponent({
     name: 'spot-contract-not-commit',
@@ -60,17 +43,31 @@ export default defineComponent({
         filterCustomTable,
         contextMenu,
         AddSpotContract,
+        SpotContractDeatil,
     },
     setup() {
-        const { spotContractList, actionQuery, columns, getColumns, search, loading, handlePermission } = getCustomList();
-        const { hasPermission } = handlePermission('spot_contract_unsubmitted');
-        const { openAction } = openModal('addSpotContract');
         const contextMenuList = ref<MenuItem[]>([]);
+        const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
+        const { hasPermission } = handlePermission('spot_contract_unsubmitted');
+        const { openAction: addAction } = openModal('addSpotContract');
+
+        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, openAction, loading, hasPermission };
+        return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
     },
 });
 </script>

+ 2 - 24
src/views/information/spot-contract/list/setup.ts

@@ -1,9 +1,8 @@
 import { ColumnType, getTableHead } from '@/common/methods/table';
-import { OperationTabMenu } from '@/services/go/commonService/interface';
 import { QuerySpotContract } from '@/services/go/ermcp/spot-contract/index';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { message } from 'ant-design-vue';
-import { inject, Ref, ref } from 'vue';
+import { ref } from 'vue';
 
 // 处理现货列表
 export function getCustomList() {
@@ -14,7 +13,6 @@ export function getCustomList() {
     // 过滤项
     const filteredInfo = ref();
     const loading = ref<boolean>(false);
-    const permissionData = inject('thirdMenuList') as Ref<OperationTabMenu[]>;
     // 获取表头
     function getColumns() {
         const list = getTableHead('table_pcweb_delivery');
@@ -82,25 +80,5 @@ export function getCustomList() {
         getColumns();
     }
 
-    // 处理按钮是否有权限
-    type customType = 'spot_contract_unsubmitted' | 'spot_contract_checkpending' | 'spot_contract_performance' | 'spot_contract_finished';
-    // 未提交 | "待审核" | "履约中" | "已完成"
-    function handlePermission(menuType: customType) {
-        // "新增" | "重新提交" | "修改" | "删除" |
-        type codeType = 'spot_contract_btn_add' | 'spot_contract_btn_resubmit' | 'spot_contract_btn_modify' | 'spot_contract_btn_delete';
-
-        // 判断按钮是否有权限
-        function hasPermission(type: codeType): boolean {
-            let result = false;
-            if (permissionData) {
-                const btnList = permissionData.value.find((e) => e.code === menuType);
-                if (btnList && btnList.children) {
-                    result = btnList.children.find((e) => e.code === type && e.type === 2) ? true : false;
-                }
-            }
-            return result;
-        }
-        return { hasPermission };
-    }
-    return { spotContractList, actionQuery, columns, filteredInfo, getColumns, search, loading, handlePermission };
+    return { spotContractList, actionQuery, columns, filteredInfo, getColumns, search, loading };
 }