feat(wms): 添加冷硬卷板切边统计和类别宽度统计功能
- 新增冷硬卷板切边统计页面和API接口 - 新增类别宽度统计页面和API接口 - 修改发货单页面,调整列显示 - 扩展统计预览功能,支持多种统计类型展示
This commit is contained in:
@@ -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',
|
||||||
|
})
|
||||||
|
}
|
||||||
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>
|
||||||
@@ -1,11 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="perspective">
|
<div class="perspective">
|
||||||
<hot-zha-raw :data="data" />
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import HotZhaRaw from "@/views/wms/coil/panels/Perspective/HotZhaRaw.vue";
|
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 {
|
export default {
|
||||||
name: 'Perspective',
|
name: 'Perspective',
|
||||||
props: {
|
props: {
|
||||||
@@ -13,7 +20,7 @@
|
|||||||
type: Array,
|
type: Array,
|
||||||
default: () => ([])
|
default: () => ([])
|
||||||
},
|
},
|
||||||
type: {
|
statType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
@@ -25,6 +32,8 @@
|
|||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
HotZhaRaw,
|
HotZhaRaw,
|
||||||
|
TrimStatistics,
|
||||||
|
CategoryWidthStatistics,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSave(data) {
|
handleSave(data) {
|
||||||
|
|||||||
@@ -8,18 +8,17 @@
|
|||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<div style="height: calc(100vh - 124px); overflow-y: scroll; overflow-x: hidden;">
|
<div style="height: calc(100vh - 124px); overflow-y: scroll; overflow-x: hidden;">
|
||||||
<div v-if="currentRow.summaryId">
|
<div v-if="currentRow.summaryId">
|
||||||
<Preview :data="currentRow.statJson" />
|
<Preview :data="currentRow.statJson" :statType="currentRow.statType" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div>钢卷生产统计详情</div>
|
<div>钢卷生产统计详情</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-dialog v-loading="previewLoading" title="效果预览" :visible.sync="previewOpen" width="800px" append-to-body>
|
<el-dialog v-loading="previewLoading" title="效果预览" :visible.sync="previewOpen" width="100vw" fullscreen append-to-body>
|
||||||
<Preview :data="liveData" />
|
<Preview :data="liveData" :statType="form.statType" />
|
||||||
<el-button type="primary" @click="handleSave">保存</el-button>
|
<el-button type="primary" @click="handleSave">保存</el-button>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,6 +30,7 @@ import LeftList from "./components/LeftList.vue";
|
|||||||
import Preview from "@/views/wms/coil/panels/Perspective/index.vue";
|
import Preview from "@/views/wms/coil/panels/Perspective/index.vue";
|
||||||
|
|
||||||
import { listRawMaterialPerspective } from "@/api/wms/rawMaterial";
|
import { listRawMaterialPerspective } from "@/api/wms/rawMaterial";
|
||||||
|
import { listCoilTrimStatistics, categoryWidthStatistics } from "@/api/wms/coil";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CoilStatisticsSummary",
|
name: "CoilStatisticsSummary",
|
||||||
@@ -74,7 +74,7 @@ export default {
|
|||||||
},
|
},
|
||||||
previewLoading: false,
|
previewLoading: false,
|
||||||
previewOpen: false,
|
previewOpen: false,
|
||||||
liveData: {},
|
liveData: [],
|
||||||
currentRow: {},
|
currentRow: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -162,7 +162,26 @@ export default {
|
|||||||
this.previewLoading = false;
|
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() {
|
handleSave() {
|
||||||
addCoilStatisticsSummary({
|
addCoilStatisticsSummary({
|
||||||
|
|||||||
@@ -42,13 +42,14 @@
|
|||||||
<el-table-column label="发货单名称" align="center" prop="waybillName" />
|
<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="licensePlate" width="100" />
|
||||||
<el-table-column label="收货单位" align="center" prop="consigneeUnit" />
|
<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">
|
<el-table-column label="发货时间" align="center" prop="deliveryTime" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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="principalPhone" width="100" /> -->
|
||||||
<el-table-column label="完成状态" align="center" prop="status" width="120">
|
<el-table-column label="完成状态" align="center" prop="status" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -108,9 +109,9 @@
|
|||||||
<el-form-item label="负责人" prop="principal">
|
<el-form-item label="负责人" prop="principal">
|
||||||
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="负责人电话" prop="principalPhone">
|
<!-- <el-form-item label="负责人电话" prop="principalPhone">
|
||||||
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" />
|
<el-input v-model="form.principalPhone" placeholder="请输入负责人电话" />
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user