Merge remote-tracking branch 'gitee/0.8.X' into 0.8.X

# Conflicts:
#	klp-ui/src/views/wms/coil/panels/LabelRender/ProductionTagPreview.vue
This commit is contained in:
2026-01-09 20:10:45 +08:00
7 changed files with 454 additions and 21 deletions

View File

@@ -163,4 +163,15 @@ export function listCoilOperation({coilIds, planId}) {
pageSize: 1000
}
})
}
// 钢卷导出
export function exportCoilData(coilIds) {
return request({
url: '/wms/materialCoil/export',
method: 'post',
data: {
coilIds
}
})
}

View File

@@ -4,13 +4,13 @@
<!-- 调整第一行结构左侧内容扩大右侧二维码减小边距 -->
<tr>
<td colspan="2" style="padding: 0; width: 50%;">
<div
<div
style="
display: flex;
display: flex;
height: 100%;
align-items: space-evenly;
text-align: center;
justify-content: space-evenly;
align-items: space-evenly;
text-align: center;
justify-content: space-evenly;
flex-direction: column;
font-size: 13px;
">
@@ -137,11 +137,11 @@ export default {
// 使用 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();
@@ -177,41 +177,41 @@ export default {
this.$nextTick(() => {
const container = this.$el;
if (!container) return;
// 纸张尺寸180mm x 100mm
const dpi = 96; // 标准 DPI
const mmToPx = dpi / 25.4; // 1mm = 3.779527559px
const paperWidthMm = this.paperWidthMm || 100;
const paperHeightMm = this.paperHeightMm || 80;
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`);
@@ -320,15 +320,15 @@ export default {
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, 100mm) !important;
max-height: var(--paper-height, 80mm) !important;
overflow: hidden !important;
}
}
</style>
</style>

View File

@@ -278,8 +278,6 @@ import MutiSelect from "@/components/MutiSelect";
import html2canvas from 'html2canvas';
import { PDFDocument } from 'pdf-lib';
export default {
name: "MaterialCoil",
components: {

View File

@@ -199,6 +199,9 @@
<ActualWarehouseSelect v-model="item.actualWarehouseId" placeholder="请选择真实库区" block
:disabled="readonly" />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="item.remark" placeholder="请输入备注" :disabled="readonly"/>
</el-form-item>
</el-form>
</div>
</div>

View File

@@ -0,0 +1,114 @@
<template>
<div class="app-container" v-loading="loading">
<el-row>
<!-- 筛选区 -->
开始时间<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"></el-date-picker>
结束时间<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择结束时间"></el-date-picker>
<el-button type="primary" style="margin-left: 10px;" @click="getList">查询</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</el-row>
<el-descriptions title="统计信息" :column="3" border>
<el-descriptions-item label="总钢卷数量">{{ summary.totalCount }}</el-descriptions-item>
<el-descriptions-item label="总重">{{ summary.totalWeight }}t</el-descriptions-item>
<el-descriptions-item label="均重">{{ summary.avgWeight }}t</el-descriptions-item>
</el-descriptions>
<el-descriptions title="明细信息" :column="3" border>
</el-descriptions>
<el-table :data="list" border height="calc(100vh - 320px)">
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
<template slot-scope="scope">
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
</template>
</el-table-column>
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
<template slot-scope="scope">
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
</template>
</el-table-column>
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
<el-table-column label="产品类型" align="center" width="250">
<template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
</template>
</el-table-column>
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
<el-table-column label="长度 (米)" align="center" prop="length" />
<el-table-column label="发货时间" align="center" prop="exportTime" />
<el-table-column label="更新人" align="center" prop="updateByName" />
</el-table>
</div>
</template>
<script>
import { listMaterialCoil } from "@/api/wms/coil";
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
export default {
components: {
ProductInfo,
RawMaterialInfo,
CoilNo,
},
data() {
// 获取昨天0点到今天0点的时间范围
const now = new Date()
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
const startTime = now.toISOString().slice(0, 10) + ' 00:00:00'
const endTime = now.toISOString().slice(0, 10) + ' 23:59:59'
return {
list: [],
queryParams: {
pageNum: 1,
pageSize: 9999,
status: 1,
startTime: startTime,
endTime: endTime,
},
loading: false,
}
},
computed: {
summary() {
// 总钢卷数量、总重、均重
const totalCount = this.list.length
const totalWeight = this.list.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0)
const avgWeight = totalCount > 0 ? (totalWeight / totalCount).toFixed(2) : 0
return {
totalCount,
totalWeight: totalWeight.toFixed(2),
avgWeight,
}
}
},
methods: {
getList() {
this.loading = true
listMaterialCoil({
...this.queryParams
}).then(res => {
this.list = res.rows
this.loading = false
})
},
// 导出
exportData() {
this.download('wms/materialCoil/export', {
coilIds: this.list.map(item => item.coilId).join(',')
}, `materialCoil_${new Date().getTime()}.xlsx`)
},
},
mounted() {
this.getList()
}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,136 @@
<template>
<div class="app-container" v-loading="loading">
<el-row>
<!-- 筛选区 -->
开始时间<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"></el-date-picker>
结束时间<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择结束时间"></el-date-picker>
<el-button type="primary" style="margin-left: 10px;" @click="getList">查询</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</el-row>
<el-descriptions title="统计信息" :column="3" border>
<el-descriptions-item label="总钢卷数量">{{ summary.totalCount }}</el-descriptions-item>
<el-descriptions-item label="总重">{{ summary.totalWeight }}t</el-descriptions-item>
<el-descriptions-item label="均重">{{ summary.avgWeight }}t</el-descriptions-item>
</el-descriptions>
<el-descriptions title="明细信息" :column="3" border>
</el-descriptions>
<el-table :data="list" border height="calc(100vh - 320px)">
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
<template slot-scope="scope">
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
</template>
</el-table-column>
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
<template slot-scope="scope">
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
</template>
</el-table-column>
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
<el-table-column label="产品类型" align="center" width="250">
<template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
</template>
</el-table-column>
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
<el-table-column label="长度 (米)" align="center" prop="length" />
<el-table-column label="更新人" align="center" prop="updateByName" />
</el-table>
</div>
</template>
<script>
import { listMaterialCoil } from "@/api/wms/coil";
import {
listPendingAction,
} from '@/api/wms/pendingAction';
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
export default {
components: {
ProductInfo,
RawMaterialInfo,
CoilNo,
},
data() {
// 获取昨天0点到今天0点的时间范围
const now = new Date()
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
const startTime = now.toISOString().slice(0, 10) + ' 00:00:00'
const endTime = now.toISOString().slice(0, 10) + ' 23:59:59'
return {
list: [],
queryParams: {
pageNum: 1,
pageSize: 9999,
status: 1,
startTime: startTime,
endTime: endTime,
},
loading: false,
}
},
computed: {
summary() {
// 总钢卷数量、总重、均重
const totalCount = this.list.length
const totalWeight = this.list.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0)
const avgWeight = totalCount > 0 ? (totalWeight / totalCount).toFixed(2) : 0
return {
totalCount,
totalWeight: totalWeight.toFixed(2),
avgWeight,
}
}
},
methods: {
getList() {
this.loading = true
listPendingAction({
// actionStatus: 2,
actionType: 401,
pageSize: 999,
pageNum: 1,
startTime: this.queryParams.startTime,
endTime: this.queryParams.endTime,
}).then(res => {
const actions = res.rows
const coilIds = actions.map(item => item.coilId).join(',')
console.log(coilIds)
if (!coilIds) {
this.$message({
message: '暂无数据',
type: 'warning',
})
this.loading = false
return
}
listMaterialCoil({
coilIds: coilIds,
}).then(res => {
this.list = res.rows
this.loading = false
})
})
},
// 导出
exportData() {
this.download('wms/materialCoil/export', {
coilIds: this.list.map(item => item.coilId).join(',')
}, `materialCoil_${new Date().getTime()}.xlsx`)
},
},
mounted() {
this.getList()
}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,171 @@
<template>
<div class="app-container" v-loading="loading">
<el-row>
<!-- 筛选区 -->
开始时间<el-date-picker v-model="queryParams.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"></el-date-picker>
结束时间<el-date-picker v-model="queryParams.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择结束时间"></el-date-picker>
<el-button type="primary" style="margin-left: 10px;" @click="getList">查询</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</el-row>
<el-descriptions title="统计信息" :column="3" border>
<el-descriptions-item label="总钢卷数量">{{ summary.totalCount }}</el-descriptions-item>
<el-descriptions-item label="总重">{{ summary.totalWeight }}t</el-descriptions-item>
<el-descriptions-item label="均重">{{ summary.avgWeight }}t</el-descriptions-item>
</el-descriptions>
<el-descriptions title="明细信息" :column="3" border>
</el-descriptions>
<el-table :data="list" border height="calc(100vh - 320px)">
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
<template slot-scope="scope">
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
</template>
</el-table-column>
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
<template slot-scope="scope">
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
</template>
</el-table-column>
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
<el-table-column label="产品类型" align="center" width="250">
<template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
</template>
</el-table-column>
<el-table-column label="长度 (米)" align="center" prop="length" />
<el-table-column label="更新人" align="center" prop="updateByName" />
</el-table>
</div>
</template>
<script>
import { listMaterialCoil } from "@/api/wms/coil";
import {
listPendingAction,
} from '@/api/wms/pendingAction';
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
export default {
components: {
ProductInfo,
RawMaterialInfo,
CoilNo,
},
data() {
// 获取昨天0点到今天0点的时间范围
const now = new Date()
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
const startTime = now.toISOString().slice(0, 10) + ' 00:00:00'
const endTime = now.toISOString().slice(0, 10) + ' 23:59:59'
return {
list: [],
queryParams: {
pageNum: 1,
pageSize: 9999,
status: 1,
startTime: startTime,
endTime: endTime,
},
loading: false,
}
},
computed: {
summary() {
// 总钢卷数量、总重、均重
const totalCount = this.list.length
const totalWeight = this.list.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0)
const avgWeight = totalCount > 0 ? (totalWeight / totalCount).toFixed(2) : 0
return {
totalCount,
totalWeight: totalWeight.toFixed(2),
avgWeight,
}
}
},
methods: {
getList() {
this.loading = true
Promise.all([
// 酸连轧成品库
listMaterialCoil({
startTime: this.queryParams.startTime,
endTime: this.queryParams.endTime,
pageSize: 9999,
pageNum: 1,
dataType: 1,
createBy: 'suanzhakuguan',
warehouseId: '1988150099140866050'
}),
// 镀锌原料库
listMaterialCoil({
startTime: this.queryParams.startTime,
endTime: this.queryParams.endTime,
pageSize: 9999,
pageNum: 1,
dataType: 1,
createBy: 'suanzhakuguan',
warehouseId: '1988150263284953089'
}),
// 脱脂原料库
listMaterialCoil({
startTime: this.queryParams.startTime,
endTime: this.queryParams.endTime,
pageSize: 9999,
pageNum: 1,
dataType: 1,
createBy: 'suanzhakuguan',
warehouseId: '1988150545175736322'
}),
]).then(([res1, res2, res3]) => {
console.log(res1, res2, res3)
this.list = [...res1.rows, ...res2.rows, ...res3.rows]
this.loading = false
})
// listPendingAction({
// // actionStatus: 2,
// actionType: 11,
// pageSize: 999,
// pageNum: 1,
// startTime: this.queryParams.startTime,
// endTime: this.queryParams.endTime,
// }).then(res => {
// const actions = res.rows
// const coilIds = actions.map(item => item.coilId).join(',')
// console.log(coilIds)
// if (!coilIds) {
// this.$message({
// message: '暂无数据',
// type: 'warning',
// })
// this.loading = false
// return
// }
// listMaterialCoil({
// coilIds: coilIds,
// }).then(res => {
// this.list = res.rows
// this.loading = false
// })
// })
},
// 导出
exportData() {
this.download('wms/materialCoil/export', {
coilIds: this.list.map(item => item.coilId).join(',')
}, `materialCoil_${new Date().getTime()}.xlsx`)
},
},
mounted() {
this.getList()
}
}
</script>
<style scoped></style>