Forráskód Böngészése

feat: 列表可选择导出

liujt 3 hete
szülő
commit
a8ced41c18

+ 7 - 1
src/components/upload/exportButton.vue

@@ -3,6 +3,7 @@
     type="primary"
     size="small"
     icon="el-icon-download"
+    :loading="loading"
     @click="exportFn"
     >{{btnName}}</el-button
   >
@@ -26,16 +27,21 @@
     },
     //注册组件
     data() {
-      return {};
+      return {
+        loading: false
+      };
     },
 
     created() {},
     methods: {
       exportFn() {
+        this.loading = true;
         exportTable({
           api: this.apiUrl,
           fileName: this.fileName,
           data:this.params
+        }).finally(() => {
+          this.loading = false;
         });
       }
     }

+ 7 - 1
src/views/saleManage/saleOrder/index.vue

@@ -96,7 +96,7 @@
                     btnName="列表导出"
                     fileName="销售订单"
                     apiUrl="/eom/saleorder/export"
-                    :params="params"
+                    :params="exportParams"
                   ></exportButton>
 
                   <el-button
@@ -633,6 +633,12 @@ export default {
     clearInterval(this.timeR);
   },
   computed: {
+    exportParams() {
+      return {
+        ...this.params,
+        orderIds: this.selection.map(item => item.id)
+      }
+    },
     clientEnvironmentId() {
       return this.$store.state.user.info.clientEnvironmentId;
     },