Bläddra i källkod

Merge remote-tracking branch 'origin/master'

xkwg 4 år sedan
förälder
incheckning
7e160cb5aa
26 ändrade filer med 770 tillägg och 332 borttagningar
  1. 23 2
      src/assets/styles/mixin.less
  2. 2 2
      src/common/components/firstMenu/index.vue
  3. 5 1
      src/common/constants/buttonType.ts
  4. 3 0
      src/common/setup/buttonPermission/interface.ts
  5. 4 0
      src/common/setup/contextMenu/index.ts
  6. 64 24
      src/layout/components/main.vue
  7. 1 1
      src/layout/components/menu.vue
  8. 21 14
      src/layout/components/top.vue
  9. 0 9
      src/views/information/custom/compoments/detail/index.vue
  10. 199 2
      src/views/information/custom/compoments/modify/index.vue
  11. 2 2
      src/views/information/custom/compoments/recover/index.vue
  12. 2 9
      src/views/information/custom/list/normal-use/index.vue
  13. 9 26
      src/views/information/custom/list/stop-use/index.vue
  14. 8 21
      src/views/information/spot-contract/list/checkpending/index.vue
  15. 7 12
      src/views/information/spot-contract/list/finished/index.vue
  16. 8 19
      src/views/information/spot-contract/list/performance/index.vue
  17. 8 19
      src/views/information/spot-contract/list/unsubmitted/index.vue
  18. 2 2
      src/views/information/warehouse-info/compoments/add/index.vue
  19. 46 0
      src/views/information/warehouse-info/compoments/detail/index.vue
  20. 2 2
      src/views/information/warehouse-info/compoments/disable/index.vue
  21. 8 7
      src/views/information/warehouse-info/compoments/filterTable/index.vue
  22. 48 0
      src/views/information/warehouse-info/compoments/modify/index.vue
  23. 48 0
      src/views/information/warehouse-info/compoments/recover/index.vue
  24. 66 85
      src/views/information/warehouse-info/list/normal-use/index.vue
  25. 116 0
      src/views/information/warehouse-info/list/setup.ts
  26. 68 73
      src/views/information/warehouse-info/list/stop-use/index.vue

+ 23 - 2
src/assets/styles/mixin.less

@@ -447,13 +447,25 @@
         }
     }
 }
-.typeSelect.ant-select-single:extend(.inlineFormSelect.ant-select-single) {
+.typeSelect.ant-select-single {
+    .rounded-corners(3px);
+    border: 1px solid #2B3F52;
+    &:hover, &:focus {
+        border-color:#0C95FF;
+    }
     .ant-select-selector {
+        height: 30px;
+        padding: 0 8px;
+        background: #15202B;
+        border: 0;
+        color: #E5E5E5;
         .ant-select-selection-placeholder {
             color: @m-grey10;
         }
-    }
+        
+    } 
     .ant-select-arrow {
+        right: 8px;
         color: @m-blue0;
     }
 }
@@ -473,4 +485,13 @@
     &:hover,&:focus {
         border-color: @m-blue10;
     }
+}
+.white {
+    color: @m-white0;
+}
+.blue {
+    color: @m-blue0;
+}
+.green {
+    color: @m-green0;
 }

+ 2 - 2
src/common/components/firstMenu/index.vue

@@ -17,7 +17,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, computed, ref } from 'vue';
+import { defineComponent, PropType, ref, watchEffect } from 'vue';
 
 interface Key {
     [propName: string]: string;
@@ -43,7 +43,7 @@ export default defineComponent({
     components: {},
     setup(props, context) {
         const current = ref<string[]>(['0']);
-        computed(() => {
+        watchEffect(() => {
             current.value = props.selectedKey;
         });
         function menuClick(value: any) {

+ 5 - 1
src/common/constants/buttonType.ts

@@ -1,6 +1,5 @@
 export interface ButtonType {
     detail: string; // 详情
-    add: string; // 新增
 
     custom_info_btn_add: string; // 客户资料 添加
     custom_info_btn_modify: string; // 客户资料 修改
@@ -15,4 +14,9 @@ export interface ButtonType {
     spot_contract_btn_finish: string; // 现货合同 正常完结
     spot_contract_btn_check: string; // 现货合同 审核
     spot_contract_btn_cancel: string; // 现货合同 撤销
+
+    warehouse_info_btn_add: string; // 仓库信息 新增
+    warehouse_info_btn_modify: string; // 现货合同 修改
+    warehouse_info_btn_disable: string; // 现货合同 停用
+    warehouse_info_btn_recover: string; // 现货合同 恢复
 }

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

@@ -6,6 +6,9 @@ export interface MenuType {
     spot_contract_checkpending: string; // 现货合同 待审核
     spot_contract_performance: string; // 现货合同 履约中
     spot_contract_finished: string; // 现货合同 已完成
+    warehouse_info_normal: string; // 仓库信息 正常
+    warehouse_info_disabled: string; // 仓库信息 停用
+
 }
 
 export interface BtnType {

+ 4 - 0
src/common/setup/contextMenu/index.ts

@@ -35,6 +35,10 @@ export function getBtnList(menuType: keyof MenuType) {
     } else {
         console.warn(`menuType: ${menuType}未找到`)
     }
+    // 详情(所有页面都可以看到,没有权限之分)
+    const { openAction } = openModal('detail')
+    forDataBtn.value.push({ lable: '详情', callback: openAction })
+
     onUnmounted(() => {
         sessionStorageUtil.removeItem(name)
     });

+ 64 - 24
src/layout/components/main.vue

@@ -1,42 +1,41 @@
 <template>
   <div class="exposure">
-    <firstMenu :list="list"
-               :value="'title'"
-               :selectedKey="selectedKey"
-               @selectMenu="selectMenu" />
+    <div class="first-menu">
+      <a-menu class="a-menu_container"
+              theme="dark"
+              v-model:selectedKeys="selectedKey"
+              @click="selectMenu"
+              mode="horizontal">
+        <a-menu-item :key="String(index)"
+                     v-for="(item, index) in list">
+          {{ item.title}}
+        </a-menu-item>
+      </a-menu>
+      <div class="menu_right">
+        <!-- <slot></slot> -->
+      </div>
+    </div>
     <router-view />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, inject, ref, Ref, watchEffect } from 'vue';
-import firstMenu from '@/common/components/firstMenu/index.vue';
+import { defineComponent, inject, Ref } from 'vue';
 import { useRouter } from 'vue-router';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
 
 export default defineComponent({
     name: 'main',
-    components: {
-        firstMenu,
-    },
+    components: {},
     setup() {
         const router = useRouter();
         const list = inject('thirdMenuList') as Ref<OperationTabMenu[]>;
-        const selectedKey = ref<string[]>(['0']);
-        // watchEffect(() => {
-        //     list.value.forEach((e, i) => {
-        //         if (router.currentRoute.value.fullPath.includes(e.code)) {
-        //             console.log('i', i);
-
-        //             selectedKey.value = [`${i}`];
-        //         }
-        //     });
-        // });
+        const selectedKey = inject('index');
         // 切换路由
-        function selectMenu(item: OperationTabMenu) {
-            router.push({ name: item.code });
+        function selectMenu(value: any) {
+            const index = +value.key;
+            router.push({ name: list.value[index].code });
         }
-
         return { selectMenu, list, selectedKey };
     },
 });
@@ -45,5 +44,46 @@ export default defineComponent({
 <style lang="less">
 .sexposure {
 }
-</style
->;
+.noBorderBottom {
+    border-bottom: none;
+}
+.first-menu {
+    width: 100%;
+    height: 40px;
+    border-bottom: 1px solid @m-blue0 !important;
+    background-color: @m-black1;
+    .a-menu_container {
+        padding-top: 5px;
+        .flex();
+        height: 34px;
+        line-height: 34px;
+        .ant-menu-item {
+            min-width: 120px;
+            height: 34px;
+            line-height: 34px;
+            background: linear-gradient(0deg, #343d46 0%, #38444f 100%);
+            margin-left: 3px;
+            font-size: 16px;
+            columns: @m-grey2;
+            border-radius: 5px 5px 0px 0px;
+            cursor: pointer;
+            font-family: Adobe Heiti Std;
+            font-weight: normal;
+            &:hover {
+                .noBorderBottom;
+            }
+        }
+        .ant-menu-item-active {
+            .noBorderBottom;
+        }
+        .ant-menu-item-selected {
+            .noBorderBottom;
+            color: @m-white;
+            background: linear-gradient(0deg, #3270d2 0%, #3a87f7 100%);
+            &:hover {
+                color: @m-white;
+            }
+        }
+    }
+}
+</style>;

+ 1 - 1
src/layout/components/menu.vue

@@ -26,7 +26,7 @@
 </template>
 
 <script lang="ts">
-import { computed, defineComponent, ref, SetupContext, unref, watchEffect } from 'vue';
+import { defineComponent, ref, SetupContext, unref, watchEffect } from 'vue';
 import APP from '@/services';
 import { initData } from '@/common/methods';
 import { OperationTabMenu } from '@/services/go/commonService/interface';

+ 21 - 14
src/layout/components/top.vue

@@ -22,13 +22,10 @@
   </a-layout>
 </template>
 <script lang="ts">
-import { UserOutlined } from '@ant-design/icons-vue';
-import { defineComponent, ref, provide, unref } from 'vue';
+import { defineComponent, ref, provide } from 'vue';
 import Setting from '@/views/setting/index.vue';
 import CapitalInfo from '@/common/components/capitalInfo/index.vue';
 import SecondMenu from '@/common/components/secondeMenu/index.vue';
-import APP from '@/services';
-import { initData } from '@/common/methods';
 import { useRouter } from 'vue-router';
 import Drawer from '@/common/components/drawer/index.vue';
 import Header from './header.vue';
@@ -36,18 +33,10 @@ import Menu from './menu.vue';
 import Main from './main.vue';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
 
-//     // 配置是否显示下半部分
-//     function setShowBottomPart(code: string): boolean {
-//         // 显示下半部分 这里保存的是市场对应的 code
-//         const show: string[] = [''];
-//         return show.includes(code);
-//     }
-
 export default defineComponent({
     name: 'layout-top',
     components: {
         Setting,
-        UserOutlined,
         CapitalInfo,
         SecondMenu,
         Drawer,
@@ -57,7 +46,8 @@ export default defineComponent({
     },
     setup(props, context) {
         const router = useRouter();
-        const list = ref<OperationTabMenu[]>([]);
+        const list = ref<OperationTabMenu[]>([]); // 右边tab栏 需要的列表数据
+        const index = ref<string[]>(['0']); // 右边tab栏 具体选中的哪一个数据 默认第一个
         // 配置是否显示下半部分
         function setShowBottomPart(code: string) {
             // 显示下半部分 这里保存的是市场对应的 code
@@ -66,12 +56,29 @@ export default defineComponent({
         }
         // 选中菜单
         function chooseMenu(value: OperationTabMenu) {
+            const temp = router.currentRoute.value.name;
+            let name = temp;
+            if (temp === 'home') {
+                // 第一次进入项目
+                name = value.code;
+            } else {
+                // 这里处理页面刷新,还原 导航栏数据
+                const i = value.children.findIndex((e) => e.code === temp);
+                if (i === -1) {
+                    // 切换左边菜单栏
+                    name = value.code;
+                } else {
+                    // 切换右边上面tab 栏
+                    index.value = [`${i}`];
+                }
+            }
             list.value = value.children;
             setShowBottomPart(value.code);
-            router.push({ name: value.code as string });
+            router.push({ name: name as string });
         }
         // 选中菜单的数据
         provide('thirdMenuList', list);
+        provide('index', index);
         // 控制菜单是否隐藏
         const collapsed = ref<boolean>(false);
         function collapse(show: boolean) {

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

@@ -138,14 +138,5 @@ export default defineComponent({
     .ant-form.inlineForm {
         margin-top: 20px;
     }
-    .white {
-        color: @m-white0;
-    }
-    .blue {
-        color: @m-blue0;
-    }
-    .green {
-        color: @m-green0;
-    }
 }
 </style>;

+ 199 - 2
src/views/information/custom/compoments/modify/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <!-- 修改客户资料-->
-  <a-modal class="modify-custom"
+  <!-- 修改客户资料 -->
+  <a-modal class="commonModal modify-custom"
            title="修改客户资料"
            v-model:visible="visible"
            @cancel="cancel"
@@ -11,17 +11,189 @@
                 :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="客户类型">
+            <a-select class="typeSelect"
+                      style="width: 200px"
+                      placeholder="请选择客户类型">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="企业名称">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入企业名称" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="企业简称">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入企业简称" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件类型">
+            <a-select class="inlineFormSelect"
+                      style="width: 200px"
+                      placeholder="请选择证件类型">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="法定代表人">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入法定代表人" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件号码">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入证件号码" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="纳税人识别号">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入纳税人识别号" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="营业执照">
+            <div class="upload">
+              <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                        :transform-file="transformFile">
+                <a-button class="uploadBtn">上传</a-button>
+              </a-upload>
+              <div class="look">查看附件</div>
+            </div>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="联系人">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入联系人" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="联系人手机号">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入联系人手机号" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="联系电话">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入联系电话" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item>
+            &nbsp;
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="通讯地址">
+            <a-select class="inlineFormSelect"
+                      style="width: 205px"
+                      placeholder="请选择省">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+            <a-select class="inlineFormSelect"
+                      style="width: 205px"
+                      placeholder="请选择市">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+            <a-select class="inlineFormSelect"
+                      style="width: 205px"
+                      placeholder="请选择县(区)">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="&nbsp;">
+            <a-input class="dialogInput"
+                     style="width: 635px"
+                     placeholder="请输入详细地址" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="备注">
+            <a-input class="dialogInput"
+                     style="width: 635px"
+                     placeholder="请输入备注" />
+          </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';
+import { initData } from '@/common/methods/index';
 
 export default defineComponent({
     name: 'modify-custom',
     components: {},
     setup() {
+        // const { visible, cancel } = closeModal('modifyCustomInfo');
         const { visible, cancel } = closeModal('custom_info_btn_modify');
         const loading = ref<boolean>(false);
         function submit() {
@@ -31,6 +203,7 @@ export default defineComponent({
                 cancel();
             }, 2000);
         }
+        initData(() => {});
         return {
             visible,
             cancel,
@@ -43,6 +216,30 @@ export default defineComponent({
 
 <style lang="less">
 .modify-custom {
+  .upload {
+      display: inline-flex;
+      .ant-btn.uploadBtn {
+          width: 60px;
+          height: 30px;
+          background: @m-blue0;
+          border: 0;
+          padding: 0;
+          text-align: center;
+          font-size: 14px;
+          color: @m-white0;
+          .rounded-corners(3px);
+          &:hover {
+              background: rgba(@m-blue0, 0);
+              color: rgba(@m-white0, 0.8);
+          }
+      }
+      .look {
+          color: @m-blue0;
+          font-size: 14px;
+          margin-left: 10px;
+          cursor: pointer;
+      }
+  }
 }
 </style
 >;

+ 2 - 2
src/views/information/custom/compoments/recover/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 修改客户资料-->
+  <!-- 恢复客户资料-->
   <a-modal class="modify-custom"
-           title="修改客户资料"
+           title="恢复客户资料"
            v-model:visible="visible"
            @cancel="cancel"
            width="890px">

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

@@ -32,19 +32,15 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
-
+import { defineComponent } from 'vue';
 import { initData } from '@/common/methods/index';
 import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
-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/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';
 import { getBtnList } from '@/common/setup/contextMenu/index';
 
 export default defineComponent({
@@ -59,16 +55,13 @@ export default defineComponent({
     },
     setup() {
         const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-        const { hasPermission } = handlePermission('custom_info_normal');
         const { commonBtn, forDataBtn } = getBtnList('custom_info_normal');
 
-        // const { openAction: addAction } = openModal('custom_info_btn_add');
-
         initData(() => {
             actionQuery(3);
             getColumns();
         });
-        return { customList, columns, search, loading, commonBtn, forDataBtn, hasPermission };
+        return { customList, columns, search, loading, commonBtn, forDataBtn };
     },
 });
 </script>

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

@@ -4,8 +4,9 @@
        :loading="loading">
     <filterCustomTable @search="search">
       <a-button class="operBtn"
-                v-if="hasPermission('custom_info_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"
                  :tableList="customList">
@@ -25,25 +26,22 @@
     <CustomDetail />
     <!-- 删除 -->
     <DeleteCustom />
-    <!-- 恢复客户资料 -->@/common/methods
+    <!-- 恢复客户资料 -->
     <RecoverCustom />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, onUnmounted, Ref, ref, watchEffect } from 'vue';
-
+import { defineComponent } from 'vue';
 import { initData } from '@/common/methods/index';
 import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
-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/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/add/index.vue';
-import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
+import { getBtnList } from '@/common/setup/contextMenu/index';
 
 export default defineComponent({
     name: 'custom-normal',
@@ -57,27 +55,13 @@ export default defineComponent({
     },
     setup() {
         const { customList, actionQuery, columns, getColumns, search, loading } = getCustomList();
-        const { hasPermission } = handlePermission('custom_info_normal');
-        const contextMenuList = ref<MenuItem[]>([]);
-
-        const { openAction: addAction } = openModal('custom_info_btn_add');
-
-        detailButton('detail', contextMenuList);
-        const { action: deleteAction } = permissionButton('custom_info_btn_delete', '删除', contextMenuList);
-        const { action: recoverAction } = permissionButton('custom_info_btn_recover', '恢复', contextMenuList);
+        const { commonBtn, forDataBtn } = getBtnList('custom_info_disabled');
 
-        const stop = watchEffect(() => {
-            hasPermission('custom_info_btn_recover') && recoverAction();
-            hasPermission('custom_info_btn_delete') && deleteAction();
-        });
-        onUnmounted(() => {
-            stop();
-        });
         initData(() => {
             actionQuery(4);
             getColumns();
         });
-        return { customList, columns, search, loading, contextMenuList, hasPermission, addAction };
+        return { customList, columns, search, loading, commonBtn, forDataBtn };
     },
 });
 </script>
@@ -85,5 +69,4 @@ export default defineComponent({
 <style lang="less">
 .custom-normal {
 }
-</style
->;
+</style>;

+ 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>

+ 2 - 2
src/views/information/warehouse-info/compoments/addWarehouse/index.vue → src/views/information/warehouse-info/compoments/add/index.vue

@@ -117,10 +117,10 @@ import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods/index';
 
 export default defineComponent({
-    name: 'add-warehouse',
+    name: 'warehouse_info_btn_add',
     components: {},
     setup() {
-        const { visible, cancel } = closeModal('custom_info_btn_add');
+        const { visible, cancel } = closeModal('warehouse_info_btn_add');
         const loading = ref<boolean>(false);
         function submit() {
             loading.value = true;

+ 46 - 0
src/views/information/warehouse-info/compoments/detail/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: 'warehouse_info_btn-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('detail');
+        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>;

+ 2 - 2
src/views/information/warehouse-info/compoments/disableWarehouse/index.vue → src/views/information/warehouse-info/compoments/disable/index.vue

@@ -74,10 +74,10 @@ import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 
 export default defineComponent({
-    name: 'custom-disable',
+    name: 'warehouse_info_btn_disable',
     components: {},
     setup() {
-        const { visible, cancel } = closeModal('custom_info_btn_disable');
+        const { visible, cancel } = closeModal('warehouse_info_btn_disable');
         const loading = ref<boolean>(false);
         function submit() {
             loading.value = true;

+ 8 - 7
src/views/information/warehouse-info/compoments/filterTable/index.vue

@@ -4,11 +4,12 @@
     <a-select label-in-value
               class="conditionSelect"
               style="width: 120px"
-              v-model:value="userinfotype"
+              v-model:value="warehousetype"
               placeholder="全部仓库类型"
               @change="handleChange">
-      <a-select-option value="1">仓库类型一</a-select-option>
-      <a-select-option value="2">仓库类型二</a-select-option>
+      <a-select-option value="1">厂库</a-select-option>
+      <a-select-option value="2">自有库</a-select-option>
+      <a-select-option value="3">合作库</a-select-option>
     </a-select>
     <a-input v-model:value="nickname"
              class="tableConditionInput"
@@ -36,24 +37,24 @@ function handleSearch(context: SetupContext) {
         value: string;
     }
     let useType = '';
-    const userinfotype = ref<number>(0);
+    const warehousetype = ref<number | undefined>(undefined);
     function handleChange(value: Value) {
         useType = value.value;
         search();
     }
     function search() {
-        const result = { nickname: [nickname.value], name: [name.value], userinfotype: [useType] };
+        const result = { warehousename: [nickname.value], address: [name.value], warehousetype: [useType] };
         context.emit('search', result);
     }
     function reset() {
         nickname.value = '';
         name.value = '';
-        userinfotype.value = 0;
+        warehousetype.value = undefined;
         useType = '';
         search();
     }
 
-    return { nickname, name, search, reset, userinfotype, handleChange };
+    return { nickname, name, search, reset, warehousetype, handleChange };
 }
 
 export default defineComponent({

+ 48 - 0
src/views/information/warehouse-info/compoments/modify/index.vue

@@ -0,0 +1,48 @@
+<template>
+  <!-- 修改仓库信息-->
+  <a-modal class="modify-custom"
+           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: 'warehouse_info_btn_modify',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('warehouse_info_btn_modify');
+        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">
+.modify-custom {
+}
+</style
+>;

+ 48 - 0
src/views/information/warehouse-info/compoments/recover/index.vue

@@ -0,0 +1,48 @@
+<template>
+  <!-- 恢复仓库信息-->
+  <a-modal class="modify-custom"
+           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: 'warehouse_info_btn_recover',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('warehouse_info_btn_recover');
+        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">
+.modify-custom {
+}
+</style
+>;

+ 66 - 85
src/views/information/warehouse-info/list/normal-use/index.vue

@@ -1,109 +1,82 @@
 <template>
   <!-- 仓库信息: 正常 -->
-  <div class="warehouse-info-normal">
+  <div class="warehouse-info-normal"
+       :loading="loading">
     <filterCustomTable @search="search">
       <a-button class="operBtn"
-                @click="openAction">新增</a-button>
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
     </filterCustomTable>
-    <a-table class="topTable"
-             :columns="columns"
-             :pagination="false"
-             rowKey="key"
-             :data-source="wareHouseInfos" />
+    <contextMenu :contextMenuList="forDataBtn"
+                 :tableList="tableList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="tableList">
+        <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template>
+      </a-table>
+    </contextMenu>
+    <!-- 新增仓库信息 -->
+    <Add />
+    <!-- 停用仓库信息 -->
+    <Disable />
+    <!-- 仓库信息详情 -->
+    <Detail />
+    <!-- 修改仓息库信 -->
+    <Modify />
   </div>
 </template>
 
 <script lang="ts">
-import { computed, defineComponent, ref } from 'vue';
-
+import { defineComponent } from 'vue';
 import { initData } from '@/common/methods';
 import filterCustomTable from '@/views/information/warehouse-info/compoments/filterTable/index.vue';
-import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
-import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
-import { message } from 'ant-design-vue';
-import { getTableHead } from '@/common/methods/table';
-import { getUserId } from '@/services/bus/account';
-
-// 查询客户资料列表
-function getWarehouseInfoList() {
-    interface ColumnType {
-        key: string;
-        dataIndex: string;
-        title: string;
-        onFilter?: Function;
-        sorter?: Function;
-    }
-
-    // 仓库数据
-    const wareHouseInfos = ref<ErmcpWareHouseInfo[]>([]);
-    // 列头
-    const columns = ref<ColumnType[]>([]);
-    // 过滤
-    const filteredInfo = ref();
-
-    // 获取表头
-    function getColumns() {
-        interface ColumnType {
-            key: string;
-            dataIndex: string;
-            title: string;
-            filteredValue?: string | null;
-            onFilter?: Function;
-            sorter?: Function;
-        }
-        const list = getTableHead('table_pcweb_warehouse');
-        console.log('list', list);
-
-        const filtered = filteredInfo.value || {};
-        columns.value.length = 0;
-        list.forEach((e, i) => {
-            const { columnfield, columntitle } = e;
-            const item: ColumnType = {
-                key: String(i),
-                dataIndex: columnfield,
-                title: columntitle,
-            };
-            columns.value.push(item);
-        });
-        console.log('columns', columns);
-    }
-
-    // 获取仓库信息
-    const wareHouseInfoList = ref<ErmcpWareHouseInfo[]>([]);
-    function actionQuery() {
-        const reqParam = { userid: getUserId(), status: '1' };
-        QueryWareHouse(reqParam)
-            .then((res) => {
-                wareHouseInfos.value = res.map((e, i) => {
-                    return { ...e, key: String(i) };
-                });
-                console.log('查询仓库列表', wareHouseInfos);
-            })
-            .catch((err) => message.error(err));
-    }
-    // 查询
-    function search(value: any) {}
-
-    return { wareHouseInfos, actionQuery, columns, getColumns, search };
-}
-
-// 新增
-function add() {
-    console.log('add');
-}
+import { getTableList, getWareHouseType, getWareHouseStatus } from '../setup';
+import { getBtnList } from '@/common/setup/contextMenu/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import Add from '../../compoments/add/index.vue';
+import Disable from '../../compoments/disable/index.vue';
+import Detail from '../../compoments/detail/index.vue';
+import Modify from '../../compoments/modify/index.vue';
 
 export default defineComponent({
     name: 'warehouse-info-normal',
     components: {
+        contextMenu,
         filterCustomTable,
+        Add,
+        Disable,
+        Detail,
+        Modify,
     },
     setup() {
-        const { wareHouseInfos, actionQuery, columns, getColumns, search } = getWarehouseInfoList();
+        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList();
+        const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal');
+        console.log('forDataBtn', forDataBtn);
+
         initData(() => {
-            actionQuery();
+            actionQuery('1');
             getColumns();
         });
-        return { wareHouseInfos, add, columns, search };
+
+        return {
+            tableList,
+            filteredInfo,
+            columns,
+            search,
+            loading,
+            commonBtn,
+            forDataBtn,
+            getWareHouseStatus,
+            getWareHouseType,
+        };
     },
 });
 </script>
@@ -113,3 +86,11 @@ export default defineComponent({
 }
 </style
 >;
+
+function getTableList(): {} {
+  throw new Error('Function not implemented.');
+}
+
+function getTableList(): { tableList: any; actionQuery: any; columns: any; filteredInfo: any; getColumns: any; search: any; loading: any; } {
+  throw new Error('Function not implemented.');
+}

+ 116 - 0
src/views/information/warehouse-info/list/setup.ts

@@ -0,0 +1,116 @@
+import { ColumnType, getTableHead } from '@/common/methods/table';
+import { getUserId } from '@/services/bus/account';
+import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
+import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
+import { message } from 'ant-design-vue';
+import { ref } from 'vue';
+
+// 客户资料列表
+export function getTableList() {
+    // 表格数据
+    const tableList = ref<ErmcpWareHouseInfo[]>([]);
+    // 表头数据
+    const columns = ref<ColumnType[]>([]);
+    // 过滤项
+    const filteredInfo = ref();
+    const loading = ref<boolean>(false);
+    // 获取表头
+    function getColumns() {
+        const list = getTableHead('table_pcweb_warehouse');
+        const filtered = filteredInfo.value || {};
+        columns.value.length = 0;
+        list.forEach((e, i) => {
+            const { columnfield, columntitle, aligntype } = e;
+            const item: ColumnType = {
+                key: String(i),
+                dataIndex: columnfield, // 表格数据对应的key
+                title: columntitle,
+                align: aligntype === 1 ? 'center' : aligntype === 2 ? 'left' : 'right',
+                slots: { customRender: columnfield },
+            };
+            // 以下添加过滤数据对应的方法
+            if (e.columnfield === 'warehousetype') {
+                item.onFilter = (value: string, record: ErmcpWareHouseInfo) => String(record.warehousetype).includes(String(value));
+                item.filteredValue = filtered.warehousetype || null;
+            }
+            if (e.columnfield === 'warehousename') {
+                item.onFilter = (value: string, record: ErmcpWareHouseInfo) => record.warehousename.includes(value);
+                item.filteredValue = filtered.warehousename || null;
+            }
+            if (e.columnfield === 'address') {
+                item.onFilter = (value: string, record: ErmcpWareHouseInfo) => record.address.includes(value);
+                item.filteredValue = filtered.address || null;
+            }
+            columns.value.push(item);
+        });
+    }
+    // 查询列表
+    function actionQuery(status: string) {
+        loading.value = true;
+        const reqParam = { userid: getUserId(), status };
+        QueryWareHouse(reqParam)
+            .then((res) => {
+                tableList.value = res.map((e, i) => {
+                    return { ...e, key: String(i) };
+                });
+                loading.value = false;
+                console.log('查询列表', tableList);
+            })
+            .catch((err) => {
+                message.error(err);
+                loading.value = false;
+            });
+    }
+    // 查询
+    function search(value: any) {
+        filteredInfo.value = value;
+        getColumns();
+    }
+
+    return { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading, };
+}
+
+/**
+ * 获取仓库类型
+ * @param type 
+ * @returns 
+ */
+export function getWareHouseType(type: number): string {
+    let result = '--';
+    switch (type) {
+        case 1:
+            result = '厂库'
+            break
+        case 2:
+            result = '自有库'
+            break
+        case 3:
+            result = '合作库'
+            break
+    }
+    return result;
+}
+
+/**
+ * 获取仓库状态
+ * @param status 
+ * @returns 
+ */
+export function getWareHouseStatus(status: number): string {
+    let result = '--';
+    switch (status) {
+        case 1:
+            result = '正常'
+            break
+        case 2:
+            result = '注销'
+            break
+        case 3:
+            result = '待审核'
+            break
+        case 4:
+            result = '审核拒绝'
+            break
+    }
+    return result;
+}

+ 68 - 73
src/views/information/warehouse-info/list/stop-use/index.vue

@@ -1,83 +1,78 @@
 <template>
-    <!-- 仓库信息: 停用 -->
-    <div class="warehouse-info-stop">
-        仓库信息: 停用
-    </div>
+  <!-- 仓库信息: 停用 -->
+  <div class="warehouse-info-stop">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="forDataBtn"
+                 :tableList="tableList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="tableList">
+        <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template>
+      </a-table>
+    </contextMenu>
+    <!-- 新增仓库信息 -->
+    <Add />
+    <!-- 恢复仓库信息 -->
+    <Recover />
+  </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 } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '@/views/information/warehouse-info/compoments/filterTable/index.vue';
+import { getTableList, getWareHouseType, getWareHouseStatus } from '../setup';
+import { getBtnList } from '@/common/setup/contextMenu/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import Add from '../../compoments/add/index.vue';
+import Recover from '../../compoments/recover/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: 'warehouse-info-stop',
+    components: {
+        contextMenu,
+        filterCustomTable,
+        Add,
+        Recover,
+    },
+    setup() {
+        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList();
+        const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal');
+        console.log('forDataBtn', forDataBtn);
 
-        return { customList, actionQuery };
-    }
-
-    export default defineComponent({
-        name: 'warehouse-info-stop',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+        initData(() => {
+            actionQuery('2');
+            getColumns();
+        });
+        return {
+            tableList,
+            filteredInfo,
+            columns,
+            search,
+            loading,
+            commonBtn,
+            forDataBtn,
+            getWareHouseStatus,
+            getWareHouseType,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .warehouse-info-stop {
-    }</style
+.warehouse-info-stop {
+}
+</style
 >;