Commit 3d33fcb4 by 李宁

1

1 parent 1a3f0393
......@@ -11,6 +11,17 @@ export function queryAllBusi(data) {
}
/**
* 全部商机-列表导出
*/
export function exportAllBusi(data) {
return request({
url: '/compass/api/opportunity/export',
data,
responseType: 'blob'
})
}
/**
* 全部商机-商机审核
*/
export function audioBusi(data) {
......
......@@ -185,15 +185,15 @@
</el-select>
</el-col>
<el-col :span="3">
<el-col :span="4">
<el-button size="small" @click="handleFilter">
<i class="el-icon-filter"></i>
查询
</el-button>
<!-- <el-button size="small" @click="handleExport" type="default" disabled>
<el-button size="small" @click="handleExport" type="default" v-loading.fullscreen.lock="fullscreenLoading">
<i class="el-icon-download"></i>
导出数据
</el-button> -->
</el-button>
</el-col>
</el-row>
</div>
......@@ -429,8 +429,9 @@
export default {
name: 'OpportunityManagement',
data() {
let fthis = this
return {
fullscreenLoading: false,
formData:{
customerPhone: '',
maintenanceStaffName: '',
......@@ -967,8 +968,42 @@ export default {
this.handleOpenAudit(row.id)
},
handleExport() {
// 模拟导出功能
this.$message.success('商机数据导出成功')
let d = this.formData
if (d.createTime) {
d.startDate = new Date(d.createTime[0]).getTime()
d.endDate = new Date(d.createTime[1]).getTime() + 24 * 60 * 60 * 1000 - 1000
} else {
d.startDate = ''
d.endDate = ''
}
this.fullscreenLoading = true
this.apiReq.exportAllBusi({
pageNum: this.pageStore.currentPage,
pageSize: this.pageStore.pageSize,
areaCode: this.addressStore.county || this.addressStore.city,
gridCode: this.addressStore.grid,
...d
}).then(res=>{
this.fullscreenLoading = false
if(res.type == 'blob') {
let fileJson = {
content: res.value,
fileType: 'xls',
fileName: '商机列表数据'
}
this.common.exportExcel(fileJson)
} else {
let errorText
try {
errorText = res.value.msg
} catch(e) {
errorText = '网络异常,请稍后重试'
}
this.$message.error(errorText)
}
})
},
handleOpenAudit(opportunityId) {
this.auditOpportunityId = opportunityId
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!