| | |
| | | <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 70px;">总价:{{total}}</div> |
| | | <div class="search_thing" style="padding-left: 70px;"> |
| | | <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.insOrder.costStatistics" :componentData="componentData" :key="upIndex" |
| | |
| | | current: -1, |
| | | size: -1, |
| | | }, |
| | | outLoading:false |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | this.getPower() |
| | | }, |
| | | methods: { |
| | | handleDown(){ |
| | | let entity = {...this.componentData.entity} |
| | | // entity.dates = JSON.stringify(entity.dates) |
| | | delete entity.orderBy |
| | | this.outLoading = true |
| | | this.$axios.post(this.$api.insOrder.export,{ |
| | | entity:entity |
| | | },{ |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | ,responseType: "blob"}).then(res => { |
| | | this.outLoading = false |
| | | this.$message.success('导出成功') |
| | | const blob = new Blob([res],{ type: 'application/octet-stream' }); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | let date = JSON.parse(entity.dates) |
| | | link.download = (entity.company?entity.company+' ':'')+date[0]+' - '+date[1]+'费用统计.xlsx'; |
| | | link.click(); |
| | | }) |
| | | }, |
| | | getTotal(){ |
| | | this.$axios.post(this.$api.insOrder.costStatistics2, { |
| | | entity:this.componentData.entity |