| | |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;text-align: left;">费用统计</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <!-- <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="small" type="primary">OA推送</el-button> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | </div> |
| | | <div class="search"> |
| | |
| | | </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> |
| | | <el-button size="small" type="primary" @click="handleDown" :loading="outLoading" v-if="isExport">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table"> |
| | | <ValueTable ref="ValueTable" :url="$api.insOrder.costStatistics" :componentData="componentData" :key="upIndex" |
| | | <ValueTable ref="ValueTable" :url="$api.insOrder.costStatistics" |
| | | :componentData="componentData" :key="upIndex" |
| | | @handleWeave="handleWeave" :column-min-width="'140'"/> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | selectField: {}, |
| | | requiredAdd: [], |
| | | requiredUp: [] |
| | | requiredUp: [], |
| | | needSort: ['createTime', 'sample'], |
| | | }, |
| | | entityCopy: {}, |
| | | upIndex: 0, |
| | |
| | | current: -1, |
| | | size: -1, |
| | | }, |
| | | outLoading:false |
| | | outLoading:false, |
| | | isExport:false |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | } |
| | | ,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(); |
| | | //将Blob 对象转换成字符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | 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(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | 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(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | getTotal(){ |
| | |
| | | if (power[i].menuMethod == 'addInsOrder') { |
| | | add = true |
| | | } |
| | | // |
| | | if (power[i].menuMethod == 'export') { |
| | | this.isExport = true |
| | | } |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(4, 1) |