浏览代码

增加批量操作按钮

jingbb 5 月之前
父节点
当前提交
5bfaf72bb8

+ 20 - 1
src/views/BasicData/productArchive.vue

@@ -80,7 +80,20 @@
         <a-card  :body-style="{ padding: '10px' }" :bordered="false" style="margin: 10px;">
              <!-- 操作按钮区域 -->
             <div  style="margin-bottom: 4px;">
-                <a-button @click="handleAdd" type="primary" preIcon="ant-design:plus">新增(add)</a-button>
+                <a-button @click="handleAdd" type="primary" preIcon="ant-design:plus" style="margin-right: 1%;">新增(add)</a-button>
+                <a-dropdown v-if="selectedRowKeys.length > 0" >
+                    <template #overlay>
+                        <a-menu>
+                        <a-menu-item key="1" @click="batchHandleDelete">
+                            <Icon icon="ant-design:delete-outlined"></Icon>
+                            删除
+                        </a-menu-item>
+                        </a-menu>
+                    </template>
+                    <a-button v-auth="'baseCode:base_company_information:deleteBatch'">批量操作
+                        <Icon icon="mdi:chevron-down"></Icon>
+                    </a-button>
+                </a-dropdown>
             </div>
             <a-alert type="info" show-icon class="alert" style="margin-bottom: 8px">
             <template #message>
@@ -352,6 +365,12 @@
                searchReset()
         })
     }
+    function batchHandleDelete(){
+        let params = {ids:selectedRowKeys.value.join(',')}
+        defHttp.delete({url:'/baseCode/baseProductArchive/deleteBatch',params}, {joinParamsToUrl: true}).then((res) => {
+            searchReset()
+        });
+    }
 </script>
 <style scoped lang="less">
 /deep/.ant-form-item{

+ 20 - 1
src/views/BasicData/productCassification.vue

@@ -3,6 +3,19 @@
   <BasicTable @register="registerTable" :rowSelection="rowSelection">
     <template #tableTitle>
       <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleCreate"> 新增(add)</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+              <template #overlay>
+                <a-menu>
+                  <a-menu-item key="1" @click="batchHandleDelete">
+                    <Icon icon="ant-design:delete-outlined"></Icon>
+                    删除(delete)
+                  </a-menu-item>
+                </a-menu>
+              </template>
+              <a-button v-auth="'baseCode:base_ship_archive:deleteBatch'">批量操作
+                <Icon icon="mdi:chevron-down"></Icon>
+              </a-button>
+        </a-dropdown>
       <!-- <div style="margin-left: 10px;margin-top: 5px">当前登录租户: <span class="tenant-name">{{loginTenantName}}</span> </div> -->
     </template>
     <!--操作栏-->
@@ -19,7 +32,7 @@
   import { ActionItem, BasicColumn, BasicTable, TableAction,FormSchema } from '/@/components/Table';
   import productCassificationModel from './components/productCassificationModel.vue';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { list,deleteDict } from './api/productCassification.api';
+  import { list,deleteDict,batchDelete} from './api/productCassification.api';
   const showFooter = ref(true);
   const [registerModal, { openModal }] = useModal();
   //定义表格列字段
@@ -129,4 +142,10 @@
       reload();
     }
   }
+    /**
+    * 批量删除事件
+    */
+    async function batchHandleDelete() {
+     await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
+   }
 </script>

+ 2 - 2
src/views/baseCode/CompanyInformation/BaseCompanyInformationList.vue

@@ -6,7 +6,7 @@
       <template #tableTitle>
           <a-button type="primary" v-auth="'baseCode:base_company_information:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
           <a-button  type="primary" v-auth="'baseCode:base_company_information:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
-          <!-- <j-upload-button type="primary" v-auth="'baseCode:base_company_information:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
+          <!-- <j-upload-button type="primary" v-auth="'baseCode:base_company_information:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> -->
           <a-dropdown v-if="selectedRowKeys.length > 0">
               <template #overlay>
                 <a-menu>
@@ -19,7 +19,7 @@
               <a-button v-auth="'baseCode:base_company_information:deleteBatch'">批量操作
                 <Icon icon="mdi:chevron-down"></Icon>
               </a-button>
-        </a-dropdown> -->
+        </a-dropdown>
         <!-- 高级查询 -->
         <!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
       </template>

+ 2 - 2
src/views/baseCode/ExchangeRate/BaseExchangeRateList.vue

@@ -7,7 +7,7 @@
           <a-button type="primary" v-auth="'baseCode:base_exchange_rate:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
           <a-button  type="primary" v-auth="'baseCode:base_exchange_rate:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
           <!-- <j-upload-button type="primary" v-auth="'baseCode:base_exchange_rate:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入(Import)</j-upload-button> -->
-          <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
+          <a-dropdown v-if="selectedRowKeys.length > 0">
               <template #overlay>
                 <a-menu>
                   <a-menu-item key="1" @click="batchHandleDelete">
@@ -19,7 +19,7 @@
               <a-button v-auth="'baseCode:base_exchange_rate:deleteBatch'">批量操作
                 <Icon icon="mdi:chevron-down"></Icon>
               </a-button>
-        </a-dropdown> -->
+        </a-dropdown>
         <!-- 高级查询 -->
         <!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
       </template>

+ 14 - 1
src/views/baseCode/ProjectArchive/BaseProjectArchiveList.vue

@@ -6,7 +6,20 @@
       <template #tableTitle>
           <a-button type="primary" v-auth="'baseCode:base_project_archive:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增(add)</a-button>
           <a-button  type="primary" v-auth="'baseCode:base_project_archive:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
-      </template>
+          <a-dropdown v-if="selectedRowKeys.length > 0">
+              <template #overlay>
+                <a-menu>
+                  <a-menu-item key="1" @click="batchHandleDelete">
+                    <Icon icon="ant-design:delete-outlined"></Icon>
+                    删除(delete)
+                  </a-menu-item>
+                </a-menu>
+              </template>
+              <a-button v-auth="'baseCode:base_ship_archive:deleteBatch'">批量操作
+                <Icon icon="mdi:chevron-down"></Icon>
+              </a-button>
+          </a-dropdown>
+        </template>
        <!--操作栏-->
       <template #action="{ record }">
         <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>

+ 2 - 2
src/views/baseCode/ShipArchive/BaseShipArchiveList.vue

@@ -10,7 +10,7 @@
          <a-button  type="primary" @click="relateCustomer"> 关联客户(relate customer)</a-button>
          <a-button  type="primary" @click="hisCustomer"> 历史客户(customer history)</a-button>
          <a-button  type="primary" @click="accessories"> 配件明细(accessories details)</a-button>
-<!--          
+         
           <a-dropdown v-if="selectedRowKeys.length > 0">
               <template #overlay>
                 <a-menu>
@@ -23,7 +23,7 @@
               <a-button v-auth="'baseCode:base_ship_archive:deleteBatch'">批量操作
                 <Icon icon="mdi:chevron-down"></Icon>
               </a-button>
-        </a-dropdown> -->
+        </a-dropdown>
         <!-- 高级查询 -->
         <!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
       </template>