feat(wms/annealPerformance): 新增加工前钢卷列表查询功能
重构退火性能报表页面,增加双标签页切换,分别展示退火后和加工前钢卷数据,新增加工前钢卷查询接口调用和对应的查询、统计、表格展示逻辑
This commit is contained in:
@@ -8,3 +8,12 @@ export function getAnnealPerformance(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询退火计划中的加工前钢卷列表
|
||||||
|
export function getAnnealRawCoils(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/anneal/performance/rawCoils',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container" v-loading="loading">
|
<div class="app-container" v-loading="loading">
|
||||||
|
<!-- <el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
||||||
|
<el-tab-pane label="退火后" name="processed" />
|
||||||
|
<el-tab-pane label="加工前" name="raw" />
|
||||||
|
</el-tabs> -->
|
||||||
|
|
||||||
|
<!-- ========== 退火后 ========== -->
|
||||||
|
<template v-if="activeTab === 'processed'">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="90px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="90px">
|
||||||
<el-form-item label="时间">
|
<el-form-item label="时间">
|
||||||
<time-range-picker v-model="timeRangeParams" start-key="startTime" end-key="endTime"
|
<time-range-picker v-model="timeRangeParams" start-key="startTime" end-key="endTime"
|
||||||
@@ -65,11 +72,48 @@
|
|||||||
<el-table-column label="当前钢卷号" prop="currentCoilNo" align="center" />
|
<el-table-column label="当前钢卷号" prop="currentCoilNo" align="center" />
|
||||||
<el-table-column label="重量(t)" prop="netWeight" align="center" />
|
<el-table-column label="重量(t)" prop="netWeight" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- ========== 加工前 ========== -->
|
||||||
|
<template v-if="activeTab === 'raw'">
|
||||||
|
<el-form :model="rawQueryParams" ref="rawQueryForm" size="small" :inline="true" label-width="90px">
|
||||||
|
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||||
|
<el-input v-model="rawQueryParams.enterCoilNo" placeholder="请输入入场钢卷号" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="当前钢卷号" prop="currentCoilNo">
|
||||||
|
<el-input v-model="rawQueryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="逻辑库区" prop="warehouseId">
|
||||||
|
<WarehouseSelect v-model="rawQueryParams.warehouseId" placeholder="请选择" clearable filterable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetRawQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-descriptions title="统计信息" :column="2" class="summary-block" border>
|
||||||
|
<el-descriptions-item label="钢卷数量">{{ rawSummary.coilCount || 0 }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="总重量">{{ rawSummary.totalWeight || 0 }} t</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
|
||||||
|
<el-table :data="rawDetailList" border height="calc(100vh - 330px)">
|
||||||
|
<el-table-column label="入场钢卷号" prop="enterCoilNo" align="center" width="140" />
|
||||||
|
<el-table-column label="当前钢卷号" prop="currentCoilNo" align="center" width="140" />
|
||||||
|
<el-table-column label="物料名称" prop="itemName" align="center" />
|
||||||
|
<el-table-column label="物料编码" prop="itemCode" align="center" />
|
||||||
|
<el-table-column label="规格" prop="specification" align="center" />
|
||||||
|
<el-table-column label="材质" prop="material" align="center" />
|
||||||
|
<el-table-column label="锌层" prop="zincLayer" align="center" />
|
||||||
|
<el-table-column label="重量(t)" prop="netWeight" align="center" />
|
||||||
|
<el-table-column label="逻辑库区" prop="warehouseName" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getAnnealPerformance } from "@/api/wms/annealPerformance";
|
import { getAnnealPerformance, getAnnealRawCoils } from "@/api/wms/annealPerformance";
|
||||||
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
import { listAnnealFurnace } from "@/api/wms/annealFurnace";
|
||||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||||
@@ -96,7 +140,9 @@ export default {
|
|||||||
return `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')} 00:00:00`;
|
return `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')} 00:00:00`;
|
||||||
})()
|
})()
|
||||||
return {
|
return {
|
||||||
|
activeTab: 'processed',
|
||||||
loading: false,
|
loading: false,
|
||||||
|
// 退火后查询参数
|
||||||
timeRangeParams: {
|
timeRangeParams: {
|
||||||
startTime,
|
startTime,
|
||||||
endTime,
|
endTime,
|
||||||
@@ -114,6 +160,14 @@ export default {
|
|||||||
summary: {},
|
summary: {},
|
||||||
detailList: [],
|
detailList: [],
|
||||||
furnaceOptions: [],
|
furnaceOptions: [],
|
||||||
|
// 加工前查询参数
|
||||||
|
rawQueryParams: {
|
||||||
|
enterCoilNo: undefined,
|
||||||
|
currentCoilNo: undefined,
|
||||||
|
warehouseId: undefined,
|
||||||
|
},
|
||||||
|
rawSummary: {},
|
||||||
|
rawDetailList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -138,26 +192,42 @@ export default {
|
|||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getAnnealPerformance(this.queryParams).then(response => {
|
if (this.activeTab === 'raw') {
|
||||||
const data = response.data || {};
|
getAnnealRawCoils(this.rawQueryParams).then(response => {
|
||||||
this.summary = data.summary || {};
|
const list = response.data || [];
|
||||||
this.detailList = data.details.map(item => {
|
this.rawDetailList = list;
|
||||||
return item.coils?.map(coil => {
|
this.rawSummary = {
|
||||||
return {
|
coilCount: list.length,
|
||||||
...item,
|
totalWeight: list.reduce((s, r) => s + Number(r.netWeight || 0), 0).toFixed(3),
|
||||||
...coil,
|
};
|
||||||
}
|
|
||||||
}) || []
|
|
||||||
}).flat();
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
getAnnealPerformance(this.queryParams).then(response => {
|
||||||
|
const data = response.data || {};
|
||||||
|
this.summary = data.summary || {};
|
||||||
|
this.detailList = (data.details || []).map(item => {
|
||||||
|
return item.coil ? { ...item, ...item.coil } : item;
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleTabClick() {
|
||||||
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
resetRawQuery() {
|
||||||
|
this.resetForm("rawQueryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
exportData() {
|
exportData() {
|
||||||
this.download('/wms/materialCoil/exportAnneal', {
|
this.download('/wms/materialCoil/exportAnneal', {
|
||||||
coilIds: this.detailList.map(item => item.coilId).join(','),
|
coilIds: this.detailList.map(item => item.coilId).join(','),
|
||||||
|
|||||||
Reference in New Issue
Block a user