This commit is contained in:
liushuai
2020-03-18 18:15:03 +08:00
parent 77b07cae6a
commit 88f1c0edf9
2 changed files with 26 additions and 2 deletions

View File

@@ -41,7 +41,7 @@
<!--成功-->
<!--</el-button>-->
<el-tooltip :open-delay="1000" effect="dark" content="将全部采购件导出到表格" placement="top">
<el-button type="warning" size="small" icon="el-icon-download" plain style="margin-left: 15px" @click="exportDetail()">导出</el-button>
<el-button type="warning" size="small" icon="el-icon-download" plain style="margin-left: 15px" @click="exportExcel()">导出</el-button>
</el-tooltip>
</el-row>
</el-card>
@@ -530,6 +530,30 @@ export default {
})
})
},
exportExcel() {
let check, check1, check2, check3
this.machineNumberValue ? check = 1 : check = 0
this.groupNumberValue ? check1 = 1 : check1 = 0
this.Name ? check2 = 1 : check2 = 0
this.startTime ? check3 = 1 : (check3 = 0, this.startTime = '')
var param = []
param[0] = ['机床流水号_check', check]
param[1] = ['机床流水号', this.machineNumberValue]
param[2] = ['组件流水号_check', check1]
param[3] = ['组件流水号', this.groupNumberValue]
param[4] = ['零件名称_check', check2]
param[5] = ['零件名称', this.Name]
param[6] = ['时间_check', check3]
if (check3 === 0) {
param[7] = ['开始时间', '']
param[8] = ['结束时间', '']
} else {
param[7] = ['开始时间', this.startTime[0]]
param[8] = ['结束时间', this.startTime[1]]
}
var Data = this.CreateData('2001', '报表_采购部采购件_查询数据', param)
this.exportExcel_NPOI(Data)
},
fetchData() {
initMachineProject().then(response => {
for (let i = 0; i < response.data.length; i++) {