Merge branch '0.9X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.9X
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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
10
klp-ui/src/api/wms/coilChangeLog.js
Normal file
10
klp-ui/src/api/wms/coilChangeLog.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 根据钢卷ID查询钢卷变更日志
|
||||||
|
export function getCoilChangeLogByCoilId(coilId) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/coilChangeLog/byCoilId/' + coilId,
|
||||||
|
method: 'get',
|
||||||
|
timeout: 100000
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -75,10 +75,11 @@
|
|||||||
<el-option label="原料" value="raw_material" />
|
<el-option label="原料" value="raw_material" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="发货状态">
|
<el-form-item label="钢卷状态">
|
||||||
<el-select v-model="productCoilBo.status" placeholder="全部" clearable style="width: 100px;">
|
<el-select v-model="productCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleProductCoilStatusChange">
|
||||||
<el-option label="在库" :value="0" />
|
<el-option label="在库" value="in_stock" />
|
||||||
<el-option label="已发货" :value="1" />
|
<el-option label="已发货" value="shipped" />
|
||||||
|
<el-option label="历史卷" value="history" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="质量状态">
|
<el-form-item label="质量状态">
|
||||||
@@ -134,10 +135,11 @@
|
|||||||
<el-option label="原料" value="raw_material" />
|
<el-option label="原料" value="raw_material" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="发货状态">
|
<el-form-item label="钢卷状态">
|
||||||
<el-select v-model="deliveryCoilBo.status" placeholder="全部" clearable style="width: 100px;">
|
<el-select v-model="deliveryCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleDeliveryCoilStatusChange">
|
||||||
<el-option label="在库" :value="0" />
|
<el-option label="在库" value="in_stock" />
|
||||||
<el-option label="已发货" :value="1" />
|
<el-option label="已发货" value="shipped" />
|
||||||
|
<el-option label="历史卷" value="history" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="质量状态">
|
<el-form-item label="质量状态">
|
||||||
@@ -417,7 +419,7 @@ export default {
|
|||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
pageNum: this.productPagination.currentPage,
|
pageNum: this.productPagination.currentPage,
|
||||||
pageSize: this.productPagination.pageSize,
|
pageSize: this.productPagination.pageSize,
|
||||||
...this.productCoilBo
|
coilBo: this.productCoilBo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.productCoilList = res.rows || [];
|
this.productCoilList = res.rows || [];
|
||||||
this.productPagination.total = res.total || 0;
|
this.productPagination.total = res.total || 0;
|
||||||
@@ -431,7 +433,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchProductCoilStatistics() {
|
fetchProductCoilStatistics() {
|
||||||
getProductCoilsStatisticsByContract({ ...this.productCoilBo, orderId: this.orderId }).then(res => {
|
getProductCoilsStatisticsByContract({ orderId: this.orderId, coilBo: this.productCoilBo }).then(res => {
|
||||||
this.productCoilStatistics = res.data || {};
|
this.productCoilStatistics = res.data || {};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -445,6 +447,21 @@ export default {
|
|||||||
this.productCoilBo = {};
|
this.productCoilBo = {};
|
||||||
this.handleProductFilter();
|
this.handleProductFilter();
|
||||||
},
|
},
|
||||||
|
handleProductCoilStatusChange(val) {
|
||||||
|
if (val === 'in_stock') {
|
||||||
|
this.productCoilBo.status = 0;
|
||||||
|
this.productCoilBo.dataType = 1;
|
||||||
|
} else if (val === 'shipped') {
|
||||||
|
this.productCoilBo.status = 1;
|
||||||
|
this.productCoilBo.dataType = undefined;
|
||||||
|
} else if (val === 'history') {
|
||||||
|
this.productCoilBo.status = 0;
|
||||||
|
this.productCoilBo.dataType = 0;
|
||||||
|
} else {
|
||||||
|
this.productCoilBo.status = undefined;
|
||||||
|
this.productCoilBo.dataType = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
handleDeliveryFilter() {
|
handleDeliveryFilter() {
|
||||||
this.deliveryCoilBo.selectType = this.deliveryCoilBo.itemType || '';
|
this.deliveryCoilBo.selectType = this.deliveryCoilBo.itemType || '';
|
||||||
this.deliveryPagination.currentPage = 1;
|
this.deliveryPagination.currentPage = 1;
|
||||||
@@ -455,6 +472,21 @@ export default {
|
|||||||
this.deliveryCoilBo = {};
|
this.deliveryCoilBo = {};
|
||||||
this.handleDeliveryFilter();
|
this.handleDeliveryFilter();
|
||||||
},
|
},
|
||||||
|
handleDeliveryCoilStatusChange(val) {
|
||||||
|
if (val === 'in_stock') {
|
||||||
|
this.deliveryCoilBo.status = 0;
|
||||||
|
this.deliveryCoilBo.dataType = 1;
|
||||||
|
} else if (val === 'shipped') {
|
||||||
|
this.deliveryCoilBo.status = 1;
|
||||||
|
this.deliveryCoilBo.dataType = undefined;
|
||||||
|
} else if (val === 'history') {
|
||||||
|
this.deliveryCoilBo.status = 0;
|
||||||
|
this.deliveryCoilBo.dataType = 0;
|
||||||
|
} else {
|
||||||
|
this.deliveryCoilBo.status = undefined;
|
||||||
|
this.deliveryCoilBo.dataType = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
handleProductPageChange({ currentPage, pageSize }) {
|
handleProductPageChange({ currentPage, pageSize }) {
|
||||||
this.productPagination.currentPage = currentPage;
|
this.productPagination.currentPage = currentPage;
|
||||||
this.productPagination.pageSize = pageSize;
|
this.productPagination.pageSize = pageSize;
|
||||||
|
|||||||
@@ -93,10 +93,11 @@
|
|||||||
<el-option label="原料" value="raw_material" />
|
<el-option label="原料" value="raw_material" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="发货状态">
|
<el-form-item label="钢卷状态">
|
||||||
<el-select v-model="productCoilBo.status" placeholder="全部" clearable style="width: 100px;">
|
<el-select v-model="productCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleCoilStatusChange">
|
||||||
<el-option label="在库" :value="0" />
|
<el-option label="在库" value="in_stock" />
|
||||||
<el-option label="已发货" :value="1" />
|
<el-option label="已发货" value="shipped" />
|
||||||
|
<el-option label="历史卷" value="history" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="质量状态">
|
<el-form-item label="质量状态">
|
||||||
@@ -144,6 +145,13 @@
|
|||||||
<el-option label="原料" value="raw_material" />
|
<el-option label="原料" value="raw_material" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="钢卷状态">
|
||||||
|
<el-select v-model="deliveryCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleDeliveryCoilStatusChange">
|
||||||
|
<el-option label="在库" value="in_stock" />
|
||||||
|
<el-option label="已发货" value="shipped" />
|
||||||
|
<el-option label="历史卷" value="history" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="质量状态">
|
<el-form-item label="质量状态">
|
||||||
<muti-select v-model="deliveryCoilBo.qualityStatusCsv" :options="dict.type.coil_quality_status" placeholder="请选择品质" clearable style="width: 160px;" />
|
<muti-select v-model="deliveryCoilBo.qualityStatusCsv" :options="dict.type.coil_quality_status" placeholder="请选择品质" clearable style="width: 160px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -470,6 +478,36 @@ export default {
|
|||||||
this.productCoilBo = {};
|
this.productCoilBo = {};
|
||||||
this.handleProductFilter();
|
this.handleProductFilter();
|
||||||
},
|
},
|
||||||
|
handleCoilStatusChange(val) {
|
||||||
|
if (val === 'in_stock') {
|
||||||
|
this.productCoilBo.status = 0;
|
||||||
|
this.productCoilBo.dataType = 1;
|
||||||
|
} else if (val === 'shipped') {
|
||||||
|
this.productCoilBo.status = 1;
|
||||||
|
this.productCoilBo.dataType = undefined;
|
||||||
|
} else if (val === 'history') {
|
||||||
|
this.productCoilBo.status = 0;
|
||||||
|
this.productCoilBo.dataType = 0;
|
||||||
|
} else {
|
||||||
|
this.productCoilBo.status = undefined;
|
||||||
|
this.productCoilBo.dataType = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleDeliveryCoilStatusChange(val) {
|
||||||
|
if (val === 'in_stock') {
|
||||||
|
this.deliveryCoilBo.status = 0;
|
||||||
|
this.deliveryCoilBo.dataType = 1;
|
||||||
|
} else if (val === 'shipped') {
|
||||||
|
this.deliveryCoilBo.status = 1;
|
||||||
|
this.deliveryCoilBo.dataType = undefined;
|
||||||
|
} else if (val === 'history') {
|
||||||
|
this.deliveryCoilBo.status = 0;
|
||||||
|
this.deliveryCoilBo.dataType = 0;
|
||||||
|
} else {
|
||||||
|
this.deliveryCoilBo.status = undefined;
|
||||||
|
this.deliveryCoilBo.dataType = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
fetchDeliveryCoils(principal) {
|
fetchDeliveryCoils(principal) {
|
||||||
this.deliveryCoilLoading = true;
|
this.deliveryCoilLoading = true;
|
||||||
return listDeliveryCoilsByPrincipal({
|
return listDeliveryCoilsByPrincipal({
|
||||||
|
|||||||
@@ -751,7 +751,7 @@ export default {
|
|||||||
.cell-input {
|
.cell-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
border: none;
|
border: 1px solid #dcdfe6;
|
||||||
outline: none;
|
outline: none;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding: 0 6px;
|
padding: 0 6px;
|
||||||
|
|||||||
@@ -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(','),
|
||||||
|
|||||||
486
klp-ui/src/views/wms/coil/info/components/ChangeLogSection.vue
Normal file
486
klp-ui/src/views/wms/coil/info/components/ChangeLogSection.vue
Normal file
@@ -0,0 +1,486 @@
|
|||||||
|
<template>
|
||||||
|
<div class="section change-log-section">
|
||||||
|
<div class="section-header">
|
||||||
|
<span class="section-icon">📝</span>
|
||||||
|
<span class="section-title">修改日志</span>
|
||||||
|
</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<el-table
|
||||||
|
v-if="changeLogs.length"
|
||||||
|
:data="changeLogs"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
size="small"
|
||||||
|
v-loading="loading"
|
||||||
|
:header-cell-style="{ background: '#f5f7fa', color: '#303133', fontWeight: 600 }"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column prop="operationDesc" label="操作类型" min-width="120" show-overflow-tooltip>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span class="operation-badge">{{ scope.row.operationDesc }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="修改信息" min-width="420">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="change-log-line">
|
||||||
|
<div class="change-log-line-boxes">
|
||||||
|
<div
|
||||||
|
v-for="(item, idx) in scope.row.previewItems"
|
||||||
|
:key="scope.row.logId + '-' + idx"
|
||||||
|
class="mini-change-item"
|
||||||
|
:title="previewText(item)"
|
||||||
|
>
|
||||||
|
<span class="mini-change-label">{{ item.label }}</span>
|
||||||
|
<span class="mini-change-box old">{{ item.oldText }}</span>
|
||||||
|
<span class="mini-change-arrow">→</span>
|
||||||
|
<span class="mini-change-box new">{{ item.newText }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.moreCount > 0"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
class="more-btn"
|
||||||
|
@click="openMoreDialog(scope.row)"
|
||||||
|
>
|
||||||
|
更多 {{ scope.row.moreCount }} 项
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createBy" label="修改人" width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column label="修改时间" width="170" show-overflow-tooltip>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ formatDateTime(scope.row.createTime) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-empty
|
||||||
|
v-else-if="!loading"
|
||||||
|
description="暂无修改日志"
|
||||||
|
:image-size="60"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="全部修改信息"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="960px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<div v-if="activeLog" class="change-log-dialog">
|
||||||
|
<div class="change-log-dialog-meta">
|
||||||
|
<span>操作类型:{{ activeLog.operationDesc }}</span>
|
||||||
|
<span>修改人:{{ activeLog.createBy }}</span>
|
||||||
|
<span>修改时间:{{ formatDateTime(activeLog.createTime) }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="change-log-grid all-items">
|
||||||
|
<div
|
||||||
|
v-for="(item, idx) in activeLog.summaryItems"
|
||||||
|
:key="'dialog-' + activeLog.logId + '-' + idx"
|
||||||
|
class="change-log-card"
|
||||||
|
>
|
||||||
|
<div class="change-log-card-header">
|
||||||
|
<span class="change-field-name">{{ item.label }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="change-log-card-body">
|
||||||
|
<div class="change-value-box old">
|
||||||
|
<span class="change-value-label">原值</span>
|
||||||
|
<span class="change-value-text">{{ item.oldText }}</span>
|
||||||
|
</div>
|
||||||
|
<span class="change-arrow">→</span>
|
||||||
|
<div class="change-value-box new">
|
||||||
|
<span class="change-value-label">新值</span>
|
||||||
|
<span class="change-value-text">{{ item.newText }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getCoilChangeLogByCoilId } from '@/api/wms/coilChangeLog'
|
||||||
|
|
||||||
|
const CHANGE_FIELD_LABELS = {
|
||||||
|
currentCoilNo: '当前钢卷号',
|
||||||
|
enterCoilNo: '入场钢卷号',
|
||||||
|
supplierCoilNo: '厂家原料号',
|
||||||
|
itemName: '物料名称',
|
||||||
|
specification: '规格',
|
||||||
|
material: '材质',
|
||||||
|
netWeight: '净重',
|
||||||
|
grossWeight: '毛重',
|
||||||
|
warehouseName: '库位',
|
||||||
|
actualWarehouseName: '实际库区',
|
||||||
|
qualityStatus: '质量状态',
|
||||||
|
manufacturer: '厂家',
|
||||||
|
zincLayer: '镀层质量',
|
||||||
|
status: '状态',
|
||||||
|
remark: '备注',
|
||||||
|
saleName: '销售员',
|
||||||
|
actualLength: '实际长度',
|
||||||
|
actualWidth: '实际宽度',
|
||||||
|
actualThickness: '实际厚度',
|
||||||
|
length: '长度',
|
||||||
|
theoreticalLength: '理论长度',
|
||||||
|
theoreticalThickness: '理论厚度',
|
||||||
|
trimmingRequirement: '净边料要求',
|
||||||
|
packagingRequirement: '包装要求',
|
||||||
|
contractNo: '合同号',
|
||||||
|
chromePlateCoilNo: '镀铬卷号',
|
||||||
|
productionStartTime: '生产开始时间',
|
||||||
|
productionEndTime: '生产结束时间',
|
||||||
|
productionDuration: '生产时长'
|
||||||
|
}
|
||||||
|
|
||||||
|
const HIDDEN_CHANGE_FIELDS = new Set([
|
||||||
|
'warehouseId',
|
||||||
|
'actualWarehouseId',
|
||||||
|
'itemId',
|
||||||
|
'parentCoilId',
|
||||||
|
'parentCoilIds',
|
||||||
|
'parentCoilNos',
|
||||||
|
'hasMergeSplit',
|
||||||
|
'exclusiveStatus'
|
||||||
|
])
|
||||||
|
|
||||||
|
const PREVIEW_ITEM_LIMIT = 3
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ChangeLogSection',
|
||||||
|
props: {
|
||||||
|
coilId: { type: [String, Number], default: '' }
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
changeLogs: [],
|
||||||
|
dialogVisible: false,
|
||||||
|
activeLog: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
coilId: {
|
||||||
|
immediate: true,
|
||||||
|
handler(val) {
|
||||||
|
if (val) {
|
||||||
|
this.loadChangeLogs()
|
||||||
|
} else {
|
||||||
|
this.changeLogs = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatDateTime(val) {
|
||||||
|
if (!val) return '-'
|
||||||
|
const date = new Date(val)
|
||||||
|
if (isNaN(date.getTime())) return String(val)
|
||||||
|
const y = date.getFullYear()
|
||||||
|
const m = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const d = String(date.getDate()).padStart(2, '0')
|
||||||
|
const hh = String(date.getHours()).padStart(2, '0')
|
||||||
|
const mm = String(date.getMinutes()).padStart(2, '0')
|
||||||
|
const ss = String(date.getSeconds()).padStart(2, '0')
|
||||||
|
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
|
||||||
|
},
|
||||||
|
getFieldLabel(field) {
|
||||||
|
return CHANGE_FIELD_LABELS[field] || field
|
||||||
|
},
|
||||||
|
shouldHideField(field, diffMap) {
|
||||||
|
if (HIDDEN_CHANGE_FIELDS.has(field)) return true
|
||||||
|
if (field.endsWith('Id') && diffMap[`${field.slice(0, -2)}Name`]) return true
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
normalizeDisplayValue(field, val) {
|
||||||
|
if (val === null || val === undefined || val === '') return '-'
|
||||||
|
if (typeof val === 'number' && /Time$/.test(field)) {
|
||||||
|
return this.formatDateTime(val)
|
||||||
|
}
|
||||||
|
if (typeof val === 'string' && /^\d{13}$/.test(val) && /Time$/.test(field)) {
|
||||||
|
return this.formatDateTime(Number(val))
|
||||||
|
}
|
||||||
|
if (Array.isArray(val)) return val.length ? val.join(', ') : '-'
|
||||||
|
if (typeof val === 'object') {
|
||||||
|
try {
|
||||||
|
return JSON.stringify(val)
|
||||||
|
} catch (e) {
|
||||||
|
return String(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return String(val)
|
||||||
|
},
|
||||||
|
buildSummaryItem(field, oldVal, newVal) {
|
||||||
|
const oldText = this.normalizeDisplayValue(field, oldVal)
|
||||||
|
const newText = this.normalizeDisplayValue(field, newVal)
|
||||||
|
if (oldText === newText) return null
|
||||||
|
return {
|
||||||
|
field,
|
||||||
|
label: this.getFieldLabel(field),
|
||||||
|
oldText,
|
||||||
|
newText
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buildSummaryItems(log) {
|
||||||
|
const items = []
|
||||||
|
if (log.changedFields) {
|
||||||
|
try {
|
||||||
|
const diffMap = JSON.parse(log.changedFields)
|
||||||
|
Object.keys(diffMap || {}).forEach(key => {
|
||||||
|
if (this.shouldHideField(key, diffMap)) return
|
||||||
|
const item = diffMap[key] || {}
|
||||||
|
const summaryItem = this.buildSummaryItem(key, item.old, item.new)
|
||||||
|
if (summaryItem) items.push(summaryItem)
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
items.push({
|
||||||
|
field: 'raw',
|
||||||
|
label: '修改内容',
|
||||||
|
oldText: '-',
|
||||||
|
newText: log.changedFields
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!items.length && log.oldCoilNo !== log.newCoilNo) {
|
||||||
|
items.push(this.buildSummaryItem('currentCoilNo', log.oldCoilNo, log.newCoilNo))
|
||||||
|
}
|
||||||
|
if (!items.length && log.operationDesc) {
|
||||||
|
items.push({
|
||||||
|
field: 'operationDesc',
|
||||||
|
label: '修改内容',
|
||||||
|
oldText: '-',
|
||||||
|
newText: log.operationDesc
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return items.length ? items : [{
|
||||||
|
field: 'empty',
|
||||||
|
label: '修改内容',
|
||||||
|
oldText: '-',
|
||||||
|
newText: '-'
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
previewText(item) {
|
||||||
|
if (!item) return '-'
|
||||||
|
return `${item.label}:${item.oldText}→${item.newText}`
|
||||||
|
},
|
||||||
|
openMoreDialog(row) {
|
||||||
|
this.activeLog = row
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
async loadChangeLogs() {
|
||||||
|
if (!this.coilId) return
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
const res = await getCoilChangeLogByCoilId(this.coilId)
|
||||||
|
const rows = (res && res.data) || []
|
||||||
|
this.changeLogs = rows.map(item => ({
|
||||||
|
...item,
|
||||||
|
createBy: item.createBy || '-',
|
||||||
|
operationDesc: item.operationDesc || '-',
|
||||||
|
summaryItems: this.buildSummaryItems(item)
|
||||||
|
})).map(item => {
|
||||||
|
const previewItems = (item.summaryItems || []).slice(0, PREVIEW_ITEM_LIMIT)
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
previewItems,
|
||||||
|
moreCount: Math.max(item.summaryItems.length - previewItems.length, 0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.error('获取钢卷修改日志失败:', e)
|
||||||
|
this.changeLogs = []
|
||||||
|
this.activeLog = null
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.operation-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 22px;
|
||||||
|
padding: 0 8px;
|
||||||
|
border-radius: 11px;
|
||||||
|
background: rgba(59, 130, 246, 0.1);
|
||||||
|
border: 1px solid rgba(59, 130, 246, 0.18);
|
||||||
|
color: #2563eb;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-line {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-line-boxes {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-change-item {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #fff;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-change-label {
|
||||||
|
color: #475569;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-change-box {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 140px;
|
||||||
|
padding: 0 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 18px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
color: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-change-box.old {
|
||||||
|
background: #fff7ed;
|
||||||
|
border-color: #fed7aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-change-box.new {
|
||||||
|
background: #ecfdf5;
|
||||||
|
border-color: #a7f3d0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-change-arrow {
|
||||||
|
color: #94a3b8;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||||
|
gap: 6px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-grid.all-items {
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
.more-btn {
|
||||||
|
padding: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-card {
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 26px;
|
||||||
|
padding: 0 8px;
|
||||||
|
background: #f8fafc;
|
||||||
|
border-bottom: 1px solid #edf2f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-field-name {
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #475569;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-card-body {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 6px 8px;
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-value-box {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
min-width: 0;
|
||||||
|
padding: 6px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-value-box.old {
|
||||||
|
background: #fff7ed;
|
||||||
|
border-color: #fed7aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-value-box.new {
|
||||||
|
background: #ecfdf5;
|
||||||
|
border-color: #a7f3d0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-value-label {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #94a3b8;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-value-text {
|
||||||
|
color: #1e293b;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.35;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-arrow {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
color: #94a3b8;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-log-dialog-meta {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 12px 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: #606266;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.change-log-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -53,6 +53,7 @@
|
|||||||
<div v-else-if="!pathLoading && pathChecked" class="cost-chart-wrap">
|
<div v-else-if="!pathLoading && pathChecked" class="cost-chart-wrap">
|
||||||
<el-empty description="暂无加工路径数据" :image-size="60" />
|
<el-empty description="暂无加工路径数据" :image-size="60" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -704,4 +705,5 @@ export default {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #f56c6c;
|
color: #f56c6c;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="coil-info-page" v-loading="loading">
|
<div class="coil-info-page" v-loading="loading">
|
||||||
<div class="content-container">
|
<div class="content-container">
|
||||||
<BasicInfoSection :coilInfo="coilInfo" :initialQualityStatus="initialQualityStatus" />
|
<BasicInfoSection :coilInfo="coilInfo" :initialQualityStatus="initialQualityStatus" />
|
||||||
@@ -42,6 +42,8 @@
|
|||||||
<ProductionCharts v-if="isColdHardCoil"
|
<ProductionCharts v-if="isColdHardCoil"
|
||||||
:segData="segData" :gaugeRows="gaugeRows" :shapeRows="shapeRows"
|
:segData="segData" :gaugeRows="gaugeRows" :shapeRows="shapeRows"
|
||||||
:perfSegCount="perfSegCount" :segLoading="segLoading" :realtimeLoading="realtimeLoading" />
|
:perfSegCount="perfSegCount" :segLoading="segLoading" :realtimeLoading="realtimeLoading" />
|
||||||
|
|
||||||
|
<ChangeLogSection :coil-id="coilId" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -64,6 +66,7 @@ import LifecycleTrace from './components/LifecycleTrace.vue'
|
|||||||
import ContractInfo from './components/ContractInfo.vue'
|
import ContractInfo from './components/ContractInfo.vue'
|
||||||
import SalesObjectionTable from './components/SalesObjectionTable.vue'
|
import SalesObjectionTable from './components/SalesObjectionTable.vue'
|
||||||
import TransferRecords from './components/TransferRecords.vue'
|
import TransferRecords from './components/TransferRecords.vue'
|
||||||
|
import ChangeLogSection from './components/ChangeLogSection.vue'
|
||||||
// import InspectionInfo from './components/InspectionInfo.vue'
|
// import InspectionInfo from './components/InspectionInfo.vue'
|
||||||
import ProductionCharts from './components/ProductionCharts.vue'
|
import ProductionCharts from './components/ProductionCharts.vue'
|
||||||
|
|
||||||
@@ -77,6 +80,7 @@ export default {
|
|||||||
ContractInfo,
|
ContractInfo,
|
||||||
SalesObjectionTable,
|
SalesObjectionTable,
|
||||||
TransferRecords,
|
TransferRecords,
|
||||||
|
ChangeLogSection,
|
||||||
// InspectionInfo,
|
// InspectionInfo,
|
||||||
ProductionCharts
|
ProductionCharts
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -142,10 +142,11 @@
|
|||||||
<el-option label="原料" value="raw_material" />
|
<el-option label="原料" value="raw_material" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="发货状态">
|
<el-form-item label="钢卷状态">
|
||||||
<el-select v-model="productCoilBo.status" placeholder="全部" clearable style="width: 100px;">
|
<el-select v-model="productCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleCoilStatusChange">
|
||||||
<el-option label="在库" :value="0" />
|
<el-option label="在库" value="in_stock" />
|
||||||
<el-option label="已发货" :value="1" />
|
<el-option label="已发货" value="shipped" />
|
||||||
|
<el-option label="历史卷" value="history" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="质量状态">
|
<el-form-item label="质量状态">
|
||||||
@@ -433,7 +434,7 @@ export default {
|
|||||||
orderId: this.currentOrder.orderId,
|
orderId: this.currentOrder.orderId,
|
||||||
pageNum: this.productPagination.currentPage,
|
pageNum: this.productPagination.currentPage,
|
||||||
pageSize: this.productPagination.pageSize,
|
pageSize: this.productPagination.pageSize,
|
||||||
...this.productCoilBo
|
coilBo: this.productCoilBo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.productCoilList = res.rows || []
|
this.productCoilList = res.rows || []
|
||||||
this.productPagination.total = res.total || 0
|
this.productPagination.total = res.total || 0
|
||||||
@@ -443,7 +444,7 @@ export default {
|
|||||||
},
|
},
|
||||||
fetchProductCoilStatistics() {
|
fetchProductCoilStatistics() {
|
||||||
if (!this.currentOrder || !this.currentOrder.orderId) return
|
if (!this.currentOrder || !this.currentOrder.orderId) return
|
||||||
getProductCoilsStatisticsByContract({ ...this.productCoilBo, orderId: this.currentOrder.orderId }).then(res => {
|
getProductCoilsStatisticsByContract({ orderId: this.currentOrder.orderId, coilBo: this.productCoilBo }).then(res => {
|
||||||
this.productCoilStatistics = res.data || {}
|
this.productCoilStatistics = res.data || {}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -457,6 +458,21 @@ export default {
|
|||||||
this.productCoilBo = {}
|
this.productCoilBo = {}
|
||||||
this.handleProductFilter()
|
this.handleProductFilter()
|
||||||
},
|
},
|
||||||
|
handleCoilStatusChange(val) {
|
||||||
|
if (val === 'in_stock') {
|
||||||
|
this.productCoilBo.status = 0;
|
||||||
|
this.productCoilBo.dataType = 1;
|
||||||
|
} else if (val === 'shipped') {
|
||||||
|
this.productCoilBo.status = 1;
|
||||||
|
this.productCoilBo.dataType = undefined;
|
||||||
|
} else if (val === 'history') {
|
||||||
|
this.productCoilBo.status = 0;
|
||||||
|
this.productCoilBo.dataType = 0;
|
||||||
|
} else {
|
||||||
|
this.productCoilBo.status = undefined;
|
||||||
|
this.productCoilBo.dataType = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
handleProductSelectionChange(selection) {
|
handleProductSelectionChange(selection) {
|
||||||
this.selectedProductRows = selection
|
this.selectedProductRows = selection
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -524,7 +524,12 @@ export default {
|
|||||||
endDate = `${dateStr}-${lastDayOfMonth.toString().padStart(2, '0')}`;
|
endDate = `${dateStr}-${lastDayOfMonth.toString().padStart(2, '0')}`;
|
||||||
} else if (dayPattern.test(dateStr)) {
|
} else if (dayPattern.test(dateStr)) {
|
||||||
startDate = dateStr;
|
startDate = dateStr;
|
||||||
endDate = dateStr;
|
const nextDay = new Date(dateStr);
|
||||||
|
nextDay.setDate(nextDay.getDate() + 1);
|
||||||
|
const nextYear = nextDay.getFullYear();
|
||||||
|
const nextMonth = String(nextDay.getMonth() + 1).padStart(2, '0');
|
||||||
|
const nextDayNum = String(nextDay.getDate()).padStart(2, '0');
|
||||||
|
endDate = `${nextYear}-${nextMonth}-${nextDayNum}`;
|
||||||
} else {
|
} else {
|
||||||
throw new Error('输入格式错误,请传入 yyyy、yyyy-MM 或 yyyy-MM-dd 格式的字符串');
|
throw new Error('输入格式错误,请传入 yyyy、yyyy-MM 或 yyyy-MM-dd 格式的字符串');
|
||||||
}
|
}
|
||||||
@@ -552,7 +557,7 @@ export default {
|
|||||||
defaultEndTime,
|
defaultEndTime,
|
||||||
getDayTimeRange,
|
getDayTimeRange,
|
||||||
// all 类型专用
|
// all 类型专用
|
||||||
viewType: 'custom',
|
viewType: 'day',
|
||||||
yesterdaySummary: {},
|
yesterdaySummary: {},
|
||||||
monthChart: null,
|
monthChart: null,
|
||||||
dayChart: null,
|
dayChart: null,
|
||||||
@@ -734,9 +739,9 @@ export default {
|
|||||||
this.queryParams.byCreateTimeStart = start;
|
this.queryParams.byCreateTimeStart = start;
|
||||||
this.queryParams.byCreateTimeEnd = end;
|
this.queryParams.byCreateTimeEnd = end;
|
||||||
} else if (this.reportType === 'all') {
|
} else if (this.reportType === 'all') {
|
||||||
// all 类型默认使用当前月份作为自定义时间范围
|
// all 类型默认使用日视图,选中今天,筛选今天07:00到明天07:00的数据
|
||||||
this.viewType = 'custom';
|
this.viewType = 'day';
|
||||||
const { start, end } = this.getDayTimeRange(this.monthDate);
|
const { start, end } = this.getDayTimeRange(this.dayDate);
|
||||||
this.queryParams.startTime = start;
|
this.queryParams.startTime = start;
|
||||||
this.queryParams.endTime = end;
|
this.queryParams.endTime = end;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,15 +2,13 @@ package com.klp.controller;
|
|||||||
|
|
||||||
import com.klp.common.core.domain.R;
|
import com.klp.common.core.domain.R;
|
||||||
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
||||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
import com.klp.domain.bo.WmsAnnealPlanCoilBo;
|
||||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||||
import com.klp.domain.vo.anneal.WmsAnnealPerformanceVo;
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceVo;
|
||||||
import com.klp.service.IWmsAnnealPerformanceService;
|
import com.klp.service.IWmsAnnealPerformanceService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -36,8 +34,8 @@ public class WmsAnnealPerformanceController {
|
|||||||
/**
|
/**
|
||||||
* 查询退火计划中的加工前钢卷列表
|
* 查询退火计划中的加工前钢卷列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/rawCoils")
|
@PostMapping("/rawCoils")
|
||||||
public R<List<WmsMaterialCoilVo>> getRawCoils(WmsAnnealPerformanceBo bo, WmsMaterialCoilBo coilBo) {
|
public R<List<WmsMaterialCoilVo>> getRawCoils(@RequestBody WmsAnnealPlanCoilBo bo) {
|
||||||
return R.ok(performanceService.queryPlanCoils(bo, coilBo));
|
return R.ok(performanceService.queryPlanCoils(bo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,15 @@ public class WmsCoilChangeLogController extends BaseController {
|
|||||||
return R.ok(iWmsCoilChangeLogService.queryById(logId));
|
return R.ok(iWmsCoilChangeLogService.queryById(logId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按钢卷ID查询变更日志
|
||||||
|
*/
|
||||||
|
@GetMapping("/byCoilId/{coilId}")
|
||||||
|
public R<List<WmsCoilChangeLogVo>> getByCoilId(@NotNull(message = "钢卷ID不能为空")
|
||||||
|
@PathVariable Long coilId) {
|
||||||
|
return R.ok(iWmsCoilChangeLogService.queryByCoilId(coilId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增钢卷变更日志
|
* 新增钢卷变更日志
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退火计划钢卷查询复合BO
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsAnnealPlanCoilBo {
|
||||||
|
|
||||||
|
private WmsAnnealPerformanceBo planBo;
|
||||||
|
|
||||||
|
private WmsMaterialCoilBo coilBo;
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.klp.domain.vo;
|
|||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.klp.common.annotation.ExcelDictFormat;
|
import com.klp.common.annotation.ExcelDictFormat;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
import com.klp.common.convert.ExcelDictConvert;
|
import com.klp.common.convert.ExcelDictConvert;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class WmsCoilChangeLogVo {
|
public class WmsCoilChangeLogVo extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.klp.service;
|
package com.klp.service;
|
||||||
|
|
||||||
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
||||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
import com.klp.domain.bo.WmsAnnealPlanCoilBo;
|
||||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||||
import com.klp.domain.vo.anneal.WmsAnnealPerformanceVo;
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceVo;
|
||||||
|
|
||||||
@@ -20,5 +20,5 @@ public interface IWmsAnnealPerformanceService {
|
|||||||
/**
|
/**
|
||||||
* 查询退火计划中的加工前钢卷列表
|
* 查询退火计划中的加工前钢卷列表
|
||||||
*/
|
*/
|
||||||
List<WmsMaterialCoilVo> queryPlanCoils(WmsAnnealPerformanceBo bo, WmsMaterialCoilBo coilBo);
|
List<WmsMaterialCoilVo> queryPlanCoils(WmsAnnealPlanCoilBo bo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ public interface IWmsCoilChangeLogService {
|
|||||||
*/
|
*/
|
||||||
List<WmsCoilChangeLogVo> queryList(WmsCoilChangeLogBo bo);
|
List<WmsCoilChangeLogVo> queryList(WmsCoilChangeLogBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按钢卷ID查询钢卷变更日志列表(匹配变更前/变更后钢卷)
|
||||||
|
*/
|
||||||
|
List<WmsCoilChangeLogVo> queryByCoilId(Long coilId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增钢卷变更日志
|
* 新增钢卷变更日志
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.klp.common.core.domain.PageQuery;
|
|||||||
import com.klp.common.core.page.TableDataInfo;
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
import com.klp.common.utils.StringUtils;
|
import com.klp.common.utils.StringUtils;
|
||||||
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
import com.klp.domain.bo.WmsAnnealPerformanceBo;
|
||||||
|
import com.klp.domain.bo.WmsAnnealPlanCoilBo;
|
||||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||||
import com.klp.domain.vo.anneal.WmsAnnealPerformanceDetailVo;
|
import com.klp.domain.vo.anneal.WmsAnnealPerformanceDetailVo;
|
||||||
@@ -210,13 +211,18 @@ public class WmsAnnealPerformanceServiceImpl implements IWmsAnnealPerformanceSer
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WmsMaterialCoilVo> queryPlanCoils(WmsAnnealPerformanceBo bo, WmsMaterialCoilBo coilBo) {
|
public List<WmsMaterialCoilVo> queryPlanCoils(WmsAnnealPlanCoilBo bo) {
|
||||||
|
WmsAnnealPerformanceBo planBo = bo.getPlanBo();
|
||||||
|
WmsMaterialCoilBo coilBo = bo.getCoilBo();
|
||||||
|
if (planBo == null || coilBo == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
// 1. 查询退火计划
|
// 1. 查询退火计划
|
||||||
LambdaQueryWrapper<WmsFurnacePlan> planQw = new LambdaQueryWrapper<WmsFurnacePlan>()
|
LambdaQueryWrapper<WmsFurnacePlan> planQw = new LambdaQueryWrapper<WmsFurnacePlan>()
|
||||||
.ge(bo.getStartTime() != null, WmsFurnacePlan::getActualStartTime, bo.getStartTime())
|
.ge(planBo.getStartTime() != null, WmsFurnacePlan::getActualStartTime, planBo.getStartTime())
|
||||||
.le(bo.getEndTime() != null, WmsFurnacePlan::getActualStartTime, bo.getEndTime())
|
.le(planBo.getEndTime() != null, WmsFurnacePlan::getActualStartTime, planBo.getEndTime())
|
||||||
.eq(bo.getTargetFurnaceId() != null, WmsFurnacePlan::getTargetFurnaceId, bo.getTargetFurnaceId())
|
.eq(planBo.getTargetFurnaceId() != null, WmsFurnacePlan::getTargetFurnaceId, planBo.getTargetFurnaceId())
|
||||||
.like(StringUtils.isNotBlank(bo.getPlanNo()), WmsFurnacePlan::getPlanNo, bo.getPlanNo())
|
.like(StringUtils.isNotBlank(planBo.getPlanNo()), WmsFurnacePlan::getPlanNo, planBo.getPlanNo())
|
||||||
.eq(WmsFurnacePlan::getDelFlag, 0);
|
.eq(WmsFurnacePlan::getDelFlag, 0);
|
||||||
List<WmsFurnacePlan> plans = planMapper.selectList(planQw);
|
List<WmsFurnacePlan> plans = planMapper.selectList(planQw);
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,16 @@ public class WmsCoilChangeLogServiceImpl implements IWmsCoilChangeLogService {
|
|||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WmsCoilChangeLogVo> queryByCoilId(Long coilId) {
|
||||||
|
return baseMapper.selectVoList(Wrappers.<WmsCoilChangeLog>lambdaQuery()
|
||||||
|
.and(wrapper -> wrapper.eq(WmsCoilChangeLog::getOldCoilId, coilId)
|
||||||
|
.or()
|
||||||
|
.eq(WmsCoilChangeLog::getNewCoilId, coilId))
|
||||||
|
.orderByDesc(WmsCoilChangeLog::getCreateTime)
|
||||||
|
.orderByDesc(WmsCoilChangeLog::getLogId));
|
||||||
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<WmsCoilChangeLog> buildQueryWrapper(WmsCoilChangeLogBo bo) {
|
private LambdaQueryWrapper<WmsCoilChangeLog> buildQueryWrapper(WmsCoilChangeLogBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<WmsCoilChangeLog> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<WmsCoilChangeLog> lqw = Wrappers.lambdaQuery();
|
||||||
|
|||||||
Reference in New Issue
Block a user