|
|
@@ -111,7 +111,9 @@
|
|
|
<!-- <el-table-column label="状态" align="center" prop="workOrderStatus" />-->
|
|
|
<el-table-column label="状态" align="center" prop="scoringStatus" >
|
|
|
<template #default="scope">
|
|
|
- <dict-tag :options="gxt_scoring_status" :value="scope.row.scoringStatus" />
|
|
|
+ <dict-tag
|
|
|
+ :options="gxt_scoring_status"
|
|
|
+ :value="scope.row.scoringStatus" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="风机编号" align="center" prop="pcsDeviceName" :show-overflow-tooltip="true" />
|
|
|
@@ -128,7 +130,7 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
- v-if="scope.row.scoringStatus == 'to_self' && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
|
|
|
+ v-if="(scope.row.scoringStatus == 'to_self' || scope.row.scoringStatus == 'returned') && (scope.row.teamLeaderId == userStore.id || userStore.roles.includes('admin'))"
|
|
|
@click="handleSelfEvaluation(scope.row)"
|
|
|
v-hasPermi="['gxt:orderScore:selfEvaluation']"
|
|
|
><i class="fa fa-edit"></i>自评</el-button>
|
|
|
@@ -240,6 +242,9 @@
|
|
|
<el-col :span="24">
|
|
|
<el-form-item :label="viewForm.orderType === 1 ? '维修总结' : '维保总结'">{{ viewForm.workSummary }}</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24" v-if="viewForm.orderType === 1 && viewForm.extraWork">
|
|
|
+ <el-form-item label="额外工作总结">{{ viewForm.extraWork }}</el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -262,6 +267,10 @@
|
|
|
<dict-tag :options="gxt_repair_order_flow_action_type" :value="flow.actionType" />
|
|
|
</h4>
|
|
|
<p>{{ flow.operatorName }}</p>
|
|
|
+ <!-- 显示退回理由 -->
|
|
|
+ <p v-if="flow.actionType === 'returnRating'">
|
|
|
+ {{ flow.actionRemark }}
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</el-timeline-item>
|
|
|
</el-timeline>
|
|
|
@@ -295,6 +304,27 @@
|
|
|
<span>{{ scope.row.finalScore !== null && scope.row.finalScore !== undefined ? parseFloat(scope.row.finalScore).toFixed(2) : '' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- 额外工分和总分 - 仅当维修工单且有额外工作总结时显示 -->
|
|
|
+ <el-table-column
|
|
|
+ label="额外工分"
|
|
|
+ align="center"
|
|
|
+ prop="extraScore"
|
|
|
+ v-if="viewForm.orderType === 1 && viewForm.extraWork && viewForm.extraWork.trim() !== ''"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.extraScore !== null && scope.row.extraScore !== undefined ? parseFloat(scope.row.extraScore).toFixed(2) : '' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="总分"
|
|
|
+ align="center"
|
|
|
+ prop="totalScore"
|
|
|
+ v-if="viewForm.orderType === 1 && viewForm.extraWork && viewForm.extraWork.trim() !== ''"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.totalScore !== null && scope.row.totalScore !== undefined ? parseFloat(scope.row.totalScore).toFixed(2) : '' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -339,6 +369,22 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <!-- 额外工作总结 - 仅维修工单显示 -->
|
|
|
+ <el-form-item
|
|
|
+ label="额外工作总结"
|
|
|
+ v-if="selfEvaluationForm.orderType === 1"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="selfEvaluationForm.extraWork"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入额外工作总结"
|
|
|
+ maxlength="200"
|
|
|
+ show-word-limit
|
|
|
+ :rows="4"
|
|
|
+ @input="handleExtraWorkChange"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="24" v-if="selfEvaluationForm.orderType === 1">
|
|
|
<el-form-item label="检修类型" prop="maintenanceType">
|
|
|
@@ -405,14 +451,57 @@
|
|
|
</el-row>
|
|
|
<el-form-item label="得分明细">
|
|
|
<el-table :data="selfEvaluationForm.scorePersonList" border style="width: 100%;">
|
|
|
- <el-table-column label="检修员" align="center" prop="nickName" style="width: 50%;">
|
|
|
+ <el-table-column label="检修员" align="center" prop="nickName" style="width: 33%;">
|
|
|
<template #default="scope">
|
|
|
<span>{{ scope.row.nickName }}<span v-if="scope.row.isLeader == 1"> (工作负责人)</span></span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="自评得分" align="center" prop="selfScore" style="width: 50%;">
|
|
|
+ <el-table-column label="自评得分" align="center" prop="selfScore" style="width: 33%;">
|
|
|
<template #default="scope">
|
|
|
- <el-input-number v-model="scope.row.selfScore" style="width: 100%;" :min="0.01" :max="10" :step="0.01"/>
|
|
|
+ <el-input-number
|
|
|
+ v-model="scope.row.selfScore"
|
|
|
+ style="width: 100%;"
|
|
|
+ :min="0.01"
|
|
|
+ :max="10"
|
|
|
+ :step="0.01"
|
|
|
+ @change="updateTotalScore(scope.row)"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 额外工分和总分 - 仅当维修工单且有额外工作总结时显示 -->
|
|
|
+ <el-table-column
|
|
|
+ label="额外工分"
|
|
|
+ align="center"
|
|
|
+ prop="extraScore"
|
|
|
+ v-if="selfEvaluationForm.orderType === 1 && selfEvaluationForm.extraWork && selfEvaluationForm.extraWork.trim() !== ''"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number
|
|
|
+ v-model="scope.row.extraScore"
|
|
|
+ style="width: 100%;"
|
|
|
+ :min="0"
|
|
|
+ :max="10"
|
|
|
+ :step="0.01"
|
|
|
+ :precision="2"
|
|
|
+ @change="updateTotalScore(scope.row)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="总分"
|
|
|
+ align="center"
|
|
|
+ prop="totalScore"
|
|
|
+ v-if="selfEvaluationForm.orderType === 1 && selfEvaluationForm.extraWork && selfEvaluationForm.extraWork.trim() !== ''"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number
|
|
|
+ v-model="scope.row.totalScore"
|
|
|
+ style="width: 100%;"
|
|
|
+ :min="0.01"
|
|
|
+ :max="20"
|
|
|
+ :step="0.01"
|
|
|
+ :precision="2"
|
|
|
+ :disabled="true"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -456,11 +545,22 @@
|
|
|
:rows="4"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <!-- 额外工作总结 - 仅维修工单显示 -->
|
|
|
+ <el-form-item
|
|
|
+ label="额外工作总结"
|
|
|
+ v-if="reviewForm.orderType === 1"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="reviewForm.extraWork"
|
|
|
+ type="textarea"
|
|
|
+ disabled
|
|
|
+ :rows="4"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="21" v-if="reviewForm.orderType === 1">
|
|
|
+ <el-col :span="12" v-if="reviewForm.orderType === 1">
|
|
|
<el-form-item label="检修类型">
|
|
|
- <el-select v-model="reviewForm.maintenanceType" placeholder="请选择检修类型" style="width: 100%" :disabled="!isMaintenanceTypeEditable" @change="handleMaintenanceTypeChange">
|
|
|
+ <el-select v-model="reviewForm.maintenanceType" placeholder="请选择检修类型" style="width: 100%" disabled>
|
|
|
<el-option
|
|
|
v-for="item in maintenanceTypeOptions"
|
|
|
:key="item.value"
|
|
|
@@ -470,8 +570,36 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="3" v-if="reviewForm.orderType === 1">
|
|
|
+<!-- <el-col :span="3" v-if="reviewForm.orderType === 1">
|
|
|
<el-button type="primary" style="margin-top: 30px;" @click="handleModifyType">修改</el-button>
|
|
|
+ </el-col>-->
|
|
|
+ <el-col :span="12" v-if="reviewForm.orderType === 1">
|
|
|
+ <el-form-item label="质量系数(建议值)" prop="finalCoefficient">
|
|
|
+ <el-input-number
|
|
|
+ v-model="reviewForm.finalCoefficient"
|
|
|
+ :min="0.5"
|
|
|
+ :max="1.5"
|
|
|
+ :step="0.01"
|
|
|
+ style="width: 100%"
|
|
|
+ controls-position="right"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- 退回理由 - 仅在维修工单显示 -->
|
|
|
+ <el-col :span="24" v-if="reviewForm.orderType === 1">
|
|
|
+ <el-form-item
|
|
|
+ label="退回理由"
|
|
|
+ prop="scoreReturnReason">
|
|
|
+ <el-input
|
|
|
+ v-model="reviewForm.scoreReturnReason"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入退回理由,输入后将显示退回按钮"
|
|
|
+ maxlength="500"
|
|
|
+ show-word-limit
|
|
|
+ :rows="6"
|
|
|
+ @input="onReturnReasonInput"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24" v-if="reviewForm.orderType === 2">
|
|
|
<el-form-item label="维保类型">
|
|
|
@@ -553,6 +681,9 @@
|
|
|
disabled
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <!-- 退回理由 - 仅在维修工单的退回操作时显示 -->
|
|
|
+
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="外委人员数(人)">
|
|
|
@@ -582,6 +713,43 @@
|
|
|
<el-input v-model="scope.row.reviewScore" style="width: 100%;" :readonly="isEditScore"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- 额外工分和总分 - 仅当维修工单且有额外工作总结时显示 -->
|
|
|
+ <el-table-column
|
|
|
+ label="额外工分"
|
|
|
+ align="center"
|
|
|
+ prop="extraScore"
|
|
|
+ v-if="reviewForm.orderType === 1 && reviewForm.extraWork && reviewForm.extraWork.trim() !== ''"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.extraScore"
|
|
|
+ style="width: 100%;"
|
|
|
+ :min="0"
|
|
|
+ :max="10"
|
|
|
+ :step="0.01"
|
|
|
+ :precision="2"
|
|
|
+ :disabled="true"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="总分"
|
|
|
+ align="center"
|
|
|
+ prop="totalScore"
|
|
|
+ v-if="reviewForm.orderType === 1 && reviewForm.extraWork && reviewForm.extraWork.trim() !== ''"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.totalScore"
|
|
|
+ style="width: 100%;"
|
|
|
+ :min="0.01"
|
|
|
+ :max="20"
|
|
|
+ :step="0.01"
|
|
|
+ :precision="2"
|
|
|
+ :disabled="true"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -589,7 +757,18 @@
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="closeReviewDialog">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitReview">提交复评</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="reviewForm.orderType === 1 && hasReturnReason"
|
|
|
+ type="warning"
|
|
|
+ @click="submitReturn">
|
|
|
+ 退 回
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="!(reviewForm.orderType === 1 && hasReturnReason)"
|
|
|
+ type="primary"
|
|
|
+ @click="submitReview">
|
|
|
+ 提交复评
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
@@ -626,7 +805,18 @@
|
|
|
:rows="4"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <!-- 额外工作总结 - 仅维修工单显示 -->
|
|
|
+ <el-form-item
|
|
|
+ label="额外工作总结"
|
|
|
+ v-if="finalEvaluationForm.orderType === 1"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="finalEvaluationForm.extraWork"
|
|
|
+ type="textarea"
|
|
|
+ disabled
|
|
|
+ :rows="4"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12" v-if="finalEvaluationForm.orderType === 1">
|
|
|
<el-form-item label="检修类型">
|
|
|
@@ -653,7 +843,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="系数" prop="finalCoefficient">
|
|
|
+ <el-form-item label="质量系数" prop="finalCoefficient">
|
|
|
<el-input-number
|
|
|
v-model="finalEvaluationForm.finalCoefficient"
|
|
|
:min="finalEvaluationForm.orderType === 1 ? 0.5 : 0.8"
|
|
|
@@ -661,6 +851,7 @@
|
|
|
:step="0.01"
|
|
|
style="width: 100%"
|
|
|
controls-position="right"
|
|
|
+ @change="onFinalCoefficientChange"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -694,7 +885,7 @@
|
|
|
<span>{{ scope.row.reviewScore !== null && scope.row.reviewScore !== undefined ? parseFloat(scope.row.reviewScore).toFixed(2) : '' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="终评得分" align="center" prop="finalScore">
|
|
|
+<!-- <el-table-column label="终评得分" align="center" prop="finalScore">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.finalScore"
|
|
|
:value="calculateFinalScore(scope.row.reviewScore, finalEvaluationForm.finalCoefficient)"
|
|
|
@@ -702,6 +893,43 @@
|
|
|
style="width: 100%;"
|
|
|
/>
|
|
|
</template>
|
|
|
+ </el-table-column>-->
|
|
|
+ <el-table-column label="终评得分" align="center" prop="finalScore">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input v-model="scope.row.finalScore"
|
|
|
+ readonly
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 额外工分和总分 - 仅当维修工单且有额外工作总结时显示 -->
|
|
|
+ <el-table-column
|
|
|
+ label="额外工分"
|
|
|
+ align="center"
|
|
|
+ prop="extraScore"
|
|
|
+ v-if="hasExtraWork()"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.extraScore"
|
|
|
+ style="width: 100%;"
|
|
|
+ :disabled="true"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="总分"
|
|
|
+ align="center"
|
|
|
+ prop="totalScore"
|
|
|
+ v-if="hasExtraWork()"
|
|
|
+ style="width: 33%;">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.totalScore"
|
|
|
+ style="width: 100%;"
|
|
|
+ :disabled="true"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
@@ -710,7 +938,7 @@
|
|
|
<el-button type="primary" @click="submitFinalEvaluation">提交终评</el-button>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="申诉信息" name="appeal">
|
|
|
+ <el-tab-pane label="申诉信息" name="appeal" v-if="finalEvaluationForm.orderType === 2">
|
|
|
<el-form-item label="申诉理由">
|
|
|
<el-input
|
|
|
v-model="finalEvaluationForm.appealReason"
|
|
|
@@ -1074,6 +1302,14 @@ const showCompletionFactorFeedback = ref(false);
|
|
|
const isMaintenanceTypeEditable = ref(false);
|
|
|
const isItemCompletionFactorEditable = ref(false);
|
|
|
|
|
|
+// 控制是否显示退回理由
|
|
|
+const showReturnReason = ref(false);
|
|
|
+
|
|
|
+// 计算属性:判断是否有退回理由
|
|
|
+const hasReturnReason = computed(() => {
|
|
|
+ return reviewForm.value && reviewForm.value.scoreReturnReason && reviewForm.value.scoreReturnReason.trim() !== '';
|
|
|
+});
|
|
|
+
|
|
|
// 查询参数
|
|
|
const queryParams = ref({
|
|
|
pageNum: 1,
|
|
|
@@ -1108,12 +1344,18 @@ const selfEvaluationRules = ref({
|
|
|
const reviewRules = ref({
|
|
|
modifyReason: [
|
|
|
{ required: true, message: "修改理由不能为空", trigger: "blur" }
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ /*scoreReturnReason: [
|
|
|
+ { required: true, message: "退回理由不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ finalCoefficient: [
|
|
|
+ { required: true, message: "质量系数(建议值)不能为空", trigger: "change" },
|
|
|
+ ]*/
|
|
|
});
|
|
|
|
|
|
const finalEvaluationRules = ref({
|
|
|
finalCoefficient: [
|
|
|
- { required: true, message: "终评系数不能为空", trigger: "change" }
|
|
|
+ { required: true, message: "质量系数不能为空", trigger: "change" }
|
|
|
]
|
|
|
});
|
|
|
|
|
|
@@ -1264,6 +1506,7 @@ function handleView(row) {
|
|
|
viewForm.value.orderType = row.orderType;
|
|
|
// 根据工单类型设置总结内容
|
|
|
viewForm.value.workSummary = row.orderType === 1 ? response.data.content : response.data.realContent;
|
|
|
+ viewForm.value.extraWork = row.orderType === 1 ? response.data.extraWork : null; // 额外工作总结
|
|
|
// 根据工单类型设置人员列表
|
|
|
if (row.orderType === 1) {
|
|
|
// 维修工单
|
|
|
@@ -1299,6 +1542,7 @@ function handleSelfEvaluation(row) {
|
|
|
pcsDeviceName: row.pcsDeviceName,
|
|
|
pcsStationName: row.pcsStationName,
|
|
|
workSummary: row.orderType === 1 ? data.content : data.realContent,
|
|
|
+ extraWork: row.orderType === 1 ? data.extraWork : null, // 额外工作总结
|
|
|
maintenanceType: row.orderType === 1 ? data.maintenanceType : null,
|
|
|
inspectionType: row.orderType === 2 ? data.inspectionType : null,
|
|
|
itemCompletionFactor: row.orderType === 2 ? data.itemCompletionFactor : null,
|
|
|
@@ -1308,10 +1552,21 @@ function handleSelfEvaluation(row) {
|
|
|
wlryNum: data.wlryNum,
|
|
|
};
|
|
|
|
|
|
- // 初始化自评分为空值,自评得分为可编辑状态
|
|
|
+ // 初始化自评分,如果之前已有自评分数则保留,否则初始化为空值
|
|
|
if (selfEvaluationForm.value.scorePersonList && selfEvaluationForm.value.scorePersonList.length > 0) {
|
|
|
selfEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
- person.selfScore = null;
|
|
|
+ // 保留之前已存在的自评分数,如果没有则初始化为null
|
|
|
+ if (person.selfScore === undefined || person.selfScore === null) {
|
|
|
+ person.selfScore = null;
|
|
|
+ }
|
|
|
+ // 保留之前已存在的额外工分,如果没有则初始化为null
|
|
|
+ if (person.extraScore === undefined || person.extraScore === null) {
|
|
|
+ person.extraScore = null;
|
|
|
+ }
|
|
|
+ // 保留之前已存在的总分,如果没有则初始化为null
|
|
|
+ if (person.totalScore === undefined || person.totalScore === null) {
|
|
|
+ person.totalScore = null;
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -1339,6 +1594,48 @@ function handleMaintenanceTypeChangeForSelfEvaluation() {
|
|
|
calculateMaintenanceScores();
|
|
|
}*/
|
|
|
clearSelfScores();
|
|
|
+ if (selfEvaluationForm.value.orderType === 1) {
|
|
|
+ // 如果额外工作总结有值,重新计算总分
|
|
|
+ if (selfEvaluationForm.value.extraWork && selfEvaluationForm.value.extraWork.trim() !== '') {
|
|
|
+ if (selfEvaluationForm.value.scorePersonList && selfEvaluationForm.value.scorePersonList.length > 0) {
|
|
|
+ selfEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
+ updateTotalScore(person);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/** 更新总分(自评得分+额外工分) */
|
|
|
+function updateTotalScore(row) {
|
|
|
+ if (row.selfScore !== null && row.selfScore !== undefined &&
|
|
|
+ row.extraScore !== null && row.extraScore !== undefined) {
|
|
|
+ // 计算总分,保留两位小数
|
|
|
+ const total = parseFloat((parseFloat(row.selfScore) + parseFloat(row.extraScore)).toFixed(2));
|
|
|
+ row.totalScore = total;
|
|
|
+ } else if (row.selfScore !== null && row.selfScore !== undefined) {
|
|
|
+ // 如果额外工分为null或undefined,只显示自评得分
|
|
|
+ row.totalScore = parseFloat(row.selfScore.toFixed(2));
|
|
|
+ } else if (row.extraScore !== null && row.extraScore !== undefined) {
|
|
|
+ // 如果自评得分为null或undefined,只显示额外工分
|
|
|
+ row.totalScore = parseFloat(row.extraScore.toFixed(2));
|
|
|
+ } else {
|
|
|
+ // 都为null或undefined,则总分为null
|
|
|
+ row.totalScore = null;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/** 处理额外工作总结变化 */
|
|
|
+function handleExtraWorkChange() {
|
|
|
+ // 如果额外工作总结为空,清空额外工分和总分的值
|
|
|
+ if (!selfEvaluationForm.value.extraWork || selfEvaluationForm.value.extraWork.trim() === '') {
|
|
|
+ if (selfEvaluationForm.value.scorePersonList && selfEvaluationForm.value.scorePersonList.length > 0) {
|
|
|
+ selfEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
+ person.extraScore = null;
|
|
|
+ person.totalScore = null;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 计算维修工单人员得分 */
|
|
|
@@ -1392,6 +1689,13 @@ function calculateRepairScores() {
|
|
|
person.selfScore = baseScore.toFixed(2);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // 如果额外工作总结有值,重新计算总分
|
|
|
+ if (selfEvaluationForm.value.extraWork && selfEvaluationForm.value.extraWork.trim() !== '') {
|
|
|
+ selfEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
+ updateTotalScore(person);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 计算维保工单人员得分 */
|
|
|
@@ -1455,6 +1759,13 @@ function submitSelfEvaluation() {
|
|
|
}
|
|
|
|
|
|
// 提交自评
|
|
|
+ // 确保在提交前计算所有人员的总分
|
|
|
+ if (selfEvaluationForm.value.scorePersonList && selfEvaluationForm.value.scorePersonList.length > 0) {
|
|
|
+ selfEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
+ updateTotalScore(person);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
selfEvaluation(selfEvaluationForm.value).then(response => {
|
|
|
proxy.$modal.msgSuccess("自评提交成功");
|
|
|
selfEvaluationDialogVisible.value = false;
|
|
|
@@ -1488,6 +1799,9 @@ function handleReview(row) {
|
|
|
confirmStatus: data.confirmStatus,
|
|
|
wwryNum: data.wwryNum,
|
|
|
wlryNum: data.wlryNum,
|
|
|
+ finalCoefficient: row.orderType === 1 ? (data.finalCoefficient ? data.finalCoefficient : 1.0) : null,
|
|
|
+ scoreReturnReason: null,
|
|
|
+ extraWork: row.orderType === 1 ? data.extraWork : null, // 额外工作总结
|
|
|
};
|
|
|
|
|
|
// 保存初始值,用于比较
|
|
|
@@ -1514,6 +1828,7 @@ function handleReview(row) {
|
|
|
isMaintenanceTypeEditable.value = false;
|
|
|
isItemCompletionFactorEditable.value = false;
|
|
|
showModifyReason.value = false;
|
|
|
+ showReturnReason.value = false;
|
|
|
|
|
|
// 如果是维保工单,根据风机型号获取维保类型选项
|
|
|
if (row.orderType === 2) {
|
|
|
@@ -1707,6 +2022,46 @@ function closeReviewDialog() {
|
|
|
proxy.resetForm("reviewRef");
|
|
|
}
|
|
|
|
|
|
+/** 提交退回 */
|
|
|
+function submitReturn() {
|
|
|
+ proxy.$refs["reviewRef"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ // 检查是否是维修工单
|
|
|
+ if (reviewForm.value.orderType !== 1) {
|
|
|
+ proxy.$modal.msgError("只有维修工单才能执行退回操作");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 验证退回理由不为空
|
|
|
+ if (!reviewForm.value.scoreReturnReason || reviewForm.value.scoreReturnReason.trim() === '') {
|
|
|
+ proxy.$modal.msgError("退回理由不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* const returnData = {
|
|
|
+ orderType: reviewForm.value.orderType,
|
|
|
+ id: reviewForm.value.id,
|
|
|
+ scoreReturnReason: reviewForm.value.scoreReturnReason,
|
|
|
+ // 保留其他必要的字段
|
|
|
+ scorePersonList: reviewForm.value.scorePersonList,
|
|
|
+ feedbackReason: reviewForm.value.feedbackReason,
|
|
|
+ confirmStatus: reviewForm.value.confirmStatus,
|
|
|
+ finalCoefficient: reviewForm.value.finalCoefficient
|
|
|
+ };*/
|
|
|
+
|
|
|
+ review(reviewForm.value).then(response => {
|
|
|
+ proxy.$modal.msgSuccess("退回成功");
|
|
|
+ reviewDialogVisible.value = false;
|
|
|
+ getList();
|
|
|
+ }).catch(error => {
|
|
|
+ proxy.$modal.msgError(error.message || "退回失败");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/** 关闭确认对话框 */
|
|
|
function closeConfirmDialog() {
|
|
|
confirmDialogVisible.value = false;
|
|
|
@@ -1716,6 +2071,12 @@ function closeConfirmDialog() {
|
|
|
proxy.resetForm("confirmRef");
|
|
|
}
|
|
|
|
|
|
+/** 监听退回理由输入 */
|
|
|
+function onReturnReasonInput() {
|
|
|
+ // 当用户输入退回理由时,自动显示退回按钮
|
|
|
+ // 这会触发计算属性hasReturnReason的更新
|
|
|
+}
|
|
|
+
|
|
|
/** 提交复评 */
|
|
|
function submitReview() {
|
|
|
proxy.$refs["reviewRef"].validate(valid => {
|
|
|
@@ -1737,13 +2098,20 @@ function submitReview() {
|
|
|
proxy.$modal.msgError("修改了分项完成系数,请填写修改理由");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ // 验证质量系数不为空(仅维修工单)
|
|
|
+ if (reviewForm.value.orderType === 1 && (!reviewForm.value.finalCoefficient || reviewForm.value.finalCoefficient === null)) {
|
|
|
+ proxy.$modal.msgError("质量系数不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
reviewForm.value.reviewScoreNum = reviewForm.value.reviewScoreNum + 1;
|
|
|
review(reviewForm.value).then(response => {
|
|
|
proxy.$modal.msgSuccess("复评提交成功");
|
|
|
reviewDialogVisible.value = false;
|
|
|
getList();
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -1822,9 +2190,10 @@ function handleFinalEvaluation(row) {
|
|
|
pcsDeviceName: row.pcsDeviceName,
|
|
|
pcsStationName: row.pcsStationName,
|
|
|
workSummary: row.orderType === 1 ? data.content : data.realContent,
|
|
|
+ extraWork: row.orderType === 1 ? data.extraWork : null, // 额外工作总结
|
|
|
maintenanceType: row.orderType === 1 ? data.maintenanceType : null,
|
|
|
inspectionType: row.orderType === 2 ? data.inspectionType : null,
|
|
|
- finalCoefficient: row.orderType === 1 ? 1.0 : 1.0, // 默认系数
|
|
|
+ finalCoefficient: row.orderType === 1 ? (data.finalCoefficient || 1.0) : 1.0, // 默认系数,维修工单使用班长建议值
|
|
|
scorePersonList: row.orderType === 1 ? (data.repairOrderPersonList || []) : (data.workOrderPersonList || []),
|
|
|
feedbackReason: row.orderType === 1 ? data.feedbackReason : null,
|
|
|
confirmStatus: data.confirmStatus,
|
|
|
@@ -1849,6 +2218,19 @@ function handleFinalEvaluation(row) {
|
|
|
// 默认显示终评信息标签页
|
|
|
activeFinalEvalTab.value = 'evaluation';
|
|
|
|
|
|
+ // 计算每个人的终评得分
|
|
|
+ if (finalEvaluationForm.value.scorePersonList && finalEvaluationForm.value.scorePersonList.length > 0) {
|
|
|
+ finalEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
+ // 计算终评得分
|
|
|
+ person.finalScore = calculateFinalScore(person.reviewScore, finalEvaluationForm.value.finalCoefficient);
|
|
|
+
|
|
|
+ // 如果是维修工单且有额外工分,则计算总分
|
|
|
+ if (finalEvaluationForm.value.orderType === 1 && person.extraScore !== null && person.extraScore !== undefined) {
|
|
|
+ person.totalScore = parseFloat((parseFloat(person.finalScore) + parseFloat(person.extraScore)).toFixed(2));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
finalEvaluationDialogVisible.value = true;
|
|
|
});
|
|
|
}
|
|
|
@@ -1867,6 +2249,27 @@ function calculateFinalScore(reviewScore, finalCoefficient) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/** 检查是否有额外工作内容 */
|
|
|
+function hasExtraWork() {
|
|
|
+ // 检查当前终评表单中的额外工作总结是否为空
|
|
|
+ return finalEvaluationForm.value.orderType === 1 && finalEvaluationForm.value.extraWork && finalEvaluationForm.value.extraWork.trim() !== '';
|
|
|
+}
|
|
|
+
|
|
|
+/** 当质量系数变化时,重新计算终评得分和总分 */
|
|
|
+function onFinalCoefficientChange() {
|
|
|
+ if (finalEvaluationForm.value.scorePersonList && finalEvaluationForm.value.scorePersonList.length > 0) {
|
|
|
+ finalEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
+ // 重新计算终评得分
|
|
|
+ person.finalScore = calculateFinalScore(person.reviewScore, finalEvaluationForm.value.finalCoefficient);
|
|
|
+
|
|
|
+ // 如果是维修工单且有额外工分,则重新计算总分
|
|
|
+ if (finalEvaluationForm.value.orderType === 1 && person.extraScore !== null && person.extraScore !== undefined) {
|
|
|
+ person.totalScore = parseFloat((parseFloat(person.finalScore) + parseFloat(person.extraScore)).toFixed(2));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/** 提交终评 */
|
|
|
function submitFinalEvaluation() {
|
|
|
proxy.$refs["finalEvaluationRef"].validate(valid => {
|
|
|
@@ -1874,6 +2277,10 @@ function submitFinalEvaluation() {
|
|
|
// 计算每个人的终评得分
|
|
|
finalEvaluationForm.value.scorePersonList.forEach(person => {
|
|
|
person.finalScore = calculateFinalScore(person.reviewScore, finalEvaluationForm.value.finalCoefficient);
|
|
|
+ // 如果是维修工单且有额外工分,则计算总分
|
|
|
+ if (finalEvaluationForm.value.orderType === 1 && person.extraScore !== null && person.extraScore !== undefined) {
|
|
|
+ person.totalScore = parseFloat((parseFloat(person.finalScore) + parseFloat(person.extraScore)).toFixed(2));
|
|
|
+ }
|
|
|
});
|
|
|
finalEvaluation(finalEvaluationForm.value).then(response => {
|
|
|
proxy.$modal.msgSuccess("终评提交成功");
|
|
|
@@ -1893,10 +2300,16 @@ function handleAppeal() {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 检查工单类型是否为维修工单或维保工单
|
|
|
+ /* // 检查工单类型是否为维修工单或维保工单
|
|
|
if (selectedOrder.orderType !== 1 && selectedOrder.orderType !== 2) {
|
|
|
proxy.$modal.msgError("只有维修工单或维保工单才能发起申诉");
|
|
|
return;
|
|
|
+ }*/
|
|
|
+
|
|
|
+ // 检查工单类型是否为维保工单
|
|
|
+ if (selectedOrder.orderType !== 2) {
|
|
|
+ proxy.$modal.msgError("只有维保工单才能发起申诉");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
// 检查工单状态是否为"待归档"或"已归档"
|
|
|
@@ -2355,4 +2768,16 @@ function validateScoringRules() {
|
|
|
word-break: break-word;
|
|
|
line-height: 1.5;
|
|
|
}
|
|
|
+
|
|
|
+.returned-status-hint {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.flow-remark {
|
|
|
+ color: #909399;
|
|
|
+ font-size: 12px;
|
|
|
+ margin: 0;
|
|
|
+ padding-left: 20px;
|
|
|
+ font-style: italic;
|
|
|
+}
|
|
|
</style>
|