|
|
@@ -374,7 +374,7 @@
|
|
|
<el-table-column
|
|
|
label="停运扣分"
|
|
|
align="center"
|
|
|
- prop="stopScore"
|
|
|
+ prop="stopScore"
|
|
|
v-if="hasStopScore()"
|
|
|
style="width: 33%;">
|
|
|
<template #default="scope">
|
|
|
@@ -1497,20 +1497,20 @@ function checkReviewScoreChanged() {
|
|
|
if (!reviewForm.value || !reviewForm.value.scorePersonList) {
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return reviewForm.value.scorePersonList.some(person => {
|
|
|
- const selfScore = person.selfScore !== null && person.selfScore !== undefined && person.selfScore !== ''
|
|
|
- ? parseFloat(person.selfScore)
|
|
|
+ const selfScore = person.selfScore !== null && person.selfScore !== undefined && person.selfScore !== ''
|
|
|
+ ? parseFloat(person.selfScore)
|
|
|
: null;
|
|
|
- const reviewScore = person.reviewScore !== null && person.reviewScore !== undefined && person.reviewScore !== ''
|
|
|
- ? parseFloat(person.reviewScore)
|
|
|
+ const reviewScore = person.reviewScore !== null && person.reviewScore !== undefined && person.reviewScore !== ''
|
|
|
+ ? parseFloat(person.reviewScore)
|
|
|
: null;
|
|
|
-
|
|
|
+
|
|
|
// 如果自评得分和复评得分都存在且不相等,则返回true
|
|
|
if (selfScore !== null && reviewScore !== null) {
|
|
|
return Math.abs(selfScore - reviewScore) > 0.005; // 使用容差避免浮点数精度问题
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 如果自评得分存在但复评得分不存在,或反之,也认为是不同
|
|
|
return (selfScore !== null && reviewScore === null) || (selfScore === null && reviewScore !== null);
|
|
|
});
|
|
|
@@ -1522,15 +1522,15 @@ function checkItemCompletionFactorChanged() {
|
|
|
// 不是维保工单,不需要检查分项完成系数
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const currentFactor = reviewForm.value.itemCompletionFactor;
|
|
|
const initialFactor = reviewForm.value.initialItemCompletionFactor;
|
|
|
-
|
|
|
+
|
|
|
if (currentFactor == null || initialFactor == null) {
|
|
|
// 如果任一值为null,认为没有变化
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 比较分项完成系数是否发生变化
|
|
|
return Math.abs(parseFloat(currentFactor) - parseFloat(initialFactor)) > 0.005;
|
|
|
}
|
|
|
@@ -1949,14 +1949,14 @@ function onReviewScoreInputChange(row) {
|
|
|
if (debounceTimer) {
|
|
|
clearTimeout(debounceTimer);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 设置新的定时器
|
|
|
debounceTimer = setTimeout(() => {
|
|
|
updateReviewTotalScore(row);
|
|
|
-
|
|
|
+
|
|
|
// 检查是否需要显示修改理由
|
|
|
const shouldShowModifyReason = checkReviewScoreChanged() || checkItemCompletionFactorChanged();
|
|
|
-
|
|
|
+
|
|
|
if (shouldShowModifyReason && !showModifyReason.value) {
|
|
|
// 需要显示修改理由,且当前未显示
|
|
|
showModifyReason.value = true;
|
|
|
@@ -2194,11 +2194,11 @@ function handleReview(row) {
|
|
|
isItemCompletionFactorEditable.value = false;
|
|
|
showReturnReason.value = false;
|
|
|
showModifyReason.value = false;
|
|
|
-
|
|
|
+
|
|
|
// 检查是否需要显示修改理由 - 检查复评得分是否与自评得分不同或分项完成系数是否变化
|
|
|
// 在数据加载完成后检查是否需要显示修改理由
|
|
|
/* const shouldShowModifyReason = checkReviewScoreChanged() || checkItemCompletionFactorChanged();
|
|
|
-
|
|
|
+
|
|
|
if (shouldShowModifyReason && !showModifyReason.value) {
|
|
|
showModifyReason.value = true;
|
|
|
} else if (!shouldShowModifyReason && showModifyReason.value) {
|
|
|
@@ -3419,7 +3419,7 @@ function hasOtherOrQitaInspectionType() {
|
|
|
function hasStopScore() {
|
|
|
// 检查当前查看的工单是否存在停运扣分
|
|
|
if (viewForm.value && viewForm.value.scorePersonList && Array.isArray(viewForm.value.scorePersonList)) {
|
|
|
- return viewForm.value.scorePersonList.some(person =>
|
|
|
+ return viewForm.value.scorePersonList.some(person =>
|
|
|
person.stopScore !== null && person.stopScore !== undefined && person.stopScore !== ''
|
|
|
);
|
|
|
}
|