Browse Source

月度工分汇总-样式优化

wanglt 3 tháng trước cách đây
mục cha
commit
5bcf76e6ed

+ 19 - 30
ygtx-ui/src/views/gxt/monthScore/index.vue

@@ -160,8 +160,9 @@
     <!-- 第五个表单:组员考核得分 -->
     <el-card v-if="!isList" class="card-form" style="margin-bottom: 20px;" shadow="hover">
       <div slot="header" class="clearfix">
-        <span style="font-weight: bold;">组员考核得分</span>
-        <el-input 
+        <span v-if="isInfo" style="font-weight: bold;">组员考核得分</span>
+        <span v-else style="font-weight: bold;">个人工分汇总</span>
+        <el-input v-if="isInfo"
           v-model="userFilterText" 
           placeholder="请输入组员姓名" 
           style="width: 200px; float: right; margin-top: 5px; margin-left: 10px;" 
@@ -174,35 +175,12 @@
       <div class="form-content" style="margin-top: 20px;">
         <!-- 组员考核得分表格 -->
         <el-table :data="userScoreList" style="width: 100%">
-          <el-table-column prop="nickName" label="组员姓名"></el-table-column>
-          <el-table-column label="维保工分">
+          <el-table-column v-if="isInfo" prop="nickName" label="组员姓名"></el-table-column>
+          <el-table-column prop="maintenanceTotalScore" label="维保工分"></el-table-column>
+          <el-table-column prop="repairTotalScore" label="维修工分"></el-table-column>
+          <el-table-column prop="finalScore" label="总工分">
             <template #default="scope">
-              <el-input-number 
-                v-model="scope.row.maintenanceTotalScore" 
-                controls-position="right" 
-                readonly
-                class="full-width-input"
-              ></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="维修工分">
-            <template #default="scope">
-              <el-input-number 
-                v-model="scope.row.repairTotalScore" 
-                controls-position="right" 
-                readonly
-                class="full-width-input"
-              ></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="总工分">
-            <template #default="scope">
-              <el-input-number 
-                v-model="scope.row.finalScore" 
-                controls-position="right" 
-                readonly
-                class="full-width-input"
-              ></el-input-number>
+              <span :style="{ color: getScoreColor(scope.row.finalScore) }">{{ scope.row.finalScore }}</span>
             </template>
           </el-table-column>
         </el-table>
@@ -667,6 +645,17 @@ export default {
         );
       }
     },
+    
+    // 根据分数返回对应颜色
+    getScoreColor(score) {
+      if (score > 0) {
+        return '#1890FF'; // 蓝色
+      } else if (score < 0) {
+        return '#F56C6C'; // 红色
+      } else {
+        return '#000000'; // 黑色
+      }
+    }
   }
 }
 </script>

+ 15 - 27
ygtx-ui/src/views/gxt/monthScore/info.vue

@@ -111,34 +111,11 @@
         <!-- 组员考核得分表格 -->
         <el-table :data="userScoreList" style="width: 100%">
           <el-table-column prop="nickName" label="组员姓名"></el-table-column>
-          <el-table-column label="维保工分">
+          <el-table-column prop="maintenanceTotalScore" label="维保工分"></el-table-column>
+          <el-table-column prop="repairTotalScore" label="维修工分"></el-table-column>
+          <el-table-column prop="finalScore" label="总工分">
             <template #default="scope">
-              <el-input-number 
-                v-model="scope.row.maintenanceTotalScore" 
-                controls-position="right" 
-                readonly
-                class="full-width-input"
-              ></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="维修工分">
-            <template #default="scope">
-              <el-input-number 
-                v-model="scope.row.repairTotalScore" 
-                controls-position="right" 
-                readonly
-                class="full-width-input"
-              ></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="总工分">
-            <template #default="scope">
-              <el-input-number 
-                v-model="scope.row.finalScore" 
-                controls-position="right" 
-                readonly
-                class="full-width-input"
-              ></el-input-number>
+              <span :style="{ color: getScoreColor(scope.row.finalScore) }">{{ scope.row.finalScore }}</span>
             </template>
           </el-table-column>
         </el-table>
@@ -540,6 +517,17 @@ export default {
         );
       }
     },
+    
+    // 根据分数返回对应颜色
+    getScoreColor(score) {
+      if (score > 0) {
+        return '#1890FF'; // 蓝色
+      } else if (score < 0) {
+        return '#F56C6C'; // 红色
+      } else {
+        return '#000000'; // 黑色
+      }
+    }
   }
 }
 </script>