|
@@ -33,7 +33,15 @@
|
|
|
</template>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="merchantInfoManagementList-refresh">查询</a-button>
|
|
|
- <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="merchantInfoManagementList-reset">重置</a-button>
|
|
|
+ <a-button style="margin: 0 0 18px 5px" @click="resetSearchForm" :disabled="disabled" id="merchantInfoManagementList-reset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin-left: 5px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ id="merchantInfoManagementList-export">导出</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
@@ -90,7 +98,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { dealerQueryList } from '@/api/dealer'
|
|
|
+import moment from 'moment'
|
|
|
+import { dealerQueryList, dealerExport } from '@/api/dealer'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import subarea from '@/views/common/subarea.js'
|
|
|
import merchantInfoManagementDetailModal from './detailModal.vue'
|
|
@@ -212,6 +221,27 @@ export default {
|
|
|
closeModal () {
|
|
|
this.itemId = ''
|
|
|
this.openModal = false
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleExport () {
|
|
|
+ const params = this.queryParam
|
|
|
+ this.exportLoading = true
|
|
|
+ dealerExport(params).then(res => {
|
|
|
+ this.exportLoading = false
|
|
|
+ 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()
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|