完善下线统计 工位节拍 工位JPH的功能

This commit is contained in:
zhangshun
2026-05-29 10:52:30 +08:00
parent c93f36c8fa
commit ebfa6f0458
5 changed files with 932 additions and 798 deletions

View File

@@ -1,32 +1,32 @@
<template>
<el-card class="topCard">
<el-row class="toolbarRow">
<span class="promptText">生产时间:</span>
<span class="promptText">{{ $t('offLinePartCount.productionTimeLabel') }}</span>
<el-date-picker
v-model="dateTime"
:clearable="false"
align="center"
end-placeholder="结束日期"
:end-placeholder="$t('offLinePartCount.endDate')"
format="yyyy-MM-dd"
range-separator=""
:range-separator="$t('offLinePartCount.dateRangeSeparator')"
size="small"
start-placeholder="开始日期"
:start-placeholder="$t('offLinePartCount.startDate')"
style="width: 240px"
type="daterange"
value-format="yyyy-MM-dd"
/>
<span style="margin-left: 10px">订单号</span>
<span style="margin-left: 10px">{{ $t('offLinePartCount.orderNumberLabel') }}</span>
<el-input
v-model="orderNumberValue"
placeholder="请输入订单号"
:placeholder="$t('offLinePartCount.orderNumberPlaceholder')"
clearable
size="small"
style="width: 150px"
/>
<span class="promptText">产品型号:</span>
<span class="promptText">{{ $t('offLinePartCount.productModelLabel') }}</span>
<el-select
v-model="engineTypeValue"
placeholder="请选择产品型号"
:placeholder="$t('offLinePartCount.selectProductModel')"
filterable
clearable
size="small"
@@ -40,10 +40,10 @@
size="mini"
/>
</el-select>
<span class="promptText">趋势粒度:</span>
<span class="promptText">{{ $t('offLinePartCount.trendGranularityLabel') }}</span>
<el-radio-group v-model="trendMode" size="small">
<el-radio-button label="day">按天</el-radio-button>
<el-radio-button label="hour">按小时</el-radio-button>
<el-radio-button label="day">{{ $t('offLinePartCount.byDay') }}</el-radio-button>
<el-radio-button label="hour">{{ $t('offLinePartCount.byHour') }}</el-radio-button>
</el-radio-group>
<el-button
class="functionButton"
@@ -52,7 +52,7 @@
icon="el-icon-search"
plain
@click="searchTable(true)"
>查询</el-button>
>{{ $t('offLinePartCount.search') }}</el-button>
<el-button
type="info"
style="margin-left: 0"
@@ -60,8 +60,8 @@
size="small"
plain
@click="exportExcel()"
>导出</el-button>
<span v-show="isExporting" style="color: #16a188">正在导出....</span>
>{{ $t('offLinePartCount.export') }}</el-button>
<span v-show="isExporting" style="color: #16a188">{{ $t('offLinePartCount.exporting') }}</span>
</el-row>
<el-row>
@@ -85,25 +85,25 @@
<el-table-column
type="index"
align="center"
label="序号"
:label="$t('offLinePartCount.sequence')"
width="90px"
/>
<el-table-column width="200px" label="订单号" align="center">
<el-table-column width="200px" :label="$t('offLinePartCount.orderNumber')" align="center">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column min-width="240px" label="产品编号" align="center">
<el-table-column min-width="240px" :label="$t('offLinePartCount.productNumber')" align="center">
<template slot-scope="scope">
{{ scope.row.发动机号 }}
</template>
</el-table-column>
<el-table-column label="产品型号" width="200px" align="center">
<el-table-column :label="$t('offLinePartCount.productModel')" width="200px" align="center">
<template slot-scope="scope">
{{ scope.row.机型 }}
</template>
</el-table-column>
<el-table-column label="下线时间" width="250px" align="center">
<el-table-column :label="$t('offLinePartCount.offlineTime')" width="250px" align="center">
<template slot-scope="scope">
{{ scope.row.离开时间 }}
</template>
@@ -282,7 +282,7 @@ export default {
}
this.trendChart.setOption({
title: {
text: '下线产量趋势分析',
text: this.$t('offLinePartCount.trendTitle'),
left: 'center'
},
tooltip: {
@@ -298,14 +298,14 @@ export default {
show: true,
feature: {
saveAsImage: {
title: '保存为图片',
title: this.$t('offLinePartCount.saveAsImage'),
type: 'png'
}
}
},
xAxis: {
type: 'category',
name: this.trendMode === 'day' ? '日期' : '小时',
name: this.trendMode === 'day' ? this.$t('offLinePartCount.dateAxis') : this.$t('offLinePartCount.hourAxis'),
data: this.trendXAxis,
axisLabel: {
interval: 0,
@@ -314,11 +314,11 @@ export default {
},
yAxis: {
type: 'value',
name: '下线发动机数量',
name: this.$t('offLinePartCount.offlineQuantityAxis'),
minInterval: 1
},
series: [{
name: '下线数量',
name: this.$t('offLinePartCount.offlineQuantitySeries'),
type: 'bar',
barMaxWidth: 40,
data: this.trendSeries,
@@ -344,7 +344,7 @@ export default {
this.dateTime && this.dateTime.length === 2 ? dateTimeCheck = 1 : dateTimeCheck = 0
if (dateTimeCheck === 0) {
this.$message({
message: '请选择开始时间与结束时间!',
message: this.$t('offLinePartCount.selectDateRange'),
type: 'error'
})
return
@@ -368,7 +368,7 @@ export default {
this.isExporting = false
})
} else {
this.$message.warning('暂无数据')
this.$message.warning(this.$t('offLinePartCount.noData'))
}
},
handleSizeChanges(val) {
@@ -382,6 +382,9 @@ export default {
}
},
watch: {
'$i18n.locale'() {
this.renderTrendChart()
},
trendMode() {
this.getTrendData()
}