소스 검색

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

lyc 1 개월 전
부모
커밋
568ea690f1
1개의 변경된 파일15개의 추가작업 그리고 1개의 파일을 삭제
  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>