Просмотр исходного кода

fix(performanceManage/monthlyAssess): 修复月度考评表单的指标数据处理和样式问题

1. 移除冗余的qcDeptType显示字段
2. 调整弹窗表单缩进和换行格式优化可读性
3. 调整明细标题的左侧间距对齐布局
4. 补全提交时的指标字段映射逻辑
5. 修复onIndicatorNameChange中的表单赋值冗余问题
huoyi 1 месяц назад
Родитель
Сommit
65d6463e60
1 измененных файлов с 23 добавлено и 16 удалено
  1. 23 16
      src/views/performanceManage/monthlyAssess/index.vue

+ 23 - 16
src/views/performanceManage/monthlyAssess/index.vue

@@ -267,7 +267,7 @@
267 267
               <div class="indicator-name">{{ item.indicatorName }}</div>
268 268
               <div class="indicator-value">{{ item.score }}/次</div>
269 269
               <div class="indicator-count">{{ item.occurCount }}次</div>
270
-              <div class="indicator-qcDeptType">{{ item.qcDeptType }}</div>
270
+
271 271
               <div class="indicator-total">{{ item.scoreResult }}</div>
272 272
               <div class="indicator-actions">
273 273
                 <el-button type="primary" link icon="Edit" @click="editIndicator(groupIndex, itemIndex)"></el-button>
@@ -483,14 +483,14 @@
483 483
     <el-dialog :title="indicatorDialog.title" v-model="indicatorDialog.visible" width="60%">
484 484
       <el-form label-width="150px" class="indicator-form" :model="indicatorDialog.form" :rules="indicatorDialog.rules">
485 485
         <el-form-item label="指标名称" prop="indicatorId" required>
486
-   
487
-            <el-select v-model="indicatorDialog.form.indicatorId" placeholder="搜索指标名称" filterable remote reserve-keyword
488
-              :remote-method="searchIndicators" :loading="indicatorDialog.loading" style="flex: 1;"
489
-              @change="onIndicatorNameChange">
490
-              <el-option v-for="item in indicatorDialog.indicatorOptions" :key="item.id" :label="item.name"
491
-                :value="item.id" />
492
-            </el-select>
493
-        
486
+
487
+          <el-select v-model="indicatorDialog.form.indicatorId" placeholder="搜索指标名称" filterable remote reserve-keyword
488
+            :remote-method="searchIndicators" :loading="indicatorDialog.loading" style="flex: 1;"
489
+            @change="onIndicatorNameChange">
490
+            <el-option v-for="item in indicatorDialog.indicatorOptions" :key="item.id" :label="item.name"
491
+              :value="item.id" />
492
+          </el-select>
493
+
494 494
         </el-form-item>
495 495
 
496 496
         <el-form-item label="分值/单位">
@@ -508,9 +508,11 @@
508 508
           </div>
509 509
         </el-form-item>
510 510
 
511
-        <template v-for="(detail, index) in (indicatorDialog.form.personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList || [])" :key="index">
511
+        <template
512
+          v-for="(detail, index) in (indicatorDialog.form.personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList || [])"
513
+          :key="index">
512 514
           <div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px;">
513
-            <h4 style="margin: 0;">明细{{ index + 1 }}</h4>
515
+            <h4 style="margin-left: 80px;">明细{{ index + 1 }}</h4>
514 516
             <el-button type="danger" size="small" @click="removeRewardPunishmentDetail(index)">删除</el-button>
515 517
           </div>
516 518
           <el-form-item label="检查部门">
@@ -526,7 +528,8 @@
526 528
           </el-form-item>
527 529
           <el-form-item v-if="indicatorDialog.form.score > 0" label="奖励">
528 530
             <div style="display: flex; align-items: center; gap: 10px;">
529
-              <el-input-number v-model="detail.amount" :min="0" :precision="2" style="width: 200px;" @change="updateTotal" />
531
+              <el-input-number v-model="detail.amount" :min="0" :precision="2" style="width: 200px;"
532
+                @change="updateTotal" />
530 533
               <span>元</span>
531 534
             </div>
532 535
           </el-form-item>
@@ -535,7 +538,8 @@
535 538
           </el-form-item>
536 539
           <el-form-item v-if="indicatorDialog.form.score < 0" label="扣罚">
537 540
             <div style="display: flex; align-items: center; gap: 10px;">
538
-              <el-input-number v-model="detail.amount" :min="0" :precision="2" style="width: 200px;" @change="updateTotal" />
541
+              <el-input-number v-model="detail.amount" :min="0" :precision="2" style="width: 200px;"
542
+                @change="updateTotal" />
539 543
               <span>元</span>
540 544
             </div>
541 545
           </el-form-item>
@@ -1025,11 +1029,14 @@ const submitForm = async () => {
1025 1029
       if (submitData.assessmentMonth) {
1026 1030
         submitData.assessmentMonth = submitData.assessmentMonth.replace('-', '')
1027 1031
       }
1028
-
1032
+      
1029 1033
       if (submitData.indicatorGroups && submitData.indicatorGroups.length > 0) {
1030 1034
         submitData.personnelMonthlyAssessmentIndicatorDetailList = submitData.indicatorGroups.flatMap(group =>
1031 1035
           group.items.map(item => ({
1032
-            ...item
1036
+            ...item,
1037
+            indicatorName: item.name || item.indicatorName,
1038
+            indicatorId: item.id || item.indicatorId,
1039
+            indicatorCode: item.code || item.indicatorCode,
1033 1040
           }))
1034 1041
         )
1035 1042
         delete submitData.indicatorGroups
@@ -1173,7 +1180,7 @@ const onIndicatorNameChange = (value) => {
1173 1180
   console.log(value, indicatorDialog.indicatorOptions, "indicatorDialog.indicatorOptions")
1174 1181
   const selected = indicatorDialog.indicatorOptions.find(item => item.id === value)
1175 1182
   if (selected) {
1176
-    indicatorDialog.form = { ...selected, occurCount: 1, personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList: [] }
1183
+    indicatorDialog.form = { ...selected, indicatorId: selected.id, indicatorName: selected.name, occurCount: 1, personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList: [] }
1177 1184
     updateTotal()
1178 1185
   }
1179 1186
 }