Browse Source

fix: 批量上传实重数据导出

lyc 2 months ago
parent
commit
5b74d4e6c5
1 changed files with 15 additions and 1 deletions
  1. 15 1
      src/views/orders/batchImportWeight.vue

+ 15 - 1
src/views/orders/batchImportWeight.vue

@@ -106,6 +106,9 @@
       :visible.sync="dialogWeight"
     >
       <el-form ref="costListFormRef">
+        <div style="text-align: right; margin-bottom: 4px;">
+          <el-button type="primary" @click="exportBatchWeight">导出表格</el-button>
+        </div>
         <vxe-table
           border
           show-overflow
@@ -139,7 +142,7 @@
         <div style="text-align: right;">
           <el-pagination
             background
-            :page-sizes="[20, 50, 100, 150, 200]"
+            :page-sizes="[50, 100, 150, 200, 400]"
             :current-page="weightThrowingDataPage"
             :page-size="weightThrowingDataSize"
             layout="prev, pager, next ,total ,sizes"
@@ -252,6 +255,7 @@ export default {
         PageSize: 20,
         total: 0
       },
+      exportLoading: false
     }
   },
   computed: {
@@ -668,6 +672,16 @@ export default {
       this.pagerDto.PageSize = s
       this.initSaveNewFeeList()
     },
+    // 导出
+    async exportBatchWeight() {
+      const currentDate = getCurrentDateTime('-')
+      const filename = '实重列表数据' + currentDate
+      this.exportLoading = true
+      if (this.$refs.costListTableRef) {
+        await this.$refs.costListTableRef.exportData({ type: 'csv', filename })
+      }
+      this.exportLoading = false
+    }
   }
 }
 </script>