Browse Source

Merge branch 'baoyang'

zhangcl 1 ngày trước cách đây
mục cha
commit
7c24d3190f

+ 7 - 1
src/api/pms/iotmainworkorderbom/index.ts

@@ -51,7 +51,8 @@ export interface IotMainWorkOrderBomVO {
   totalRunTime: number  // 累计运行时间
   tempTotalMileage: number  // 临时 累计运行公里数
   tempTotalRunTime: number  // 临时 累计运行时间
-
+  mainRuntime: number  // 保养时累计运行公里数
+  mainMileage: number  // 保养时累计运行时间
   // 上次保养时间 不同于自然日保养规则下的 上次保养自然日期
   lastMaintenanceDate: Date
   // 下次保养公里数
@@ -82,6 +83,11 @@ export const IotMainWorkOrderBomApi = {
     return await request.get({ url: `/pms/iot-main-work-order-bom/getWorkOrderBOMs`, params })
   },
 
+  // 获得PMS 保养工单明细BOM列表 保养时累计公里数 时长
+  maintenanceCumulativeValue: async (params: any) => {
+    return await request.get({ url: `/pms/iot-main-work-order-bom/maintenanceCumulativeValue`, params })
+  },
+
   // 查询PMS 保养计划明细BOM详情
   getIotMainWorkOrderBom: async (id: number) => {
     return await request.get({ url: `/pms/iot-main-work-order-bom/get?id=` + id })

+ 5 - 1
src/locales/en.ts

@@ -576,6 +576,8 @@ export default {
     enterNumber: "Please fill number",
     enterContent: "Please fill content",
     exceedMax: "The input value cannot exceed{max}",
+    mainSumTime: 'Running Time(H)',
+    mainSumKil:'Running Kilometers(KM)',
   },
   modelTemplate:{
     name:'TemplateName',
@@ -1106,7 +1108,9 @@ export default {
     notGenerated: "Not Generated",
     generatedNotExecuted: "Not Executed",
     consumeMaterials: "Consumables",
-    mainStatus: "Upkeep Status"
+    mainStatus: "Upkeep Status",
+    mainRuntimeError: 'Main Runtime Error',
+    mainMileageError: 'Main Mileage Error'
   },
   inspect:{
     InspectionItems:'InspectionItems',

+ 5 - 1
src/locales/ru.ts

@@ -518,6 +518,8 @@ export default {
     sumKil:'累计运行公里数(Km)',
     confirm:'确定',
     cancel:'取消',
+    mainSumTime: '保养时累计运行时间(H)',
+    mainSumKil:'保养时累计运行公里数(KM)',
   },
   modelTemplate:{
     name:'模板名称',
@@ -1005,7 +1007,9 @@ export default {
     notGenerated: "未生成工单",
     generatedNotExecuted: "已生成工单未执行",
     consumeMaterials: "消耗物料",
-    mainStatus: "保养状态"
+    mainStatus: "保养状态",
+    mainRuntimeError: '保养时累计运行时间错误!',
+    mainMileageError: '保养时累计运行公里数错误!'
   },
   inspect:{
     InspectionItems:'巡检项',

+ 5 - 1
src/locales/zh-CN.ts

@@ -565,7 +565,9 @@ export default {
   operationFillForm:{
     team:'所属队伍',
     sumTime:'累计运行时间(H)',
+    mainSumTime: '保养时累计运行时间(H)',
     sumKil:'累计运行公里数(KM)',
+    mainSumKil:'保养时累计运行公里数(KM)',
     confirm:'确定',
     cancel:'取消',
     alert:'以下数值取自PLC,如有不符请修改',
@@ -1103,7 +1105,9 @@ export default {
     notGenerated: "未生成工单",
     generatedNotExecuted: "已生成工单未执行",
     consumeMaterials: "消耗物料",
-    mainStatus: "保养状态"
+    mainStatus: "保养状态",
+    mainRuntimeError: '保养时累计运行时间错误!',
+    mainMileageError: '保养时累计运行公里数错误!'
   },
   inspect:{
     InspectionItems:'巡检项',

+ 26 - 2
src/views/pms/iotmainworkorder/DeviceAlarmBomList.vue

@@ -63,7 +63,13 @@
             <el-table-column :label="t('mainPlan.RunTimeCycle')" align="center" prop="nextRunningTime"
                              :width="columnWidths.nextRunningTime"/>
             <el-table-column :label="t('mainPlan.nextMaintTime')" align="center" prop="timePeriod"
-                             :width="columnWidths.timePeriod"/>
+                             :width="columnWidths.timePeriod">
+              <template #default="{ row }">
+                <span :class="{ 'negative-value': isNegative(row.timePeriod) }">
+                  {{ row.timePeriod }}
+                </span>
+              </template>
+            </el-table-column>
           </el-table-column>
 
           <!-- 里程分组列 -->
@@ -75,7 +81,13 @@
             <el-table-column :label="t('mainPlan.operatingMileageCycle')" align="center" prop="nextRunningKilometers"
                              :width="columnWidths.nextRunningKilometers"/>
             <el-table-column :label="t('mainPlan.nextMaintKil')" align="center" prop="kilometerCycle"
-                             :width="columnWidths.kilometerCycle"/>
+                             :width="columnWidths.kilometerCycle">
+              <template #default="{ row }">
+                <span :class="{ 'negative-value': isNegative(row.kilometerCycle) }">
+                  {{ row.kilometerCycle }}
+                </span>
+              </template>
+            </el-table-column>
           </el-table-column>
 
           <!-- 日期分组列 -->
@@ -472,6 +484,13 @@ const resetQuery = () => {
   handleQuery()
 }
 
+// 判断是否为负数的辅助函数
+const isNegative = (value: any): boolean => {
+  if (value === null || value === undefined || value === '') return false;
+  const num = Number(value);
+  return !isNaN(num) && num < 0;
+};
+
 // 监听分页数据变化,重新设置列宽
 watch(paginatedList, () => {
   nextTick(() => {
@@ -650,4 +669,9 @@ watch([showTimeColumns, showMileageColumns, showNaturalDateColumns], () => {
   }
 }
 
+/* 负数值样式 */
+.negative-value {
+  color: #f56c6c;
+  font-weight: 600;
+}
 </style>

+ 331 - 117
src/views/pms/iotmainworkorder/IotMainWorkOrderOptimize.vue

@@ -224,6 +224,66 @@
             {{ row.totalMileage ?? row.tempTotalMileage }}
           </template>
         </el-table-column>
+        <el-table-column :label="t('operationFillForm.mainSumTime')" align="center" prop="mainRuntime" v-if="hasTimeRuleInCurrentPage"
+                         :formatter="erpPriceTableColumnFormatter" :width="columnWidths.mainRuntime">
+          <template #default="{ row }">
+            <el-tooltip
+              :disabled="!row.mainRuntimeError"
+              :content="row.mainRuntimeError"
+              placement="top"
+              effect="light"
+              popper-class="main-runtime-tooltip"
+              :show-after="0"
+            >
+              <div class="main-runtime-input-wrapper">
+                <el-input-number
+                  v-model="row.mainRuntime"
+                  :precision="2"
+                  :min="0"
+                  :controls="false"
+                  style="width: 100%"
+                  :disabled="row.status === 1"
+                  @change="validateMainRuntime(row)"
+                  @blur="validateMainRuntime(row)"
+                  :class="{
+                    'is-required-input': row.mainRuntimeError,
+                    'error-input': row.mainRuntimeError
+                  }"
+                />
+              </div>
+            </el-tooltip>
+          </template>
+        </el-table-column>
+        <el-table-column :label="t('operationFillForm.mainSumKil')" align="center" prop="mainMileage" v-if="hasMileageRuleInCurrentPage"
+                         :formatter="erpPriceTableColumnFormatter" :width="columnWidths.mainMileage">
+          <template #default="{ row }">
+            <el-tooltip
+              :disabled="!row.mainMileageError"
+              :content="row.mainMileageError"
+              placement="top"
+              effect="light"
+              popper-class="main-runtime-tooltip"
+              :show-after="0"
+            >
+              <div class="main-runtime-input-wrapper">
+                <el-input-number
+                  v-model="row.mainMileage"
+                  :precision="2"
+                  :min="0"
+                  :controls="false"
+                  style="width: 100%"
+                  :disabled="row.status === 1"
+                  @change="validateMainMileage(row)"
+                  @blur="validateMainMileage(row)"
+                  :class="{
+                    'is-required-input': row.mainMileageError,
+                    'error-input': row.mainMileageError
+                  }"
+                />
+              </div>
+            </el-tooltip>
+          </template>
+        </el-table-column>
         <el-table-column :label="t('mainPlan.lastMaintenanceDate')" prop="lastMaintenanceDate" :width="columnWidths.lastMaintenanceDate">
           <template #default="{ row }">
             <div class="full-content-cell">
@@ -248,7 +308,9 @@
           <el-table-column :label="t('mainPlan.remainKm')"
                            align="center" prop="remainKm" :width="columnWidths.remainKm">
             <template #default="{ row }">
-              {{ row.remainKm != null ? row.remainKm.toFixed(2) : '-' }}
+              <span :class="{ 'negative-value': row.remainKm != null && row.remainKm < 0 }">
+                {{ row.remainKm != null ? row.remainKm.toFixed(2) : '-' }}
+              </span>
             </template>
           </el-table-column>
         </el-table-column>
@@ -270,7 +332,9 @@
           <el-table-column :label="t('mainPlan.remainH')"
                            align="center" prop="remainH" :width="columnWidths.remainH">
             <template #default="{ row }">
-              {{ row.remainH != null ? row.remainH.toFixed(2) : '-' }}
+              <span :class="{ 'negative-value': row.remainH != null && row.remainH < 0 }">
+                {{ row.remainH != null ? row.remainH.toFixed(2) : '-' }}
+              </span>
             </template>
           </el-table-column>
           <el-table-column
@@ -316,38 +380,16 @@
           <el-table-column :label="t('mainPlan.remainDay')"
                            align="center" prop="remainDay" :width="columnWidths.remainDay">
             <template #default="{ row }">
-              {{ row.remainDay ?? '-' }}
+              <span :class="{ 'negative-value': row.remainDay != null && row.remainDay < 0 }">
+                {{ row.remainDay ?? '-' }}
+              </span>
             </template>
           </el-table-column>
         </el-table-column>
 
-        <!--
-        <el-table-column :label="t('iotMaintain.numberOfMaterials')" align="center" width="90">
-          <template #default="scope">
-            {{ getMaterialCount(scope.row.bomNodeId) }}
-          </template>
-        </el-table-column> -->
-
         <el-table-column :label="t('iotMaintain.operation')" align="center" prop="operation" :width="columnWidths.operation" fixed="right">
           <template #default="scope">
             <div class="horizontal-actions">
-              <!-- 查看当前保养项已经绑定的物料列表
-              <el-tooltip
-                v-if="scope.row.deviceBomMaterials && scope.row.deviceBomMaterials.length > 0"
-                effect="dark"
-                :content="t('mainPlan.deviceBomMaterials')"
-                placement="top"
-                :show-after="300"
-              >
-                <el-button
-                  type="primary"
-                  link
-                  :icon="View"
-                  @click="handleDropdownCommand({ action: 'deviceBomMaterials', row: scope.row })"
-                  class="action-button"
-                />
-              </el-tooltip> -->
-
               <!-- 延迟保养按钮 -->
               <el-tooltip
                 v-if="scope.row.status === 0"
@@ -365,38 +407,6 @@
                 />
               </el-tooltip>
 
-              <!-- 选择物料按钮
-              <el-tooltip
-                v-if="scope.row.status === 0"
-                effect="dark"
-                :content="t('stock.selectMaterial')"
-                placement="top"
-                :show-after="300"
-              >
-                <el-button
-                  type="primary"
-                  link
-                  :icon="Box"
-                  @click="handleDropdownCommand({ action: 'material', row: scope.row })"
-                  class="action-button"
-                />
-              </el-tooltip> -->
-
-              <!-- 物料详情按钮
-              <el-tooltip
-                effect="dark"
-                :content="t('bomList.materialDetail')"
-                placement="top"
-                :show-after="300"
-              >
-                <el-button
-                  type="primary"
-                  link
-                  :icon="Document"
-                  @click="handleDropdownCommand({ action: 'detail', row: scope.row })"
-                  class="action-button"
-                />
-              </el-tooltip> -->
             </div>
           </template>
         </el-table-column>
@@ -539,13 +549,6 @@
         </el-table-column>
         <el-table-column label="消耗数量" align="center" prop="quantity" width="120px">
           <template #default="{ row }">
-            <!-- 新增物料行:显示tooltip、必填红色边框、禁止输入0
-            <el-tooltip
-              effect=""
-              content=""
-              placement=""
-              :disabled="row.quantity > 0"
-            > -->
             <el-input-number
               v-model="row.quantity"
               :precision="4"
@@ -982,11 +985,6 @@ const toggleShowAllMaterials = () => {
   });
 };
 
-// 为表格行添加类名,实现高亮效果
-/* const tableRowClassName = ({ row }) => {
-  return row.isSelected ? 'highlight-row' : '';
-}; */
-
 // 分组合并计算逻辑
 const groupSpans = ref<Record<string, { span: number, index: number }>>({})
 
@@ -1276,6 +1274,20 @@ const handleSizeChange = (newSize: number) => {
 const handleStatusChange = (row: IotMainWorkOrderBomVO) => {
   // 如果是从未完成(0)切换到完成(1)
   if (row.status === 1 && row.initialStatus === 0) {
+    // 校验 mainRuntime
+    if (!validateMainRuntime(row)) {
+      message.error(`${row.deviceCode}-${formatMaintItemName(row.name)} ${t('mainPlan.mainRuntimeError')}`);
+      row.status = 0; // 重置状态
+      return;
+    }
+
+    // 校验 mainMileage
+    if (!validateMainMileage(row)) {
+      message.error(`${row.deviceCode}-${formatMaintItemName(row.name)} ${t('mainPlan.mainMileageError')}`);
+      row.status = 0; // 重置状态
+      return;
+    }
+
     // 检查消耗物料规则:如果设置为不消耗物料(rule=1),则跳过物料校验
     if (row.rule === 1) {
       console.log(`保养项 ${row.name} 设置为不消耗物料,跳过物料校验`);
@@ -1323,6 +1335,86 @@ const validateAllRunningTimes = (): boolean => {
   return isValid;
 };
 
+// 校验 mainRuntime 的方法
+const validateMainRuntime = (row: IotMainWorkOrderBomVO) => {
+  // 清除之前的错误
+  row.mainRuntimeError = '';
+
+  const mainRuntime = Number(row.mainRuntime) || 0;
+  const totalRunTime = Number(row.totalRunTime ?? row.tempTotalRunTime) || 0;
+  const lastRunningTime = Number(row.lastRunningTime) || 0;
+
+  // 如果 mainRuntime 为 0 或空,不显示错误(允许为空)如果设置了累计运行时长保养规则 mainRuntime 必填
+  /* if (!mainRuntime || mainRuntime === 0) {
+    return true;
+  } */
+
+  // 校验规则:lastRunningTime ≤ mainRuntime ≤ totalRunTime
+  if (mainRuntime < lastRunningTime) {
+    row.mainRuntimeError = `保养时累计运行时间不能小于上次保养时长(${lastRunningTime})`;
+    return false;
+  }
+
+  if (mainRuntime > totalRunTime) {
+    row.mainRuntimeError = `保养时累计运行时间不能大于累计运行时间(${totalRunTime})`;
+    return false;
+  }
+  // 校验通过时确保错误信息被清除
+  row.mainRuntimeError = '';
+  return true;
+};
+
+// 校验 mainMileage 的方法
+const validateMainMileage = (row: IotMainWorkOrderBomVO) => {
+  // 清除之前的错误
+  row.mainMileageError = '';
+
+  const mainMileage = Number(row.mainMileage) || 0;
+  const totalMileage = Number(row.totalMileage ?? row.tempTotalMileage) || 0;
+  const lastRunningKilometers = Number(row.lastRunningKilometers) || 0;
+
+  // 如果 mainMileage 为 0 或空,不显示错误(允许为空)如果设置了累计运行时长保养规则 mainMileage 必填
+  /* if (!mainMileage || mainMileage === 0) {
+    return true;
+  } */
+
+  // 校验规则:lastRunningKilometers ≤ mainMileage ≤ totalMileage
+  if (mainMileage < lastRunningKilometers) {
+    row.mainMileageError = `保养时累计运行公里数不能小于上次保养里程数(${lastRunningKilometers})`;
+    return false;
+  }
+
+  if (mainMileage > totalMileage) {
+    row.mainMileageError = `保养时累计运行公里数不能大于累计运行公里数(${totalMileage})`;
+    return false;
+  }
+  // 校验通过时确保错误信息被清除
+  row.mainMileageError = '';
+  return true;
+};
+
+// 全局校验所有 mainRuntime
+const validateAllMainRuntimes = (): boolean => {
+  let isValid = true;
+  list.value.forEach(row => {
+    if (!validateMainRuntime(row)) {
+      isValid = false;
+    }
+  });
+  return isValid;
+};
+
+// 全局校验所有 mainMileage
+const validateAllMainMileages = (): boolean => {
+  let isValid = true;
+  list.value.forEach(row => {
+    if (!validateMainMileage(row)) {
+      isValid = false;
+    }
+  });
+  return isValid;
+};
+
 /** 新增物料 */
 const handleAddMaterial = () => {
   // 检查是否选中保养项
@@ -1467,7 +1559,7 @@ const selectChoose = (selectedMaterial) => {
     }
   });
 
-  // 关键修复:立即更新当前显示的物料列表
+  // 立即更新当前显示的物料列表
   refreshCurrentBomItemMaterials();
 
   // 选择物料后立即计算费用
@@ -1783,6 +1875,18 @@ const submitForm = async () => {
     return; // 校验失败则终止提交
   }
 
+  // 保养时 累计运行时长 mainRuntime 全局校验
+  if (!validateAllMainRuntimes()) {
+    message.error(t('mainPlan.mainRuntimeError'));
+    return;
+  }
+
+  // 保养时 累计运行公里数 mainMileage 全局校验
+  if (!validateAllMainMileages()) {
+    message.error(t('mainPlan.mainMileageError'));
+    return;
+  }
+
   // 校验所有设置为完成状态的保养项的物料数据
   const invalidBomItems = [];
 
@@ -2095,6 +2199,16 @@ const calculateAllColumnsWidth = () => {
       label: t('operationFillForm.sumKil'),
       getValue: (row) => row.totalMileage ?? row.tempTotalMileage
     },
+    {
+      prop: 'mainRuntime',
+      label: t('operationFillForm.mainSumTime'),
+      getValue: (row) => row.mainRuntime
+    },
+    {
+      prop: 'mainMileage',
+      label: t('operationFillForm.mainSumKil'),
+      getValue: (row) => row.mainMileage
+    },
     { prop: 'name', label: t('bomList.bomNode') },
     { prop: 'lastMaintenanceDate', label: t('mainPlan.lastMaintenanceDate') },
     { prop: 'mileageRule', label: t('main.mileage') },
@@ -2198,6 +2312,105 @@ const tableHeaderStyle = ({ row, rowIndex }) => {
   }
 }
 
+// 更新列表数据的函数
+const updateListWithCumulativeData = (cumulativeData: any[]) => {
+  cumulativeData.forEach(item => {
+    // 根据 bomNodeId 找到对应的行
+    const targetRow = list.value.find(row => row.bomNodeId === item.bomNodeId)
+    if (targetRow) {
+      // 按照优先级设置 mainRuntime 字段的值 保养时长
+      // 优先级:mainRuntime > tempMainRunTime
+      if (item.mainRuntime && Number(item.mainRuntime) > 0) {
+        // 如果 mainRuntime 有值且大于0,使用 mainRuntime
+        targetRow.mainRuntime = Number(item.mainRuntime)
+      } else if (item.tempMainRunTime && Number(item.tempMainRunTime) > 0) {
+        // 如果 mainRuntime 没有有效值,但 tempMainRunTime 有值且大于0,使用 tempMainRunTime
+        targetRow.mainRuntime = Number(item.tempMainRunTime)
+      } else {
+        // 两个字段都没有有效值,保持原值或设置为0
+        targetRow.mainRuntime = 0
+      }
+
+      // 按照优先级设置 mainMileage 字段的值 保养里程数
+      // 优先级:mainMileage > tempMainMileage
+      if (item.mainMileage && Number(item.mainMileage) > 0) {
+        // 如果 mainMileage 有值且大于0,使用 mainMileage
+        targetRow.mainMileage = Number(item.mainMileage)
+      } else if (item.tempMainMileage && Number(item.tempMainMileage) > 0) {
+        // 如果 mainMileage 没有有效值,但 tempMainMileage 有值且大于0,使用 tempMainMileage
+        targetRow.mainMileage = Number(item.tempMainMileage)
+      } else {
+        // 两个字段都没有有效值,保持原值或设置为0
+        targetRow.mainMileage = 0
+      }
+
+      // 更新数据后立即重新校验,清除可能的错误状态
+      nextTick(() => {
+        validateMainRuntime(targetRow)
+      })
+    }
+  })
+}
+
+const fetchCumulativeData = async () => {
+  if (!formData.value.actualStartTime) {
+    console.warn('actualStartTime is empty, skip fetching cumulative data');
+    return;
+  }
+
+  try {
+    // 确保时间戳格式正确
+    const startTime = Number(formData.value.actualStartTime);
+    if (isNaN(startTime)) {
+      console.error('Invalid actualStartTime:', formData.value.actualStartTime);
+      return;
+    }
+
+    const queryParams = {
+      workOrderId: id,
+      actualStartTime: dayjs(startTime).format('YYYY-MM-DD')
+    }
+
+    console.log('Fetching cumulative data with params:', queryParams);
+
+    const response = await IotMainWorkOrderBomApi.maintenanceCumulativeValue(queryParams)
+
+    if (response && Array.isArray(response)) {
+      updateListWithCumulativeData(response);
+      // 在所有数据更新完成后,重新校验所有行的 mainRuntime
+      nextTick(() => {
+        list.value.forEach(row => {
+          // 校验 保养时累计运行时长
+          if (row.mainRuntime) {
+            validateMainRuntime(row);
+          }
+          // 校验 保养时累计运行公里数
+          if (row.mainMileage) {
+            validateMainMileage(row);
+          }
+        });
+      });
+      message.success('累计运行数据更新成功');
+    }
+  } catch (error) {
+    console.error('获取累计运行数据失败:', error);
+    message.error('获取累计运行数据失败');
+  }
+}
+
+// 监听保养开始时间变化
+watch(
+  () => formData.value.actualStartTime,
+  async (newVal, oldVal) => {
+    console.log('actualStartTime changed:', { newVal, oldVal });
+
+    if (newVal && newVal !== oldVal) {
+      await fetchCumulativeData();
+    }
+  },
+  { immediate: false, deep: true }
+);
+
 // 原有代码保持不变,新增“选择物料”按钮的点击处理方法
 const handleSelectMaterial = () => {
   // 校验是否已选中保养项(避免无选中项时点击按钮报错)
@@ -2693,49 +2906,15 @@ const handleRowClick = (row) => {
   border-bottom: none; /* 移除默认边框 */
 }
 
-/* 添加选中行高亮样式 - 增强版
-:deep(.el-table .highlight-row) {
-  background-color: #d1eaff !important;
-}
-
-:deep(.el-table .highlight-row:hover>td) {
-  background-color: #b8dfff !important;
-}
-
-:deep(.el-table .highlight-row.current-row>td) {
-  background-color: #99ccff !important;
-  border-bottom: 2px solid #409eff !important;
-} */
-
 /* 增强高亮行样式的特异性,确保覆盖Element UI的默认样式 */
 :deep(.el-table__body tr.current-row>td) {
   background-color: #d1eaff !important;
 }
 
-/*
-:deep(.el-table__body tr.highlight-row:hover td) {
-  background-color: #d9ecff !important;
-}
-
-:deep(.el-table__body tr.highlight-row.current-row td) {
-  background-color: #c6e2ff !important;
-  border-bottom: 2px solid #409eff !important;
-} */
-
-/* 针对斑马纹表格的特殊处理
-:deep(.el-table--striped .el-table__body tr.highlight-row.el-table__row--striped td) {
-  background-color: #d1eaff !important;
-} */
-
 :deep(.el-table__body tr.current-row:hover>td) {
   background-color: #b8dfff !important;
 }
 
-/*
-:deep(.el-table--striped .el-table__body tr.highlight-row.el-table__row--striped.current-row td) {
-  background-color: #99ccff !important;
-} */
-
 /* 物料列表操作区域样式 */
 .material-list-header {
   display: flex;
@@ -2826,8 +3005,10 @@ const handleRowClick = (row) => {
   border-color: #f56c6c !important; /* Element错误色 */
   box-shadow: 0 0 0 1px rgba(245, 108, 108, 0.4) !important; /* 错误阴影 */
 }
-:deep(.is-required-input .el-input-number__input) {
+:deep(.is-required-input .el-input-number__input),
+:deep(.error-input .el-input-number__input) {
   border-color: #f56c6c !important;
+  background-color: #fef0f0 !important;
   box-shadow: 0 0 0 1px rgba(245, 108, 108, 0.4) !important;
 }
 
@@ -2835,19 +3016,17 @@ const handleRowClick = (row) => {
 :deep(.is-required-input .el-input__inner:hover) {
   border-color: #f56c6c !important;
 }
-:deep(.is-required-input .el-input-number__input:hover) {
+:deep(.is-required-input .el-input-number__input:hover),
+:deep(.error-input .el-input-number__input:hover) {
   border-color: #f56c6c !important;
+  background-color: #fef0f0 !important;
 }
 
-/* Tooltip提示样式优化 */
-:deep(.el-tooltip__popper.is-warning) {
-  background-color: #fff3cd !important;
-  border-color: #ffeeba !important;
-  color: #856404 !important;
-}
-:deep(.el-tooltip__popper.is-warning .el-tooltip__arrow) {
-  border-top-color: #ffeeba !important;
-  border-bottom-color: #ffeeba !important;
+:deep(.is-required-input .el-input-number__input:focus),
+:deep(.error-input .el-input-number__input:focus) {
+  border-color: #f56c6c !important;
+  background-color: #fef0f0 !important;
+  box-shadow: 0 0 0 1px rgba(245, 108, 108, 0.2) !important;
 }
 
 /* 状态列容器样式 - 水平排列 */
@@ -2896,4 +3075,39 @@ const handleRowClick = (row) => {
   border-color: #e6a23c;
 }
 
+/* 自定义淡红色背景的 tooltip */
+:deep(.main-runtime-tooltip) {
+  background: #fef0f0 !important;
+  border: 1px solid #fbc4c4 !important;
+  color: #f56c6c !important;
+  max-width: 300px;
+  font-size: 12px;
+  padding: 8px 12px;
+}
+
+/* 隐藏 Tooltip 菱形箭头(核心需求) */
+:deep(.main-runtime-tooltip .el-tooltip__arrow),
+:deep(.main-runtime-tooltip .el-tooltip__arrow::before) {
+  display: none !important; /* 完全隐藏箭头及伪元素 */
+  width: 0 !important;
+  height: 0 !important;
+}
+
+/* 新增包装层样式,确保tooltip正确触发 */
+.main-runtime-input-wrapper {
+  width: 100%;
+  position: relative;
+}
+
+/* 负数值红色样式 */
+:deep(.negative-value) {
+  color: #f56c6c !important;
+  font-weight: 600;
+}
+
+/* 确保在表格单元格中正确显示 */
+:deep(.el-table .cell .negative-value) {
+  display: inline-block;
+  width: 100%;
+}
 </style>