Bläddra i källkod

fix: 安全考核下发时间问题修改

xiaweibo 1 månad sedan
förälder
incheckning
91aad9a691

+ 18 - 7
src/views/production-safety/safetyAssessment/evaluationSystem/evaluationSystem.vue

@@ -128,12 +128,12 @@
                     }"
                     }"
                     @confirm="handleDelete(scope.row.id)"
                     @confirm="handleDelete(scope.row.id)"
                   />
                   />
-                  <ActionButton text="下发" @click="handleIssue(scope.row.id)" />
+                  <ActionButton text="下发" @click="handleIssue(scope.row)" />
                 </template>
                 </template>
 
 
                 <!-- 待反馈:作废 / 考核对象 -->
                 <!-- 待反馈:作废 / 考核对象 -->
                 <template v-else-if="Number(scope.row.status) === 2">
                 <template v-else-if="Number(scope.row.status) === 2">
-                  <ActionButton text="下发" @click="handleIssue(scope.row.id)" />
+                  <ActionButton text="下发" @click="handleIssue(scope.row)" />
                   <ActionButton
                   <ActionButton
                     text="作废"
                     text="作废"
                     :popconfirm="{
                     :popconfirm="{
@@ -255,6 +255,7 @@
               value-format="YYYY-MM-DD"
               value-format="YYYY-MM-DD"
               format="YYYY-MM-DD"
               format="YYYY-MM-DD"
               style="width: 100%"
               style="width: 100%"
+              :disabled="showTimeDisabled"
               :disabled-date="(date: Date) => {
               :disabled-date="(date: Date) => {
                 if (issueForm.endDate) {
                 if (issueForm.endDate) {
                   return date > new Date(issueForm.endDate);
                   return date > new Date(issueForm.endDate);
@@ -265,6 +266,7 @@
           </el-form-item>
           </el-form-item>
           <el-form-item label="计划结束日期:">
           <el-form-item label="计划结束日期:">
             <el-date-picker
             <el-date-picker
+              :disabled="showTimeDisabled"
               v-model="issueForm.endDate"
               v-model="issueForm.endDate"
               type="date"
               type="date"
               placeholder="请选择计划结束日期"
               placeholder="请选择计划结束日期"
@@ -322,6 +324,8 @@
 
 
   const router = useRouter();
   const router = useRouter();
 
 
+  const showTimeDisabled = ref(false);
+
   // 表格
   // 表格
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
 
 
@@ -444,6 +448,8 @@
             item.planStartTime && item.planEndTime
             item.planStartTime && item.planEndTime
               ? `${item.planStartTime} 至 ${item.planEndTime}`
               ? `${item.planStartTime} 至 ${item.planEndTime}`
               : item.planStartTime || item.planEndTime || '-', // 计划完成时间
               : item.planStartTime || item.planEndTime || '-', // 计划完成时间
+          planStartTime: item.planStartTime || '', // 计划开始时间
+          planEndTime: item.planEndTime || '', // 计划结束时间
         }));
         }));
         pagination.total = res.totalRow;
         pagination.total = res.totalRow;
       }
       }
@@ -511,17 +517,22 @@
   };
   };
 
 
   // 下发考核表
   // 下发考核表
-  const handleIssue = async (id: number) => {
-    currentIssueId.value = id;
+  const handleIssue = async (row: any) => {
+    currentIssueId.value = row.id;
     issueForm.departmentName = '';
     issueForm.departmentName = '';
-    issueForm.startDate = '';
-    issueForm.endDate = '';
+    issueForm.startDate = row.planStartTime;
+    issueForm.endDate = row.planEndTime;
     issueForm.userGroupId = undefined;
     issueForm.userGroupId = undefined;
     issueForm.deptSelfApproveUserId = undefined;
     issueForm.deptSelfApproveUserId = undefined;
     issueDeptIds.value = [];
     issueDeptIds.value = [];
     issueDialogVisible.value = true;
     issueDialogVisible.value = true;
+    if(row.planStartTime && row.planEndTime && row.status === 2) {
+      showTimeDisabled.value = true;
+    } else {
+      showTimeDisabled.value = false;
+    }
     // 弹窗打开时才加载下发弹窗所需数据
     // 弹窗打开时才加载下发弹窗所需数据
-    await Promise.all([getDeptTreeData(), getUserGroupOptions(), getDeptSelfApproveUserList(id)]);
+    await Promise.all([getDeptTreeData(), getUserGroupOptions(), getDeptSelfApproveUserList(row.id)]);
   };
   };
 
 
   const handleIssueDeptChange = () => {
   const handleIssueDeptChange = () => {