Ver código fonte

评价导出完成

王宇昕 5 anos atrás
pai
commit
3407d3c2e0

+ 2 - 2
src/dashoo.cn/frontend_web/nuxt.config.js

@@ -172,9 +172,9 @@ module.exports = {
 
   axios: {
     // baseURL: '//192.168.1.44:10091/api/' // 本机开发使用
-     // baseURL: '//localhost:10091/api/' // 本机开发使用
+     baseURL: '//localhost:10091/api/' // 本机开发使用
     // baseURL: '//192.168.1.41:10091/api/' // 本机开发使用
-    baseURL: '//192.168.124.13:10091/api/' // 本机开发使用
+    // baseURL: '//192.168.124.13:10091/api/' // 本机开发使用
 
     /* --------Nuxt Start发版用 START-------------- */
     // baseURL: '/api/'

+ 4 - 3
src/dashoo.cn/frontend_web/src/api/oilcontract/contractSumScore.js

@@ -58,10 +58,11 @@ export default {
       })
     },
     // 导出评论excel
-    docexportExcel(id, myAxios) {
+    docexportExcel(CreateOn, params, myAxios) {
       return myAxios({
-        url: `/contract-score/exportexcel/${id}`,
-        method: 'get',
+        url: '/contract-score/exportexcel?CreateOn='+ CreateOn,
+        method: 'GET',
+        params: params
       })
     },
 

+ 39 - 24
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-goods-year-check/index.vue

@@ -13,7 +13,7 @@
         </span>
         <span style="float: right;">
           <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">导入</el-button> -->
-          <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button>
           <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="onChangeSelect">{{selectBoolean?'取消':'一键处理'}}</el-button>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="selectBoolean" @click="onChangeSelectSubmit">处理</el-button> -->
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="!selectAllButtonBoolean&&userSelectBoolean" @click="onSelectAllButton">一键处理</el-button>
@@ -339,6 +339,44 @@
       this.statusFun()
     },
     methods: {
+      // 导出
+      exportExcel () {
+       //分页及列表条件
+       let params = {
+         _currentPage: this.currentPage,
+         _size: this.size,
+         Order: this.Column.Order,
+         Prop: this.Column.Prop,
+         ContractClass:'01',
+       }
+       let myCreateOn = []
+       // 解析时间
+       if (this.CreateOn.length == 2) {
+         this.CreateOn[1].setHours(23)
+         this.CreateOn[1].setMinutes(59)
+         this.CreateOn[1].setSeconds(59)
+         myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+         myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+       }
+       //查询条件
+       Object.assign(params, this.searchForm)
+
+       api.docexportExcel(myCreateOn.join(','), params, this.$axios).then(res => {
+           if (res.data.code === 0) {
+             let docurl = res.data.item
+             // 内网服务器专用
+             const myDomain = window.location.host
+             if (process.client && docurl.indexOf('upfile') === 0) {
+               const myDomain = window.location.host
+               location.href = 'http://' + myDomain + '/' + docurl
+             } else {
+               location.href = 'http://' + docurl
+             }
+           }
+         }).catch(err => {
+           console.error(err)
+         })
+      },
       //一键处理
       onSelectAll(e){
         console.log(e)
@@ -538,29 +576,6 @@
           }
         })
       },
-      exportExcel () {
-        /* generate workbook object from table */
-        let wb = XLSX.utils.table_to_book(
-          document.querySelector('#rebateSetTable')
-        )
-        /* get binary string as output */
-        let wbout = XLSX.write(wb, {
-          bookType: 'xlsx',
-          bookSST: true,
-          type: 'array'
-        })
-        try {
-          FileSaver.saveAs(
-            new Blob([wbout], {
-              type: 'application/octet-stream'
-            }),
-            'SupplierUsedName.xlsx'
-          )
-        } catch (e) {
-          if (typeof console !== 'undefined') console.log(e, wbout)
-        }
-        return wbout
-      },
       formatDateTime(date) {
         var y = date.getFullYear();
         var m = date.getMonth() + 1;

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-goods-year/index.vue

@@ -13,7 +13,7 @@
         </span>
         <span style="float: right;">
           <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">导入</el-button> -->
-          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button>
+          <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
         </span>
         <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
           <el-form-item label="上报时间">

+ 21 - 2
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-service-year-check/index.vue

@@ -348,7 +348,27 @@
     methods: {
       // 导出
       exportExcel () {
-        api.docexportExcel(102, this.$axios).then(res => {
+        //分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          ContractClass:'03',
+        }
+        let myCreateOn = []
+        // 解析时间
+        if (this.CreateOn.length == 2) {
+          this.CreateOn[1].setHours(23)
+          this.CreateOn[1].setMinutes(59)
+          this.CreateOn[1].setSeconds(59)
+          myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+          myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+        }
+        //查询条件
+        Object.assign(params, this.searchForm)
+
+        api.docexportExcel(myCreateOn.join(','), params, this.$axios).then(res => {
             if (res.data.code === 0) {
               let docurl = res.data.item
               // 内网服务器专用
@@ -356,7 +376,6 @@
               if (process.client && docurl.indexOf('upfile') === 0) {
                 const myDomain = window.location.host
                 location.href = 'http://' + myDomain + '/' + docurl
-
               } else {
                 location.href = 'http://' + docurl
               }

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-service-year/index.vue

@@ -13,7 +13,7 @@
         </span>
         <span style="float: right;">
           <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">导入</el-button> -->
-          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button>
+          <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
         </span>
         <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
           <el-form-item label="上报时间">