|
@@ -5,6 +5,8 @@
|
|
|
<el-col :span="24">
|
|
|
<div class="top">
|
|
|
<el-input placeholder="客户名称" class="input-demo" v-model="formCondition.customerName"></el-input>
|
|
|
+ <el-input placeholder="主体名称" class="input-demo" v-model="formCondition.company"></el-input>
|
|
|
+ <el-input placeholder="公司名称" class="input-demo" v-model="formCondition.subCompany"></el-input>
|
|
|
<el-button type="success" style="margin-left: 1%;" @click="loadData">查询</el-button>
|
|
|
<!-- <el-button type="success" style="margin-left: 1%;" @click="addCustomerShow = true">添加</el-button>-->
|
|
|
<el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
|
|
@@ -642,7 +644,8 @@ import XLSX from "xlsx";
|
|
|
return{
|
|
|
formCondition:{
|
|
|
customerName:'',
|
|
|
- startTime:''
|
|
|
+ company:'',
|
|
|
+ subCompany:''
|
|
|
},
|
|
|
hightt:'0px',
|
|
|
coustomerTable:[],
|
|
@@ -720,6 +723,7 @@ import XLSX from "xlsx";
|
|
|
customerRec:{
|
|
|
|
|
|
},
|
|
|
+ queryParam:{},
|
|
|
customer:{
|
|
|
id:0,
|
|
|
customerName:'',
|
|
@@ -1047,6 +1051,8 @@ import XLSX from "xlsx";
|
|
|
formData.append('current', this.current);
|
|
|
formData.append('size', this.pagesize);
|
|
|
formData.append('customerName', this.formCondition.customerName);
|
|
|
+ formData.append('company', this.formCondition.company);
|
|
|
+ formData.append('subCompany', this.formCondition.subCompany);
|
|
|
const response = await this.$http.post(`customer/findCustomer`, formData);
|
|
|
if (response.data.code === 0) {
|
|
|
this.coustomerTable = response.data.data.records;
|
|
@@ -1064,41 +1070,43 @@ import XLSX from "xlsx";
|
|
|
// console.log(`当前页: ${val}`);
|
|
|
},
|
|
|
async exportExcel() {
|
|
|
- let curr = this.current;
|
|
|
- let pagesize1 = this.pagesize;
|
|
|
- this.current = 1;
|
|
|
- this.pagesize = this.total;
|
|
|
- await this.loadData();
|
|
|
- // 设置当前日期
|
|
|
- let time = new Date();
|
|
|
- //console.log(time);
|
|
|
- let year = time.getFullYear();
|
|
|
- let month = time.getMonth() + 1;
|
|
|
- let day = time.getDate();
|
|
|
- let name = "客户管理查询列表_"+year + "" + month + "" + day;
|
|
|
- // console.log(name)
|
|
|
- /* generate workbook object from table */
|
|
|
- // .table要导出的是哪一个表格
|
|
|
- var wb = XLSX.utils.table_to_book(document.querySelector(".table"),{ raw: true });
|
|
|
- /* get binary string as output */
|
|
|
- var wbout = XLSX.write(wb, {
|
|
|
- bookType: "xlsx",
|
|
|
- bookSST: true,
|
|
|
- type: "array"
|
|
|
- });
|
|
|
- try {
|
|
|
- // name+'.xlsx'表示导出的excel表格名字
|
|
|
- FileSaver.saveAs(
|
|
|
- new Blob([wbout], { type: "application/octet-stream" }),
|
|
|
- name + ".xlsx"
|
|
|
- );
|
|
|
- } catch (e) {
|
|
|
- if (typeof console !== "undefined") console.log(e, wbout);
|
|
|
- }
|
|
|
- this.current = curr;
|
|
|
- this.pagesize = pagesize1;
|
|
|
- this.loadData();
|
|
|
- return wbout;
|
|
|
+ let customer = this.formCondition.customerName;
|
|
|
+ window.location.href = hostUrl+"customer/findCustomerRecListExport?customerName="+customer+"&&companyName="+this.formCondition.subCompany+"&&companyBelongName="+this.formCondition.company;
|
|
|
+ // let curr = this.current;
|
|
|
+ // let pagesize1 = this.pagesize;
|
|
|
+ // this.current = 1;
|
|
|
+ // this.pagesize = this.total;
|
|
|
+ // await this.loadData();
|
|
|
+ // // 设置当前日期
|
|
|
+ // let time = new Date();
|
|
|
+ // //console.log(time);
|
|
|
+ // let year = time.getFullYear();
|
|
|
+ // let month = time.getMonth() + 1;
|
|
|
+ // let day = time.getDate();
|
|
|
+ // let name = "客户管理查询列表_"+year + "" + month + "" + day;
|
|
|
+ // // console.log(name)
|
|
|
+ // /* generate workbook object from table */
|
|
|
+ // // .table要导出的是哪一个表格
|
|
|
+ // var wb = XLSX.utils.table_to_book(document.querySelector(".table"),{ raw: true });
|
|
|
+ // /* get binary string as output */
|
|
|
+ // var wbout = XLSX.write(wb, {
|
|
|
+ // bookType: "xlsx",
|
|
|
+ // bookSST: true,
|
|
|
+ // type: "array"
|
|
|
+ // });
|
|
|
+ // try {
|
|
|
+ // // name+'.xlsx'表示导出的excel表格名字
|
|
|
+ // FileSaver.saveAs(
|
|
|
+ // new Blob([wbout], { type: "application/octet-stream" }),
|
|
|
+ // name + ".xlsx"
|
|
|
+ // );
|
|
|
+ // } catch (e) {
|
|
|
+ // if (typeof console !== "undefined") console.log(e, wbout);
|
|
|
+ // }
|
|
|
+ // this.current = curr;
|
|
|
+ // this.pagesize = pagesize1;
|
|
|
+ // this.loadData();
|
|
|
+ // return wbout;
|
|
|
},
|
|
|
}
|
|
|
};
|