Browse Source

完善客户查询--增加导出功能

master
yunuo970428 1 year ago
parent
commit
edd829dee6
  1. 14
      anrui-buscenter/anrui-buscenter-ui/src/api/jichuxinxi/crmcustomer.js
  2. 61
      anrui-buscenter/anrui-buscenter-ui/src/views/kehuguanli/kehuchaxun/kehuchaxun.vue

14
anrui-buscenter/anrui-buscenter-ui/src/api/jichuxinxi/crmcustomer.js

@ -69,6 +69,17 @@ export function deleteBySids(data) {
})
}
// 导出
export function exportExcel(data) {
return request({
url: '/crm/v1/crmcustomertemp/exportExcel',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
// 推送财务数据--是否确定车架号选择否
export function sendFinCustomer(data, orgCode) {
return request({
@ -93,9 +104,6 @@ export function sendFinCustomerTrue(data) {
})
}
// 推送财务数据--是否确定车架号选择是,选择车辆
export function vehicleCrmList(data) {
return request({

61
anrui-buscenter/anrui-buscenter-ui/src/views/kehuguanli/kehuchaxun/kehuchaxun.vue

@ -24,6 +24,14 @@
<el-option v-for="item in induslevel" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="销售专员">
<el-input v-model="listQuery.params.staffName" placeholder="" class="addinputw" clearable/>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker value-format="yyyy-MM-dd" v-model="listQuery.params.createStartDate" clearable style="width: 160px;" type="date" placeholder="开始日期"/>
<span style="padding: 0 8px"></span>
<el-date-picker value-format="yyyy-MM-dd" v-model="listQuery.params.createEndDate" clearable style="width: 160px;" type="date" placeholder="结束日期"/>
</el-form-item>
<el-form-item label="提醒日期">
<el-date-picker value-format="yyyy-MM-dd" v-model="listQuery.params.remindStartDay" clearable style="width: 160px;" type="date" placeholder="开始日期"/>
<span style="padding: 0 8px"></span>
@ -90,6 +98,11 @@
<span>{{ scope.row.level }}</span>
</template>
</el-table-column>
<el-table-column label="创建日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="提醒日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.remind_day }}</span>
@ -173,7 +186,7 @@
</template>
<script>
import { listPageByOrgPathSid, sendFinCustomer } from '@/api/jichuxinxi/crmcustomer'
import { listPageByOrgPathSid, sendFinCustomer, exportExcel } from '@/api/jichuxinxi/crmcustomer'
import { typeValues, getOrgSidByPath, fetchDetailsByUseOrgSid, getButtonPermissions } from '@/api/dictcommons/dictcommons'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
@ -211,6 +224,13 @@ export default {
btnKey: 'toPush',
btnLabel: '推送财务数据'
},
{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'doExport',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
@ -243,7 +263,10 @@ export default {
remindEndtDay: '',
userSid: '',
staffSid: '',
orgSidPath: ''
orgSidPath: '',
createStartDate: '',
createEndDate: '',
staffName: ''
},
total: 0
},
@ -275,6 +298,9 @@ export default {
case 'toPush':
this.toPush()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
@ -328,6 +354,7 @@ export default {
this.listQuery = {
current: 1,
size: 10,
total: 0,
params: {
customerTypeKey: '',
levelKey: '',
@ -337,7 +364,10 @@ export default {
remindEndtDay: '',
userSid: '',
staffSid: '',
orgSidPath: ''
orgSidPath: '',
createStartDate: '',
createEndDate: '',
staffName: ''
}
}
this.getList()
@ -465,6 +495,31 @@ export default {
}
})
},
doExport() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
exportExcel(this.listQuery.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '客户信息表' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)

Loading…
Cancel
Save