diff --git a/klp-ui/src/api/wms/coil.js b/klp-ui/src/api/wms/coil.js index fcc7f63f..101254be 100644 --- a/klp-ui/src/api/wms/coil.js +++ b/klp-ui/src/api/wms/coil.js @@ -473,3 +473,13 @@ export function excludeLock(coilId) { timeout: 600000, }) } + +// 轻量钢卷列表 +export function listLightCoil(data) { + return request({ + url: '/wms/materialCoil/listForReport', + method: 'get', + timeout: 600000, + params: data + }) +} \ No newline at end of file diff --git a/klp-ui/src/api/wms/pendingAction.js b/klp-ui/src/api/wms/pendingAction.js index dd706eca..8982e3d6 100644 --- a/klp-ui/src/api/wms/pendingAction.js +++ b/klp-ui/src/api/wms/pendingAction.js @@ -167,3 +167,15 @@ export function restorePendingAction(actionId) { method: 'put' }) } + +/** + * 轻量待操作列表 + */ +export function listLightPendingAction(query) { + return request({ + url: '/wms/coilPendingAction/actionCoilIdList', + method: 'get', + params: query, + timeout: 600000 + }) +} diff --git a/klp-ui/src/views/micro/pages/acid/components/ActualPerformance.vue b/klp-ui/src/views/micro/pages/acid/components/ActualPerformance.vue index d67a4ba3..728ffdce 100644 --- a/klp-ui/src/views/micro/pages/acid/components/ActualPerformance.vue +++ b/klp-ui/src/views/micro/pages/acid/components/ActualPerformance.vue @@ -430,6 +430,12 @@ export default { async handleRowClick(row) { // 快速点击防重:每次点击递增版本号,旧的 sync 任务检测到版本号变更后自动放弃 const clickRev = ++this._clickRev + + // 记录点击前的钢卷号,用于判断是否同一行重复点击 + const prevExcoilId = this.selectedRow + ? (this.selectedRow.EXCOILID || this.selectedRow.excoilid || null) + : null + this.selectedRow = row this.segData = null this.gaugeRows = null @@ -450,8 +456,12 @@ export default { // 如果期间又点击了其他行则放弃后续操作 if (this._clickRev !== clickRev) return - // 后台静默同步到规程(不阻塞 UI) - this.autoSyncToActiveSpec(excoilId || encoilId, clickRev) + // 同一钢卷重复点击:跳过规程同步,避免重复写入 + const isSameCoil = excoilId && excoilId === prevExcoilId + if (!isSameCoil) { + // 后台静默同步到规程(不阻塞 UI) + this.autoSyncToActiveSpec(excoilId || encoilId, clickRev) + } await this.$nextTick() // 加载完成后自动选中第一个趋势参数 @@ -879,22 +889,34 @@ export default { for (const item of items) { if (guard()) return - // 确保 plan 点位存在 + // 确保 plan 点位存在(幂等:插入失败时降级重查,应对并发竞态) let planId const ep = planMap[item.pointCode] if (ep) { planId = ep.planId } else { - const r = await addProcessPlan({ - versionId, - segmentType: 'PROCESS', - segmentName: item.groupLabel, - pointName: item.pointName, - pointCode: item.pointCode, - sortOrder: 0 - }) - if (guard()) return - planId = r.data + try { + const r = await addProcessPlan({ + versionId, + segmentType: 'PROCESS', + segmentName: item.groupLabel, + pointName: item.pointName, + pointCode: item.pointCode, + sortOrder: 0 + }) + if (guard()) return + planId = r.data + // 写入本地 map,同一次 sync 内不再重复插入 + planMap[item.pointCode] = { planId } + } catch (_dupErr) { + // 唯一键冲突:该点位已由并发请求写入,重新查询获取真实 planId + const refetch = await listProcessPlan({ versionId, pageNum: 1, pageSize: 500 }) + if (guard()) return + const found = (refetch.rows || []).find(p => p.pointCode === item.pointCode) + if (!found) continue // 极端情况:查不到则跳过本条目 + planId = found.planId + planMap[item.pointCode] = found + } } // 查已存储参数 diff --git a/klp-ui/src/views/wms/report/components/coilTable/index.vue b/klp-ui/src/views/wms/report/components/coilTable/index.vue index 569a1aff..dc2e943b 100644 --- a/klp-ui/src/views/wms/report/components/coilTable/index.vue +++ b/klp-ui/src/views/wms/report/components/coilTable/index.vue @@ -1,15 +1,15 @@