Redeem 1 år sedan
förälder
incheckning
b97b87d852
1 ändrade filer med 35 tillägg och 1 borttagningar
  1. 35 1
      src/views/OYE/components/oYeRealTimeInventory.vue

+ 35 - 1
src/views/OYE/components/oYeRealTimeInventory.vue

@@ -36,7 +36,9 @@
         </el-form-item>
         <el-button type="primary" @click="search">查询</el-button>
         <el-button type="primary" @click="exportExcel">导出</el-button>
-
+        <el-button type="primary" @click="exportExcelBefore"
+          >下载点前Excel</el-button
+        >
         <el-button
           type="primary"
           @click="addEditTime"
@@ -211,6 +213,21 @@
         ></dilTable>
       </el-dialog>
     </div>
+    <div class="exportExcelBefore">
+      <el-dialog title="下载点前Excel" :visible.sync="exportExcelBeforeVisible">
+        <el-date-picker
+          v-model="excelTime"
+          type="date"
+          placeholder="选择日期"
+          style="width:140px"
+        >
+        </el-date-picker>
+
+        <el-button type="primary" size="middle" @click="downLoadFile"
+          >下载</el-button
+        >
+      </el-dialog>
+    </div>
   </div>
 </template>
 <script>
@@ -222,6 +239,7 @@ import {
   accSub,
   accDiv
 } from '@/utils/util.js'
+
 export default {
   data() {
     const generateStartDate = _ => {
@@ -239,6 +257,8 @@ export default {
       return endTime.getTime()
     }
     return {
+      excelTime: new Date(),
+      exportExcelBeforeVisible: false,
       activeMenu: window.top.localStorage.getItem('activeMenu'),
       options: {
         requestUrl: '',
@@ -331,6 +351,20 @@ export default {
     this.getRequestUrl()
   },
   methods: {
+    exportExcelBefore() {
+      this.exportExcelBeforeVisible = true
+    },
+    downLoadFile() {
+      const ele = document.createElement('a')
+      const url =
+        'https://wl.dasteel.cn:32322/api/v1/uc/getFile?path=/data/' +
+        'dil-wms-api/' +
+        formatDate(this.excelTime, 'yyyy-MM-dd') +
+        '.xlsx'
+      ele.setAttribute('href', url) //设置下载文件的url地址
+      ele.setAttribute('download', 'download') //用于设置下载文件的文件名
+      ele.click()
+    },
     sureMake() {
       this.updateInsertForm.newInventoryId = this.selectedRowData1.inventoryId
       this.updateInsertForm.saleArea = this.selectedRowData1.saleArea