Commit a8672bbb authored by 邓春圆's avatar 邓春圆

客户模块异步导出

parent 91f48a6c
...@@ -131,23 +131,23 @@ export function waiteConfirmExportExcel(query) { ...@@ -131,23 +131,23 @@ export function waiteConfirmExportExcel(query) {
* @param query * @param query
* @return {*} * @return {*}
*/ */
export function waitDistributionExportExcel(query) { // export function waitDistributionExportExcel(query) {
return request({ // return request({
url: '/ecw/customer/wait-distribution-export-excel', // url: '/ecw/customer/wait-distribution-export-excel',
method: 'get', // method: 'get',
params: query, // params: query,
responseType: 'blob' // responseType: 'blob'
}) // })
} // }
// 公海池客户列表导出 // 公海池客户列表导出
export function publicExportExcel(query) { // export function publicExportExcel(query) {
return request({ // return request({
url: '/ecw/customer/public-export-excel', // url: '/ecw/customer/public-export-excel',
method: 'get', // method: 'get',
params: query, // params: query,
responseType: 'blob' // responseType: 'blob'
}) // })
} // }
export function indirectCustomerExportExcel(query) { export function indirectCustomerExportExcel(query) {
return request({ return request({
url: '/ecw/indirect-customer/export-excel', url: '/ecw/indirect-customer/export-excel',
...@@ -434,3 +434,39 @@ export function getCustomerOperatelog(params){ ...@@ -434,3 +434,39 @@ export function getCustomerOperatelog(params){
params params
}) })
} }
//全部导出
export function customerExportExcel(){
return request({
url:'/ecw/customer/export-excel',
method:'get'
})
}
// 导出我的客户列表
//全部导出
export function mineExportExcel(){
return request({
url:'/ecw/customer/mine-export-excel',
method:'get'
})
}
// 导出我的待接收客户
export function waiteConfirEexportExcel(){
return request({
url:'/ecw/customer/waite-confirm-export-excel',
method:'get'
})
}
//公海池客户列表导出
export function publicExportExcel(){
return request({
url:'/ecw/customer/public-export-excel',
method:'get'
})
}
//待分配客户
export function waitDistributionExportExcel(){
return request({
url:'/ecw/customer/wait-distribution-export-excel',
method:'get'
})
}
...@@ -555,7 +555,7 @@ import CustomerFollowList from "@/components/CustomerFollowList" ...@@ -555,7 +555,7 @@ import CustomerFollowList from "@/components/CustomerFollowList"
import customerComplaints from "@/components/customerComplaints" import customerComplaints from "@/components/customerComplaints"
import {listServiceUser} from "@/api/system/user"; import {listServiceUser} from "@/api/system/user";
import { getCountryListAll } from '@/api/ecw/country' import { getCountryListAll } from '@/api/ecw/country'
import {getCreditPage} from "@/api/customer/credit"; import {customerExportExcel, getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer"; import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue"; import Template from "@/views/cms/template/index.vue";
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue"; import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
...@@ -782,20 +782,26 @@ export default { ...@@ -782,20 +782,26 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 let func = null
let params = {...this.queryParams}; let title = ''
params.pageNo = undefined; switch (this.$route.path){
params.pageSize = undefined; case '/customer/customer' :
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); func = customerExportExcel
// 执行导出 title = '是否确认导出所有客户数据项?'
this.$modal.confirm(this.$t('是否确认导出所有客户数据项?')).then(() => { break;
this.exportLoading = true; case '/customer/department-customers':
return exportCustomerExcel(params); // getCustomerDeptPage(params).then(this.setData);
}).then(response => { break;
this.$download.excel(response, `${this.$t('客户信息')}.xls`); case '/customer/potential':
/* console.log(response,'response') // getPotential(params).then(this.setData)
this.$download.excel(response, `${this.$t('全部客户信息')}.xls`); */ break;
this.exportLoading = false; }
// // 执行导出
this.$modal.confirm(this.$t(title)).then(() => {
func().then(r =>{
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
})
}).catch(() => {}); }).catch(() => {});
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
......
...@@ -360,7 +360,7 @@ import { ...@@ -360,7 +360,7 @@ import {
exportCustomerExcel, exportCustomerExcel,
getWaitForConfirmList, getWaitForConfirmList,
confirm, confirm,
waiteConfirmExportExcel waiteConfirmExportExcel, waiteConfirEexportExcel
} from "@/api/ecw/customer"; } from "@/api/ecw/customer";
import { listServiceUser } from "@/api/system/user" import { listServiceUser } from "@/api/system/user"
import { getDictDatas, DICT_TYPE } from '@/utils/dict' import { getDictDatas, DICT_TYPE } from '@/utils/dict'
...@@ -615,17 +615,15 @@ export default { ...@@ -615,17 +615,15 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; // let params = {...this.queryParams};
params.pageNo = undefined; // params.pageNo = undefined;
params.pageSize = undefined; // params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); // this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出 // 执行导出
this.$modal.confirm(this.$t('是否确认导出我的待接受客户数据项?')).then(() => { this.$modal.confirm(this.$t('是否确认导出我的待接受客户数据项?')).then(() => {
this.exportLoading = true; waiteConfirEexportExcel().then(()=>{
return waiteConfirmExportExcel(params); this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
}).then(response => { })
this.$download.excel(response, `${this.$t('我的待接收客户')}.xls`);
this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
}, },
......
...@@ -439,18 +439,10 @@ export default { ...@@ -439,18 +439,10 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 this.$modal.confirm(this.$t('是否确认导出待分配客户数据项?')).then(response => {
let params = {...this.queryParams}; waitDistributionExportExcel().then(()=>{
params.pageNo = undefined; this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
params.pageSize = undefined; })
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出待分配客户数据项?')).then(() => {
this.exportLoading = true;
return waitDistributionExportExcel(params);
}).then(response => {
this.$download.excel(response, `${this.$t('待分配客户')}.xls`);
this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
}, },
}, },
......
...@@ -154,7 +154,7 @@ import { ...@@ -154,7 +154,7 @@ import {
updateCustomer, updateCustomer,
deleteCustomer, deleteCustomer,
getMyCustomerService, getMyCustomerService,
mineExporteExcel mineExporteExcel, mineExportExcel
} from "@/api/ecw/customer"; } from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload' import upload from '@/components/ImageUpload'
...@@ -408,17 +408,17 @@ export default { ...@@ -408,17 +408,17 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; // let params = {...this.queryParams};
params.pageNo = undefined; // params.pageNo = undefined;
params.pageSize = undefined; // params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); // this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出 // // 执行导出
this.$modal.confirm(this.$t('是否确认导出我的客户数据项?')).then(() => { this.$modal.confirm(this.$t('是否确认导出我的客户数据项?')).then(() => {
this.exportLoading = true; mineExportExcel().then(
return mineExporteExcel(params); ()=>{
}).then(response => { this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
this.$download.excel(response, `${this.$t('我的客户列表')}.xls`); }
this.exportLoading = false; )
}).catch(() => {}); }).catch(() => {});
}, },
followUp(row){ followUp(row){
......
...@@ -412,18 +412,11 @@ export default { ...@@ -412,18 +412,11 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出公海池客户数据项?')).then(() => { this.$modal.confirm(this.$t('是否确认导出公海池客户数据项?')).then(() => {
this.exportLoading = true; publicExportExcel().then(()=>{
return publicExportExcel(params); this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
}).then(response => { })
this.$download.excel(response, `${this.$t('公海池客户')}.xls`);
this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
}, },
//分配客服 //分配客服
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment