Przeglądaj źródła

Merge branch 'develop' of jianguan-web/qpls-md-html into master

陈瑞 3 lat temu
rodzic
commit
9dd670df15
31 zmienionych plików z 1318 dodań i 224 usunięć
  1. 94 0
      src/api/reportData.js
  2. 50 0
      src/config/router.config.js
  3. 15 9
      src/libs/JGPrint.js
  4. 22 2
      src/libs/getDate.js
  5. 3 12
      src/views/bulkManagement/bulkImport/list.vue
  6. 3 13
      src/views/bulkManagement/bulkWarehousingOrder/list.vue
  7. 3 13
      src/views/financialManagement/companyReceivablePayable/detail.vue
  8. 3 13
      src/views/inventoryManagement/inventoryChecking/detailModal.vue
  9. 3 13
      src/views/inventoryManagement/inventoryChecking/makeInventory.vue
  10. 3 12
      src/views/inventoryManagement/inventoryImport/list.vue
  11. 3 13
      src/views/inventoryManagement/inventoryQuery/list.vue
  12. 3 14
      src/views/inventoryManagement/inventoryWarning/list.vue
  13. 3 13
      src/views/productManagement/priceChangeRecord/list.vue
  14. 3 13
      src/views/productManagement/productInfo/list.vue
  15. 3 13
      src/views/productManagement/productInfoJg/list.vue
  16. 3 14
      src/views/purchasingManagement/purchaseOrder/detail.vue
  17. 3 12
      src/views/purchasingManagement/purchaseOrder/importGuideModal.vue
  18. 2 2
      src/views/reportData/chainCustomerReport/list.vue
  19. 55 0
      src/views/reportData/chainPurchaseReceiptReport/list.vue
  20. 284 0
      src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptDetail.vue
  21. 233 0
      src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptOrder.vue
  22. 3 3
      src/views/reportData/chainSalesDetailReport/list.vue
  23. 2 2
      src/views/reportData/chainSalesReport/list.vue
  24. 3 8
      src/views/reportData/chainStockReport/detailModal.vue
  25. 4 12
      src/views/reportData/chainStockReport/list.vue
  26. 55 0
      src/views/reportData/purchaseReceiptReport/list.vue
  27. 249 0
      src/views/reportData/purchaseReceiptReport/purchaseReceiptDetail.vue
  28. 198 0
      src/views/reportData/purchaseReceiptReport/purchaseReceiptOrder.vue
  29. 5 3
      src/views/reportData/salesDetailReport/list.vue
  30. 2 2
      src/views/reportData/salesReport/list.vue
  31. 3 13
      src/views/salesManagement/salesQuery/list.vue

+ 94 - 0
src/api/reportData.js

@@ -204,3 +204,97 @@ export const reportCheckWarehouseCount = (params) => {
     method: 'post'
   })
 }
+// 采购入库报表  采购入库单报表 列表 分页
+export const reportReceivingBillList = (params) => {
+  const url = `/report/reportReceivingBill/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库单报表 合计
+export const reportReceivingBillCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库单报表  导出
+export const reportReceivingBillExport = params => {
+  return axios.request({
+    url: `/report/reportReceivingBill/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 采购入库报表  采购入库明细报表 列表 分页
+export const reportReceivingBillDetailList = (params) => {
+  const url = `/report/reportReceivingBill/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库明细报表 合计
+export const reportReceivingBillDetailCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 采购入库报表  采购入库明细报表  导出
+export const reportReceivingBillDetailExport = params => {
+  return axios.request({
+    url: `/report/reportReceivingBill/detailExport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 连锁采购入库报表  连锁采购入库单报表 列表 分页
+export const reportChainReceivingBillList = (params) => {
+  const url = `/report/reportReceivingBill/linkageReportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁采购入库报表  连锁采购入库单报表 合计
+export const reportChainReceivingBillCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/linkageReportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁采购入库报表  连锁采购入库明细报表 列表 分页
+export const reportChainReceivingBillDetailList = (params) => {
+  const url = `/report/reportReceivingBill/linkageReportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 连锁采购入库报表  连锁采购入库明细报表 合计
+export const reportChainReceivingBillDetailCount = (params) => {
+  return axios({
+    url: '/report/reportReceivingBill/linkageReportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}

+ 50 - 0
src/config/router.config.js

@@ -1643,6 +1643,56 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/purchaseReceiptReport',
+            redirect: '/reportData/purchaseReceiptReport/list',
+            name: 'purchaseReceiptReport',
+            component: BlankLayout,
+            meta: {
+              title: '采购入库报表',
+              icon: 'profile',
+              permission: 'M_purchaseReceiptReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'purchaseReceiptReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/purchaseReceiptReport/list.vue'),
+                meta: {
+                  title: '采购入库报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_purchaseReceiptReportList'
+                }
+              }
+            ]
+          },
+          {
+            path: '/reportData/chainPurchaseReceiptReport',
+            redirect: '/reportData/chainPurchaseReceiptReport/list',
+            name: 'chainPurchaseReceiptReport',
+            component: BlankLayout,
+            meta: {
+              title: '连锁采购入库报表',
+              icon: 'profile',
+              permission: 'M_chainPurchaseReceiptReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'chainPurchaseReceiptReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainPurchaseReceiptReport/list.vue'),
+                meta: {
+                  title: '连锁采购入库报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_chainPurchaseReceiptReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/receivedSendStorageReport',
             redirect: '/reportData/receivedSendStorageReport/list',

+ 15 - 9
src/libs/JGPrint.js

@@ -10,6 +10,7 @@ export const JGPrint = function (data, type, printerType) {
   // 针式打印
   if (printerType == 'NEEDLE') {
     const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
+    console.log(LODOP,'LODOP')
     if (!LODOP) {
       confirm({
         title: '提示?',
@@ -88,15 +89,20 @@ export const demoDownloadPDF = function (url) {
 // 导出下载excel
 export const downloadExcel = function (data, fileName) {
   if (!data) { return }
-  const url = window.URL.createObjectURL(new Blob([data]))
-  const link = document.createElement('a')
-  link.style.display = 'none'
-  link.href = url
-  const a = moment().format('YYYYMMDDHHmmss')
-  const fname = fileName + a
-  link.setAttribute('download', fname + '.xlsx')
-  document.body.appendChild(link)
-  link.click()
+  const blob = new Blob([data], { type: 'application/vnd.ms-excel' })
+  if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+    navigator.msSaveBlob(blob, fileName + '.xlsx')
+  } else {
+    const link = document.createElement('a')
+    link.style.display = 'none'
+    var href = URL.createObjectURL(blob)
+    link.href = href
+    link.setAttribute('download', fileName + '.xlsx')
+    document.body.appendChild(link)
+    link.click()
+    document.body.removeChild(link)
+    window.URL.revokeObjectURL(href) // 释放掉blob对象
+  }
 }
 
 /*

+ 22 - 2
src/libs/getDate.js

@@ -86,8 +86,18 @@ export default {
     obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format('YYYY-MM-DD')
     return obj
   },
-  // 获取当前月的开始到当天结束时间
+  // 获取上一月的今天到当月的今天
   getCurrMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 1).valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始到当天结束时间
+  getCurrLastMonthDays () {
     const obj = {
       starttime: '',
       endtime: ''
@@ -106,8 +116,18 @@ export default {
     obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD')
     return obj
   },
-  // 获取近三个月的开始结束时间
+  // 获取三月前的今天到当月的今天
   getThreeMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 3).valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 3).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取近三个月的开始结束时间
+  getThreeMonthCurrDays () {
     const obj = {
       starttime: '',
       endtime: ''

+ 3 - 12
src/views/bulkManagement/bulkImport/list.vue

@@ -72,6 +72,7 @@
 import { STable, Upload } from '@/components'
 import { stockImportList, stockImportFinish, stockImportCancel, stockImportExportError } from '@/api/stockImport'
 import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, Upload },
   data () {
@@ -197,21 +198,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+		  const fileName = '散件导入错误项' + moment().format('YYYY_MMDD')
+		  downloadExcel(res, fileName)
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const fname = '散件导入错误项' + moment('YYYY_MMDD')
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 3 - 13
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -146,6 +146,7 @@ import getDate from '@/libs/getDate.js'
 import basicInfoModal from './basicInfoModal.vue'
 import { sparePartsPurList, sparePartsPurCount, sparePartsPurDel, sparePartsPurPut, sparePartsPurExport } from '@/api/sparePartsPur'
 import { supplierAllList } from '@/api/supplier'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
@@ -314,22 +315,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+          const fileName = '散件入库单' + moment().format('YYYYMMDDHHmmss')
+          downloadExcel(res, fileName)
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '散件入库单' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     // 供应商下拉数据
     getSupplierList () {
       supplierAllList().then(res => {

+ 3 - 13
src/views/financialManagement/companyReceivablePayable/detail.vue

@@ -71,6 +71,7 @@
 
 <script>
 import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { settleInfoList, settleInfoQueryReceiptOrPaySum } from '@/api/settle'
@@ -150,21 +151,10 @@ export default {
       this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+	  // const fileName = '单位应收应付' + moment().format('YYYYMMDDHHmmss')
+	  // downloadExcel(res, fileName)
       // })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '单位应收应付' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用

+ 3 - 13
src/views/inventoryManagement/inventoryChecking/detailModal.vue

@@ -151,6 +151,7 @@
 
 <script>
 import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import { STable } from '@/components'
 import printModal from './printModal.vue'
 import ProductType from '@/views/common/productType.js'
@@ -319,7 +320,8 @@ export default {
           reader.readAsText(res)
         } else {
           if (this.nowType == 'export' || this.nowType == 'typeExport') {
-            this.download(res)
+			const fileName = '库存盘点' + moment().format('YYYYMMDDHHmmss')
+			downloadExcel(res, fileName)
           } else {
             this.print(res, objs.type)
           }
@@ -339,18 +341,6 @@ export default {
         window.frames['printficd'].print()
       }
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存盘点' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 3 - 13
src/views/inventoryManagement/inventoryChecking/makeInventory.vue

@@ -172,6 +172,7 @@ import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import ProductType from '@/views/common/productType.js'
 import printModal from './printModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import { checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseInventory, checkWarehouseDetail, checkWarehouseDetailSave, checkWarehouseCheckZero, checkWarehouseWarehouse, checkWarehouseDetailExport, checkWarehouseDetailPrint } from '@/api/checkWarehouse'
 export default {
   components: { STable, VSelect, ProductType, printModal },
@@ -404,7 +405,8 @@ export default {
           reader.readAsText(res)
         } else {
           if (this.nowType == 'export' || this.nowType == 'typeExport') {
-            this.download(res)
+			const fileName = '库存盘点' + moment().format('YYYYMMDDHHmmss')
+			downloadExcel(res, fileName)
           } else {
             this.print(res, objs.type)
           }
@@ -424,18 +426,6 @@ export default {
         window.frames['printficm'].print()
       }
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存盘点' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用

+ 3 - 12
src/views/inventoryManagement/inventoryImport/list.vue

@@ -73,6 +73,7 @@
 import { STable, Upload } from '@/components'
 import { stockImportList, stockImportFinish, stockImportCancel, stockImportKCExportError } from '@/api/stockImport'
 import moment from 'moment'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, Upload },
   data () {
@@ -191,21 +192,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+		  const fileName = '库存导入错误项' + moment().format('YYYY_MMDD')
+		  downloadExcel(res, fileName)
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const fname = '库存导入错误项' + moment('YYYY_MMDD')
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 3 - 13
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -129,6 +129,7 @@ import { dealerProductTypeList } from '@/api/dealerProductType'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect, inventoryQueryDetailModal },
   data () {
@@ -276,22 +277,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+		  const fileName = '库存查询' + moment().format('YYYYMMDDHHmmss')
+		  downloadExcel(res, fileName)
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存查询' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     getProductType () {
       dealerProductTypeList({}).then(res => {
         this.recursionFun(res.data)

+ 3 - 14
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -182,6 +182,7 @@ import { STable, VSelect } from '@/components'
 import { stockWarnList, stockWarnSaveBatch } from '@/api/stockWarn'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect },
   data () {
@@ -408,22 +409,10 @@ export default {
       this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+	  // const fileName = '库存预警' + moment().format('YYYYMMDDHHmmss')
+	  // downloadExcel(res, fileName)
       // })
     },
-    //  下载
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '库存预警' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 3 - 13
src/views/productManagement/priceChangeRecord/list.vue

@@ -121,6 +121,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import { productPriceChangeList, getCurrentDealer } from '@/api/product'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -282,21 +283,10 @@ export default {
       this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+      // const fileName = '价格变更记录' + moment().format('YYYYMMDDHHmmss')
+      // downloadExcel(res, fileName)
       // })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '价格变更记录' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     //  产品品牌  列表
     getProductBrand () {
       productBrandQuery({}).then(res => {

+ 3 - 13
src/views/productManagement/productInfo/list.vue

@@ -138,6 +138,7 @@ import { dealerProductTypeList } from '@/api/dealerProductType'
 import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
 import productInfoDetailModal from './detailModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ProductList',
   components: { STable, VSelect, productInfoDetailModal },
@@ -285,22 +286,11 @@ export default {
       this.spinning = true
       dealerProductExport(this.queryParam).then(res => {
         this.exportLoading = false
-        this.download(res)
         this.spinning = false
+		const fileName = '自建产品列表' + moment().format('YYYYMMDDHHmmss')
+		downloadExcel(res, fileName)
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '自建产品列表' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     //  产品品牌  列表
     getProductBrand () {
       dealerProductBrandQuery({}).then(res => {

+ 3 - 13
src/views/productManagement/productInfoJg/list.vue

@@ -115,6 +115,7 @@ import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { productTypeQuery } from '@/api/productType'
 import { productList, getCurrentDealer } from '@/api/product'
 import { STable, VSelect } from '@/components'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ProductJgList',
   components: { STable, VSelect },
@@ -241,21 +242,10 @@ export default {
       this.exportLoading = true
       // dealerProductExport(this.queryParam).then(res => {
       //   this.exportLoading = false
-      //   this.download(res)
+	  // const fileName = '箭冠产品列表' + moment().format('YYYYMMDDHHmmss')
+	  // downloadExcel(res, fileName)
       // })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '箭冠产品列表' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     //  产品品牌  列表
     getProductBrand () {
       dealerProductBrandQuery({ 'sysFlag': '1' }).then(res => {

+ 3 - 14
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -143,7 +143,7 @@ import { STable, VSelect } from '@/components'
 import { purchaseDetailBySn, purchaseDetailPrint, purchaseDetailExport, purchaseExportDetail } from '@/api/purchase'
 import { purchaseDetailList } from '@/api/purchaseDetail'
 import Print from '@/views/common/print.vue'
-import { hdPrint } from '@/libs/JGPrint'
+import { hdPrint, downloadExcel } from '@/libs/JGPrint'
 export default {
   components: { STable, VSelect, Print },
   data () {
@@ -229,22 +229,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+			const fileName = '采购产品' + moment().format('YYYYMMDDHHmmss')
+			downloadExcel(res, fileName)
         }
       })
     },
-    download (data, type) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '采购产品' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用

+ 3 - 12
src/views/purchasingManagement/purchaseOrder/importGuideModal.vue

@@ -66,6 +66,7 @@
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
 import { purchaseDetailDownload } from '@/api/purchase'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'ImportGuideModal',
   components: { ChooseImportModal, Upload },
@@ -134,21 +135,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+		  const fileName = '采购单产品导入模板'
+		  downloadExcel(res, fileName)
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const fname = '采购单产品导入模板'
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 2 - 2
src/views/reportData/chainCustomerReport/list.vue

@@ -50,7 +50,7 @@
             <template v-if="advanced">
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0!important;">
                         <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
@@ -79,7 +79,7 @@
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="customerReportList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>

+ 55 - 0
src/views/reportData/chainPurchaseReceiptReport/list.vue

@@ -0,0 +1,55 @@
+<template>
+  <a-card size="small" :bordered="false" class="chainPurchaseReceiptReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 标签页 -->
+      <a-tabs type="card" :default-active-key="nowKey" @change="handleTabChange" class="chainPurchaseReceiptReportList-tabs ">
+        <a-tab-pane v-for="item in tabPaneData" :key="item.val">
+          <span slot="tab">{{ item.name }}</span>
+        </a-tab-pane>
+      </a-tabs>
+      <purchaseReceiptOrder v-show="nowKey=='1'" @spinning="spinningFun" />
+      <purchaseReceiptDetail v-show="nowKey=='2'" @spinning="spinningFun" />
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import purchaseReceiptOrder from './purchaseReceiptOrder.vue'
+import purchaseReceiptDetail from './purchaseReceiptDetail.vue'
+export default {
+  components: { purchaseReceiptOrder, purchaseReceiptDetail },
+  data () {
+    return {
+      spinning: false,
+      tabPaneData: [
+        { name: '采购入库单报表', val: '1' },
+        { name: '采购入库明细报表', val: '2' }
+      ],
+      nowKey: '1'
+    }
+  },
+  methods: {
+    spinningFun (val) {
+      this.spinning = val
+    },
+    // tab切换
+    handleTabChange (key) {
+      this.nowKey = key
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.nowKey = '1'
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.nowKey = '1'
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 284 - 0
src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptDetail.vue

@@ -0,0 +1,284 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="chainPurchaseReceiptDetailList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="连锁店" prop="tenantId">
+              <a-select
+                placeholder="请选择连锁店"
+                id="chainPurchaseReceiptDetailList-tenantId"
+                allowClear
+                v-model="queryParam.tenantId"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption">
+                <a-select-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="财务审核时间" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品品牌">
+              <ProductBrand id="chainPurchaseReceiptDetailList-productBrandSn" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品分类">
+                <ProductType id="chainPurchaseReceiptDetailList-productType" @change="changeProductType" v-model="productType"></ProductType>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="salesDetailReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="salesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainPurchaseReceiptDetailList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainPurchaseReceiptDetailList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_chainPurchaseReceiptReportExport')"
+              id="chainPurchaseReceiptDetailList-export">导出</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        采购总数量:<strong>{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</strong>;
+        采购总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        入库总数量:<strong>{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }}</strong>;
+        入库总成本:<strong>{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? '¥'+totalData.putAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import { hdPrint } from '@/libs/JGPrint'
+import { reportChainReceivingBillDetailList, reportChainReceivingBillDetailCount, reportReceivingBillDetailExport, linkageGroupList } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        tenantId: undefined,
+        time: [],
+        beginDate: '',
+        endDate: '',
+        productEntity: {
+          productBrandSn: undefined,
+          productTypeSn1: undefined,
+          productTypeSn2: undefined,
+          productTypeSn3: undefined,
+          code: '',
+          name: ''
+        }
+      },
+      productType: [],
+      rules: {
+        'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, // 高级搜索 展开/关闭
+      exportLoading: false,
+      columns: [
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购数量', dataIndex: 'qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'putAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportChainReceivingBillDetailList(params).then(res => {
+            // 总计
+            this.getCount(params)
+            const data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.$emit('spinning', false)
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            _this.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null, //  合计
+      linkageGroupData: []
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportChainReceivingBillDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.tenantId = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.spinning = true
+      _this.exportLoading = true
+      // 打印或导出
+      hdPrint('', 'export', reportReceivingBillDetailExport, this.queryParam, '连锁采购入库明细报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          this.linkageGroupData = res.data || []
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

+ 233 - 0
src/views/reportData/chainPurchaseReceiptReport/purchaseReceiptOrder.vue

@@ -0,0 +1,233 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="chainPurchaseReceiptOrderList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="连锁店" prop="tenantId">
+              <a-select
+                placeholder="请选择连锁店"
+                id="chainPurchaseReceiptOrderList-tenantId"
+                allowClear
+                v-model="queryParam.tenantId"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption">
+                <a-select-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="财务审核时间" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainPurchaseReceiptOrderList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainPurchaseReceiptOrderList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_chainPurchaseReceiptReportExport')"
+              id="chainPurchaseReceiptOrderList-export">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        总单数:<strong>{{ (totalData && (totalData.totalPutCategory || totalData.totalPutCategory==0)) ? totalData.totalPutCategory : '--' }}</strong>;
+        采购总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        采购总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        入库总数量:<strong>{{ (totalData && (totalData.totalPutQty || totalData.totalPutQty==0)) ? totalData.totalPutQty : '--' }}</strong>;
+        入库总成本:<strong>{{ (totalData && (totalData.totalPutAmount || totalData.totalPutAmount==0)) ? '¥'+totalData.totalPutAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { hdPrint } from '@/libs/JGPrint'
+import { reportChainReceivingBillList, reportChainReceivingBillCount, reportReceivingBillExport, linkageGroupList } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        tenantId: undefined,
+        time: [],
+        beginDate: '',
+        endDate: ''
+      },
+      productType: [],
+      rules: {
+        'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库款数', dataIndex: 'totalPutCategory', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'totalQty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'totalPutQty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'totalPutAmount', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '17%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportChainReceivingBillList(params).then(res => {
+            // 总计
+            this.getCount(params)
+            const data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.$emit('spinning', false)
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            _this.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null, //  合计
+      linkageGroupData: []
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportChainReceivingBillCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.tenantId = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.spinning = true
+      _this.exportLoading = true
+      // 打印或导出
+      hdPrint('', 'export', reportReceivingBillExport, this.queryParam, '连锁采购入库单报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          this.linkageGroupData = res.data || []
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.getLinkageGroup()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

+ 3 - 3
src/views/reportData/chainSalesDetailReport/list.vue

@@ -118,7 +118,7 @@
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
                         <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省" allowClear>
@@ -144,10 +144,10 @@
                 </a-row>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesDetailReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesDetailReportList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>

+ 2 - 2
src/views/reportData/chainSalesReport/list.vue

@@ -66,7 +66,7 @@
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="8">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
                         <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
@@ -92,7 +92,7 @@
                 </a-row>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesReportList-reset">重置</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">

+ 3 - 8
src/views/reportData/chainStockReport/detailModal.vue

@@ -11,8 +11,8 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        现有库存总数量(个):<strong> {{ (currentStock && currentStock.totalQty) || 0 }} </strong>;
-        现有库存总成本(¥):<strong> {{ (currentStock && currentStock.totalCost) || 0 }} </strong>。
+        可用库存总数量(个):<strong> {{ (currentStock && currentStock.totalQty) || 0 }} </strong>;
+        可用库存总成本(¥):<strong> {{ (currentStock && currentStock.totalCost) || 0 }} </strong>。
       </div>
     </a-alert>
     <!-- 详情 -->
@@ -25,11 +25,6 @@
       :columns="columns"
       :data="loadData"
       bordered>
-      <!-- 库存数量 -->
-      <template slot="currentQty" slot-scope="text, record">
-        {{ (Number(record.currentQty) + Number(record.freezeQty)) || 0 }}
-        <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
-      </template>
     </s-table>
     <div class="btn-cont">
       <a-button id="chainStockReportDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -74,7 +69,7 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, width: '8%', align: 'center' },
+        { title: '库存数量', dataIndex: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '成本单价', dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 4 - 12
src/views/reportData/chainStockReport/list.vue

@@ -87,8 +87,8 @@
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
-          现有库存总数量(个):<strong> {{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }} </strong>;
-          现有库存总成本(¥):<strong> {{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }} </strong>。
+          可用库存总数量(个):<strong> {{ (totalData && (totalData.currentStockQty || totalData.currentStockQty==0)) ? totalData.currentStockQty : '--' }} </strong>;
+          可用库存总成本(¥):<strong> {{ (totalData && (totalData.currentStockCost || totalData.currentStockCost==0)) ? totalData.currentStockCost : '--' }} </strong>。
         </div>
       </a-alert>
       <!-- 列表 -->
@@ -101,14 +101,6 @@
         :data="loadData"
         :defaultLoadData="false"
         bordered>
-        <!-- 现有库存数量 -->
-        <template slot="currentStockQty" slot-scope="text, record">
-          {{ (Number(record.currentStockQty) + Number(record.freezeQty)) || 0 }}
-          <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
-        </template>
-        <template slot="currentStockCost" slot-scope="text, record">
-          {{ (Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000 || 0 }}
-        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="chainStockReportList-detail-btn">详情</a-button>
@@ -156,8 +148,8 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: '14%', align: 'center', sorter: true },
-        { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: '14%', align: 'center', sorter: true },
+        { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '14%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '可用库存成本(¥)', dataIndex: 'currentStockCost', width: '14%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 55 - 0
src/views/reportData/purchaseReceiptReport/list.vue

@@ -0,0 +1,55 @@
+<template>
+  <a-card size="small" :bordered="false" class="purchaseReceiptReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 标签页 -->
+      <a-tabs type="card" :default-active-key="nowKey" @change="handleTabChange" class="purchaseReceiptReportList-tabs ">
+        <a-tab-pane v-for="item in tabPaneData" :key="item.val">
+          <span slot="tab">{{ item.name }}</span>
+        </a-tab-pane>
+      </a-tabs>
+      <purchaseReceiptOrder v-show="nowKey=='1'" @spinning="spinningFun" />
+      <purchaseReceiptDetail v-show="nowKey=='2'" @spinning="spinningFun" />
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import purchaseReceiptOrder from './purchaseReceiptOrder.vue'
+import purchaseReceiptDetail from './purchaseReceiptDetail.vue'
+export default {
+  components: { purchaseReceiptOrder, purchaseReceiptDetail },
+  data () {
+    return {
+      spinning: false,
+      tabPaneData: [
+        { name: '采购入库单报表', val: '1' },
+        { name: '采购入库明细报表', val: '2' }
+      ],
+      nowKey: '1'
+    }
+  },
+  methods: {
+    spinningFun (val) {
+      this.spinning = val
+    },
+    // tab切换
+    handleTabChange (key) {
+      this.nowKey = key
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.nowKey = '1'
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.nowKey = '1'
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 249 - 0
src/views/reportData/purchaseReceiptReport/purchaseReceiptDetail.vue

@@ -0,0 +1,249 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="purchaseReceiptDetailList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="财务审核时间" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品品牌">
+              <ProductBrand id="purchaseReceiptDetailList-productBrandSn" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="产品分类">
+              <ProductType id="purchaseReceiptDetailList-productType" @change="changeProductType" v-model="productType"></ProductType>
+            </a-form-model-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="salesDetailReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="salesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="purchaseReceiptDetailList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseReceiptDetailList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_purchaseReceiptReportExport')"
+              id="purchaseReceiptDetailList-export">导出</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        采购总数量:<strong>{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</strong>;
+        采购总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        入库总数量:<strong>{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }}</strong>;
+        入库总成本:<strong>{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? '¥'+totalData.putAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import { hdPrint } from '@/libs/JGPrint'
+import { reportReceivingBillDetailList, reportReceivingBillDetailCount, reportReceivingBillDetailExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        productEntity: {
+          productBrandSn: undefined,
+          productTypeSn1: undefined,
+          productTypeSn2: undefined,
+          productTypeSn3: undefined,
+          code: '',
+          name: ''
+        }
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, // 高级搜索 展开/关闭
+      exportLoading: false,
+      columns: [
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购数量', dataIndex: 'qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'putAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportReceivingBillDetailList(params).then(res => {
+            // 总计
+            this.getCount(params)
+            const data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.$emit('spinning', false)
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            _this.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null //  合计
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportReceivingBillDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.spinning = true
+      _this.exportLoading = true
+      // 打印或导出
+      hdPrint('', 'export', reportReceivingBillDetailExport, this.queryParam, '采购入库明细报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

+ 198 - 0
src/views/reportData/purchaseReceiptReport/purchaseReceiptOrder.vue

@@ -0,0 +1,198 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="purchaseReceiptOrderList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="财务审核时间" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="purchaseReceiptOrderList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseReceiptOrderList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_purchaseReceiptReportExport')"
+              id="purchaseReceiptOrderList-export">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        总单数:<strong>{{ (totalData && (totalData.totalPutCategory || totalData.totalPutCategory==0)) ? totalData.totalPutCategory : '--' }}</strong>;
+        采购总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        采购总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        入库总数量:<strong>{{ (totalData && (totalData.totalPutQty || totalData.totalPutQty==0)) ? totalData.totalPutQty : '--' }}</strong>;
+        入库总成本:<strong>{{ (totalData && (totalData.totalPutAmount || totalData.totalPutAmount==0)) ? '¥'+totalData.totalPutAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { hdPrint } from '@/libs/JGPrint'
+import { reportReceivingBillList, reportReceivingBillCount, reportReceivingBillExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: ''
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库款数', dataIndex: 'totalPutCategory', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购数量', dataIndex: 'totalQty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'totalPutQty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'totalPutAmount', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '17%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportReceivingBillList(params).then(res => {
+            // 总计
+            this.getCount(params)
+            const data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            this.$emit('spinning', false)
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            _this.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null //  合计
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportReceivingBillCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.spinning = true
+      _this.exportLoading = true
+      // 打印或导出
+      hdPrint('', 'export', reportReceivingBillExport, this.queryParam, '采购入库单报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+</style>

+ 5 - 3
src/views/reportData/salesDetailReport/list.vue

@@ -104,7 +104,7 @@
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="7">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
                         <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省" allowClear>
@@ -130,7 +130,7 @@
                 </a-row>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailReportList-reset">重置</a-button>
               <a-button
@@ -142,7 +142,7 @@
                 v-if="$hasPermissions('B_salesDetailExport')"
                 class="button-warning"
                 id="salesDetailReportList-export-btn">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -471,6 +471,8 @@ export default {
       })
     },
     pageInit () {
+      this.disabled = false
+      this.spinning = false
       this.getArea('province')
       this.getCustTypeList()
       this.getSettleStyleList()

+ 2 - 2
src/views/reportData/salesReport/list.vue

@@ -52,7 +52,7 @@
               </a-col>
               <a-col :md="12" :sm="24">
                 <a-row>
-                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }">
+                  <a-form-model-item label="客户所在区" :labelCol="{span: 4}" :wrapperCol="{ span: 20 }" style="margin-bottom: 0!important;">
                     <a-col span="8">
                       <a-form-model-item prop="provinceSn" style="margin: 0;">
                         <a-select v-model="queryParam.provinceSn" allowClear @change="getCityList" placeholder="请选择省">
@@ -78,7 +78,7 @@
                 </a-row>
               </a-col>
             </template>
-            <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReportList-reset">重置</a-button>
               <a-button

+ 3 - 13
src/views/salesManagement/salesQuery/list.vue

@@ -187,6 +187,7 @@ import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, s
 import { settleStyleQueryAll } from '@/api/settleStyle'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'TableList',
   components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList },
@@ -395,22 +396,11 @@ export default {
           })
           reader.readAsText(res)
         } else {
-          this.download(res)
+          const fileName = '销售列表' + moment().format('YYYYMMDDHHmmss')
+          downloadExcel(res, fileName)
         }
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '销售列表' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     // 获取收款方式
     getSettleStyle () {
       settleStyleQueryAll().then(res => {