diff --git a/docs/double-rack-ddl.sql b/docs/double-rack-ddl.sql new file mode 100644 index 00000000..74382905 --- /dev/null +++ b/docs/double-rack-ddl.sql @@ -0,0 +1,81 @@ +-- 双机架 (double-rack) 数据库 DDL +-- 在 jdbc:mysql://140.143.206.120:13306/double-rack 上执行 + +-- 工艺方案主表 +CREATE TABLE IF NOT EXISTS `mill_process_recipe` ( + `recipe_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键', + `recipe_no` VARCHAR(64) NOT NULL COMMENT '方案记录号(唯一)', + `alloy_no` VARCHAR(32) NOT NULL COMMENT '合金号', + `pass_count` INT NOT NULL DEFAULT 0 COMMENT '道次数量', + `in_thick` DECIMAL(8,3) DEFAULT NULL COMMENT '原料厚度(mm)', + `out_thick` DECIMAL(8,3) DEFAULT NULL COMMENT '成品厚度(mm)', + `out_width` DECIMAL(8,1) DEFAULT NULL COMMENT '成品宽度(mm)', + `status` CHAR(1) NOT NULL DEFAULT '0' COMMENT '状态: 0-正常 1-停用', + `del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志: 0-存在 2-删除', + `create_by` VARCHAR(64) DEFAULT NULL, + `create_time` DATETIME DEFAULT NULL, + `update_by` VARCHAR(64) DEFAULT NULL, + `update_time` DATETIME DEFAULT NULL, + `remark` VARCHAR(512) DEFAULT NULL, + PRIMARY KEY (`recipe_id`), + UNIQUE KEY `uk_recipe_no` (`recipe_no`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='双机架工艺方案主表'; + +-- 工艺方案道次表 +CREATE TABLE IF NOT EXISTS `mill_process_pass` ( + `pass_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键', + `recipe_id` BIGINT NOT NULL COMMENT '关联方案ID', + `pass_no` INT NOT NULL COMMENT '道次序号', + `in_thick` DECIMAL(8,3) DEFAULT NULL COMMENT '入口厚度(mm)', + `out_thick` DECIMAL(8,3) DEFAULT NULL COMMENT '出口厚度(mm)', + `width` DECIMAL(8,1) DEFAULT NULL COMMENT '宽度(mm)', + `roll_force` DECIMAL(10,2) DEFAULT NULL COMMENT '轧制力(kN)', + `in_tension` DECIMAL(10,2) DEFAULT NULL COMMENT '入口张力(kN)', + `out_tension` DECIMAL(10,2) DEFAULT NULL COMMENT '出口张力(kN)', + `max_speed` DECIMAL(8,2) DEFAULT NULL COMMENT '最高速度(m/min)', + `in_unit_tension` DECIMAL(10,4) DEFAULT NULL COMMENT '入口单位张力(N/mm²)', + `out_unit_tension` DECIMAL(10,4) DEFAULT NULL COMMENT '出口单位张力(N/mm²)', + `reduction` DECIMAL(8,3) DEFAULT NULL COMMENT '压下量(mm)', + `total_reduction` DECIMAL(8,3) DEFAULT NULL COMMENT '总压下量(mm)', + `del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志', + `create_by` VARCHAR(64) DEFAULT NULL, + `create_time` DATETIME DEFAULT NULL, + `update_by` VARCHAR(64) DEFAULT NULL, + `update_time` DATETIME DEFAULT NULL, + `remark` VARCHAR(512) DEFAULT NULL, + PRIMARY KEY (`pass_id`), + KEY `idx_recipe_id` (`recipe_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='双机架工艺方案道次表'; + +-- 生产计划表(轧制队列) +CREATE TABLE IF NOT EXISTS `mill_production_plan` ( + `plan_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键', + `plan_no` VARCHAR(64) NOT NULL COMMENT '计划号', + `plan_status` CHAR(1) NOT NULL DEFAULT '0' COMMENT '计划状态: 0-待生产 1-生产中 2-完成 3-撤销', + `prod_status` VARCHAR(16) NOT NULL DEFAULT 'Idle' COMMENT '生产状态: Idle/Rolling/NextCoil/Done/Error', + `sort_no` INT NOT NULL DEFAULT 0 COMMENT '队列序号', + `in_mat_no` VARCHAR(64) DEFAULT NULL COMMENT '钢卷编号(入场钢卷号)', + `sg_sign` VARCHAR(64) DEFAULT NULL COMMENT '合金牌号', + `in_mat_thick` DECIMAL(8,3) DEFAULT NULL COMMENT '采料厚度(mm)', + `in_mat_width` DECIMAL(8,1) DEFAULT NULL COMMENT '采料宽度(mm)', + `in_mat_wt` DECIMAL(10,3) DEFAULT NULL COMMENT '采料重量(t)', + `in_mat_len` DECIMAL(10,2) DEFAULT NULL COMMENT '采料长度(m)', + `in_mat_in_dia` DECIMAL(8,1) DEFAULT NULL COMMENT '采料内径(mm)', + `in_mat_dia` DECIMAL(8,1) DEFAULT NULL COMMENT '采料外径(mm)', + `out_thick` DECIMAL(8,3) DEFAULT NULL COMMENT '成品厚度(mm)', + `pass_count` INT NOT NULL DEFAULT 0 COMMENT '道次数', + `recipe_id` BIGINT DEFAULT NULL COMMENT '关联工艺方案ID', + `recipe_no` VARCHAR(64) DEFAULT NULL COMMENT '工艺方案号', + `enter_coil_no` VARCHAR(64) DEFAULT NULL COMMENT '关联三级入场钢卷号', + `current_coil_no` VARCHAR(64) DEFAULT NULL COMMENT '关联三级当前钢卷号', + `del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志', + `create_by` VARCHAR(64) DEFAULT NULL, + `create_time` DATETIME DEFAULT NULL, + `update_by` VARCHAR(64) DEFAULT NULL, + `update_time` DATETIME DEFAULT NULL, + `remark` VARCHAR(512) DEFAULT NULL, + PRIMARY KEY (`plan_id`), + KEY `idx_in_mat_no` (`in_mat_no`), + KEY `idx_enter_coil_no` (`enter_coil_no`), + KEY `idx_current_coil_no` (`current_coil_no`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='双机架生产计划表(轧制队列)'; diff --git a/klp-admin/src/main/resources/application-dev.yml b/klp-admin/src/main/resources/application-dev.yml index a5fe3783..38d92067 100644 --- a/klp-admin/src/main/resources/application-dev.yml +++ b/klp-admin/src/main/resources/application-dev.yml @@ -98,6 +98,14 @@ spring: url: jdbc:mysql://140.143.206.120:3306/cgldb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true username: klp password: KeLunPu123@ + # 双机架数据源 + double-rack: + lazy: true + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://140.143.206.120:13306/double-rack?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true + username: klp + password: KeLunPu@123 # Oracle 数据源 acid-l2: lazy: true @@ -167,7 +175,7 @@ redisson: # 客户端名称 clientName: ${klp.name} # 最小空闲连接数 - connectionMinimumIdleSize: 8 + connectionMinimumIdleSize: 4 # 连接池大小 connectionPoolSize: 32 # 连接空闲超时,单位:毫秒 diff --git a/klp-admin/src/main/resources/application-prod.yml b/klp-admin/src/main/resources/application-prod.yml index 5a18a336..f4555360 100644 --- a/klp-admin/src/main/resources/application-prod.yml +++ b/klp-admin/src/main/resources/application-prod.yml @@ -103,6 +103,15 @@ spring: password: root hikari: connectionTestQuery: SELECT 1 FROM DUAL + + # 双机架数据源 + double-rack: + lazy: true + type: ${spring.datasource.type} + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://140.143.206.120:13306/double-rack?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true + username: klp + password: KeLunPu@123 # postgres: # type: ${spring.datasource.type} # driverClassName: org.postgresql.Driver diff --git a/klp-ui/src/api/wms/drMill.js b/klp-ui/src/api/wms/drMill.js new file mode 100644 index 00000000..83868bd2 --- /dev/null +++ b/klp-ui/src/api/wms/drMill.js @@ -0,0 +1,100 @@ +import request from '@/utils/request' + +// ── 双机架工艺规程 ── + +export function listDrRecipe(params) { + return request({ url: '/dr/mill/recipe/list', method: 'get', params }) +} + +export function getDrRecipeDetail(id) { + return request({ url: `/dr/mill/recipe/${id}`, method: 'get' }) +} + +export function addDrRecipe(data) { + return request({ url: '/dr/mill/recipe', method: 'post', data }) +} + +export function updateDrRecipe(data) { + return request({ url: '/dr/mill/recipe', method: 'put', data }) +} + +export function delDrRecipe(ids) { + return request({ url: `/dr/mill/recipe/${ids}`, method: 'delete' }) +} + +// ── 双机架工艺规程版本 ── + +export function listDrRecipeVersions(recipeId) { + return request({ url: `/dr/mill/recipe/version/list/${recipeId}`, method: 'get' }) +} + +export function getDrRecipeVersionDetail(versionId) { + return request({ url: `/dr/mill/recipe/version/${versionId}`, method: 'get' }) +} + +export function addDrRecipeVersion(data) { + return request({ url: '/dr/mill/recipe/version', method: 'post', data }) +} + +export function updateDrRecipeVersion(data) { + return request({ url: '/dr/mill/recipe/version', method: 'put', data }) +} + +export function activateDrRecipeVersion(versionId) { + return request({ url: `/dr/mill/recipe/version/activate/${versionId}`, method: 'put' }) +} + +export function delDrRecipeVersion(versionId) { + return request({ url: `/dr/mill/recipe/version/${versionId}`, method: 'delete' }) +} + +// ── 双机架生产计划 ── + +export function listDrPlan(params) { + return request({ url: '/dr/mill/plan/list', method: 'get', params }) +} + +export function addDrPlan(data) { + return request({ url: '/dr/mill/plan', method: 'post', data }) +} + +export function updateDrPlan(data) { + return request({ url: '/dr/mill/plan', method: 'put', data }) +} + +export function delDrPlan(id) { + return request({ url: `/dr/mill/plan/${id}`, method: 'delete' }) +} + +export function getDrPlanByActionId(actionId) { + return request({ url: `/dr/mill/plan/byAction/${actionId}`, method: 'get' }) +} + +/** 实绩分页查询(double-rack 库,按创建时间倒序) */ +export function listDrActualPage(params) { + return request({ url: '/dr/mill/plan/actual/page', method: 'get', params }) +} + +export function moveUpDrPlan(id) { + return request({ url: `/dr/mill/plan/moveUp/${id}`, method: 'put' }) +} + +export function moveDownDrPlan(id) { + return request({ url: `/dr/mill/plan/moveDown/${id}`, method: 'put' }) +} + +export function finishDrPlan(id) { + return request({ url: `/dr/mill/plan/finish/${id}`, method: 'put' }) +} + +// ── WMS 钢卷号查询(供计划绑定) ── + +export function queryCoilByNo(coilNo) { + return request({ url: '/wms/materialCoil/queryByCoilNo', method: 'get', params: { coilNo } }) +} + +// ── 双机架操作录入(保存 coilWarehouseOperationLog) ── + +import { addCoilWarehouseOperationLog, listCoilWarehouseOperationLog } from '@/api/wms/coilWarehouseOperationLog' + +export { addCoilWarehouseOperationLog, listCoilWarehouseOperationLog } diff --git a/klp-ui/src/components/CoilSelector/index.vue b/klp-ui/src/components/CoilSelector/index.vue index 8bf21d68..0e2d6efa 100644 --- a/klp-ui/src/components/CoilSelector/index.vue +++ b/klp-ui/src/components/CoilSelector/index.vue @@ -142,7 +142,7 @@
- + diff --git a/klp-ui/src/layout/components/TagsView/ScrollPane.vue b/klp-ui/src/layout/components/TagsView/ScrollPane.vue index f92d99b7..b7251076 100644 --- a/klp-ui/src/layout/components/TagsView/ScrollPane.vue +++ b/klp-ui/src/layout/components/TagsView/ScrollPane.vue @@ -88,6 +88,12 @@ export default { } .el-scrollbar__wrap { height: 39px; + overflow-x: auto; + overflow-y: hidden; + } + .el-scrollbar__view { + display: inline-block; /* 让所有 tag 排在同一行,不换行 */ + white-space: nowrap; } } } diff --git a/klp-ui/src/layout/components/TagsView/index.vue b/klp-ui/src/layout/components/TagsView/index.vue index 3d898700..d780c960 100644 --- a/klp-ui/src/layout/components/TagsView/index.vue +++ b/klp-ui/src/layout/components/TagsView/index.vue @@ -245,7 +245,7 @@ export default { // background: #454c51; border-bottom: 1px solid #a0a6ad; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.05) inset; - + .tags-view-wrapper { .tags-view-item { display: inline-block; @@ -253,6 +253,7 @@ export default { cursor: pointer; height: 26px; line-height: 26px; + white-space: nowrap; border: 1px solid #a0a6ad; color: #111; // 标签金属渐变背景 @@ -262,32 +263,32 @@ export default { margin-left: 5px; margin-top: 4px; border-radius: 4px; - box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1), + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1), -1px -1px 2px rgba(255, 255, 255, 0.05); transition: all 0.2s ease; - + &:first-of-type { margin-left: 15px; } - + &:last-of-type { margin-right: 15px; } - + &:hover { - box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15), + box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15), -1px -1px 2px rgba(255, 255, 255, 0.08); border-color: #8d939b; } - + &.active { // 激活状态主色调渐变 background: linear-gradient(145deg, #6b809d, #637994); color: #fff; border-color: #5a6d86; - box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15), + box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15), -1px -1px 2px rgba(255, 255, 255, 0.1) inset; - + &::before { content: ''; background: rgba(255, 255, 255, 0.8); @@ -302,7 +303,7 @@ export default { } } } - + .contextmenu { margin: 0; // 右键菜单金属背景 @@ -317,15 +318,15 @@ export default { font-size: 12px; font-weight: 400; color: #606266; - box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15), + box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15), -2px -2px 5px rgba(255, 255, 255, 0.08); - + li { margin: 0; padding: 7px 16px; cursor: pointer; transition: all 0.2s ease; - + &:hover { background: rgba(99, 121, 148, 0.15); color: #637994; @@ -349,13 +350,13 @@ export default { transition: all .3s cubic-bezier(.645, .045, .355, 1); transform-origin: 100% 50%; margin-left: 4px; - + &:before { transform: scale(.6); display: inline-block; vertical-align: -3px; } - + &:hover { background-color: rgba(0, 0, 0, 0.15); color: #ddd; @@ -363,7 +364,7 @@ export default { inset -1px -1px 2px rgba(255, 255, 255, 0.05); } } - + &.active { .el-icon-close:hover { background-color: rgba(255, 255, 255, 0.2); @@ -372,4 +373,4 @@ export default { } } } - \ No newline at end of file + diff --git a/klp-ui/src/views/micro/pages/acid/index.vue b/klp-ui/src/views/micro/pages/acid/index.vue index 0675fa83..e8e39034 100644 --- a/klp-ui/src/views/micro/pages/acid/index.vue +++ b/klp-ui/src/views/micro/pages/acid/index.vue @@ -1,11 +1,7 @@ - 点位名称: + 参数名称: 新建参数 + 新建方案点位 + >管理点位 模板导入
- + - - - - - - - + + + + + + + + + + + + + - - - @@ -361,6 +274,16 @@ + + + + + @@ -488,7 +411,7 @@ const TEMPLATE_HEADERS = ['段类型', '段名称', '点位名称', '参数名 /** 表头字段映射 */ const HEADER_MAP = { '段类型': 'segmentType', - '段名称': 'segmentName', + '段名称': 'segmentName', '点位名称': 'pointName', '参数名称': 'paramName', '设定值': 'targetValue', @@ -514,9 +437,8 @@ export default { appliedFilterName: '', planList: [], planLoading: false, - selectedPlan: null, - paramList: [], - paramLoading: false, + allParamList: [], + allParamLoading: false, planOpen: false, planTitle: '', planSubmitLoading: false, @@ -531,6 +453,7 @@ export default { paramSubmitLoading: false, paramForm: {}, paramRules: { + planId: [{ required: true, message: '请选择所属点位', trigger: 'change' }], paramCode: [{ required: true, message: '参数编码不能为空', trigger: 'blur' }], paramName: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }] }, @@ -632,12 +555,6 @@ export default { extra.sort((a, b) => String(a.label).localeCompare(String(b.label), 'zh-CN')) return [...SEGMENT_FORM_OPTIONS, ...extra] }, - /** 当前选中点位下的异常条目 */ - planAnomalies() { - if (!this.selectedPlan) return [] - return this.allAnomalies.filter(a => a.paramCode === this.selectedPlan.pointCode || - this.paramList.some(p => p.paramCode === a.paramCode)) - }, /** paramCode → anomaly 的快速索引(用于状态列) */ paramAnomalyMap() { const map = {} @@ -648,45 +565,42 @@ export default { if (!this.coilAnomalyCoilId) return [] return this.allAnomalies.filter(a => a.coilId === this.coilAnomalyCoilId) }, - filteredPlans() { + /** 所有 plan 的参数平铺成一行,带 plan 的段/点位信息 */ + flatRows() { + const SEG_LABELS = { INLET: '入口段', PROCESS: '工艺段', OUTLET: '出口段' } + const planMap = {} + for (const plan of this.planList) planMap[plan.planId] = plan + const rows = [] + for (const param of this.allParamList) { + const plan = planMap[param.planId] + if (!plan) continue + rows.push({ + ...param, + _planId: plan.planId, + _segmentType: plan.segmentType, + _segmentLabel: SEG_LABELS[plan.segmentType] || plan.segmentName || plan.segmentType, + _pointName: plan.pointName, + _sortOrder: plan.sortOrder || 0 + }) + } + rows.sort((a, b) => { + const s = (a._sortOrder || 0) - (b._sortOrder || 0) + return s !== 0 ? s : (a.paramId || 0) - (b.paramId || 0) + }) + return rows + }, + filteredFlatRows() { const type = this.activeSegmentType - const sub = this.activeSegmentName - return this.planList.filter(p => { - const typeOk = - type === '' || type === undefined || type === null - ? true - : String(p.segmentType) === String(type) - let nameOkSeg = true - if (typeOk && type !== '' && type !== undefined && type !== null) { - if (sub === '' || sub === undefined || sub === null) { - nameOkSeg = true - } else if (sub === '__EMPTY__') { - const sn = p.segmentName != null ? String(p.segmentName).trim() : '' - nameOkSeg = !sn - } else { - const sn = p.segmentName != null ? String(p.segmentName).trim() : '' - nameOkSeg = sn === String(sub).trim() - } - } - const nameOk = !this.appliedFilterName || (p.pointName || '').includes(this.appliedFilterName) - return typeOk && nameOkSeg && nameOk + const name = this.appliedFilterName + return this.flatRows.filter(r => { + const typeOk = !type || String(r._segmentType) === String(type) + const nameOk = !name || (r.paramName || '').includes(name) || (r.paramCode || '').includes(name) + return typeOk && nameOk }) } }, watch: { $route: { immediate: true, handler() { this.syncFromRoute() } }, - planAnomalies: { - handler(list) { - if (list.length && this.anomalyExpanded) { - this.$nextTick(() => this.renderAnomalyChart()) - } - } - }, - anomalyExpanded(val) { - if (val && this.planAnomalies.length) { - this.$nextTick(() => this.renderAnomalyChart()) - } - }, segmentTypeTabOptions: { handler() { const a = this.activeSegmentType @@ -852,22 +766,26 @@ export default { }, loadPlans() { this.planLoading = true - this.selectedPlan = null - this.paramList = [] listProcessPlan({ versionId: this.versionId, pageNum: 1, pageSize: 500 }).then(res => { this.planList = res.rows || [] + this.loadAllParams() }).catch(e => console.error(e)).finally(() => { this.planLoading = false }) }, - loadParams(planId) { - this.paramLoading = true - listProcessPlanParam({ planId, pageNum: 1, pageSize: 500 }).then(res => { - this.paramList = res.rows || [] - }).catch(e => console.error(e)).finally(() => { this.paramLoading = false }) - }, - onPlanSelect(row) { - if (!row) return - this.selectedPlan = row - this.loadParams(row.planId) + async loadAllParams() { + if (!this.planList.length) { this.allParamList = []; return } + this.allParamLoading = true + try { + const results = await Promise.all( + this.planList.map(plan => + listProcessPlanParam({ planId: plan.planId, pageNum: 1, pageSize: 500 }) + .then(res => res.rows || []) + .catch(() => []) + ) + ) + this.allParamList = results.flat() + } finally { + this.allParamLoading = false + } }, applyFilter() { this.appliedFilterName = this.filterName }, resetFilter() { @@ -921,28 +839,33 @@ export default { }).catch(() => {}) }, openParamDialog(planRow, paramRow) { - const targetPlan = planRow || this.selectedPlan - if (!targetPlan) { this.$message.warning('请先选择一个方案点位'); return } - if (!this.selectedPlan || this.selectedPlan.planId !== targetPlan.planId) { - this.selectedPlan = targetPlan - this.loadParams(targetPlan.planId) - } this.paramForm = paramRow ? { ...paramRow } : { - planId: targetPlan.planId, - paramCode: undefined, - paramName: undefined, + planId: planRow ? planRow.planId : undefined, + paramCode: undefined, + paramName: undefined, targetValue: undefined, - lowerLimit: undefined, - upperLimit: undefined, - unit: undefined, - remark: undefined + lowerLimit: undefined, + upperLimit: undefined, + unit: undefined, + remark: undefined } this.paramTitle = paramRow ? '编辑方案参数' : '新建方案参数' this.paramOpen = true this.$nextTick(() => this.$refs.paramFormRef && this.$refs.paramFormRef.clearValidate()) }, + editParamFromFlat(row) { + this.openParamDialog(null, row) + }, + deleteParamFromFlat(row) { + this.$modal.confirm('确认删除该参数?').then(() => { + return delProcessPlanParam(row.paramId) + }).then(() => { + this.$modal.msgSuccess('删除成功') + this.loadAllParams() + }).catch(() => {}) + }, submitParam() { this.$refs.paramFormRef.validate(ok => { if (!ok) return @@ -951,18 +874,10 @@ export default { req.then(() => { this.$modal.msgSuccess('保存成功') this.paramOpen = false - this.loadParams(this.selectedPlan.planId) + this.loadAllParams() }).catch(e => console.error(e)).finally(() => { this.paramSubmitLoading = false }) }) }, - removeParam(row) { - this.$modal.confirm('确认删除该参数?').then(() => { - return delProcessPlanParam(row.paramId) - }).then(() => { - this.$modal.msgSuccess('删除成功') - this.loadParams(this.selectedPlan.planId) - }).catch(() => {}) - }, // ===================== 导入相关方法 ===================== /** * 打开导入对话框 @@ -1218,7 +1133,7 @@ export default { async batchImport() { // �照点位名称分组,每个点位创建一条记录,然后添加多个参数 const pointGroups = {} - + // 分组处理 this.tableData.forEach(row => { const pointKey = `${row.segmentType}_${row.segmentName}_${row.pointName}` @@ -1249,12 +1164,12 @@ export default { try { await this.importOnePoint(group) this.importedCount += group.params.length - + // 更新进度 index += group.params.length const currentProgress = Math.round((index / this.totalCount) * 100) this.progress = currentProgress - + await new Promise(resolve => setTimeout(resolve, 50)) } catch (error) { throw new Error(`导入点位"${group.pointName}"失败:${error.message}`) @@ -1275,7 +1190,7 @@ export default { pointCode: group.pointCode, sortOrder: 0 } - + const planRes = await addProcessPlan(planParams) if (planRes.code !== 200) { throw new Error(`点位创建失败:${planRes.msg || '接口返回异常'}`) @@ -1293,7 +1208,7 @@ export default { lowerLimit: param.lowerLimit ? Number(param.lowerLimit) : null, unit: param.unit } - + const paramRes = await addProcessPlanParam(paramParams) if (paramRes.code !== 200) { throw new Error(`参数"${param.paramName}"创建失败:${paramRes.msg || '接口返回异常'}`) @@ -1354,7 +1269,7 @@ export default { // 创建工作簿 const wb = XLSX.utils.book_new() const ws = XLSX.utils.aoa_to_sheet(templateData) - + // 设置列宽 ws['!cols'] = [ { wch: 10 }, // 段类型 @@ -1366,7 +1281,7 @@ export default { { wch: 10 }, // 下限 { wch: 10 } // 单位 ] - + XLSX.utils.book_append_sheet(wb, ws, '导入模板') XLSX.writeFile(wb, '方案点位导入模板.xlsx') }, @@ -1558,6 +1473,19 @@ export default { .btn-danger { color: #f56c6c; } +/* ── 段 chip ── */ +.seg-chip { + display: inline-block; + padding: 2px 7px; + border-radius: 10px; + font-size: 11px; + font-weight: 600; + white-space: nowrap; +} +.seg-inlet { background: #ecf5ff; color: #3a6ea8; border: 1px solid #b3d8ff; } +.seg-process { background: #f0f9eb; color: #3a7a2a; border: 1px solid #b3e19d; } +.seg-outlet { background: #fdf6ec; color: #a86a00; border: 1px solid #f5dab1; } + /* ── 偏差分析 ── */ .anomaly-section-header { display: flex; diff --git a/klp-ui/src/views/wms/report/abnormal.vue b/klp-ui/src/views/wms/report/abnormal.vue index f36081df..24d5a068 100644 --- a/klp-ui/src/views/wms/report/abnormal.vue +++ b/klp-ui/src/views/wms/report/abnormal.vue @@ -37,6 +37,10 @@ + + + @@ -99,14 +103,16 @@ @@ -147,7 +153,7 @@ export default { ColumnsSetting, TimeRangePicker }, - dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], + dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status'], data() { // 工具函数:个位数补零 const addZero = (num) => num.toString().padStart(2, '0') diff --git a/klp-ui/src/views/wms/report/delivery.vue b/klp-ui/src/views/wms/report/delivery.vue index fd892589..d3fb6ba6 100644 --- a/klp-ui/src/views/wms/report/delivery.vue +++ b/klp-ui/src/views/wms/report/delivery.vue @@ -3,14 +3,8 @@ - + + + + 查询 导出 @@ -93,7 +91,7 @@ export default { CoilTable, TimeRangePicker, }, - dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], + dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status'], data() { // 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05) const addZero = (num) => num.toString().padStart(2, '0') diff --git a/klp-ui/src/views/wms/report/receive.vue b/klp-ui/src/views/wms/report/receive.vue index eb7b3006..4d48bf4b 100644 --- a/klp-ui/src/views/wms/report/receive.vue +++ b/klp-ui/src/views/wms/report/receive.vue @@ -20,26 +20,32 @@ - + - + - + - + - + + + + + + @@ -115,7 +121,7 @@ export default { HierarchicalPivot, CrossTable, }, - dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], + dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status'], data() { // 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05) const addZero = (num) => num.toString().padStart(2, '0') diff --git a/klp-ui/src/views/wms/report/template/action.vue b/klp-ui/src/views/wms/report/template/action.vue index e010e378..38bc67ba 100644 --- a/klp-ui/src/views/wms/report/template/action.vue +++ b/klp-ui/src/views/wms/report/template/action.vue @@ -71,12 +71,19 @@ - - + + + + + 查询 @@ -219,7 +226,7 @@ export default { name: 'MergeTemplate', props: { actionType: { - type: Number, + type: [Number, String], required: true }, productionLine: { @@ -246,7 +253,7 @@ export default { ColumnsSetting, TimeRangePicker }, - dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], + dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status'], data() { // 工具函数:个位数补零 const addZero = (num) => num.toString().padStart(2, '0') @@ -466,7 +473,7 @@ export default { this.loading = true; // 所有报表类型都使用原始的 listPendingAction 方式获取数据 - const res = await listPendingAction({ ...this.queryParams, actionType: this.actionType, actionStatus: 2 }); + const res = await listPendingAction({ ...this.queryParams, actionTypes: this.actionType, actionStatus: 2 }); // 获取两层数据 const lossIds = res.rows.filter(item => item.coilId).map(item => item.coilId); const lossActionIds = res.rows.filter(item => item.actionId).map(item => item.actionId); diff --git a/klp-ui/src/views/wms/report/template/comprehensive.vue b/klp-ui/src/views/wms/report/template/comprehensive.vue index d2b61d38..510228c4 100644 --- a/klp-ui/src/views/wms/report/template/comprehensive.vue +++ b/klp-ui/src/views/wms/report/template/comprehensive.vue @@ -2,8 +2,6 @@
- - 日视图 月视图 @@ -42,10 +40,14 @@ - + + + + + + 查询 导出产出钢卷 @@ -86,7 +92,6 @@ {{ summary.countDiff }}(昨日: {{ yesterdaySummary.countDiff }}) {{ summary.weightDiff }}(昨日: {{ yesterdaySummary.weightDiff }}) {{ summary.avgWeightDiff }}t(昨日: {{ yesterdaySummary.avgWeightDiff }}t) - {{ summary.passRate }}(昨日: {{ yesterdaySummary.passRate }}) @@ -216,7 +221,7 @@ export default { default: '', }, }, - dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'], + dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status'], data() { // 工具函数:个位数补零 const addZero = (num) => num.toString().padStart(2, '0') @@ -443,7 +448,7 @@ export default { fetchOutputList({ ...this.queryParams, ...this.baseQueryParams, - warehouseIds: this.warehouseIds.join(','), + // warehouseIds: this.warehouseIds.join(','), }), ]).then(([lossList, outputList]) => { this.lossList = lossList diff --git a/klp-ui/src/views/wms/report/template/day.vue b/klp-ui/src/views/wms/report/template/day.vue index c9843b98..236368ef 100644 --- a/klp-ui/src/views/wms/report/template/day.vue +++ b/klp-ui/src/views/wms/report/template/day.vue @@ -14,10 +14,14 @@ - + + + + + + 查询 导出产出钢卷 @@ -153,6 +161,7 @@ export default { CoilTable, SplitSummary, }, + dicts: ['coil_quality_status'], props: { actionTypes: { type: Array, @@ -332,7 +341,7 @@ export default { fetchOutputList({ ...this.queryParams, ...this.baseQueryParams, - warehouseIds: this.warehouseIds.join(','), + // warehouseIds: this.warehouseIds.join(','), }), ]).then(([lossList, outputList]) => { this.lossList = lossList diff --git a/klp-ui/src/views/wms/report/template/loss.vue b/klp-ui/src/views/wms/report/template/loss.vue index f7601cc3..7f3bba64 100644 --- a/klp-ui/src/views/wms/report/template/loss.vue +++ b/klp-ui/src/views/wms/report/template/loss.vue @@ -40,6 +40,10 @@ + + + 查询 导出 @@ -111,7 +115,7 @@ export default { default: '', }, }, - dicts: ['coil_material', 'coil_manufacturer'], + dicts: ['coil_quality_status'], data() { // 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05) const addZero = (num) => num.toString().padStart(2, '0') diff --git a/klp-ui/src/views/wms/report/template/mands.vue b/klp-ui/src/views/wms/report/template/mands.vue index ce4a55f9..434945e7 100644 --- a/klp-ui/src/views/wms/report/template/mands.vue +++ b/klp-ui/src/views/wms/report/template/mands.vue @@ -42,10 +42,14 @@ - + + + + + + 查询 导出产出钢卷 @@ -163,7 +171,6 @@