|
|
@ -1,113 +1,360 @@ |
|
|
|
<template> |
|
|
|
<div ref="tableRef" |
|
|
|
class="table-height-wrap"> |
|
|
|
<div ref="tableRef" class="table-height-wrap predict-version-wrapper"> |
|
|
|
<SearchTemplate> |
|
|
|
<el-form :inline="true" |
|
|
|
class="clearfix search-content"> |
|
|
|
<el-form-item :label="getColumnName('AP_ErrorDatalst-Id')"> |
|
|
|
<el-input v-model.trim="queryParams.Id" |
|
|
|
placeholder="请输入查询内容" |
|
|
|
clearable |
|
|
|
style="width: 240px" /> |
|
|
|
<el-form :inline="true" class="clearfix search-content"> |
|
|
|
<el-form-item label="版本号" style="margin-bottom: 0"> |
|
|
|
<el-select |
|
|
|
style="width: 250px" |
|
|
|
v-model="queryParams.versionId" |
|
|
|
filterable |
|
|
|
placeholder="请选择" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in getSpecifiedVersion" |
|
|
|
:key="item['AP_CustDemandVerHead-VersionId']" |
|
|
|
:label="item['AP_CustDemandVerHead-VersionId']" |
|
|
|
:value="item['AP_CustDemandVerHead-VersionId']" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="客户"> |
|
|
|
<el-select |
|
|
|
style="width: 250px" |
|
|
|
v-model="queryParams.customerId" |
|
|
|
placeholder="请选择" |
|
|
|
multiple |
|
|
|
filterable |
|
|
|
collapse-tags |
|
|
|
:loading="customerLoading" |
|
|
|
@visible-change="setCustomerList" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in customerArray" |
|
|
|
:key="item['Customer-CustomerId']" |
|
|
|
:label="item['Customer-Name1']" |
|
|
|
:value="item['Customer-CustomerId']" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="getColumnName('AP_ErrorDatalst-ErrorStatus')"> |
|
|
|
<el-select v-model="queryParams.ErrorStatus" |
|
|
|
placeholder="请选择"> |
|
|
|
<el-option v-for="item in statusOptions" |
|
|
|
:key="item['Stdef-StdefTyp']" |
|
|
|
:label="item['Stdef-Bez']" |
|
|
|
:value="item['Stdef-StdefTyp']" /> |
|
|
|
<el-form-item label="物料"> |
|
|
|
<el-select |
|
|
|
style="width: 250px" |
|
|
|
v-model="queryParams.artId" |
|
|
|
filterable |
|
|
|
:loading="artIdLoading" |
|
|
|
@visible-change="setArtList" |
|
|
|
placeholder="请选择" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in artList" |
|
|
|
:key="item['Article-ArtId']" |
|
|
|
:label="item['Article-ArtId'] + '-' + item['Article-Descr1']" |
|
|
|
:value="item['Article-ArtId']" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button icon="el-icon-search" |
|
|
|
size="mini" |
|
|
|
class="search-button-style" |
|
|
|
@click="handleQuery">搜索</el-button> |
|
|
|
<el-button icon="el-icon-refresh" |
|
|
|
size="mini" |
|
|
|
class="reset-button-style" |
|
|
|
@click="resetQuery">重置</el-button> |
|
|
|
<el-button |
|
|
|
icon="el-icon-search" |
|
|
|
size="mini" |
|
|
|
:disabled="!queryParams.versionId" |
|
|
|
class="search-button-style" |
|
|
|
@click="handleQuery" |
|
|
|
>搜索</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
icon="el-icon-refresh" |
|
|
|
size="mini" |
|
|
|
class="reset-button-style" |
|
|
|
@click="resetQuery" |
|
|
|
>重置</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
icon="el-icon-download" |
|
|
|
class="add-button-style" |
|
|
|
@click="handleExport" |
|
|
|
style="margin-left: 24px" |
|
|
|
>导出</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> |
|
|
|
</SearchTemplate> |
|
|
|
<ContentContainer> |
|
|
|
<el-table :data="tableData" |
|
|
|
v-loading="loading" |
|
|
|
size="mini" |
|
|
|
style="width: 100%" |
|
|
|
border |
|
|
|
v-if="tableHeight" |
|
|
|
@header-dragend="(newWidth, oldWidth, column)=>saveRowWidth(column, newWidth)" |
|
|
|
:height="tableHeight"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in headers" |
|
|
|
<el-table |
|
|
|
v-if="tableHeight" |
|
|
|
:height="tableHeight" |
|
|
|
:data="tableData1" |
|
|
|
v-loading="loading" |
|
|
|
size="mini" |
|
|
|
@header-dragend=" |
|
|
|
(newWidth, oldWidth, column) => saveRowWidth(column, newWidth) |
|
|
|
" |
|
|
|
border |
|
|
|
> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('AP_CustArtlst-ArtId')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["AP_CustArtlst-ArtId"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('AP_CustArtlst-Descr1')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["AP_CustArtlst-Descr1"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('Article-ArtSize2')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["Article-ArtSize2"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('Customer-CustomerId')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["Customer-CustomerId"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('AP_CustArtlst-CustArtId')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["AP_CustArtlst-CustArtId"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('Customer-FcustId')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["Customer-FcustId"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('Customer-Name1')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["Customer-Name1"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('AP_CustArtlst-LastUser')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["AP_CustArtlst-LastUser"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
show-overflow-tooltip |
|
|
|
:label="getColumnName('User-Name')" |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row["User-Name"] }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="item in headers" |
|
|
|
:key="item" |
|
|
|
:width="getRowWidth(item)" |
|
|
|
:label="getColumnName(item)" |
|
|
|
:show-overflow-tooltip="true"> |
|
|
|
:label="getColumnName(item)" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ scope.row[item] }}</span> |
|
|
|
<span>{{ scope.row[item] || 0 }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<!-- 分页 --> |
|
|
|
<Pagination v-show="pagination.total > 0" |
|
|
|
v-model:pagination="pagination" |
|
|
|
@change="getList" /> |
|
|
|
<Pagination |
|
|
|
v-show="pagination.total > 0" |
|
|
|
v-model:pagination="pagination" |
|
|
|
@change="getTableList" |
|
|
|
/> |
|
|
|
</ContentContainer> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { ListMixin } from "@/mixins/ListMixin"; |
|
|
|
export default { |
|
|
|
mixins: [ListMixin], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
statusOptions: [], |
|
|
|
queryTableDataUrl: "/admin/ap/errordatalst/query", |
|
|
|
headers: [ |
|
|
|
"AP_ErrorDatalst-Id", |
|
|
|
"AP_ErrorDatalst-ErrorInfo", |
|
|
|
"AP_ErrorDatalst-ErrorType", |
|
|
|
"AP_ErrorDatalst-ErrorStatus", |
|
|
|
"AP_ErrorDatalst-TargetSource", |
|
|
|
"AP_ErrorDatalst-LastModify", |
|
|
|
"AP_ErrorDatalst-LastUser", |
|
|
|
"AP_ErrorDatalst-CreateTime", |
|
|
|
], // 遍历表头 |
|
|
|
tableHeight: 0, |
|
|
|
}; |
|
|
|
import { ListMixin } from "@/mixins/ListMixin"; |
|
|
|
import { get } from "@/server/api.js"; |
|
|
|
import { getArtIdList } from "@/server/productionPlanning/emergencyOrder"; |
|
|
|
export default { |
|
|
|
mixins: [ListMixin], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
artList: [], |
|
|
|
customerArray: [], |
|
|
|
queryTableDataUrl: "/admin/ap/custdemandverhead/selectdetail", |
|
|
|
headers: [], // 遍历表头 |
|
|
|
tableHeight: 0, |
|
|
|
artIdLoading: false, |
|
|
|
customerLoading: false, |
|
|
|
tableData1: [], |
|
|
|
getSpecifiedVersion: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 查询分页列表 |
|
|
|
getTableList() { |
|
|
|
this.loading = true; |
|
|
|
for (let key in this.queryParams) { |
|
|
|
if (this.queryParams[key] == '') { |
|
|
|
this.queryParams[key] = undefined |
|
|
|
} |
|
|
|
} |
|
|
|
get(this.queryTableDataUrl, { |
|
|
|
...this.pagination, |
|
|
|
...this.queryParams, |
|
|
|
"customerId": this.queryParams.customerId ? this.queryParams.customerId.join(",") : undefined |
|
|
|
}) |
|
|
|
.then(({ code, data: { count = 0, records: { Data = [], Head = [] } } }) => { |
|
|
|
if (code === 200) { |
|
|
|
this.headers = Head || [] |
|
|
|
this.tableData1 = (Data || []).map(el => { |
|
|
|
return { |
|
|
|
...el.Info, |
|
|
|
...el.Item |
|
|
|
} |
|
|
|
}) |
|
|
|
this.pagination.total = count |
|
|
|
this.loading = false |
|
|
|
} else { |
|
|
|
this.loading = false |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.loading = false |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 物料列表 |
|
|
|
setArtList() { |
|
|
|
if (this.artList.length > 0) { |
|
|
|
// 已经有数据了,请求过接口 |
|
|
|
} else { |
|
|
|
this.artIdLoading = true |
|
|
|
getArtIdList().then(({ data = [] }) => { |
|
|
|
this.artIdLoading = false |
|
|
|
this.artList = data; |
|
|
|
}).catch(() => { |
|
|
|
this.artIdLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 客户列表 |
|
|
|
setCustomerList() { |
|
|
|
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() { |
|
|
|
this.pagination.pageNumber = 1; |
|
|
|
this.getTableList(); |
|
|
|
}, |
|
|
|
// 重置按钮操作 |
|
|
|
resetQuery() { |
|
|
|
this.queryParams.customerId = []; |
|
|
|
this.queryParams.versionId = ''; |
|
|
|
this.queryParams.artId = ''; |
|
|
|
this.handleQuery(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 搜索按钮操作 |
|
|
|
handleQuery() { |
|
|
|
this.pagination.pageNumber = 1; |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
// 重置按钮操作 |
|
|
|
resetQuery() { |
|
|
|
this.queryParams.Id = undefined; |
|
|
|
this.handleQuery(); |
|
|
|
}, |
|
|
|
// 根据客户查询版本 |
|
|
|
getVersionOfCustom() { |
|
|
|
get(`/admin/ap/custdemandverhead/selectuinquelist`).then(({ code, data }) => { |
|
|
|
if (code === 200) { |
|
|
|
this.getSpecifiedVersion = data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.getStanderOne({ statid: 'AP_ErrorDatalst-ErrorStatus' }).then((res) => { |
|
|
|
this.statusOptions = res.data |
|
|
|
// 导出 |
|
|
|
handleExport() { |
|
|
|
for (let key in this.queryParams) { |
|
|
|
if (this.queryParams[key] == '') { |
|
|
|
this.queryParams[key] = undefined |
|
|
|
} |
|
|
|
} |
|
|
|
get(`/admin/ap/custdemandverhead/selectdetailExcel`, { |
|
|
|
...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(); |
|
|
|
}) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.tableHeight = this.calculationTableHeight( |
|
|
|
this.$refs.tableRef, |
|
|
|
120 |
|
|
|
); |
|
|
|
}, |
|
|
|
// 导出最新预测偏差 |
|
|
|
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(); |
|
|
|
}) |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="less" |
|
|
|
scoped> |
|
|
|
.table-height-wrap { |
|
|
|
height: 100%; |
|
|
|
overflow: hidden; |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getVersionOfCustom() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.tableHeight = this.calculationTableHeight( |
|
|
|
this.$refs.tableRef, |
|
|
|
120 |
|
|
|
); |
|
|
|
}) |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
.predict-version-wrapper { |
|
|
|
height: 100%; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
</style> |