Compare commits
12 Commits
d3da84f65e
...
test.X
| Author | SHA1 | Date | |
|---|---|---|---|
| 75a2623d8b | |||
| 5d046be15b | |||
|
|
fef2f132d0 | ||
|
|
1038b17a66 | ||
|
|
bd5e0ac5e9 | ||
| 896c6b89ca | |||
| a8e94ac34d | |||
|
|
f389576c92 | ||
|
|
a2b90f3b72 | ||
|
|
693edbb543 | ||
| 194c481e12 | |||
| 0050af7677 |
@@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 科伦普冷轧涂镀数智运营一体化平台
|
||||
VUE_APP_TITLE = MES一体化平台
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 科伦普冷轧涂镀数智运营一体化平台
|
||||
VUE_APP_TITLE = MES一体化平台
|
||||
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 科伦普冷轧涂镀数智运营一体化平台
|
||||
VUE_APP_TITLE = MES一体化平台
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.png">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= webpackConfig.name %></title>
|
||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
||||
<style>
|
||||
|
||||
@@ -328,3 +328,21 @@ export function returnCoil(coilId) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 冷硬卷切边统计
|
||||
*/
|
||||
export function listCoilTrimStatistics() {
|
||||
return request({
|
||||
url: '/wms/materialCoil/statistics/trimStatistics',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 类别宽度统计,汇总统计
|
||||
export function categoryWidthStatistics() {
|
||||
return request({
|
||||
url: '/wms/materialCoil/statistics/categoryWidthStatistics',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/coilStatisticsSummary.js
Normal file
44
klp-ui/src/api/wms/coilStatisticsSummary.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询钢卷生产统计汇总(数据透视结果持久化)列表
|
||||
export function listCoilStatisticsSummary(query) {
|
||||
return request({
|
||||
url: '/wms/coilStatisticsSummary/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询钢卷生产统计汇总(数据透视结果持久化)详细
|
||||
export function getCoilStatisticsSummary(summaryId) {
|
||||
return request({
|
||||
url: '/wms/coilStatisticsSummary/' + summaryId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增钢卷生产统计汇总(数据透视结果持久化)
|
||||
export function addCoilStatisticsSummary(data) {
|
||||
return request({
|
||||
url: '/wms/coilStatisticsSummary',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改钢卷生产统计汇总(数据透视结果持久化)
|
||||
export function updateCoilStatisticsSummary(data) {
|
||||
return request({
|
||||
url: '/wms/coilStatisticsSummary',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除钢卷生产统计汇总(数据透视结果持久化)
|
||||
export function delCoilStatisticsSummary(summaryId) {
|
||||
return request({
|
||||
url: '/wms/coilStatisticsSummary/' + summaryId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -67,3 +67,13 @@ export function listRawMaterialWithBom(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 热轧原料库存透视表
|
||||
*/
|
||||
export function listRawMaterialPerspective() {
|
||||
return request({
|
||||
url: '/wms/rawMaterial/statistics',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -35,7 +35,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '科伦普一体化平台',
|
||||
title: 'MES一体化平台',
|
||||
logo: logoImg
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<img :src="avatar" class="user-avatar" alt="头像" />
|
||||
<div class="greeting-text">
|
||||
<div class="greeting-title">{{ greeting }},{{ name }}</div>
|
||||
<div class="greeting-desc">欢迎使用科伦普冷轧涂渡数智一体化平台</div>
|
||||
<div class="greeting-desc">欢迎使用MES数智一体化平台</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -12,10 +12,10 @@ export default {
|
||||
components: { Home },
|
||||
mounted() {
|
||||
// 确保容器DOM已渲染后,对容器执行全屏
|
||||
this.$nextTick(() => {
|
||||
this.enterFullscreen()
|
||||
this.addFullscreenListener()
|
||||
})
|
||||
// this.$nextTick(() => {
|
||||
// this.enterFullscreen()
|
||||
// this.addFullscreenListener()
|
||||
// })
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 移除监听,避免内存泄漏
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
!document.mozFullScreenElement &&
|
||||
!document.webkitFullscreenElement &&
|
||||
!document.msFullscreenElement
|
||||
|
||||
|
||||
if (isExit) {
|
||||
// 退出全屏后返回上一页
|
||||
this.$router.back()
|
||||
@@ -91,4 +91,4 @@ export default {
|
||||
height: 100%;
|
||||
/* 可根据需要添加其他样式(如背景色等) */
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,68 +1,71 @@
|
||||
<template>
|
||||
<div class="dashboard-editor-container">
|
||||
<img src="http://kelunpuzhonggong.com/upload/img/20250427091033.jpg" alt="">
|
||||
|
||||
<div class="aboutus">
|
||||
<el-row :gutter="30">
|
||||
<!-- 左栏 -->
|
||||
<el-col :span="12" :xs="24">
|
||||
<div class="aboutus-title">
|
||||
<h2>关于我们</h2>
|
||||
<p>ABOUT US</p>
|
||||
</div>
|
||||
<div class="aboutus-left">
|
||||
<p class="aboutus-desc">
|
||||
嘉祥科伦普重工有限公司是山东省重点工程项目,是济宁市工程之一,也是科伦普产品结构调整重要的工程项目。工程采用了外方技术总负责、关键设备整体引进、点采集成、国内技术总成、自主创新、单体设备引进等多种建设方案,保证了技术先进和人才的培养,确保工程投产后达产达效。
|
||||
</p>
|
||||
<p class="aboutus-desc">
|
||||
科伦普冷轧重工有限公司是设计年产量150万吨,能向广大用户提供热轧酸洗、热轧镀锌、冷硬、罩式退火、冷轧镀锌、铝锌合金、锌铝合金、锌铝镁、镀铬等各大类产品。产品覆盖东北、华北、华东、华南等地区。
|
||||
</p>
|
||||
</div>
|
||||
<!-- <div class="dashboard-editor-container">-->
|
||||
<!-- <img src="http://kelunpuzhonggong.com/upload/img/20250427091033.jpg" alt="">-->
|
||||
<!-- -->
|
||||
<!-- <div class="aboutus">-->
|
||||
<!-- <el-row :gutter="30">-->
|
||||
<!-- <!– 左栏 –>-->
|
||||
<!-- <el-col :span="12" :xs="24">-->
|
||||
<!-- <div class="aboutus-title">-->
|
||||
<!-- <h2>关于我们</h2>-->
|
||||
<!-- <p>ABOUT US</p>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="aboutus-left">-->
|
||||
<!-- <p class="aboutus-desc">-->
|
||||
<!-- MES一体化平台是面向制造企业车间执行层的生产信息化管理系统,为企业提供包括制造数据管理、计划排程管理、生产调度管理、库存管理、质量管理、人力资源管理、工作中心管理等多项企业管理功能。-->
|
||||
<!-- </p>-->
|
||||
<!-- <p class="aboutus-desc">-->
|
||||
<!-- 平台通过互联网技术实现企业数字化转型,提高生产效率、降低成本、提升产品质量,实现精益化生产管理,帮助企业实现智能制造目标。-->
|
||||
<!-- </p>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<statistic-group />
|
||||
</el-col>
|
||||
<!-- <statistic-group />-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- 右栏 -->
|
||||
<el-col :span="12" :xs="24">
|
||||
<img src="http://kelunpuzhonggong.com/upload/img/20251015103934.jpg" alt="">
|
||||
<!-- <div class="aboutus-right">
|
||||
<p class="aboutus-detail">
|
||||
嘉祥科伦普重工有限公司成立于2017年8月,注册资金33100万元,主要经营高铁设备、配件制造与销售,模具制造与销售,新材料技术研发,高性能有色金属及合金材料销售,机械零件、零部件加工与销售,金属材料制造与销售,锌铝镁新材料等。目前公司拥有10余项具有自主知识产权的发明专利技术,综合技术水平达国内领先,2024年公司主导产品国内市场占有率约占85%。2024年总资产5.98亿元,净资产4.49亿元,收入3.95亿元,公司现有员工238人,研究与试验发展人员57人,其中专职研究与试验发展人员52人,外聘专家5人。
|
||||
</p>
|
||||
<p class="aboutus-detail">
|
||||
2024年公司新建科伦普合金新材料研发项目,占地290亩,采用国内先进的镀层核心技术和热处理工艺,专业生产锌铝镁板材和镀铬板材。致力于打造国内工艺链条最完善、产品型号最丰富的涂镀新材料生产企业。全部投产后可实现新增销售收入80亿元,利税4.7亿元,带动就业约500人。项目主要生产的冷轧板、锌铝镁涂层板、镀铬涂层板、镀锡涂层板等产品,涵盖0.08MM-6.0MM区间60多种产品,是国内单个企业产品种类最多的项目。产品因其防锈、耐氧化、耐腐蚀、高电导、高稳定的优秀特性,广泛应用于建筑结构件、汽车制造、轻工家电、食品包装、医疗器械、电子通讯、航空航天领域。
|
||||
</p>
|
||||
</div> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<!-- <!– 右栏 –>-->
|
||||
<!-- <el-col :span="12" :xs="24">-->
|
||||
<!-- <img src="http://kelunpuzhonggong.com/upload/img/20251015103934.jpg" alt="">-->
|
||||
<!-- <!– <div class="aboutus-right">-->
|
||||
<!-- <p class="aboutus-detail">-->
|
||||
<!-- 嘉祥科伦普重工有限公司成立于2017年8月,注册资金33100万元,主要经营高铁设备、配件制造与销售,模具制造与销售,新材料技术研发,高性能有色金属及合金材料销售,机械零件、零部件加工与销售,金属材料制造与销售,锌铝镁新材料等。目前公司拥有10余项具有自主知识产权的发明专利技术,综合技术水平达国内领先,2024年公司主导产品国内市场占有率约占85%。2024年总资产5.98亿元,净资产4.49亿元,收入3.95亿元,公司现有员工238人,研究与试验发展人员57人,其中专职研究与试验发展人员52人,外聘专家5人。-->
|
||||
<!-- </p>-->
|
||||
<!-- <p class="aboutus-detail">-->
|
||||
<!-- 2024年公司新建科伦普合金新材料研发项目,占地290亩,采用国内先进的镀层核心技术和热处理工艺,专业生产锌铝镁板材和镀铬板材。致力于打造国内工艺链条最完善、产品型号最丰富的涂镀新材料生产企业。全部投产后可实现新增销售收入80亿元,利税4.7亿元,带动就业约500人。项目主要生产的冷轧板、锌铝镁涂层板、镀铬涂层板、镀锡涂层板等产品,涵盖0.08MM-6.0MM区间60多种产品,是国内单个企业产品种类最多的项目。产品因其防锈、耐氧化、耐腐蚀、高电导、高稳定的优秀特性,广泛应用于建筑结构件、汽车制造、轻工家电、食品包装、医疗器械、电子通讯、航空航天领域。-->
|
||||
<!-- </p>-->
|
||||
<!-- </div> –>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div>
|
||||
<statistic-group />
|
||||
</div> -->
|
||||
|
||||
<!-- <AllApplications />
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="18">
|
||||
<el-empty description="办公模块定制开发中"></el-empty>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<mini-calendar />
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</div>
|
||||
<!-- <!– <div>-->
|
||||
<!-- <statistic-group />-->
|
||||
<!-- </div> –>-->
|
||||
<!-- -->
|
||||
<!-- <!– <AllApplications /> -->
|
||||
<!-- <el-row :gutter="10">-->
|
||||
<!-- <el-col :span="18">-->
|
||||
<!-- <el-empty description="办公模块定制开发中"></el-empty>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="6">-->
|
||||
<!-- <mini-calendar />-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row> –>-->
|
||||
<!-- </div>-->
|
||||
<Dashboard />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StatisticGroup from '@/components/HomeModules/StatisticGroup.vue'
|
||||
// import AllApplications from '@/components/HomeModules/AllApplications.vue'
|
||||
// import MiniCalendar from '@/components/HomeModules/MiniCalendar.vue'
|
||||
import Dashboard from '@/views/dashboard/demo.vue'
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
// PanelGroup,
|
||||
StatisticGroup,
|
||||
Dashboard,
|
||||
// AllApplications,
|
||||
// MiniCalendar,
|
||||
},
|
||||
@@ -193,4 +196,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -3,15 +3,14 @@
|
||||
<div class="login-box">
|
||||
<div class="login-left">
|
||||
<div class="login-title-welcome">
|
||||
<img src="../assets/logo/logo.png" alt="logo" class="logo-img" />
|
||||
<span class="login-title">欢迎使用科伦普冷轧涂镀数智一体化平台</span>
|
||||
<!-- <img src="../assets/logo/logo.png" alt="logo" class="logo-img" />-->
|
||||
<span class="login-title">欢迎使用MES一体化平台</span>
|
||||
</div>
|
||||
<p>
|
||||
嘉祥科伦普重工有限公司是山东省重点工程项目,是济宁市工程之一,也是科伦普产品结构调整重要的工程项目。工程采用了外方技术总负责、关键设备整体引进、点采集成、国内技术总成、自主创新、单体设备引进等多种建设方
|
||||
案,保证了技术先进和人才的培养,确保工程投产后达产达效。
|
||||
MES一体化平台是面向制造企业车间执行层的生产信息化管理系统,为企业提供包括制造数据管理、计划排程管理、生产调度管理、库存管理、质量管理、人力资源管理、工作中心管理等多项企业管理功能。
|
||||
</p>
|
||||
<p>
|
||||
科伦普冷轧重工有限公司是设计年产量150万 吨,能向广大用户提供热轧酸洗、热轧镀锌、冷硬、罩式退火、冷轧镀锌、铝锌合金、锌铝合金、锌铝镁、镀铬等各大类产品。产品覆盖东北、华北、华东、华南等地区。
|
||||
平台通过互联网技术实现企业数字化转型,提高生产效率、降低成本、提升产品质量,实现精益化生产管理。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -300,4 +299,4 @@ $--metal-gradient-light: linear-gradient(145deg, #f5f5f550, #ffffff50);
|
||||
color: $--color-text-secondary; // 浅灰色文字
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
488
klp-ui/src/views/wms/coil/panels/LabelRender/DuGeTag.vue
Normal file
488
klp-ui/src/views/wms/coil/panels/LabelRender/DuGeTag.vue
Normal file
@@ -0,0 +1,488 @@
|
||||
<template>
|
||||
<div class="label-container" :style="{ '--print-scale': printScale }">
|
||||
<div class="label-box">
|
||||
<!-- 顶部公司信息 -->
|
||||
<div class="company-header">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<img :src="logo" alt="Company Logo" class="company-logo" />
|
||||
<div class="company-name">
|
||||
科伦普<br />
|
||||
<span class="english-name">KE LUN PU</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">嘉祥科伦普重工有限公司</div>
|
||||
<img src="@/assets/images/pashi.png" alt="怕湿" class="company-logo" />
|
||||
</div>
|
||||
|
||||
<!-- 核心信息网格布局:替代原表格 -->
|
||||
<div class="info-grid">
|
||||
<!-- 第一行:订货单位 + 合同号 -->
|
||||
<div class="info-grid-item label-cell">订货单位</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.orderUnit || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">合同号</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.contractNumber || ''" />
|
||||
</div>
|
||||
|
||||
<!-- 第二行:执行标准 + 钢卷号 -->
|
||||
<div class="info-grid-item label-cell">产品名称</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.itemName || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">执行标准</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.executionStandard || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">钢卷号</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.currentCoilNo || ''" />
|
||||
</div>
|
||||
|
||||
<!-- 第三行:原料卷号 + 规格 -->
|
||||
<div class="info-grid-item label-cell">原料卷号</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.enterCoilNo || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">规格</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.specification || ''" />
|
||||
</div>
|
||||
|
||||
<!-- 第四行:材质 + 表面质量 -->
|
||||
<div class="info-grid-item label-cell">材质</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="materialWithManufacturer || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">表面状态</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.surfaceTreatmentDesc || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">调制度</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.temperGrade || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">产品等级</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.qualityStatus || ''" />
|
||||
</div>
|
||||
|
||||
<!-- 第五行:表面处理 + 剪切要求 -->
|
||||
<!-- <div class="info-grid-item label-cell">表面处理</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.surfaceTreatmentDesc || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">切边要求</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.trimmingRequirement || ''" />
|
||||
</div> -->
|
||||
|
||||
<!-- 第六行:包装种类 + 毛重 -->
|
||||
<div class="info-grid-item label-cell">镀层质量</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.zincLayer || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">毛重</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.grossWeight || ''" />
|
||||
</div>
|
||||
|
||||
<!-- 第七行:净重 + 参考长度 -->
|
||||
<div class="info-grid-item label-cell">净重</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.netWeight || ''" />
|
||||
</div>
|
||||
<div class="info-grid-item label-cell">参考长度</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="content.length || ''" />
|
||||
</div>
|
||||
|
||||
<!-- 第八行:生产日期(跨3列) -->
|
||||
<div class="info-grid-item label-cell">生产日期</div>
|
||||
<div class="info-grid-item value-cell">
|
||||
<input type="text" class="nob" :value="parseTime(content.updateTime, '{y}-{m}-{d}')" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部信息 -->
|
||||
<div class="footer-info">
|
||||
<div class="address">
|
||||
地址:山东省济宁市嘉祥县开发区生物产业园区新民路北<br />
|
||||
<span class="english-address">Address: North Extension of Xinmin Road,Bio-Industrial Park,Development
|
||||
Zone,<br />
|
||||
Jiaxiang County,Jining City,Shandong Province</span>
|
||||
<br />
|
||||
<span>
|
||||
TEL:0537-6625068 0537-6625067
|
||||
</span>
|
||||
</div>
|
||||
<div class="contact-timestamp">
|
||||
<!-- 放大二维码,占用更多下方空间,弱化底部留白感 -->
|
||||
<QRCode :content="content.qrcodeRecordId || ''" :size="90" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import logo from '@/assets/logo/logo.png'
|
||||
import QRCode from '../../../print/components/QRCode.vue';
|
||||
|
||||
export default {
|
||||
name: 'MetalSheetLabel',
|
||||
components: {
|
||||
QRCode
|
||||
},
|
||||
props: {
|
||||
content: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
// form3 所有字段
|
||||
orderUnit: '',
|
||||
contractNumber: '',
|
||||
productName: '镀锌卷板合格品(GI)',
|
||||
executionStandard: '',
|
||||
coilNumber: 'D2Z125031809202',
|
||||
rawBlankNumber: '',
|
||||
specification: '2.28*1250',
|
||||
material: '',
|
||||
qualityStatus: '',
|
||||
surfaceTreatmentDesc: '环保钝化/不涂油',
|
||||
trimmingRequirement: '',
|
||||
packagingRequirement: 'A03',
|
||||
grossWeight: '',
|
||||
netWeight: '7080',
|
||||
referenceLength: '320',
|
||||
length: '320',
|
||||
productionDate: '2025-03-19',
|
||||
// 底部信息字段
|
||||
address: '唐山市滦州市茨榆坨工业区',
|
||||
englishAddress: 'Donghai special steel, ciyutuo Industrial Zone, Luanzhou, Tangshan, Hebei province, China.',
|
||||
tel: '0315-7560777',
|
||||
timestamp: '2025.04.12 10:14',
|
||||
qrcodeRecordId: '',
|
||||
})
|
||||
},
|
||||
paperWidthMm: {
|
||||
type: Number,
|
||||
default: 180
|
||||
},
|
||||
paperHeightMm: {
|
||||
type: Number,
|
||||
default: 100
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 材质展示信息,额外带上厂家的首字母
|
||||
materialWithManufacturer() {
|
||||
return this.content.material
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
logo,
|
||||
printScale: 1,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 使用 matchMedia 监听打印状态(更可靠)
|
||||
this.printMediaQuery = window.matchMedia('print');
|
||||
this.printMediaQuery.addListener(this.handlePrintMediaChange);
|
||||
|
||||
// 监听打印事件作为备用
|
||||
window.addEventListener('beforeprint', this.handleBeforePrint);
|
||||
window.addEventListener('afterprint', this.handleAfterPrint);
|
||||
|
||||
// 计算初始缩放比例
|
||||
this.$nextTick(() => {
|
||||
this.calculatePrintScale();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.printMediaQuery) {
|
||||
this.printMediaQuery.removeListener(this.handlePrintMediaChange);
|
||||
}
|
||||
window.removeEventListener('beforeprint', this.handleBeforePrint);
|
||||
window.removeEventListener('afterprint', this.handleAfterPrint);
|
||||
},
|
||||
methods: {
|
||||
handlePrintMediaChange(mq) {
|
||||
if (mq.matches) {
|
||||
// 进入打印模式
|
||||
this.calculatePrintScale();
|
||||
} else {
|
||||
// 退出打印模式
|
||||
this.resetPrintScale();
|
||||
}
|
||||
},
|
||||
handleBeforePrint() {
|
||||
// 延迟计算,确保DOM已更新
|
||||
setTimeout(() => {
|
||||
this.calculatePrintScale();
|
||||
}, 100);
|
||||
},
|
||||
handleAfterPrint() {
|
||||
this.resetPrintScale();
|
||||
},
|
||||
calculatePrintScale() {
|
||||
this.$nextTick(() => {
|
||||
const container = this.$el;
|
||||
if (!container) return;
|
||||
|
||||
// 纸张尺寸:180mm x 100mm
|
||||
// 在打印时,使用 mm 单位更准确
|
||||
// 1mm = 3.779527559px (96 DPI) 或 1mm = 3.779527559px (72 DPI)
|
||||
// 为了更准确,我们直接使用 mm 转 px 的通用计算
|
||||
const dpi = 96; // 标准 DPI
|
||||
const mmToPx = dpi / 25.4; // 1mm = 3.779527559px
|
||||
|
||||
const paperWidthMm = this.paperWidthMm || 180;
|
||||
const paperHeightMm = this.paperHeightMm || 100;
|
||||
const marginMm = 2;
|
||||
|
||||
const paperWidthPx = paperWidthMm * mmToPx;
|
||||
const paperHeightPx = paperHeightMm * mmToPx;
|
||||
const marginPx = marginMm * mmToPx;
|
||||
|
||||
// 获取内容实际尺寸(在屏幕上的尺寸)
|
||||
const rect = container.getBoundingClientRect();
|
||||
let contentWidth = rect.width;
|
||||
let contentHeight = rect.height;
|
||||
|
||||
// 如果尺寸为0或无效,尝试使用 scrollWidth/scrollHeight
|
||||
if (contentWidth === 0 || contentHeight === 0) {
|
||||
contentWidth = container.scrollWidth || contentWidth;
|
||||
contentHeight = container.scrollHeight || contentHeight;
|
||||
}
|
||||
|
||||
// 计算可用空间(减去边距)
|
||||
const availableWidth = paperWidthPx - marginPx * 2;
|
||||
const availableHeight = paperHeightPx - marginPx * 2;
|
||||
|
||||
// 计算缩放比例
|
||||
const scaleX = contentWidth > 0 ? availableWidth / contentWidth : 1;
|
||||
const scaleY = contentHeight > 0 ? availableHeight / contentHeight : 1;
|
||||
|
||||
// 取较小的缩放比例,确保内容完全适配(不超过1,不放大)
|
||||
this.printScale = Math.min(scaleX, scaleY, 1);
|
||||
|
||||
// 设置CSS变量和内联样式
|
||||
container.style.setProperty('--print-scale', this.printScale);
|
||||
container.style.setProperty('--paper-width', `${paperWidthMm}mm`);
|
||||
container.style.setProperty('--paper-height', `${paperHeightMm}mm`);
|
||||
|
||||
console.log('打印缩放计算:', {
|
||||
contentSize: { width: contentWidth, height: contentHeight },
|
||||
paperSize: { width: paperWidthPx, height: paperHeightPx },
|
||||
scale: this.printScale
|
||||
});
|
||||
});
|
||||
},
|
||||
resetPrintScale() {
|
||||
this.printScale = 1;
|
||||
if (this.$el) {
|
||||
this.$el.style.setProperty('--print-scale', 1);
|
||||
this.$el.style.removeProperty('--paper-width');
|
||||
this.$el.style.removeProperty('--paper-height');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.label-container {
|
||||
padding: 1em;
|
||||
/* width: 680.315px; */
|
||||
/* height: 377.953px; */
|
||||
/* width: fit-content;
|
||||
height: fit-content; */
|
||||
/* 减少内边距,避免生成PDF时上下留白不一致 */
|
||||
/* padding: 0.1em;
|
||||
font-size: 12px;
|
||||
border: 1px solid #000;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Arial', sans-serif; */
|
||||
/* border: 1px solid #000; */
|
||||
}
|
||||
|
||||
.label-box {
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
/* margin: 1em; */
|
||||
padding: 0.1em;
|
||||
font-size: 12px;
|
||||
border: 1px solid #000;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Arial', sans-serif;
|
||||
}
|
||||
|
||||
.company-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0.3em;
|
||||
position: relative;
|
||||
/* 为绝对定位的 title 提供定位上下文 */
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
width: 5em;
|
||||
height: 5em;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.title {
|
||||
position: absolute;
|
||||
/* 绝对定位,脱离 flex 流 */
|
||||
left: 50%;
|
||||
/* 从左边50%开始 */
|
||||
transform: translateX(-50%);
|
||||
/* 向左移动自身宽度的50%,实现居中 */
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
/* 防止文字换行 */
|
||||
}
|
||||
|
||||
.english-name {
|
||||
width: 100%;
|
||||
font-size: 1em;
|
||||
opacity: 0.9;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
.product-title {
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-bottom: 0.4em;
|
||||
border-bottom: 1.5px solid #000;
|
||||
padding-bottom: 0.2em;
|
||||
}
|
||||
|
||||
/* 网格布局核心样式 */
|
||||
.info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
/* 4列等宽 */
|
||||
gap: 0;
|
||||
/* 消除网格间距,确保边框连贯 */
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.info-grid-item {
|
||||
border: 1px solid #000;
|
||||
padding: 0.1em;
|
||||
font-size: 1.05em;
|
||||
height: 2em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
word-break: break-all;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 生产日期跨3列 */
|
||||
.date-colspan {
|
||||
grid-column: span 3;
|
||||
/* 占据3列 */
|
||||
}
|
||||
|
||||
.footer-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
font-size: 0.85em;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
.address {
|
||||
line-height: 1.25;
|
||||
width: 80%;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.english-address {
|
||||
opacity: 0.9;
|
||||
font-size: 1.1em;
|
||||
line-height: 1.15;
|
||||
word-break: normal;
|
||||
/* 正常换行,只在单词边界(空格)处换行 */
|
||||
overflow-wrap: normal;
|
||||
/* 不在单词内部断行,保持单词完整 */
|
||||
}
|
||||
|
||||
.contact-timestamp {
|
||||
text-align: right;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.nob {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 打印样式 - 强制单页,适配180mm x 100mm纸张,保持原有样式不变 */
|
||||
@media print {
|
||||
@page {
|
||||
size: 180mm 100mm;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
* {
|
||||
-webkit-print-color-adjust: exact !important;
|
||||
print-color-adjust: exact !important;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* 隐藏所有其他内容,只显示标签容器 */
|
||||
body>*:not(.label-container) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.label-container {
|
||||
/* 防止分页 - 多重保护 */
|
||||
page-break-inside: avoid !important;
|
||||
break-inside: avoid !important;
|
||||
page-break-after: avoid !important;
|
||||
break-after: avoid !important;
|
||||
page-break-before: avoid !important;
|
||||
break-before: avoid !important;
|
||||
orphans: 999 !important;
|
||||
widows: 999 !important;
|
||||
|
||||
/* 应用动态缩放,保持原有样式 */
|
||||
transform: scale(var(--print-scale, 1)) !important;
|
||||
transform-origin: top left !important;
|
||||
|
||||
/* 确保缩放后不超出纸张 */
|
||||
max-width: var(--paper-width, 180mm) !important;
|
||||
max-height: var(--paper-height, 100mm) !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -31,17 +31,17 @@
|
||||
</div>
|
||||
<div class="grid-cell label-cell">下工序</div>
|
||||
<div class="grid-cell value-cell">
|
||||
<div class="nob" contenteditable>{{ content.nextProcess || '冷硬卷' }}</div>
|
||||
<div class="nob" contenteditable>{{ content.nextProcess || '镀锌卷' }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 第四行:包装要求、切边要求 -->
|
||||
<div class="grid-cell label-cell">包装要求</div>
|
||||
<div class="grid-cell value-cell">
|
||||
<div class="nob" contenteditable>{{ content.packagingRequirements || '' }}</div>
|
||||
<div class="nob" contenteditable>{{ content.packagingRequirement || '' }}</div>
|
||||
</div>
|
||||
<div class="grid-cell label-cell">切边要求</div>
|
||||
<div class="grid-cell value-cell">
|
||||
<div class="nob" contenteditable>{{ content.trimmingRequirements || '' }}</div>
|
||||
<div class="nob" contenteditable>{{ content.trimmingRequirement || '' }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 第五行:班组、代码(二维码) -->
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="grid-cell label-cell">代码</div>
|
||||
<div class="grid-cell qrcode-cell">
|
||||
<!-- 二维码容器 -->
|
||||
<QRCode :content="content.qrcodeRecordId" />
|
||||
<QRCode :content="content.qrcodeRecordId" :size="80"/>
|
||||
</div>
|
||||
|
||||
<!-- 第六行:生产日期 -->
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
.label-container {
|
||||
width: 45em;
|
||||
height: 25em;
|
||||
padding: 0;
|
||||
padding: 16px;
|
||||
font-family: "SimSun", serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ export default {
|
||||
.grid-cell {
|
||||
border: 1px solid #333;
|
||||
padding: 4px;
|
||||
font-size: 14px;
|
||||
font-size: 20px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
@@ -205,20 +205,21 @@ export default {
|
||||
/* 公司名称单元格 */
|
||||
.company-cell {
|
||||
grid-column: span 4; /* 跨4列 */
|
||||
font-size: 18px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
background-color: #f5f5f5;
|
||||
/* background-color: #f5f5f5; */
|
||||
}
|
||||
|
||||
/* 标签单元格(左) */
|
||||
.label-cell {
|
||||
background-color: #f5f5f5;
|
||||
/* background-color: #f5f5f5; */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 值单元格 */
|
||||
.value-cell {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.date-cell {
|
||||
|
||||
@@ -29,8 +29,14 @@
|
||||
<ZincRawTag
|
||||
v-if="tagType === '5'"
|
||||
:content="content"
|
||||
:paperWidthMm="100"
|
||||
:paperHeightMm="80"
|
||||
/>
|
||||
<DuGeTag
|
||||
v-if="tagType === 'ge'"
|
||||
:content="content"
|
||||
:paperWidthMm="180"
|
||||
:paperHeightMm="100"
|
||||
:paperHeightMm="80"
|
||||
/>
|
||||
<!-- <SampleTagPreview v-if="labelType === '4'" :content="content" />
|
||||
<ForgeTagPreview v-if="labelType === '5'" :content="content" />
|
||||
@@ -54,6 +60,7 @@ import OuterTagPreview from './OuterTagPreview.vue';
|
||||
import GalvanizedTag from './GalvanizedTag.vue';
|
||||
import WhereTag from './WhereTag.vue';
|
||||
import ZincRawTag from './ZincRawTag.vue';
|
||||
import DuGeTag from './DuGeTag.vue';
|
||||
|
||||
// import SampleTagPreview from './SampleTagPreview.vue';
|
||||
// import ForgeTagPreview from './ForgeTagPreview.vue';
|
||||
@@ -67,6 +74,7 @@ export default {
|
||||
GalvanizedTag,
|
||||
WhereTag,
|
||||
ZincRawTag,
|
||||
DuGeTag,
|
||||
// SampleTagPreview,
|
||||
// ForgeTagPreview,
|
||||
// SaltSprayTagPreview,
|
||||
@@ -87,10 +95,18 @@ export default {
|
||||
width: 180,
|
||||
height: 100,
|
||||
},
|
||||
'ge': {
|
||||
width: 180,
|
||||
height: 100,
|
||||
},
|
||||
'where': {
|
||||
width: 100,
|
||||
height: 80,
|
||||
},
|
||||
'5': {
|
||||
width: 180,
|
||||
height: 100,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -137,6 +153,8 @@ export default {
|
||||
this.labelType = '4';
|
||||
} else if (itemType == 'product' && itemName == '冷轧卷') {
|
||||
this.labelType = '3';
|
||||
} else if (itemType == 'product' && itemName == '镀铬卷') {
|
||||
this.labelType = 'ge'
|
||||
} else {
|
||||
this.labelType = '3';
|
||||
}
|
||||
|
||||
175
klp-ui/src/views/wms/coil/panels/Perspective/HotZhaRaw.vue
Normal file
175
klp-ui/src/views/wms/coil/panels/Perspective/HotZhaRaw.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div class="hot-zha-raw">
|
||||
<div v-if="!data || data.length === 0" class="empty-data">
|
||||
暂无数据
|
||||
</div>
|
||||
<div v-else class="data-container">
|
||||
<!-- 表头 -->
|
||||
<div class="header-row">
|
||||
<div class="header-cell manufacturer-header">厂家</div>
|
||||
<div class="header-cell material-header">材质</div>
|
||||
<div class="header-cell spec-header">规格</div>
|
||||
<div class="header-cell count-header">求和项:件数</div>
|
||||
<div class="header-cell weight-header">求和项:重量</div>
|
||||
</div>
|
||||
<!-- 数据行 -->
|
||||
<div v-for="(manufacturer, mIndex) in processedData" :key="'manufacturer-' + mIndex" class="manufacturer-section">
|
||||
<!-- 厂家行 -->
|
||||
<div class="row manufacturer-row">
|
||||
<div class="cell manufacturer-cell" :colspan="2">{{ manufacturer.manufacturer }}</div>
|
||||
<div class="cell"></div>
|
||||
<div class="cell"></div>
|
||||
<div class="cell">{{ manufacturer.totalCoilCount }}</div>
|
||||
<div class="cell">{{ manufacturer.totalWeight }}</div>
|
||||
</div>
|
||||
<!-- 材质行 -->
|
||||
<div v-for="(material, matIndex) in manufacturer.materials" :key="'material-' + mIndex + '-' + matIndex" class="material-section">
|
||||
<div class="row material-row">
|
||||
<div class="cell"></div>
|
||||
<div class="cell material-cell">{{ material.material }}</div>
|
||||
<div class="cell"></div>
|
||||
<div class="cell">{{ material.totalCoilCount }}</div>
|
||||
<div class="cell">{{ material.totalWeight }}</div>
|
||||
</div>
|
||||
<!-- 规格行 -->
|
||||
<div v-for="(spec, sIndex) in material.specifications" :key="'spec-' + mIndex + '-' + matIndex + '-' + sIndex" class="row spec-row">
|
||||
<div class="cell"></div>
|
||||
<div class="cell"></div>
|
||||
<div class="cell spec-cell">{{ spec.specification }}</div>
|
||||
<div class="cell">{{ spec.coilCount }}</div>
|
||||
<div class="cell">{{ spec.totalWeight }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="processedData.length === 0" class="no-data">
|
||||
过滤后暂无数据
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HotZhaRaw',
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
processedData() {
|
||||
if (!this.data || !Array.isArray(this.data)) {
|
||||
return [];
|
||||
}
|
||||
return this.data;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSave() {
|
||||
this.$emit('save', this.processedData);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.hot-zha-raw {
|
||||
width: 100%;
|
||||
min-height: 200px;
|
||||
}
|
||||
.empty-data,
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
.data-container {
|
||||
width: 100%;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.header-row {
|
||||
display: flex;
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
.header-cell {
|
||||
padding: 8px;
|
||||
border-right: 1px solid #ddd;
|
||||
word-break: break-all;
|
||||
}
|
||||
.header-cell:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
.manufacturer-header {
|
||||
width: 200px;
|
||||
}
|
||||
.material-header {
|
||||
width: 100px;
|
||||
}
|
||||
.spec-header {
|
||||
width: 150px;
|
||||
}
|
||||
.count-header,
|
||||
.weight-header {
|
||||
width: 120px;
|
||||
text-align: right;
|
||||
}
|
||||
.row {
|
||||
display: flex;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
.row:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
.cell {
|
||||
padding: 8px;
|
||||
border-right: 1px solid #ddd;
|
||||
word-break: break-all;
|
||||
}
|
||||
.cell:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
/* 确保表头和数据行的列宽一致 */
|
||||
.row .cell:nth-child(1) {
|
||||
width: 200px;
|
||||
}
|
||||
.row .cell:nth-child(2) {
|
||||
width: 100px;
|
||||
}
|
||||
.row .cell:nth-child(3) {
|
||||
width: 150px;
|
||||
}
|
||||
.row .cell:nth-child(4),
|
||||
.row .cell:nth-child(5) {
|
||||
width: 120px;
|
||||
text-align: right;
|
||||
}
|
||||
.spec-cell {
|
||||
padding-left: 20px;
|
||||
}
|
||||
.manufacturer-row {
|
||||
background-color: #e6f7ff;
|
||||
}
|
||||
.material-row {
|
||||
background-color: #f0f5ff;
|
||||
}
|
||||
.spec-row {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.manufacturer-cell {
|
||||
font-weight: bold;
|
||||
}
|
||||
.material-cell {
|
||||
font-weight: bold;
|
||||
}
|
||||
.spec-cell {
|
||||
padding-left: 20px;
|
||||
}
|
||||
</style>
|
||||
152
klp-ui/src/views/wms/coil/panels/Perspective/TrimStatistics.vue
Normal file
152
klp-ui/src/views/wms/coil/panels/Perspective/TrimStatistics.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div class="trim-statistics-table">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
:span-method="objectSpanMethod"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<!-- 厚度列 -->
|
||||
<el-table-column
|
||||
prop="thickness"
|
||||
label="厚度"
|
||||
width="80"
|
||||
align="center"
|
||||
/>
|
||||
|
||||
<!-- 冷硬卷板净边料现货库存 表头组 -->
|
||||
<el-table-column
|
||||
label="冷硬卷板净边料现货库存"
|
||||
align="center"
|
||||
>
|
||||
<el-table-column
|
||||
label="总计"
|
||||
align="center"
|
||||
>
|
||||
<el-table-column label="数量(件)" prop="trimmedTotalCount" width="80" align="center" />
|
||||
<el-table-column label="重量(吨)" prop="trimmedTotalWeight" width="80" align="center" />
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="width in widthList"
|
||||
:key="'trimmed-' + width"
|
||||
:label="width"
|
||||
align="center"
|
||||
>
|
||||
<el-table-column label="数量(件)" :prop="`trimmed_${width}_count`" width="80" align="center" />
|
||||
<el-table-column label="重量(吨)" :prop="`trimmed_${width}_weight`" width="80" align="center" />
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 冷硬卷板毛边料现货库存 表头组 -->
|
||||
<el-table-column
|
||||
label="冷硬卷板毛边料现货库存"
|
||||
align="center"
|
||||
>
|
||||
<el-table-column
|
||||
label="总计"
|
||||
align="center"
|
||||
>
|
||||
<el-table-column label="数量(件)" prop="untrimmedTotalCount" width="80" align="center" />
|
||||
<el-table-column label="重量(吨)" prop="untrimmedTotalWeight" width="80" align="center" />
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="width in widthList"
|
||||
:key="'untrimmed-' + width"
|
||||
:label="width"
|
||||
align="center"
|
||||
>
|
||||
<el-table-column label="数量(件)" :prop="`untrimmed_${width}_count`" width="80" align="center" />
|
||||
<el-table-column label="重量(吨)" :prop="`untrimmed_${width}_weight`" width="80" align="center" />
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'TrimStatistics',
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 定义表格中需要展示的宽度规格(与图片中一致)
|
||||
widthList() {
|
||||
return [
|
||||
'1000', '1200/1202', '1218/1220', '1240/1252',
|
||||
'1010/1015', '1210/1215', '1225/1235', '1260-1265',
|
||||
'1000~1005', '1200~1215', '1218~1235', '1250~1265'
|
||||
];
|
||||
},
|
||||
// 处理后的数据(适配表格列结构)
|
||||
tableData() {
|
||||
return this.data.map(item => {
|
||||
const row = {
|
||||
thickness: item.thickness,
|
||||
trimmedTotalCount: 0, // 净边料总计数量
|
||||
trimmedTotalWeight: 0, // 净边料总计重量
|
||||
untrimmedTotalCount: 0, // 毛边料总计数量
|
||||
untrimmedTotalWeight: 0 // 毛边料总计重量
|
||||
};
|
||||
|
||||
// 初始化所有宽度的数量和重量为0
|
||||
this.widthList.forEach(width => {
|
||||
row[`trimmed_${width}_count`] = 0;
|
||||
row[`trimmed_${width}_weight`] = 0;
|
||||
row[`untrimmed_${width}_count`] = 0;
|
||||
row[`untrimmed_${width}_weight`] = 0;
|
||||
});
|
||||
|
||||
// 处理净边料数据
|
||||
item.trimmedList.forEach(trimmed => {
|
||||
const widthKey = trimmed.width;
|
||||
if (this.widthList.includes(widthKey)) {
|
||||
row[`trimmed_${widthKey}_count`] = trimmed.coilCount;
|
||||
row[`trimmed_${widthKey}_weight`] = trimmed.totalWeight;
|
||||
// 累加总计
|
||||
row.trimmedTotalCount += trimmed.coilCount;
|
||||
row.trimmedTotalWeight = (Number(row.trimmedTotalWeight) + Number(trimmed.totalWeight)).toFixed(3);
|
||||
}
|
||||
});
|
||||
|
||||
// 处理毛边料数据
|
||||
item.untrimmedList.forEach(untrimmed => {
|
||||
const widthKey = untrimmed.width;
|
||||
if (this.widthList.includes(widthKey)) {
|
||||
row[`untrimmed_${widthKey}_count`] = untrimmed.coilCount;
|
||||
row[`untrimmed_${widthKey}_weight`] = untrimmed.totalWeight;
|
||||
// 累加总计
|
||||
row.untrimmedTotalCount += untrimmed.coilCount;
|
||||
row.untrimmedTotalWeight = (Number(row.untrimmedTotalWeight) + Number(untrimmed.totalWeight)).toFixed(3);
|
||||
}
|
||||
});
|
||||
|
||||
return row;
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 合并表头的跨度方法(可选,若需要合并行/列可扩展)
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
// 可根据需求实现行/列合并逻辑,例如合并重复的厚度行
|
||||
// 示例:若需合并相同厚度的行,可在此处返回 { rowspan: n, colspan: m }
|
||||
return { rowspan: 1, colspan: 1 };
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.trim-statistics-table {
|
||||
padding: 10px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.el-table {
|
||||
--el-table-header-text-color: #333;
|
||||
--el-table-row-hover-bg-color: #f5f7fa;
|
||||
}
|
||||
</style>
|
||||
57
klp-ui/src/views/wms/coil/panels/Perspective/index.vue
Normal file
57
klp-ui/src/views/wms/coil/panels/Perspective/index.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<div class="perspective">
|
||||
<hot-zha-raw v-if="statType == '热轧原料'" :data="data" />
|
||||
<trim-statistics v-else-if="statType == '冷硬卷板'" :data="data" />
|
||||
<category-width-statistics v-else-if="statType == '汇总'" :data="data" />
|
||||
<div v-else>
|
||||
<el-alert type="warning" message="请选择有效统计类型" show-icon />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HotZhaRaw from "@/views/wms/coil/panels/Perspective/HotZhaRaw.vue";
|
||||
import TrimStatistics from "@/views/wms/coil/panels/Perspective/TrimStatistics.vue";
|
||||
import CategoryWidthStatistics from "@/views/wms/coil/panels/Perspective/CategoryWidthStatistics.vue";
|
||||
export default {
|
||||
name: 'Perspective',
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
},
|
||||
statType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
components: {
|
||||
HotZhaRaw,
|
||||
TrimStatistics,
|
||||
CategoryWidthStatistics,
|
||||
},
|
||||
methods: {
|
||||
handleSave(data) {
|
||||
const dataText = JSON.stringify(data, null, 2);
|
||||
this.$emit('save', {
|
||||
title: this.title,
|
||||
data: dataText,
|
||||
type: this.type,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.perspective {
|
||||
width: 100%;
|
||||
min-height: 200px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
@@ -246,8 +246,7 @@
|
||||
<div class="info-item">
|
||||
<span class="info-label">品名:</span>
|
||||
<span class="info-value">
|
||||
<el-popover placement="top" width="280" trigger="hover"
|
||||
popper-class="material-params-popover">
|
||||
<el-popover placement="top" width="280" trigger="hover" popper-class="material-params-popover">
|
||||
<div class="material-params-content">
|
||||
<div class="params-list">
|
||||
<div class="param-item">
|
||||
@@ -273,7 +272,7 @@
|
||||
<span class="param-value">{{ item.manufacturer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<span slot="reference" style="cursor: pointer; color: #2bf;">{{ item.itemName || '—' }}</span>
|
||||
@@ -552,6 +551,32 @@ export default {
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
},
|
||||
tagSizeMap: {
|
||||
'2': {
|
||||
width: 100,
|
||||
height: 80,
|
||||
},
|
||||
'3': {
|
||||
width: 180,
|
||||
height: 100,
|
||||
},
|
||||
'4': {
|
||||
width: 180,
|
||||
height: 100,
|
||||
},
|
||||
'ge': {
|
||||
width: 180,
|
||||
height: 80,
|
||||
},
|
||||
'where': {
|
||||
width: 100,
|
||||
height: 80,
|
||||
},
|
||||
'5': {
|
||||
width: 180,
|
||||
height: 100,
|
||||
},
|
||||
},
|
||||
stepSpilt: {
|
||||
list: [],
|
||||
@@ -633,8 +658,26 @@ export default {
|
||||
handlePrintLabel(row) {
|
||||
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||
|
||||
this.labelRender.type = row.itemType === 'product' ? '3' : '2'
|
||||
const itemType = row.itemType || '';
|
||||
const warehouseId = row.warehouseId || '';
|
||||
// 在镀锌颜料库的卷使用镀锌原料标签
|
||||
if (itemType == 'raw_material' && warehouseId == '1988150263284953089') {
|
||||
this.labelRender.type = '5';
|
||||
} else if (itemType == 'raw_material') {
|
||||
this.labelRender.type = '2';
|
||||
} else if (itemType == 'product' && itemName == '冷硬卷') {
|
||||
this.labelRender.type = '3';
|
||||
} else if (itemType == 'product' && itemName == '热轧卷板') {
|
||||
this.labelRender.type = '3';
|
||||
} else if (itemType == 'product' && itemName == '镀锌卷') {
|
||||
this.labelRender.type = '4';
|
||||
} else if (itemType == 'product' && itemName == '冷轧卷') {
|
||||
this.labelRender.type = '3';
|
||||
} else if (itemType == 'product' && itemName == '镀铬卷') {
|
||||
this.labelRender.type = 'ge';
|
||||
} else {
|
||||
this.labelRender.type = '3';
|
||||
}
|
||||
this.labelRender.data = {
|
||||
...row,
|
||||
itemName: itemName,
|
||||
|
||||
320
klp-ui/src/views/wms/coil/perspective/components/LeftList.vue
Normal file
320
klp-ui/src/views/wms/coil/perspective/components/LeftList.vue
Normal file
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索区域 - 使用flex布局 -->
|
||||
<div class="search-bar">
|
||||
<!-- 统计类型下拉选择框 -->
|
||||
<el-select v-model="queryParams.statType" placeholder="请选择统计类型" clearable size="mini" class="search-select">
|
||||
<el-option label="热轧原料" value="热轧原料" />
|
||||
<el-option label="冷硬卷板" value="冷硬卷板" />
|
||||
<el-option label="汇总" value="汇总" />
|
||||
</el-select>
|
||||
|
||||
<!-- 标题搜索输入框 -->
|
||||
<el-input v-model="queryParams.title" placeholder="请输入标题搜索" clearable @keyup.enter.native="handleQuery"
|
||||
size="mini" class="search-input" />
|
||||
|
||||
<!-- 新增按钮 -->
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" class="add-btn">
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 自定义列表(替代表格) -->
|
||||
<div class="statistics-list" v-loading="loading">
|
||||
<!-- 列表为空时的提示 -->
|
||||
<div v-if="coilStatisticsSummaryList.length === 0 && !loading" class="empty-tip">
|
||||
暂无统计数据
|
||||
</div>
|
||||
|
||||
<!-- 列表项 - 增加选中样式判断 -->
|
||||
<div v-for="(item, index) in coilStatisticsSummaryList" :key="index" class="statistics-item"
|
||||
:class="{ 'statistics-item-selected': currentRow.summaryId === item.summaryId }" @click="handleSelect(item)">
|
||||
<!-- 内容区域 -->
|
||||
<div class="item-content">
|
||||
<el-tag type="info">{{ item.statType }}</el-tag>
|
||||
<div style="display: flex;">
|
||||
<!-- 双击后变成输入框,输入框失去焦点触发更新 -->
|
||||
<div class="value">{{ item.title }}</div>
|
||||
<!-- <span class="value">{{ item.createTime }}</span>
|
||||
<span class="value">{{ item.createBy }}</span> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 操作区域 -->
|
||||
<div class="item-actions">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(item)">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" class="pagination-container" />
|
||||
|
||||
<!-- 添加或修改钢卷生产统计对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<div v-for="item in tableType" :key="item.statType" @click="handleCreate(item)" class="type-item">
|
||||
<div class="type-title">{{ item.title }}</div>
|
||||
<div class="type-desc">{{ item.description }}</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCoilStatisticsSummary, delCoilStatisticsSummary, updateCoilStatisticsSummary } from "@/api/wms/coilStatisticsSummary";
|
||||
|
||||
export default {
|
||||
name: "CoilStatisticsSummary",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 钢卷生产统计表格数据
|
||||
coilStatisticsSummaryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
title: undefined,
|
||||
statType: undefined,
|
||||
},
|
||||
tableType: [
|
||||
{ statType: '热轧原料', title: '热轧原料', description: '统计热轧原料的实时库存' },
|
||||
{ statType: '冷硬卷板', title: '冷硬卷板', description: '统计冷硬卷板的实时库存' },
|
||||
{ statType: '汇总', title: '汇总', description: '各类产品汇总表' },
|
||||
],
|
||||
currentRow: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
computed: {
|
||||
currentId() {
|
||||
return this.currentRow.summaryId
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询钢卷生产统计列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCoilStatisticsSummary(this.queryParams).then(response => {
|
||||
this.coilStatisticsSummaryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSelect(row) {
|
||||
this.currentRow = row;
|
||||
this.$emit('select', row);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
// 重置表单
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleCreate(item) {
|
||||
this.$emit('add', {
|
||||
statType: item.statType,
|
||||
title: item.title,
|
||||
statJson: '{}',
|
||||
});
|
||||
this.open = false;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.open = true;
|
||||
this.title = "添加钢卷生产统计";
|
||||
},
|
||||
submitUpdate(row) {
|
||||
updateCoilStatisticsSummary(row).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const summaryIds = row.summaryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除钢卷生产统计编号为"' + summaryIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delCoilStatisticsSummary(summaryIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
// 删除后清空选中状态
|
||||
if (this.currentRow.summaryId === row.summaryId) {
|
||||
this.currentRow = {};
|
||||
}
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 提交表单 */
|
||||
submitForm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
// 这里补充提交逻辑
|
||||
setTimeout(() => {
|
||||
this.buttonLoading = false;
|
||||
this.open = false;
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.getList();
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 搜索栏样式 */
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 20px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.search-select {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 自定义列表样式 */
|
||||
.statistics-list {
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 0px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.statistics-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
transition: background-color 0.2s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.statistics-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.statistics-item:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
/* 新增选中状态样式 */
|
||||
.statistics-item-selected {
|
||||
background-color: #e5f3ff;
|
||||
border-left: 3px solid #409eff;
|
||||
}
|
||||
|
||||
.statistics-item-selected:hover {
|
||||
background-color: #e5f3ff;
|
||||
}
|
||||
|
||||
.item-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.item-title,
|
||||
.item-type {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #666;
|
||||
margin-right: 8px;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.item-actions {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
/* 分页样式 */
|
||||
.pagination-container {
|
||||
margin-top: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* 对话框内类型选项样式 */
|
||||
.type-item {
|
||||
padding: 12px;
|
||||
border: 1px solid #e6e6e6;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.type-item:hover {
|
||||
border-color: #409eff;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.type-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.type-desc {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
260
klp-ui/src/views/wms/coil/perspective/index.vue
Normal file
260
klp-ui/src/views/wms/coil/perspective/index.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="6">
|
||||
<LeftList ref="leftList" @add="handleAdd" @select="handleSelect" />
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div style="height: calc(100vh - 124px); overflow-y: scroll; overflow-x: hidden;">
|
||||
<div v-if="currentRow.summaryId">
|
||||
<Preview :data="currentRow.statJson" :statType="currentRow.statType" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<div>钢卷生产统计详情</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-dialog v-loading="previewLoading" title="效果预览" :visible.sync="previewOpen" width="100vw" fullscreen append-to-body>
|
||||
<Preview :data="liveData" :statType="form.statType" />
|
||||
<el-button type="primary" @click="handleSave">保存</el-button>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCoilStatisticsSummary, delCoilStatisticsSummary, addCoilStatisticsSummary, updateCoilStatisticsSummary } from "@/api/wms/coilStatisticsSummary";
|
||||
import LeftList from "./components/LeftList.vue";
|
||||
import Preview from "@/views/wms/coil/panels/Perspective/index.vue";
|
||||
|
||||
import { listRawMaterialPerspective } from "@/api/wms/rawMaterial";
|
||||
import { listCoilTrimStatistics, categoryWidthStatistics } from "@/api/wms/coil";
|
||||
|
||||
export default {
|
||||
name: "CoilStatisticsSummary",
|
||||
components: {
|
||||
LeftList,
|
||||
Preview
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 钢卷生产统计表格数据
|
||||
coilStatisticsSummaryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
title: undefined,
|
||||
statType: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
previewLoading: false,
|
||||
previewOpen: false,
|
||||
liveData: [],
|
||||
currentRow: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询钢卷生产统计列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCoilStatisticsSummary(this.queryParams).then(response => {
|
||||
this.coilStatisticsSummaryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
summaryId: undefined,
|
||||
title: undefined,
|
||||
statType: undefined,
|
||||
statJson: undefined,
|
||||
remark: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelect(row) {
|
||||
this.currentRow = {
|
||||
...row,
|
||||
statJson: JSON.parse(row.statJson)
|
||||
};
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(form) {
|
||||
this.previewOpen = true;
|
||||
this.form = form;
|
||||
if (form.statType == '热轧原料') {
|
||||
this.previewLoading = true;
|
||||
listRawMaterialPerspective().then(response => {
|
||||
const data = response.data;
|
||||
// 处理数据
|
||||
const filteredData = data.filter(manufacturer => {
|
||||
// 确保manufacturer和其materials存在
|
||||
if (!manufacturer || !Array.isArray(manufacturer.materials)) {
|
||||
return false;
|
||||
}
|
||||
// 过滤材质:totalCoilCount > 0
|
||||
manufacturer.materials = manufacturer.materials.filter(material => {
|
||||
// 确保material和其specifications存在
|
||||
if (!material || !Array.isArray(material.specifications)) {
|
||||
return false;
|
||||
}
|
||||
// 过滤规格:coilCount > 0
|
||||
material.specifications = material.specifications.filter(spec => spec.coilCount > 0);
|
||||
// 只有当规格数组不为空时,才保留该材质
|
||||
return material.specifications.length > 0;
|
||||
});
|
||||
// 只有当材质数组不为空时,才保留该厂家
|
||||
return manufacturer.materials.length > 0;
|
||||
});
|
||||
this.liveData = filteredData;
|
||||
}).finally(() => {
|
||||
this.previewLoading = false;
|
||||
});
|
||||
}
|
||||
else if (form.statType == '冷硬卷板') {
|
||||
this.previewLoading = true;
|
||||
listCoilTrimStatistics().then(response => {
|
||||
this.liveData = response.data;
|
||||
}).finally(() => {
|
||||
this.previewLoading = false;
|
||||
});
|
||||
}
|
||||
else if (form.statType == '汇总') {
|
||||
this.previewLoading = true;
|
||||
categoryWidthStatistics().then(response => {
|
||||
this.liveData = response.data;
|
||||
}).finally(() => {
|
||||
this.previewLoading = false;
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.$modal.msgError("未知类型");
|
||||
}
|
||||
this.previewLoading = false;
|
||||
},
|
||||
handleSave() {
|
||||
addCoilStatisticsSummary({
|
||||
...this.form,
|
||||
statJson: JSON.stringify(this.liveData)
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.liveData = [];
|
||||
this.form = {};
|
||||
this.$refs.leftList.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const summaryId = row.summaryId || this.ids
|
||||
getCoilStatisticsSummary(summaryId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改钢卷生产统计";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.summaryId != null) {
|
||||
updateCoilStatisticsSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addCoilStatisticsSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const summaryIds = row.summaryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除钢卷生产统计编号为"' + summaryIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delCoilStatisticsSummary(summaryIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/coilStatisticsSummary/export', {
|
||||
...this.queryParams
|
||||
}, `coilStatisticsSummary_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -42,13 +42,14 @@
|
||||
<el-table-column label="发货单名称" align="center" prop="waybillName" />
|
||||
<el-table-column label="车牌" align="center" prop="licensePlate" width="100" />
|
||||
<el-table-column label="收货单位" align="center" prop="consigneeUnit" />
|
||||
<el-table-column label="发货单位" align="center" prop="senderUnit" />
|
||||
<!-- <el-table-column label="发货单位" align="center" prop="senderUnit" /> -->
|
||||
<el-table-column label="订单编号" align="center" prop="orderNo" />
|
||||
<el-table-column label="发货时间" align="center" prop="deliveryTime" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人" align="center" prop="principal" width="60" />
|
||||
<!-- <el-table-column label="负责人电话" align="center" prop="principalPhone" width="100" /> -->
|
||||
<el-table-column label="完成状态" align="center" prop="status" width="120">
|
||||
<template slot-scope="scope">
|
||||
@@ -108,9 +109,9 @@
|
||||
<el-form-item label="负责人" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人电话" prop="principalPhone">
|
||||
<!-- <el-form-item label="负责人电话" prop="principalPhone">
|
||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.domain.vo.dashboard.CoilTrimStatisticsVo;
|
||||
import com.klp.domain.vo.dashboard.CategoryWidthStatisticsVo;
|
||||
import com.klp.service.IWmsMaterialCoilService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
@@ -461,11 +462,21 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
* 冷硬卷切边统计
|
||||
* 按厚度、宽度、切边要求(净边/毛边)统计钢卷数量和重量
|
||||
*/
|
||||
@GetMapping("/trimStatistics")
|
||||
@GetMapping("/statistics/trimStatistics")
|
||||
public R<List<CoilTrimStatisticsVo>> trimStatistics() {
|
||||
return R.ok(iWmsMaterialCoilService.getCoilTrimStatistics());
|
||||
}
|
||||
|
||||
/**
|
||||
* 类别宽度统计
|
||||
* 纵坐标:热轧卷板、冷硬卷、冷轧卷、镀锌钢卷(毛化)、镀锌管料、镀锌钢卷(未光整)
|
||||
* 横坐标:净边1000、1200、1220、1250 + 其他宽度及毛边 + 合计
|
||||
*/
|
||||
@GetMapping("/statistics/categoryWidthStatistics")
|
||||
public R<List<CategoryWidthStatisticsVo>> categoryWidthStatistics() {
|
||||
return R.ok(iWmsMaterialCoilService.getCategoryWidthStatistics());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.klp.domain.vo.dashboard;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CategoryWidthRawVo {
|
||||
private String category;
|
||||
private String width;
|
||||
private String isTrimmed;
|
||||
private BigDecimal totalWeight;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.klp.domain.vo.dashboard;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CategoryWidthStatisticsVo {
|
||||
private String category;
|
||||
private BigDecimal width1000;
|
||||
private BigDecimal width1200;
|
||||
private BigDecimal width1220;
|
||||
private BigDecimal width1250;
|
||||
private BigDecimal otherWidth;
|
||||
private BigDecimal total;
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.klp.domain.vo.dashboard.CoilTrimRawVo;
|
||||
import com.klp.domain.vo.dashboard.CategoryWidthRawVo;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -83,5 +84,7 @@ public interface WmsMaterialCoilMapper extends BaseMapperPlus<WmsMaterialCoilMap
|
||||
List<WmsMaterialCoilDeliveryExportVo> selectDeliveryExportListByCoilIds(@Param("coilIds") java.util.Collection<Long> coilIds);
|
||||
|
||||
List<CoilTrimRawVo> selectCoilTrimStatistics();
|
||||
|
||||
List<CategoryWidthRawVo> selectCategoryWidthStatistics();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.domain.vo.dashboard.CoilTrimStatisticsVo;
|
||||
import com.klp.domain.vo.dashboard.CategoryWidthStatisticsVo;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -217,6 +218,9 @@ public interface IWmsMaterialCoilService {
|
||||
Map<String, Object> cancelSpecialSplit(@NotNull(message = "待操作记录ID不能为空") Long pendingActionId);
|
||||
|
||||
List<CoilTrimStatisticsVo> getCoilTrimStatistics();
|
||||
|
||||
List<CategoryWidthStatisticsVo> getCategoryWidthStatistics();
|
||||
|
||||
WmsMaterialCoilVo returnCoil(@NotNull(message = "钢卷ID不能为空") Long coilId);
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,6 +21,8 @@ import com.klp.domain.vo.*;
|
||||
import com.klp.domain.vo.dashboard.CoilTrimStatisticsVo;
|
||||
import com.klp.domain.vo.dashboard.CoilTrimRawVo;
|
||||
import com.klp.domain.vo.dashboard.TrimWidthStatisticsVo;
|
||||
import com.klp.domain.vo.dashboard.CategoryWidthStatisticsVo;
|
||||
import com.klp.domain.vo.dashboard.CategoryWidthRawVo;
|
||||
import com.klp.domain.WmsCoilPendingAction;
|
||||
import com.klp.domain.bo.WmsCoilPendingActionBo;
|
||||
import com.klp.mapper.*;
|
||||
@@ -4395,5 +4397,60 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CategoryWidthStatisticsVo> getCategoryWidthStatistics() {
|
||||
List<CategoryWidthRawVo> rawList = baseMapper.selectCategoryWidthStatistics();
|
||||
|
||||
Map<String, List<CategoryWidthRawVo>> byCategory = rawList.stream()
|
||||
.collect(Collectors.groupingBy(v -> v.getCategory() == null ? "其他" : v.getCategory()));
|
||||
|
||||
List<CategoryWidthStatisticsVo> result = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, List<CategoryWidthRawVo>> categoryEntry : byCategory.entrySet()) {
|
||||
CategoryWidthStatisticsVo vo = new CategoryWidthStatisticsVo();
|
||||
vo.setCategory(categoryEntry.getKey());
|
||||
|
||||
BigDecimal total = BigDecimal.ZERO;
|
||||
BigDecimal width1000 = BigDecimal.ZERO;
|
||||
BigDecimal width1200 = BigDecimal.ZERO;
|
||||
BigDecimal width1220 = BigDecimal.ZERO;
|
||||
BigDecimal width1250 = BigDecimal.ZERO;
|
||||
BigDecimal otherWidth = BigDecimal.ZERO;
|
||||
|
||||
for (CategoryWidthRawVo raw : categoryEntry.getValue()) {
|
||||
BigDecimal weight = raw.getTotalWeight() == null ? BigDecimal.ZERO : raw.getTotalWeight();
|
||||
String width = raw.getWidth();
|
||||
String isTrimmed = raw.getIsTrimmed();
|
||||
|
||||
if ("净边".equals(isTrimmed)) {
|
||||
if ("1000".equals(width)) {
|
||||
width1000 = width1000.add(weight);
|
||||
} else if ("1200".equals(width)) {
|
||||
width1200 = width1200.add(weight);
|
||||
} else if ("1220".equals(width)) {
|
||||
width1220 = width1220.add(weight);
|
||||
} else if ("1250".equals(width)) {
|
||||
width1250 = width1250.add(weight);
|
||||
} else {
|
||||
otherWidth = otherWidth.add(weight);
|
||||
}
|
||||
} else {
|
||||
otherWidth = otherWidth.add(weight);
|
||||
}
|
||||
total = total.add(weight);
|
||||
}
|
||||
|
||||
vo.setWidth1000(width1000);
|
||||
vo.setWidth1200(width1200);
|
||||
vo.setWidth1220(width1220);
|
||||
vo.setWidth1250(width1250);
|
||||
vo.setOtherWidth(otherWidth);
|
||||
vo.setTotal(total);
|
||||
result.add(vo);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -703,5 +703,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ORDER BY thickness, width, trimmingRequirement
|
||||
</select>
|
||||
|
||||
<!-- 类别宽度统计 -->
|
||||
<select id="selectCategoryWidthStatistics" resultType="com.klp.domain.vo.dashboard.CategoryWidthRawVo">
|
||||
SELECT
|
||||
CASE
|
||||
WHEN rm.raw_material_name LIKE '%热轧卷板%' OR p.product_name LIKE '%热轧卷板%' THEN '热轧卷板'
|
||||
WHEN rm.raw_material_name LIKE '%冷硬卷%' OR p.product_name LIKE '%冷硬卷%' THEN '冷硬卷'
|
||||
WHEN rm.raw_material_name LIKE '%冷轧卷%' OR p.product_name LIKE '%冷轧卷%' THEN '冷轧卷'
|
||||
WHEN rm.raw_material_name LIKE '%镀锌卷%' OR p.product_name LIKE '%镀锌卷%' THEN
|
||||
CASE
|
||||
WHEN mc.business_purpose = '毛化镀锌卷' THEN '镀锌钢卷(毛化)'
|
||||
WHEN mc.business_purpose = '镀锌管料' THEN '镀锌管料'
|
||||
WHEN mc.business_purpose = '镀锌钢卷' THEN '镀锌钢卷(未光整)'
|
||||
ELSE '镀锌卷'
|
||||
END
|
||||
ELSE '其他'
|
||||
END AS category,
|
||||
SUBSTRING_INDEX(COALESCE(rm.specification, p.specification), '*', -1) AS width,
|
||||
CASE
|
||||
WHEN mc.trimming_requirement = '净边' THEN '净边'
|
||||
ELSE '毛边'
|
||||
END AS isTrimmed,
|
||||
COALESCE(SUM(mc.net_weight), 0) AS totalWeight
|
||||
FROM wms_material_coil mc
|
||||
LEFT JOIN wms_raw_material rm ON mc.item_id = rm.raw_material_id AND mc.item_type = 'raw_material'
|
||||
LEFT JOIN wms_product p ON mc.item_id = p.product_id AND mc.item_type = 'product'
|
||||
WHERE mc.del_flag = 0
|
||||
AND mc.data_type = 1
|
||||
AND mc.status = 0
|
||||
AND (
|
||||
rm.raw_material_name LIKE '%热轧卷板%'
|
||||
OR p.product_name LIKE '%热轧卷板%'
|
||||
OR rm.raw_material_name LIKE '%冷硬卷%'
|
||||
OR p.product_name LIKE '%冷硬卷%'
|
||||
OR rm.raw_material_name LIKE '%冷轧卷%'
|
||||
OR p.product_name LIKE '%冷轧卷%'
|
||||
OR rm.raw_material_name LIKE '%镀锌卷%'
|
||||
OR p.product_name LIKE '%镀锌卷%'
|
||||
)
|
||||
GROUP BY category, width, isTrimmed
|
||||
ORDER BY category, isTrimmed, width
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user