refactor(wms/report): 重构报表页面,提取公共组件和逻辑
将多个报表页面的公共逻辑提取到模板组件中,包括: 1. 创建out.vue和loss.vue作为基础模板 2. 重构zha.vue、zinc.vue等页面使用模板组件 3. 统一处理规格解析逻辑,添加宽度和厚度显示列 4. 优化仓库选择和查询参数处理
This commit is contained in:
@@ -108,12 +108,14 @@
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="250">
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<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="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
@@ -259,8 +261,24 @@ export default {
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: lossIds.join(',') || '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '' }),
|
||||
]);
|
||||
this.lossList = lossRes.rows;
|
||||
this.outList = outRes.rows;
|
||||
this.lossList = lossRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
});
|
||||
this.outList = outRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
});
|
||||
this.loading = false;
|
||||
},
|
||||
// 导出
|
||||
|
||||
Reference in New Issue
Block a user