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:
@@ -163,4 +163,15 @@ export function listCoilOperation({coilIds, planId}) {
|
|||||||
pageSize: 1000
|
pageSize: 1000
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 钢卷导出
|
||||||
|
export function exportCoilData(coilIds) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/materialCoil/export',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
coilIds
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,13 @@
|
|||||||
<!-- 调整第一行结构,左侧内容扩大,右侧二维码减小边距 -->
|
<!-- 调整第一行结构,左侧内容扩大,右侧二维码减小边距 -->
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" style="padding: 0; width: 50%;">
|
<td colspan="2" style="padding: 0; width: 50%;">
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
align-items: space-evenly;
|
align-items: space-evenly;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
">
|
">
|
||||||
@@ -137,11 +137,11 @@ export default {
|
|||||||
// 使用 matchMedia 监听打印状态(更可靠)
|
// 使用 matchMedia 监听打印状态(更可靠)
|
||||||
this.printMediaQuery = window.matchMedia('print');
|
this.printMediaQuery = window.matchMedia('print');
|
||||||
this.printMediaQuery.addListener(this.handlePrintMediaChange);
|
this.printMediaQuery.addListener(this.handlePrintMediaChange);
|
||||||
|
|
||||||
// 监听打印事件作为备用
|
// 监听打印事件作为备用
|
||||||
window.addEventListener('beforeprint', this.handleBeforePrint);
|
window.addEventListener('beforeprint', this.handleBeforePrint);
|
||||||
window.addEventListener('afterprint', this.handleAfterPrint);
|
window.addEventListener('afterprint', this.handleAfterPrint);
|
||||||
|
|
||||||
// 计算初始缩放比例
|
// 计算初始缩放比例
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.calculatePrintScale();
|
this.calculatePrintScale();
|
||||||
@@ -177,41 +177,41 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const container = this.$el;
|
const container = this.$el;
|
||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|
||||||
// 纸张尺寸:180mm x 100mm
|
// 纸张尺寸:180mm x 100mm
|
||||||
const dpi = 96; // 标准 DPI
|
const dpi = 96; // 标准 DPI
|
||||||
const mmToPx = dpi / 25.4; // 1mm = 3.779527559px
|
const mmToPx = dpi / 25.4; // 1mm = 3.779527559px
|
||||||
|
|
||||||
const paperWidthMm = this.paperWidthMm || 100;
|
const paperWidthMm = this.paperWidthMm || 100;
|
||||||
const paperHeightMm = this.paperHeightMm || 80;
|
const paperHeightMm = this.paperHeightMm || 80;
|
||||||
const marginMm = 2;
|
const marginMm = 2;
|
||||||
|
|
||||||
const paperWidthPx = paperWidthMm * mmToPx;
|
const paperWidthPx = paperWidthMm * mmToPx;
|
||||||
const paperHeightPx = paperHeightMm * mmToPx;
|
const paperHeightPx = paperHeightMm * mmToPx;
|
||||||
const marginPx = marginMm * mmToPx;
|
const marginPx = marginMm * mmToPx;
|
||||||
|
|
||||||
// 获取内容实际尺寸
|
// 获取内容实际尺寸
|
||||||
const rect = container.getBoundingClientRect();
|
const rect = container.getBoundingClientRect();
|
||||||
let contentWidth = rect.width;
|
let contentWidth = rect.width;
|
||||||
let contentHeight = rect.height;
|
let contentHeight = rect.height;
|
||||||
|
|
||||||
// 如果尺寸为0或无效,尝试使用 scrollWidth/scrollHeight
|
// 如果尺寸为0或无效,尝试使用 scrollWidth/scrollHeight
|
||||||
if (contentWidth === 0 || contentHeight === 0) {
|
if (contentWidth === 0 || contentHeight === 0) {
|
||||||
contentWidth = container.scrollWidth || contentWidth;
|
contentWidth = container.scrollWidth || contentWidth;
|
||||||
contentHeight = container.scrollHeight || contentHeight;
|
contentHeight = container.scrollHeight || contentHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算可用空间(减去边距)
|
// 计算可用空间(减去边距)
|
||||||
const availableWidth = paperWidthPx - marginPx * 2;
|
const availableWidth = paperWidthPx - marginPx * 2;
|
||||||
const availableHeight = paperHeightPx - marginPx * 2;
|
const availableHeight = paperHeightPx - marginPx * 2;
|
||||||
|
|
||||||
// 计算缩放比例
|
// 计算缩放比例
|
||||||
const scaleX = contentWidth > 0 ? availableWidth / contentWidth : 1;
|
const scaleX = contentWidth > 0 ? availableWidth / contentWidth : 1;
|
||||||
const scaleY = contentHeight > 0 ? availableHeight / contentHeight : 1;
|
const scaleY = contentHeight > 0 ? availableHeight / contentHeight : 1;
|
||||||
|
|
||||||
// 取较小的缩放比例,确保内容完全适配(不超过1,不放大)
|
// 取较小的缩放比例,确保内容完全适配(不超过1,不放大)
|
||||||
this.printScale = Math.min(scaleX, scaleY, 1);
|
this.printScale = Math.min(scaleX, scaleY, 1);
|
||||||
|
|
||||||
// 设置CSS变量和内联样式
|
// 设置CSS变量和内联样式
|
||||||
container.style.setProperty('--print-scale', this.printScale);
|
container.style.setProperty('--print-scale', this.printScale);
|
||||||
container.style.setProperty('--paper-width', `${paperWidthMm}mm`);
|
container.style.setProperty('--paper-width', `${paperWidthMm}mm`);
|
||||||
@@ -320,15 +320,15 @@ export default {
|
|||||||
break-before: avoid !important;
|
break-before: avoid !important;
|
||||||
orphans: 999 !important;
|
orphans: 999 !important;
|
||||||
widows: 999 !important;
|
widows: 999 !important;
|
||||||
|
|
||||||
/* 应用动态缩放,保持原有样式 */
|
/* 应用动态缩放,保持原有样式 */
|
||||||
transform: scale(var(--print-scale, 1)) !important;
|
transform: scale(var(--print-scale, 1)) !important;
|
||||||
transform-origin: top left !important;
|
transform-origin: top left !important;
|
||||||
|
|
||||||
/* 确保缩放后不超出纸张 */
|
/* 确保缩放后不超出纸张 */
|
||||||
max-width: var(--paper-width, 100mm) !important;
|
max-width: var(--paper-width, 100mm) !important;
|
||||||
max-height: var(--paper-height, 80mm) !important;
|
max-height: var(--paper-height, 80mm) !important;
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -278,8 +278,6 @@ import MutiSelect from "@/components/MutiSelect";
|
|||||||
import html2canvas from 'html2canvas';
|
import html2canvas from 'html2canvas';
|
||||||
import { PDFDocument } from 'pdf-lib';
|
import { PDFDocument } from 'pdf-lib';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MaterialCoil",
|
name: "MaterialCoil",
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -199,6 +199,9 @@
|
|||||||
<ActualWarehouseSelect v-model="item.actualWarehouseId" placeholder="请选择真实库区" block
|
<ActualWarehouseSelect v-model="item.actualWarehouseId" placeholder="请选择真实库区" block
|
||||||
:disabled="readonly" />
|
:disabled="readonly" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="item.remark" placeholder="请输入备注" :disabled="readonly"/>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
114
klp-ui/src/views/wms/report/delivery.vue
Normal file
114
klp-ui/src/views/wms/report/delivery.vue
Normal 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>
|
||||||
136
klp-ui/src/views/wms/report/receive.vue
Normal file
136
klp-ui/src/views/wms/report/receive.vue
Normal 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>
|
||||||
171
klp-ui/src/views/wms/report/zha.vue
Normal file
171
klp-ui/src/views/wms/report/zha.vue
Normal 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>
|
||||||
Reference in New Issue
Block a user