From 9d35f39906fc6e72fa30dddc5318b8039827d3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Wed, 21 Jan 2026 10:54:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(hrm):=20=E7=BB=9F=E4=B8=80=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=A4=96=E5=87=BA=E6=9D=A1=E6=89=93=E5=8D=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在请假、外出申请页面统一审批状态显示为标签样式 - 将审批状态字段从approveStatus改为approvalStatus - 添加外出条打印组件,支持PDF格式打印 - 优化审批状态标签颜色和文本显示 - 修复已撤销状态显示错误问题 --- klp-ui/src/views/wms/hrm/apply/goout.vue | 94 ++++- klp-ui/src/views/wms/hrm/apply/leave.vue | 32 +- .../wms/hrm/components/outLabelPrinter.vue | 320 ++++++++++++++++++ klp-ui/src/views/wms/hrm/todo/index.vue | 48 ++- 4 files changed, 452 insertions(+), 42 deletions(-) create mode 100644 klp-ui/src/views/wms/hrm/components/outLabelPrinter.vue diff --git a/klp-ui/src/views/wms/hrm/apply/goout.vue b/klp-ui/src/views/wms/hrm/apply/goout.vue index dd22581a..68bf6b8d 100644 --- a/klp-ui/src/views/wms/hrm/apply/goout.vue +++ b/klp-ui/src/views/wms/hrm/apply/goout.vue @@ -37,7 +37,7 @@ - + @@ -51,7 +51,8 @@
- {{ form.applyId ? '更新申请' : '提交申请' }} + {{ form.outId ? '更新申请' : '提交申请' + }} 重置表单
@@ -63,7 +64,13 @@ 刷新 - + + + - + + + @@ -342,53 +342,7 @@ export default { loading.close() console.log('停机统计响应:', response) - if (response.code === 200 && response.rows && response.rows.length > 0) { - this.tableData = response.rows.map(item => ({ - time: this.formatDateTime(item.startDate) + ' - ' + this.formatDateTime(item.endDate), - duration: this.secondsToMinutes(item.duration) + 'min', - remark: item.remark || '-', - machine: item.unit || '-' - })) - - const totalDurationSeconds = response.rows.reduce((sum, item) => sum + (Number(item.duration) || 0), 0) - const totalDurationMinutes = this.secondsToMinutes(totalDurationSeconds) - const totalCount = response.rows.length - const totalAvailableMinutes = this.getTotalAvailableMinutes() - const workRate = this.calculateWorkRate(totalDurationMinutes, totalAvailableMinutes) - - this.summaryData = [ - { label: '停机时间', value: totalDurationMinutes, unit: 'min' }, - { label: '停机次数', value: totalCount, unit: '次' }, - { label: '作业率', value: workRate, unit: '%' } - ] - - const crewMap = {} - const typeMap = {} - response.rows.forEach(item => { - const crew = item.crew || '未知班组' - const type = item.stopType || '未知类型' - const durationMinutes = this.secondsToMinutes(item.duration) - crewMap[crew] = (crewMap[crew] || 0) + durationMinutes - typeMap[type] = (typeMap[type] || 0) + durationMinutes - }) - - this.crewPieData = Object.keys(crewMap).map(crew => ({ name: crew, value: crewMap[crew] })) - this.typePieData = Object.keys(typeMap).map(type => ({ name: type, value: typeMap[type] })) - - // 渲染饼图 - this.$nextTick(() => { - this.renderPieChart('crew', this.crewPieData) - this.renderPieChart('type', this.typePieData) - }) - - if (this.activeTab !== 'day') { - if (response.rows.length > 0) { - this.buildTrendChart(response.rows) - } else { - this.trendXData = [] - } - } - } else { + if (response.code !== 200 || !response.rows || response.rows.length === 0) { console.log('暂无停机数据') this.tableData = [] this.summaryData = [ @@ -403,6 +357,53 @@ export default { this.clearChart(this.trendChart) this.renderPieChart('crew', []) this.renderPieChart('type', []) + return + } + + this.tableData = response.rows.map(item => ({ + time: this.formatDateTime(item.startDate) + ' - ' + this.formatDateTime(item.endDate), + duration: this.secondsToMinutes(item.duration) + 'min', + remark: item.remark || '-', + machine: item.unit || '-' + })) + + const totalDurationSeconds = response.rows.reduce((sum, item) => sum + (Number(item.duration) || 0), 0) + const totalDurationMinutes = this.secondsToMinutes(totalDurationSeconds) + const totalCount = response.rows.length + const totalAvailableMinutes = this.getTotalAvailableMinutes() + const workRate = this.calculateWorkRate(totalDurationMinutes, totalAvailableMinutes) + + this.summaryData = [ + { label: '停机时间', value: totalDurationMinutes, unit: 'min' }, + { label: '停机次数', value: totalCount, unit: '次' }, + { label: '作业率', value: workRate, unit: '%' } + ] + + const crewMap = {} + const typeMap = {} + response.rows.forEach(item => { + const crew = item.crew || '未知班组' + const type = item.stopType || '未知类型' + const durationMinutes = this.secondsToMinutes(item.duration) + crewMap[crew] = (crewMap[crew] || 0) + durationMinutes + typeMap[type] = (typeMap[type] || 0) + durationMinutes + }) + + this.crewPieData = Object.keys(crewMap).map(crew => ({ name: crew, value: crewMap[crew] })) + this.typePieData = Object.keys(typeMap).map(type => ({ name: type, value: typeMap[type] })) + + // 渲染饼图 + this.$nextTick(() => { + this.renderPieChart('crew', this.crewPieData) + this.renderPieChart('type', this.typePieData) + }) + + if (this.activeTab !== 'day') { + if (response.rows.length > 0) { + this.buildTrendChart(response.rows) + } else { + this.trendXData = [] + } } }).catch(error => { loading.close() @@ -807,6 +808,7 @@ export default { .trend-chart { height: 250px !important; min-height: 250px; + max-height: 300px; } // ✅【修复】饼图容器增加固定高度,解决高度塌陷 @@ -845,13 +847,6 @@ export default { color: #909399; } -.detail-list { - background: #fff; - border-radius: 4px; - border: 1px solid #e4e7ed; - overflow: hidden; -} - .detail-item { padding: 12px; border-bottom: 1px solid #f5f7fa; diff --git a/klp-ui/src/views/lines/zinc/components/shutdown-statistic.vue b/klp-ui/src/views/lines/zinc/components/shutdown-statistic.vue index e02f037c..d7f17ed5 100644 --- a/klp-ui/src/views/lines/zinc/components/shutdown-statistic.vue +++ b/klp-ui/src/views/lines/zinc/components/shutdown-statistic.vue @@ -13,7 +13,51 @@ 查询 - + +
+ +
+

停机次数

+

{{ stopCount }}

+
+
+ +
+

停机总时长

+

{{ formatDuration(totalStopDuration) }}

+
+
+ +
+

作业率

+

{{ operationRate }}%

+
+
+
+ + +
+ + + +
+
+ + + +
+
+
+ +
- - -
@@ -48,6 +86,14 @@ \ No newline at end of file + + + \ No newline at end of file