Pārlūkot izejas kodu

收发存、连锁收发存 报表 导出功能

chenrui 3 gadi atpakaļ
vecāks
revīzija
86961937c3

+ 18 - 0
src/api/reportData.js

@@ -18,6 +18,15 @@ export const linkageReportPageTotal = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+// 连锁收发存报表  导出
+export const reportChainStockPutOutExport = params => {
+  return axios.request({
+    url: `/report/reportStockPutOut/exportLinkageReport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 // 收发存报表-分页列表
 // 收发存报表-分页列表
 export const reportPageList = (params) => {
 export const reportPageList = (params) => {
   const url = `report/reportStockPutOut/reportPage/${params.pageNo}/${params.pageSize}`
   const url = `report/reportStockPutOut/reportPage/${params.pageNo}/${params.pageSize}`
@@ -45,6 +54,15 @@ export const reportStockPutOutCount = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+// 收发存报表  导出
+export const reportStockPutOutExport = params => {
+  return axios.request({
+    url: `/report/reportStockPutOut/exportReport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 // 大客户报表-分页列表
 // 大客户报表-分页列表
 export const reportBigCustomerList = (params) => {
 export const reportBigCustomerList = (params) => {
   const url = `report/reportBigCustomer/reportPage/${params.pageNo}/${params.pageSize}`
   const url = `report/reportBigCustomer/reportPage/${params.pageNo}/${params.pageSize}`

+ 32 - 2
src/views/reportData/chainReceivedSendStorageReport/list.vue

@@ -76,7 +76,16 @@
             <a-col :md="6" :sm="24">
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="sendStorageReportList-refresh">查询</a-button>
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="sendStorageReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="sendStorageReportList-reset">重置</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="sendStorageReportList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                v-if="$hasPermissions('B_chainReceivedSendStorageReportExport')"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="sendStorageReportList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
               </a>
@@ -117,7 +126,8 @@ import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { dealerProductTypeList } from '@/api/dealerProductType'
-import { linkageReportPageList, linkageReportPageTotal, linkageGroupList } from '@/api/reportData'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { linkageReportPageList, linkageReportPageTotal, linkageGroupList, reportChainStockPutOutExport } from '@/api/reportData'
 export default {
 export default {
   components: { STable, VSelect },
   components: { STable, VSelect },
   data () {
   data () {
@@ -249,6 +259,26 @@ export default {
       this.totalData = null
       this.totalData = null
       this.$refs.table.clearTable()
       this.$refs.table.clearTable()
     },
     },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          params.auditDate = params.auditDate + '-01'
+          _this.exportLoading = true
+          _this.spinning = true
+          reportChainStockPutOutExport(params).then(res => {
+            const fileName = '连锁收发存报表' + moment().format('YYYYMMDDHHmmss')
+            downloadExcel(res, fileName)
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
     //  产品分类  change
     //  产品分类  change
     changeProductType (val, opt) {
     changeProductType (val, opt) {
       this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''

+ 32 - 2
src/views/reportData/receivedSendStorageReport/list.vue

@@ -62,7 +62,16 @@
             <a-col :md="6" :sm="24">
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="receivedSendStorageReportList-refresh">查询</a-button>
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="receivedSendStorageReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="receivedSendStorageReportList-reset">重置</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="receivedSendStorageReportList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                v-if="$hasPermissions('B_receivedSendStorageReportExport')"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="receivedSendStorageReportList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
               </a>
@@ -99,11 +108,13 @@
 </template>
 </template>
 
 
 <script>
 <script>
+import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import rangeDate from '@/views/common/rangeDate.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { reportPageList, reportStockPutOutCount } from '@/api/reportData'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { reportPageList, reportStockPutOutCount, reportStockPutOutExport } from '@/api/reportData'
 export default {
 export default {
   components: { STable, VSelect, rangeDate },
   components: { STable, VSelect, rangeDate },
   data () {
   data () {
@@ -236,6 +247,25 @@ export default {
       this.totalData = null
       this.totalData = null
       this.$refs.table.clearTable()
       this.$refs.table.clearTable()
     },
     },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportStockPutOutExport(params).then(res => {
+            const fileName = '收发存报表' + moment().format('YYYYMMDDHHmmss')
+            downloadExcel(res, fileName)
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
     //  产品分类  change
     //  产品分类  change
     changeProductType (val, opt) {
     changeProductType (val, opt) {
       this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''