Pārlūkot izejas kodu

报表bug修复, 入库单报表

chenrui 3 gadi atpakaļ
vecāks
revīzija
73f53ac2ec

+ 30 - 2
src/api/reportData.js

@@ -280,6 +280,34 @@ export const reportSalesBillExport = (params) => {
   })
 }
 //  入库单报表
+export const reportStockPutList = (params) => {
+  const url = `/report/reportStockPut/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  入库单报表  合计
+export const reportStockPutCount = (params) => {
+  return axios({
+    url: '/report/reportStockPut/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 入库单报表 导出
+export const reportStockPutExport = (params) => {
+  return axios({
+    url: '/report/reportStockPut/exportExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+//  入库单明细报表
 export const reportStockPutDetailList = (params) => {
   const url = `/report/reportStockPut/detail/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
@@ -290,7 +318,7 @@ export const reportStockPutDetailList = (params) => {
     method: 'post'
   })
 }
-//  入库单报表  合计
+//  入库单明细报表  合计
 export const reportStockPutDetailCount = (params) => {
   return axios({
     url: '/report/reportStockPut/detail/queryCount',
@@ -298,7 +326,7 @@ export const reportStockPutDetailCount = (params) => {
     method: 'post'
   })
 }
-// 入库单报表 导出
+// 入库单明细报表 导出
 export const reportStockPutDetailExport = (params) => {
   return axios({
     url: '/report/reportStockPut/detail/exportExcel',

+ 61 - 25
src/config/router.config.js

@@ -600,6 +600,42 @@ export const asyncRouterMap = [
               }
             ]
           },
+          // {
+          //   path: '/inventoryManagement/inventoryCheck',
+          //   redirect: '/inventoryManagement/inventoryCheck/list',
+          //   name: 'inventoryCheck',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '库存盘点',
+          //     icon: 'monitor'
+          //     // permission: 'M_inventoryCheckList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'inventoryCheckList',
+          //       component: () => import(/* webpackChunkName: "inventoryManagement" */ '@/views/inventoryManagement/inventoryCheck/list.vue'),
+          //       meta: {
+          //         title: '库存盘点列表',
+          //         icon: 'monitor',
+          //         hidden: true
+          //         // permission: 'M_inventoryCheckList'
+          //       }
+          //     },
+          //     {
+          //       path: 'detail/:sn',
+          //       name: 'inventoryCheckDetail',
+          //       component: () => import(/* webpackChunkName: "inventoryManagement" */ '@/views/inventoryManagement/inventoryCheck/detail.vue'),
+          //       meta: {
+          //         title: '库存盘点详情',
+          //         icon: 'monitor',
+          //         hidden: true
+          //         // permission: 'B_goodsManage_edit'
+          //       }
+          //     }
+          //   ]
+          // },
           {
             path: '/inventoryManagement/inventoryWarning',
             name: 'inventoryWarningList',
@@ -1125,31 +1161,31 @@ export const asyncRouterMap = [
               }
             ]
           },
-          // {
-          //   path: '/reportData/warehousingOrder',
-          //   redirect: '/reportData/warehousingOrder/list',
-          //   name: 'warehousingOrder',
-          //   component: BlankLayout,
-          //   meta: {
-          //     title: '入库单报表',
-          //     icon: 'profile'
-          //     // permission: 'M_warehousingOrderList'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'warehousingOrderList',
-          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/warehousingOrder/list.vue'),
-          //       meta: {
-          //         title: '入库单报表列表',
-          //         icon: 'profile',
-          //         hidden: true
-          //         // permission: 'M_warehousingOrderList'
-          //       }
-          //     }
-          //   ]
-          // },
+          {
+            path: '/reportData/warehousingOrder',
+            redirect: '/reportData/warehousingOrder/list',
+            name: 'warehousingOrder',
+            component: BlankLayout,
+            meta: {
+              title: '入库单报表',
+              icon: 'profile',
+              permission: 'M_warehousingOrderList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'warehousingOrderList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/warehousingOrder/list.vue'),
+                meta: {
+                  title: '入库单报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_warehousingOrderList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/warehousingOrderDetail',
             redirect: '/reportData/warehousingOrderDetail/list',

+ 15 - 30
src/views/reportData/actualSalesReport/list.vue

@@ -135,13 +135,13 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
 import { actualSalesExport } from '@/api/reportData'
 export default {
@@ -376,39 +376,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      actualSalesExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(actualSalesExport, params, '实售销售报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     // 总计
     getCount (params) {
       salesBillRealReportCount(params).then(res => {
@@ -431,7 +412,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 16 - 30
src/views/reportData/allocationDetails/list.vue

@@ -158,7 +158,6 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -168,6 +167,7 @@ import { productTypeQuery } from '@/api/productType'
 import { getArea } from '@/api/data'
 import { allocateTypeAllList } from '@/api/allocateType'
 import ProductBrand from '@/views/common/productBrand.js'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { userQueryList } from '@/api/power-user'
 import { allocateReportDetailList, allocateReportDetailCount, allocateReportDetailExport } from '@/api/allocateReport'
 export default {
@@ -279,7 +279,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
@@ -336,39 +340,21 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      allocateReportDetailExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(allocateReportDetailExport, params, '调拨明细报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          console.log('error submit!!')
+          return false
         }
       })
     },
-    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()
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''

+ 5 - 1
src/views/reportData/allocationOrderTotal/list.vue

@@ -168,7 +168,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 15 - 30
src/views/reportData/billingReturnReport/list.vue

@@ -135,13 +135,13 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { salesReportReturnList, salesReportReturnCount, billingReturnExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate },
@@ -377,39 +377,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      billingReturnExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(billingReturnExport, params, '开单退货报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     // 总计
     getCount (params) {
       salesReportReturnCount(params).then(res => {
@@ -432,7 +413,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 5 - 1
src/views/reportData/districtTypeSalesDetails/list.vue

@@ -130,7 +130,11 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 5 - 1
src/views/reportData/hPriceDifferenceDetailReport/list.vue

@@ -229,7 +229,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 5 - 1
src/views/reportData/nationalCustomerCostStatistics/list.vue

@@ -394,7 +394,11 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 10 - 28
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -89,6 +89,7 @@ import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { reportRebateReportList, reportRebateCount, reportRebateExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList },
@@ -221,39 +222,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      reportRebateExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportRebateExport, params, '差价明细报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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 () {
       this.getArea('province')
     }

+ 5 - 1
src/views/reportData/provinceTypeSalesDetails/list.vue

@@ -146,7 +146,11 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 5 - 1
src/views/reportData/regionalPromotionCostStatistics/list.vue

@@ -149,7 +149,11 @@ export default {
   methods: {
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 15 - 30
src/views/reportData/returnSlipReport/list.vue

@@ -140,13 +140,13 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { salesReportReturnBillList, salesReportReturnBillCount, returnSlipExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate },
@@ -383,39 +383,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      returnSlipExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(returnSlipExport, params, '开单退货单报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     // 总计
     getCount (params) {
       salesReportReturnBillCount(params).then(res => {
@@ -438,7 +419,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 15 - 30
src/views/reportData/salesAmountReport/list.vue

@@ -135,13 +135,13 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { salesBillReportGroupByBuyerList, salesBillReportCount } from '@/api/salesBillReport'
 import { salesAmountExport } from '@/api/reportData'
 export default {
@@ -377,39 +377,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      salesAmountExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(salesAmountExport, params, '开单销售报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     // 总计
     getCount (params) {
       salesBillReportCount(params).then(res => {
@@ -432,7 +413,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 19 - 10
src/views/reportData/salesDetails/list.vue

@@ -114,9 +114,9 @@
                 @click="handleStock"
                 id="salesDetailsList-stockDate">盘点区间日期</a-button>
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailsList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesDetailsList-reset">重置</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailsList-reset">重置</a-button>
               <a-button
-                style="margin-left: 10px"
+                style="margin-left: 5px"
                 type="primary"
                 class="button-warning"
                 @click="handleExport"
@@ -248,7 +248,6 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        delete params.time
         return reportSalesBillDetailList(params).then(res => {
           this.getCount(params)
           const data = res.data
@@ -296,7 +295,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
@@ -334,12 +337,18 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      this.spinning = true
-      hdExportExcel(reportSalesBillDetailExport, params, '销售明细(开单统计)报表', function () {
-        _this.exportLoading = false
-        _this.spinning = false
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportSalesBillDetailExport, params, '销售明细(开单统计)报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
       })
     },
     filterOption (input, option) {

+ 17 - 8
src/views/reportData/salesOrderTotal/list.vue

@@ -202,7 +202,6 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        delete params.time
         return reportSalesBillList(params).then(res => {
           this.getCount(params)
           const data = res.data
@@ -247,7 +246,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
@@ -276,12 +279,18 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      this.spinning = true
-      hdExportExcel(reportSalesBillExport, params, '销售(开单统计)报表', function () {
-        _this.exportLoading = false
-        _this.spinning = false
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportSalesBillExport, params, '销售(开单统计)报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
       })
     },
     filterOption (input, option) {

+ 18 - 8
src/views/reportData/salesPresentation/list.vue

@@ -374,13 +374,19 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      delete params.time
-      this.exportLoading = true
-      this.spinning = true
-      hdExportExcel(reportDispatchReportExport, params, '销售交单报表', function () {
-        _this.exportLoading = false
-        _this.spinning = false
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          delete params.time
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportDispatchReportExport, params, '销售交单报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
       })
     },
     // 总计
@@ -405,7 +411,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 15 - 30
src/views/reportData/salesReturnDetailReport/list.vue

@@ -180,7 +180,6 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDateTime from '@/views/common/rangeDateTime.vue'
@@ -190,6 +189,7 @@ import { getArea } from '@/api/data'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import ProductBrand from '@/views/common/productBrand.js'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { reportSalesReturnDetailList, reportSalesReturnDetailCount, reportSalesReturnDetailExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDateTime, custList, subarea, ProductBrand },
@@ -309,7 +309,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
@@ -347,39 +351,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      reportSalesReturnDetailExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportSalesReturnDetailExport, params, '销售退货明细报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 15 - 30
src/views/reportData/salesReturnReport/list.vue

@@ -135,13 +135,13 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { salesReportReturnRebateList, salesReportReturnRebateCount, salesReturnExport } from '@/api/reportData'
 
 export default {
@@ -378,39 +378,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      salesReturnExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(salesReturnExport, params, '实售退货报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     // 总计
     getCount (params) {
       salesReportReturnRebateCount(params).then(res => {
@@ -433,7 +414,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },

+ 17 - 32
src/views/reportData/salesReturnsReport/list.vue

@@ -80,9 +80,9 @@
                 @click="handleStock"
                 id="salesReturnsReportList-stockDate">盘点区间日期</a-button>
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnsReportList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnsReportList-reset">重置</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnsReportList-reset">重置</a-button>
               <a-button
-                style="margin-left: 10px"
+                style="margin-left: 5px"
                 type="primary"
                 class="button-warning"
                 @click="handleExport"
@@ -143,8 +143,8 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { reportSalesReturnList, reportSalesReturnCount, salesReturnsExport } from '@/api/reportData'
-import moment from 'moment'
 export default {
   components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
@@ -218,39 +218,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      salesReturnsExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(salesReturnsExport, params, '销售退货单报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     // 盘点库存日期
     handleStock () {
       this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
@@ -277,7 +258,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 15 - 30
src/views/reportData/salesSlipReport/list.vue

@@ -140,13 +140,13 @@
 </template>
 
 <script>
-import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
 import { salesSlipExport } from '@/api/reportData'
 export default {
@@ -384,39 +384,20 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      _this.spinning = true
-      salesSlipExport(params).then(res => {
-        this.exportLoading = false
-        _this.spinning = false
-        if (res.type == 'application/json') {
-          var reader = new FileReader()
-          reader.addEventListener('loadend', function () {
-            const obj = JSON.parse(reader.result)
-            _this.$notification.error({
-              message: '提示',
-              description: obj.message
-            })
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(salesSlipExport, params, '开单销售单报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
           })
-          reader.readAsText(res)
         } else {
-          this.download(res)
+          return false
         }
       })
     },
-    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()
-    },
     // 总计
     getCount (params) {
       salesBillReportCount(params).then(res => {
@@ -439,7 +420,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },

+ 59 - 44
src/views/reportData/warehousingOrder/list.vue

@@ -19,20 +19,33 @@
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="入库单号">
-                <a-input id="warehousingOrderList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入退货单号"/>
+                <a-input id="warehousingOrderList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入退货单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="入库类型">
                 <v-select
-                  v-model="queryParam.dealerLevel"
-                  ref="dealerLevel"
-                  id="warehousingOrderList-dealerLevel"
+                  v-model="queryParam.putBizType"
+                  ref="putBizType"
+                  id="warehousingOrderList-putBizType"
                   code="PUT_STOCK_TYPE"
                   placeholder="请选择入库类型"
                   allowClear></v-select>
               </a-form-model-item>
             </a-col>
+            <template v-if="advanced">
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="散件入库子类型">
+                  <v-select
+                    v-model="queryParam.sparePartsType"
+                    ref="sparePartsType"
+                    id="warehousingOrderList-sparePartsType"
+                    code="SPARE_PARTS_TYPE"
+                    placeholder="请选择散件入库子类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+            </template>
             <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
               <a-button
                 type="primary"
@@ -49,17 +62,13 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
+                v-if="$hasPermissions('B_warehousingOrderExport')"
                 id="warehousingOrderList-export">导出</a-button>
-<!--              <a-button
-                style="margin-left: 5px"
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                v-if="$hasPermissions('B_salesOrderTotalExport')"
-                id="warehousingOrderList-export">导出</a-button>
- -->            </a-col>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
           </a-row>
         </a-form-model>
       </div>
@@ -76,10 +85,10 @@
         <template slot="footer">
           <a-row :gutter="15">
             <a-col :md="4" :sm="24">
-              总数量:{{ (totalData && (totalData.totalPutQty || totalData.totalPutQty==0)) ? totalData.totalPutQty : '--' }}
+              总数量:{{ (totalData && (totalData.productTotalQty || totalData.productTotalQty==0)) ? totalData.productTotalQty : '--' }}
             </a-col>
             <a-col :md="4" :sm="24">
-              总金额:{{ (totalData && (totalData.totalPutAmount || totalData.totalPutAmount==0)) ? totalData.totalPutAmount : '--' }}
+              总金额:{{ (totalData && (totalData.productTotalCost || totalData.productTotalCost==0)) ? totalData.productTotalCost : '--' }}
             </a-col>
           </a-row>
         </template>
@@ -92,23 +101,21 @@
 import { STable, VSelect } from '@/components'
 import rangeDateTime from '@/views/common/rangeDateTime.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { reportStockPutDetailList, reportStockPutDetailCount, reportStockPutDetailExport } from '@/api/reportData'
+import { reportStockPutList, reportStockPutCount, reportStockPutExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDateTime },
   data () {
     return {
       spinning: false,
+      advanced: false,
       tableHeight: 0,
       queryParam: { //  查询条件
         time: [],
         beginDate: '',
         endDate: '',
-        salesBillNo: '',
-        dealerName: '',
-        dealerLevel: undefined,
-        creatorId: undefined,
-        subareaSn: undefined,
-        dealerProvinceSn: undefined
+        stockPutNo: '',
+        putBizType: undefined,
+        sparePartsType: undefined
       },
       rules: {
         'time': [{ required: true, message: '请选择完成日期', trigger: 'change' }]
@@ -116,12 +123,13 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       columns: [
-        { title: '入库单号', dataIndex: 'salesBillNo', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库开单日期', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商名称', dataIndex: 'dealerName', width: '27%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '入库数量', dataIndex: 'totalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库金额', dataIndex: 'totalRealSaleAmount', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '入库类型', dataIndex: 'operatorName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '入库单号', dataIndex: 'stockPutNo', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库开单日期', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'supplierName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '入库数量', dataIndex: 'productTotalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库金额', dataIndex: 'productTotalCost', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '散件入库子类型', dataIndex: 'sparePartsTypeDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -129,7 +137,7 @@ export default {
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
-        return reportStockPutDetailList(params).then(res => {
+        return reportStockPutList(params).then(res => {
           this.getCount(params)
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -151,7 +159,7 @@ export default {
     },
     // 总计
     getCount (params) {
-      reportStockPutDetailCount(params).then(res => {
+      reportStockPutCount(params).then(res => {
         if (res.status == 200 && res.data) {
           this.totalData = res.data
         } else {
@@ -171,7 +179,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
@@ -181,12 +193,9 @@ export default {
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.salesBillNo = ''
-      this.queryParam.dealerName = ''
-      this.queryParam.dealerLevel = undefined
-      this.queryParam.creatorId = undefined
-      this.queryParam.subareaSn = undefined
-      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.stockPutNo = ''
+      this.queryParam.putBizType = undefined
+      this.queryParam.sparePartsType = undefined
       this.totalData = null
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
@@ -194,12 +203,18 @@ export default {
     //  导出
     handleExport () {
       const _this = this
-      const params = this.queryParam
-      this.exportLoading = true
-      this.spinning = true
-      hdExportExcel(reportStockPutDetailExport, params, '入库单报表', function () {
-        _this.exportLoading = false
-        _this.spinning = false
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportStockPutExport, params, '入库单明细报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
       })
     },
     filterOption (input, option) {

+ 5 - 1
src/views/reportData/warehousingOrderDetail/list.vue

@@ -189,7 +189,11 @@ export default {
     },
     //  创建时间  change
     dateChange (date) {
-      this.queryParam.time = date
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },