|
@@ -2,7 +2,7 @@
|
|
|
<base-form slot="content" ref="ruleForm" :data="searchData">
|
|
|
<div slot="footer">
|
|
|
<el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
|
|
|
- <!-- <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出{{ this.$route.meta.title }}信息</el-button> -->
|
|
|
+ <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出</el-button>
|
|
|
</div>
|
|
|
</base-form>
|
|
|
</template>
|
|
@@ -38,6 +38,20 @@ export default {
|
|
|
]
|
|
|
this.setDefaultValue(params, 'searchData')
|
|
|
},
|
|
|
+ toExportExcel () {
|
|
|
+ const oldform = this.$refs.ruleForm.baseForm
|
|
|
+ const newForm = { ...oldform }
|
|
|
+ if (newForm.startEndTime) {
|
|
|
+ newForm.start_at = newForm.startEndTime[0]
|
|
|
+ newForm.end_at = newForm.startEndTime[1]
|
|
|
+ delete newForm.startEndTime
|
|
|
+ } else {
|
|
|
+ this.$msgw('请选择导出的时间范围')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const token = window.sessionStorage.getItem('fp_token')
|
|
|
+ window.open(`https://api.honglouplus.com/adm/contact/click/export?token=${encodeURIComponent(token)}&start_at=${newForm.start_at}&end_at=${newForm.end_at}&sale_id=${newForm.sale_id}`)
|
|
|
+ },
|
|
|
searchHandle() {
|
|
|
const oldform = this.$refs.ruleForm.baseForm
|
|
|
const newForm = { ...oldform }
|