Pārlūkot izejas kodu

月报添加样式优化

yanghao 3 dienas atpakaļ
vecāks
revīzija
3e8bd2ebed
1 mainītis faili ar 201 papildinājumiem un 76 dzēšanām
  1. 201 76
      src/views/pms/qhse/monthlyReport/MonthlyReportAdd.vue

+ 201 - 76
src/views/pms/qhse/monthlyReport/MonthlyReportAdd.vue

@@ -4,7 +4,7 @@
       ref="formRef"
       :model="formData"
       :rules="formRules"
-      label-width="180px"
+      label-width="auto"
       class="report-form">
       <!-- 1. 基本信息 -->
       <el-card class="form-section" shadow="hover">
@@ -14,10 +14,10 @@
             <span>基本信息</span>
           </div>
         </template>
-        <el-row :gutter="20">
-          <el-col :span="12">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
             <el-form-item label="部门名称" prop="deptId">
-              <!-- <el-input
+              <el-input
                 v-model="deptName"
                 placeholder="请选择部门"
                 readonly
@@ -25,27 +25,17 @@
                 <template #suffix>
                   <Icon icon="ep:search" class="cursor-pointer" />
                 </template>
-              </el-input> -->
-
-              <el-tree-select
-                clearable
-                v-model="formData.deptId"
-                :data="deptList2"
-                :props="defaultProps"
-                :check-strictly="false"
-                node-key="id"
-                filterable
-                placeholder="请选择所属队伍" />
+              </el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
             <el-form-item label="月报标题" prop="title">
               <el-input v-model="formData.title" placeholder="请输入月报标题" />
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="20">
-          <el-col :span="12">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
             <el-form-item label="年月" prop="yearMonth">
               <el-date-picker
                 v-model="formData.yearMonth"
@@ -67,8 +57,8 @@
             <span>人工时和安全行驶公里数</span>
           </div>
         </template>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="员工人数" prop="employee">
               <el-input-number
                 v-model="formData.employee"
@@ -78,7 +68,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="分包商人数" prop="subcontractors">
               <el-input-number
                 v-model="formData.subcontractors"
@@ -88,7 +78,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="安全行驶里程数(公里)" prop="drivingMileage">
               <el-input-number
                 v-model="formData.drivingMileage"
@@ -98,7 +88,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="总人工时数(小时)" prop="totalManHours">
               <el-input-number
                 v-model="formData.totalManHours"
@@ -119,8 +109,8 @@
             <span>QHSE被动性指标统计</span>
           </div>
         </template>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="无事故累计天数" prop="withoutAccident">
               <el-input-number
                 v-model="formData.withoutAccident"
@@ -130,7 +120,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="死亡事故(起)" prop="fatality">
               <el-input-number
                 v-model="formData.fatality"
@@ -140,7 +130,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="损失工时事故(起)" prop="injury">
               <el-input-number
                 v-model="formData.injury"
@@ -150,7 +140,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="工作受限事件(起)" prop="restrictedCase">
               <el-input-number
                 v-model="formData.restrictedCase"
@@ -161,8 +151,8 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="医疗处理事件(起)" prop="medicalCase">
               <el-input-number
                 v-model="formData.medicalCase"
@@ -172,7 +162,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="急救箱事件(起)" prop="firstAidCase">
               <el-input-number
                 v-model="formData.firstAidCase"
@@ -182,7 +172,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="交通事故(起)" prop="vehicleAccident">
               <el-input-number
                 v-model="formData.vehicleAccident"
@@ -192,7 +182,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="未遂事件(起)" prop="nearMiss">
               <el-input-number
                 v-model="formData.nearMiss"
@@ -203,8 +193,8 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="泄漏事件(起)" prop="spill">
               <el-input-number
                 v-model="formData.spill"
@@ -214,7 +204,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="违反保命规则的次数(次)" prop="lifeSavingRules">
               <el-input-number
                 v-model="formData.lifeSavingRules"
@@ -235,8 +225,8 @@
             <span>QHSE主动性指标统计</span>
           </div>
         </template>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="班前会(次)" prop="toolboxTalk">
               <el-input-number
                 v-model="formData.toolboxTalk"
@@ -246,7 +236,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="QHSE管理委员会会议(次)" prop="committeeMeeting">
               <el-input-number
                 v-model="formData.committeeMeeting"
@@ -256,7 +246,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="QHSE月度例会(次)" prop="monthlyMeeting">
               <el-input-number
                 v-model="formData.monthlyMeeting"
@@ -266,7 +256,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="公司级隐患排查(次)" prop="companyHazard">
               <el-input-number
                 v-model="formData.companyHazard"
@@ -277,8 +267,8 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="QHSE检查(次)" prop="qhseInspection">
               <el-input-number
                 v-model="formData.qhseInspection"
@@ -288,7 +278,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="安全观察卡(张)" prop="socCards">
               <el-input-number
                 v-model="formData.socCards"
@@ -298,7 +288,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="工作许可审核(份)" prop="ptwAudit">
               <el-input-number
                 v-model="formData.ptwAudit"
@@ -308,7 +298,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="工作安全分析(次)" prop="jsa">
               <el-input-number
                 v-model="formData.jsa"
@@ -319,8 +309,8 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="演练次数" prop="drills">
               <el-input-number
                 v-model="formData.drills"
@@ -330,7 +320,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="QHSE培训次数" prop="training">
               <el-input-number
                 v-model="formData.training"
@@ -340,7 +330,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="QHSE培训人次" prop="participantsTraining">
               <el-input-number
                 v-model="formData.participantsTraining"
@@ -350,7 +340,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="QHSE培训学时数(小时)" prop="trainingsHours">
               <el-input-number
                 v-model="formData.trainingsHours"
@@ -371,8 +361,8 @@
             <span>环境数据</span>
           </div>
         </template>
-        <el-row :gutter="20">
-          <el-col :span="6">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="水消耗(吨)" prop="waterConsumption">
               <el-input-number
                 v-model="formData.waterConsumption"
@@ -382,7 +372,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="柴油消耗(升)" prop="dieselConsumption">
               <el-input-number
                 v-model="formData.dieselConsumption"
@@ -392,7 +382,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="用电量(千瓦·小时)" prop="electricityConsumption">
               <el-input-number
                 v-model="formData.electricityConsumption"
@@ -402,7 +392,7 @@
                 style="width: 100%" />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
+          <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
             <el-form-item label="天然气消耗量(立方米)" prop="naturalGasConsumption">
               <el-input-number
                 v-model="formData.naturalGasConsumption"
@@ -423,8 +413,8 @@
             <span>其他信息</span>
           </div>
         </template>
-        <el-row :gutter="20">
-          <el-col :span="12">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
             <el-form-item label="工单填报人" prop="dutyPerson">
               <el-input
                 v-model="dutyPersonName"
@@ -438,8 +428,8 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="20">
-          <el-col :span="24">
+        <el-row :gutter="16">
+          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
             <el-form-item label="备注" prop="remark">
               <el-input
                 v-model="formData.remark"
@@ -459,14 +449,10 @@
     </el-form>
 
     <!-- 部门选择弹窗 -->
-    <!-- <DeptSelectForm
-      ref="deptSelectFormRef"
-      :checkStrictly="true"
-      :multiple="false"
-      @confirm="handleDeptConfirm" /> -->
+    <DeptSelectForm ref="deptSelectFormRef" :multiple="false" @confirm="handleDeptConfirm" />
 
     <!-- 用户选择弹窗 -->
-    <UserSelectForm ref="userSelectFormRef" :multiple="false" @confirm="handleUserConfirm" />
+    <UserSelectForm ref="userSelectFormRef" @confirm="handleUserConfirm" />
   </div>
 </template>
 
@@ -607,42 +593,181 @@ onMounted(async () => {
   deptList2.value = handleTree(await DeptApi.getSimpleDeptList())
 })
 </script>
-
 <style scoped lang="scss">
 .monthly-report-add {
-  padding: 20px;
+  padding: 12px;
+  min-height: 100vh;
+  background-color: #f5f7fa;
 
   .report-form {
     max-width: 1400px;
     margin: 0 auto;
 
     .form-section {
-      margin-bottom: 20px;
+      margin-bottom: 16px;
+      border-radius: 8px;
 
       :deep(.el-card__header) {
-        padding: 15px 20px;
+        padding: 12px 16px;
         background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
         color: white;
+        border-radius: 8px 8px 0 0;
+      }
+
+      :deep(.el-card__body) {
+        padding: 16px;
       }
 
       .section-header {
         display: flex;
         align-items: center;
-        font-size: 16px;
+        font-size: 15px;
         font-weight: 600;
       }
+
+      :deep(.el-form-item) {
+        margin-bottom: 16px;
+      }
+
+      :deep(.el-form-item__label) {
+        font-size: 14px;
+        line-height: 1.5;
+      }
+
+      :deep(.el-input),
+      :deep(.el-input-number),
+      :deep(.el-date-editor) {
+        width: 100%;
+      }
+
+      :deep(.el-input-number) {
+        .el-input__inner {
+          text-align: left;
+        }
+      }
     }
 
     .form-actions {
       display: flex;
       justify-content: center;
-      gap: 20px;
-      padding: 20px 0;
-      margin-top: 20px;
-      border-top: 1px solid #e4e7ed;
+      gap: 12px;
+      padding: 16px 0;
+      margin-top: 16px;
+      background: white;
+      border-radius: 8px;
+      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+      position: sticky;
+      bottom: 0;
+      z-index: 10;
 
       .el-button {
-        min-width: 120px;
+        min-width: 100px;
+        flex: 1;
+        max-width: 150px;
+        height: 44px;
+        font-size: 15px;
+      }
+    }
+  }
+}
+
+// 移动端优化
+@media screen and (max-width: 768px) {
+  .monthly-report-add {
+    padding: 8px;
+
+    .report-form {
+      .form-section {
+        margin-bottom: 12px;
+
+        :deep(.el-card__header) {
+          padding: 10px 12px;
+        }
+
+        :deep(.el-card__body) {
+          padding: 12px;
+        }
+
+        .section-header {
+          font-size: 14px;
+        }
+
+        :deep(.el-form-item__label) {
+          font-size: 13px;
+          padding-right: 8px;
+        }
+
+        :deep(.el-input__inner),
+        :deep(.el-textarea__inner) {
+          font-size: 14px;
+          min-height: 40px;
+        }
+
+        :deep(.el-input-number) {
+          .el-input-number__decrease,
+          .el-input-number__increase {
+            width: 32px;
+            height: 40px;
+            line-height: 40px;
+          }
+
+          .el-input__inner {
+            height: 40px;
+            line-height: 40px;
+          }
+        }
+
+        :deep(.el-date-editor) {
+          .el-input__inner {
+            height: 40px;
+            line-height: 40px;
+          }
+        }
+      }
+
+      .form-actions {
+        padding: 12px;
+        gap: 10px;
+        position: fixed;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        margin: 0;
+        border-radius: 0;
+        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
+
+        .el-button {
+          height: 44px;
+          font-size: 15px;
+        }
+      }
+    }
+  }
+}
+
+// 超小屏幕优化
+@media screen and (max-width: 480px) {
+  .monthly-report-add {
+    padding: 6px;
+
+    .report-form {
+      .form-section {
+        :deep(.el-card__body) {
+          padding: 10px;
+        }
+
+        :deep(.el-form-item) {
+          margin-bottom: 12px;
+        }
+
+        :deep(.el-form-item__label) {
+          font-size: 12px;
+        }
+
+        :deep(.el-input__inner),
+        :deep(.el-textarea__inner) {
+          font-size: 13px;
+        }
       }
     }
   }