Browse Source

bug 修复

lilei 3 years ago
parent
commit
5fcddaa5dd

+ 46 - 1
src/views/reportData/actualSalesReport/list.vue

@@ -69,7 +69,15 @@
             </template>
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="actualSalesReportList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="actualSalesReportList-reset">重置</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="actualSalesReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="actualSalesReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -124,6 +132,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -347,6 +356,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    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
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    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 => {

+ 45 - 0
src/views/reportData/billingReturnReport/list.vue

@@ -70,6 +70,14 @@
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="billingReturnReportList-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="billingReturnReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="billingReturnReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -124,6 +132,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -349,6 +358,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    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
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    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 => {

+ 45 - 0
src/views/reportData/returnSlipReport/list.vue

@@ -75,6 +75,14 @@
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnSlipReportList-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="returnSlipReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="returnSlipReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -129,6 +137,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -355,6 +364,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    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
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    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 => {

+ 46 - 1
src/views/reportData/salesAmountReport/list.vue

@@ -69,7 +69,15 @@
             </template>
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesAmountReportList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesAmountReportList-reset">重置</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesAmountReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="returnSlipReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -124,6 +132,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -348,6 +357,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    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
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    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 => {

+ 3 - 4
src/views/reportData/salesReturnDetailReport/list.vue

@@ -118,20 +118,19 @@
             <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
               <a-button
                 type="primary"
-                class="button-warning"
+                class="button-info"
                 size="small"
                 @click="handleStock"
                 id="salesReturnDetailList-stockDate">盘点区间日期</a-button>
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnDetailList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnDetailList-reset">重置</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnDetailList-reset">重置</a-button>
               <a-button
-                style="margin-left: 5px"
+                style="margin-left: 10px"
                 type="primary"
                 class="button-warning"
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
-                v-if="$hasPermissions('B_salerReturnDetailTable_export')"
                 id="salesReturnDetailList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}

+ 45 - 0
src/views/reportData/salesReturnReport/list.vue

@@ -70,6 +70,14 @@
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnReportList-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="salesReturnReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -124,6 +132,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -349,6 +358,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    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
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    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 => {

+ 48 - 2
src/views/reportData/salesReturnsReport/list.vue

@@ -75,12 +75,20 @@
             <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
               <a-button
                 type="primary"
-                class="button-warning"
+                class="button-info"
                 size="small"
                 @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: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnsReportList-reset">重置</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnsReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="salesReturnsReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -135,11 +143,13 @@ import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import { getArea } from '@/api/data'
 import { reportSalesReturnList, reportSalesReturnCount } from '@/api/reportData'
+import moment from 'moment'
 export default {
   components: { STable, VSelect, rangeDate, subarea, custList },
   data () {
     return {
       spinning: false,
+      exportLoading: false,
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -205,6 +215,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      _this.spinning = true
+      oosDetailExport(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
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    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('无盘点区间的起始/终止时间,请自行选择日期区间查询!')

+ 46 - 1
src/views/reportData/salesSlipReport/list.vue

@@ -74,7 +74,15 @@
             </template>
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesSlipReportList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesSlipReportList-reset">重置</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesSlipReportList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="salesSlipReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -129,6 +137,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -355,6 +364,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    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
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    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 => {

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.194:8602/ocs-admin',
-        target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
+        target: 'http://192.168.16.188:8602/ocs-admin',
+        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         // target: 'http://ocs-admin.360arrow.com/ocs-admin', //  Éú²ú
         ws: false,
         changeOrigin: true,