Browse Source

导出最新预测偏差

wangxy
wangxy 2 years ago
parent
commit
f18ddd74a2
1 changed files with 51 additions and 17 deletions
  1. +51
    -17
      src/views/plan/workbench/predictVersion/index.vue

+ 51
- 17
src/views/plan/workbench/predictVersion/index.vue View File

@ -4,7 +4,7 @@
<el-form :inline="true" class="clearfix search-content"> <el-form :inline="true" class="clearfix search-content">
<el-form-item label="版本号" style="margin-bottom: 0"> <el-form-item label="版本号" style="margin-bottom: 0">
<el-select <el-select
style="width: 300px"
style="width: 250px"
v-model="queryParams.versionId" v-model="queryParams.versionId"
filterable filterable
placeholder="请选择" placeholder="请选择"
@ -19,7 +19,7 @@
</el-form-item> </el-form-item>
<el-form-item label="客户"> <el-form-item label="客户">
<el-select <el-select
style="width: 300px"
style="width: 250px"
v-model="queryParams.customerId" v-model="queryParams.customerId"
placeholder="请选择" placeholder="请选择"
multiple multiple
@ -38,7 +38,7 @@
</el-form-item> </el-form-item>
<el-form-item label="物料"> <el-form-item label="物料">
<el-select <el-select
style="width: 300px"
style="width: 250px"
v-model="queryParams.artId" v-model="queryParams.artId"
filterable filterable
:loading="artIdLoading" :loading="artIdLoading"
@ -76,6 +76,13 @@
style="margin-left: 24px" style="margin-left: 24px"
>导出</el-button >导出</el-button
> >
<el-button
icon="el-icon-download"
class="add-button-style"
@click="handleNewExport"
style="margin-left: 24px;width: 150px;"
>导出最新预测偏差</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</SearchTemplate> </SearchTemplate>
@ -247,23 +254,31 @@ export default {
}, },
// //
setArtList() { setArtList() {
this.artIdLoading = true
getArtIdList().then(({ data = [] }) => {
this.artIdLoading = false
this.artList = data;
}).catch(() => {
this.artIdLoading = false
})
if (this.artList.length > 0) {
//
} else {
this.artIdLoading = true
getArtIdList().then(({ data = [] }) => {
this.artIdLoading = false
this.artList = data;
}).catch(() => {
this.artIdLoading = false
})
}
}, },
// //
setCustomerList() { setCustomerList() {
this.customerLoading = true
get('/admin/base/customer/customerlst').then(({ data = [] }) => {
this.customerLoading = false
this.customerArray = data
}).catch(() => {
this.customerLoading = false
})
if (this.customerArray.length > 0) {
//
} else {
this.customerLoading = true
get('/admin/base/customer/customerlst').then(({ data = [] }) => {
this.customerLoading = false
this.customerArray = data
}).catch(() => {
this.customerLoading = false
})
}
}, },
// //
handleQuery() { handleQuery() {
@ -304,6 +319,25 @@ export default {
link.click(); link.click();
}) })
}, },
//
handleNewExport() {
for (let key in this.queryParams) {
if (this.queryParams[key] == '' || key == 'versionId') {
this.queryParams[key] = undefined
}
}
get(`/admin/ap/custdemandverhead/difference`, {
...this.queryParams,
"customerId": this.queryParams.customerId ? this.queryParams.customerId.join(",") : undefined
}).then(res => {
let link = document.createElement('a');
link.style.display = 'none';
link.href = (process.env.VUE_APP_BASE_URL || "http://101.201.121.115:9003/") + res.data;
link.setAttribute('download', '最新预测偏差.xlsx');
document.body.appendChild(link);
link.click();
})
},
}, },
created() { created() {
this.getVersionOfCustom() this.getVersionOfCustom()


Loading…
Cancel
Save