zcy há 3 anos atrás
pai
commit
2400cfacc5
1 ficheiros alterados com 34 adições e 6 exclusões
  1. 34 6
      src/views/security/stand/index.vue

+ 34 - 6
src/views/security/stand/index.vue

@@ -59,10 +59,20 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator" style="margin: 15px 0">
       <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
-      <!--      <a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>-->
-      <!--      <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="url.importExcelUrl" @change="handleImportExcel">-->
-      <!--        <a-button ghost type="danger" icon="import">导入</a-button>-->
-      <!--      </a-upload>-->
+      <a-button ghost type="danger" @click="handleExportXls()">导出数据(含报废)</a-button>
+      <a-button ghost type="danger" @click="handleExportCode()">批量导出二维码</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel">
+            <a-icon type="delete" />
+            删除
+          </a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px">
+          批量操作
+          <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
 
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
@@ -128,7 +138,7 @@
 import { listMixin } from '@/mixin/listMixin'
 import columns from './indexColumns'
 import CheckAndEditModel from './CheckAndEditModel'
-import { getAction } from '@/api/request'
+import { getAction, downFile } from '@/api/request'
 
 export default {
   components: {
@@ -147,7 +157,8 @@ export default {
       url: {
         list: '/business/safetool/base/safety/tool/list',
         delete: '/business/safetool/base/safety/tool/',
-        exportXlsUrl: '/exportXlsUrl',
+        exportXlsUrl: '/business/safetool/base/safety/tool/export',
+        qrcode: '/st/export',
         tree: '/system/dept/treeSelect',
         importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
       }
@@ -172,6 +183,23 @@ export default {
           this.treeData = res.data
         }
       })
+    },
+    handleExportCode() {
+      if (this.selectedRowKeys.length <= 0) {
+        this.$message.warning('请选择一条记录!')
+        return
+      }
+      const param = this.getQueryParams()
+      if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
+        param['id'] = this.selectedRowKeys.join(',')
+      }
+      downFile(this.url.qrcode, param).then((data) => {
+        if (data.code !== 200) {
+          this.$message.warning('文件下载失败')
+        } else {
+          window.location.href = data.url
+        }
+      })
     }
   }
 }