Commit 20c3447c authored by huangyuanyuan's avatar huangyuanyuan

线路收客新增导出功能

parent 71137e35
...@@ -20,13 +20,15 @@ ...@@ -20,13 +20,15 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="getList()"/> <input type="button" class="normalBtn" :value="$t('pub.searchBtn')" @click="getList()"/>
<input type="button" class="hollowFixedBtn" value="导出" @click="Export"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div> <div v-loading="loading">
<el-table :data="List" stripe border> <el-table :data="List" border>
<el-table-column fixed prop="BranchName" label="公司名称" min-width="100"> <el-table-column fixed prop="BranchName" label="公司名称" min-width="100">
</el-table-column> </el-table-column>
<el-table-column min-width="130" @sort-by="SortBy" sortable v-for='(item,index) in newArr' :prop='item.Rank' :label="item.title" :key='index'> <el-table-column min-width="130" @sort-by="SortBy" sortable v-for='(item,index) in newArr' :prop='item.Rank' :label="item.title" :key='index'>
...@@ -53,6 +55,8 @@ ...@@ -53,6 +55,8 @@
ColList:[], ColList:[],
List:[], List:[],
newArr:[], newArr:[],
loading:false,
userId:0,
} }
}, },
created(){ created(){
...@@ -61,11 +65,22 @@ ...@@ -61,11 +65,22 @@
this.productionDate=[mon2,mon1]; this.productionDate=[mon2,mon1];
this.msg.StartTime=this.productionDate[0]; this.msg.StartTime=this.productionDate[0];
this.msg.EndTime=this.productionDate[1]; this.msg.EndTime=this.productionDate[1];
let userInfo = this.getLocalStorage();
this.userId = userInfo.EmployeeId;
}, },
mounted(){ mounted(){
this.getList(); this.getList();
}, },
methods:{ methods:{
Export(){
this.msg.EmployeeId = this.userId;
let msg = JSON.parse(JSON.stringify(this.msg));
this.GetLocalFile(
"financestatistics_post_OutToExcelGetCompanyLineGuestList",
msg,
"线路收客统计.xls"
);
},
SortBy(){ SortBy(){
}, },
...@@ -79,21 +94,20 @@ ...@@ -79,21 +94,20 @@
} }
}, },
getList(){ getList(){
this.loading=true;
this.apipost('financestatistics_post_GetCompanyLineGuestList',this.msg, res => { this.apipost('financestatistics_post_GetCompanyLineGuestList',this.msg, res => {
this.loading=false;
if(res.data.resultCode == 1) { if(res.data.resultCode == 1) {
this.ColList=res.data.data.ColList; this.ColList=res.data.data.ColList;
this.List=res.data.data.List; this.List=res.data.data.List;
console.log("this.ColList",this.ColList);
console.log("this.List",this.List);
for(let i = 1; i < this.ColList.length; i++) { for(let i = 1; i < this.ColList.length; i++) {
this.newArr.push({ this.newArr.push({
"Rank":this.ColList[i].Sort, "Rank":this.ColList[i].Sort,
'value': this.ColList[i].Col, 'value': this.ColList[i].Col,
"title": this.ColList[i].Name, "title": this.ColList[i].Name,
}) })
} }
console.log("this.newArr",this.newArr);
}else{ }else{
this.Error(res.data.message); this.Error(res.data.message);
......
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