ソースを参照

Merge branch 'feat/production-safety' of http://192.168.6.110/product-group-fe/sfy-safety-group/sfy-safety into feat/production-safety

sunqijun 2 ヶ月 前
コミット
aad074bf34

+ 5 - 3
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagement/components/safetySystemConstructionWorkPlanManagementDetail.vue

@@ -214,9 +214,11 @@
   //  时间格式化
   const formatDate = (date) => {
     if (!date) return '';
-    const year = date.getFullYear();
-    const month = String(date.getMonth() + 1).padStart(2, '0');
-    const day = String(date.getDate()).padStart(2, '0');
+    const dateObj = typeof date === 'object' && date instanceof Date ? date : new Date(date);
+    if (isNaN(dateObj.getTime())) return '';
+    const year = dateObj.getFullYear();
+    const month = String(dateObj.getMonth() + 1).padStart(2, '0');
+    const day = String(dateObj.getDate()).padStart(2, '0');
     return `${year}-${month}-${day}`; // 输出:****-**-**
   };
   //转部门格式 “2,3“ -> [2,3]

+ 3 - 6
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagement/configs/tables.ts

@@ -87,20 +87,17 @@ export const WORK_PLAN_TABLE_COLUMNS: TableColumnProps[] = [
   {
     label: '下发数',
     prop: 'issuedCount',
-    align: 'left',
-    minWidth: '80px',
+    slot: 'issuedCount',
   },
   {
     label: '反馈数',
     prop: 'feedbackCount',
-    align: 'left',
-    minWidth: '80px',
+    slot: 'feedbackCount',
   },
   {
     label: '反馈比例',
     prop: 'feedbackRatio',
-    align: 'left',
-    minWidth: '80px',
+    slot: 'feedbackRatio',
   },
   {
     label: '计划完成时间',

+ 11 - 1
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagement/safetySystemConstructionWorkPlanManagement.vue

@@ -79,6 +79,7 @@
           
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
+
                 <!-- 1-未下发、2-待反馈、3-已完成 4- 已作废 -->
                 <!-- 未下发(1):编辑、删除、下发 -->
                 <template v-if="Number(scope.row.status) === 1">
@@ -86,7 +87,7 @@
                   <ActionButton
                     text="删除"
                     :popconfirm="{
-                      title: '确定要删除?',
+                      title: '确定要删除?', 
                     }"
                     @confirm="handleDelete(scope.row.id)"
                   />
@@ -120,6 +121,15 @@
                 </template>
               </div>
             </template>
+            <template #feedbackCount="scope">
+              {{ (scope.row.feedbackCount === 0 && scope.row.status === 1) ? '-' : scope.row.feedbackCount }}
+            </template>
+            <template #issuedCount="scope">
+              {{ (scope.row.issuedCount === 0 && scope.row.status === 1) ? '-' : scope.row.issuedCount }}
+            </template>
+            <template #feedbackRatio="scope">
+              {{ (scope.row.feedbackRatio === 0 && scope.row.status === 1) ? '-' : scope.row.feedbackRatio }}
+            </template>
           </BasicTable>
         </div>
       </div>

+ 1 - 2
src/views/production-safety/productionSafetySystem/safetySystemConstructionWorkPlanManagementDept/safetySystemConstructionWorkPlanManagementDept.vue

@@ -78,12 +78,11 @@
             </template>
             <template #action="scope">
               <div class="action-container--div" style="justify-content: left">
-                <!-- 进行中(1)/待反馈:查看 -->
                 <template v-if="Number(scope.row.status) === 2">
                   <ActionButton text="反馈" @click="handleIssue(scope.row.id)" />
                 </template>
 
-                <!-- 已完成(2):删除、查看 -->
+                <!-- 已完成(3):删除、查看 -->
                 <template v-else>
                   <ActionButton text="查看" @click="handleView(scope.row.id)" />
                 </template>