|
@@ -83,6 +83,14 @@
|
|
|
id="hPriceDifferenceDetailList-stockDate">盘点区间日期</a-button>
|
|
|
<a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="hPriceDifferenceDetailList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="hPriceDifferenceDetailList-reset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin-left: 5px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ id="shortageStatisticsCList-export">导出</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 5px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
@@ -117,6 +125,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'
|
|
@@ -125,7 +134,7 @@ import subarea from '@/views/common/subarea.js'
|
|
|
import { getArea } from '@/api/data'
|
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
|
import ProductType from '@/views/common/productType.js'
|
|
|
-import { headRebateDetailReportList, headRebateDetailReportCount } from '@/api/reportData'
|
|
|
+import { headRebateDetailReportList, headRebateDetailReportCount, headRebateDetailReportExport } from '@/api/reportData'
|
|
|
export default {
|
|
|
components: { STable, VSelect, custList, subarea, rangeDate, ProductBrand, ProductType },
|
|
|
data () {
|
|
@@ -139,6 +148,7 @@ export default {
|
|
|
],
|
|
|
beginDate: getDate.getCurrMonthDays().starttime,
|
|
|
endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ exportLoading: false,
|
|
|
bizNo: '',
|
|
|
dealer: {
|
|
|
dealerSn: undefined,
|
|
@@ -228,6 +238,42 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 导出
|
|
|
+ handleExport () {
|
|
|
+ const _this = this
|
|
|
+ const params = this.queryParam
|
|
|
+ this.exportLoading = true
|
|
|
+ _this.spinning = true
|
|
|
+ headRebateDetailReportExport(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('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
|