Răsfoiți Sursa

pms 项目详情 包含任务列表

zhangcl 1 lună în urmă
părinte
comite
63cbbe3f45

+ 22 - 0
src/router/modules/remaining.ts

@@ -283,6 +283,28 @@ const remainingRouter: AppRouteRecordRaw[] = [
       }
     ]
   },
+  {
+    path: '/iotProjectInfoDetail',
+    component: Layout,
+    name: 'IotProjectInfoDetail',
+    meta: {
+      hidden: true
+    },
+    children: [
+      {
+        path: 'project/info/detail/:id(\\d+)',
+        component: () => import('@/views/pms/iotprojectinfo/IotProjectInfoDetail.vue'),
+        name: 'IotProjectInfoDetail',
+        meta: {
+          title: t('rem.detail'),
+          noCache: false,
+          hidden: true,
+          canTo: true,
+          activeMenu: '/project/detail'
+        }
+      }
+    ]
+  },
   {
     path: '/FillOrderInfo2',
     component: Layout,

+ 1 - 0
src/utils/dict.ts

@@ -277,4 +277,5 @@ export enum DICT_TYPE {
   RQ_IOT_SUM = 'rq_iot_isSum',//是否累计
   PMS_ORDER_PROCESS_MODE = "pms_main_work_order_process_mode",  // 保养方式 0内部保养  1委外保养
   PMS_THING_MODEL_UNIT = 'pms_thing_model_unit', // pms属性模板单位
+  PMS_PROJECT_TASK_SCHEDULE = 'rq_iot_project_work_progress'  // 日报 项目管理 任务计划
 }

+ 362 - 0
src/views/pms/iotprojectinfo/IotProjectInfoDetail.vue

@@ -0,0 +1,362 @@
+<template>
+  <ContentWrap v-loading="formLoading">
+    <!--
+    <el-page-header>
+      <template #content>
+        <span class="text-large font-600 mr-3"> 项目详情 </span>
+      </template>
+    </el-page-header> -->
+
+    <!-- 项目基本信息 -->
+    <el-card class="box-card" style="margin-top: 20px">
+      <template #header>
+        <div class="card-header">
+          <span>项目基本信息</span>
+        </div>
+      </template>
+
+      <el-form
+        ref="formRef"
+        :model="formData"
+        label-width="100px"
+      >
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="合同名称">
+              <el-input v-model="formData.contractName" readonly />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="合同编号">
+              <el-input v-model="formData.contractCode" readonly />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="客户名称">
+              <el-input v-model="formData.manufactureName" readonly />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="结算方式">
+              <el-input v-model="formData.payment" readonly />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="总数">
+              <el-input v-model="formData.workloadTotal" readonly />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="已完成">
+              <el-input v-model="formData.workloadFinish" readonly />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="开始时间">
+              <el-date-picker
+                v-model="formData.startTime"
+                type="date"
+                placeholder="选择开始时间"
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="完成时间">
+              <el-date-picker
+                v-model="formData.endTime"
+                type="date"
+                placeholder="选择完成时间"
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="备注">
+          <el-input v-model="formData.remark" type="textarea" readonly />
+        </el-form-item>
+      </el-form>
+    </el-card>
+
+    <!-- 任务列表 -->
+    <el-card class="box-card" style="margin-top: 20px">
+      <template #header>
+        <div class="card-header">
+          <span>任务列表</span>
+        </div>
+      </template>
+
+      <el-table :data="taskList" v-loading="loading">
+        <el-table-column label="井号" prop="wellName" />
+        <el-table-column label="井型/井别" prop="wellType" />
+        <el-table-column label="施工地点" prop="location" />
+        <el-table-column label="施工工艺" prop="technique" />
+        <el-table-column label="设计工作量" prop="workloadDesign" />
+        <el-table-column label="施工队伍">
+          <template #default="{ row }">
+            {{ getDeptNames(row.deptIds) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="施工设备">
+          <template #default="{ row }">
+            <el-tooltip
+              :content="getAllDeviceNames(row.deviceIds)"
+              placement="top"
+            >
+              <span class="device-names">
+                {{ getDeviceNames(row.deviceIds) }}
+              </span>
+            </el-tooltip>
+          </template>
+        </el-table-column>
+        <el-table-column label="责任人">
+          <template #default="{ row }">
+            <el-tooltip
+              :content="getAllResponsiblePersonNames(row.responsiblePerson)"
+              placement="top"
+            >
+              <span class="responsible-names">
+                {{ getResponsiblePersonNames(row.responsiblePerson) }}
+              </span>
+            </el-tooltip>
+          </template>
+        </el-table-column>
+        <el-table-column label="备注" prop="remark" />
+      </el-table>
+    </el-card>
+  </ContentWrap>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, onMounted } from "vue";
+import { useRoute, useRouter } from "vue-router";
+import { IotProjectInfoApi } from '@/api/pms/iotprojectinfo'
+import { IotProjectTaskApi } from '@/api/pms/iotprojecttask'
+import { IotDeviceApi } from '@/api/pms/device'
+import * as UserApi from "@/api/system/user";
+import * as DeptApi from "@/api/system/dept";
+import { handleTree } from "@/utils/tree";
+
+/** 项目信息 详情 包含 项目下的任务列表 */
+defineOptions({ name: 'IotProjectInfoDetail' })
+
+const { currentRoute, push } = useRouter();
+const { params } = useRoute();
+const loading = ref(false);
+const formLoading = ref(false);
+
+// 项目基本信息
+const formData = ref({
+  id: undefined,
+  contractName: undefined,
+  contractCode: undefined,
+  manufactureName: undefined,
+  payment: undefined,
+  workloadTotal: undefined,
+  workloadFinish: undefined,
+  startTime: undefined,
+  endTime: undefined,
+  remark: undefined,
+});
+
+// 任务列表
+const taskList = ref([]);
+const deptList = ref([]);
+const deviceMap = ref({});
+const responsiblePersonList = ref([]);
+
+// 获取部门名称
+const getDeptNames = (deptIds) => {
+  if (!deptIds || deptIds.length === 0) return '';
+
+  const names = [];
+  const findDept = (list, id) => {
+    for (const item of list) {
+      if (item.id === id) {
+        names.push(item.name);
+        return true;
+      }
+      if (item.children && findDept(item.children, id)) {
+        return true;
+      }
+    }
+    return false;
+  };
+
+  deptIds.forEach(id => findDept(deptList.value, id));
+  return names.join(', ');
+};
+
+// 获取设备名称
+const getDeviceNames = (deviceIds) => {
+  if (!deviceIds || deviceIds.length === 0) return '';
+
+  const deviceNames = deviceIds
+    .map(id => deviceMap.value[id]?.deviceCode)
+    .filter(name => name);
+
+  if (deviceNames.length === 0) return '';
+  if (deviceNames.length > 2) {
+    return `${deviceNames[0]}, ${deviceNames[1]}...`;
+  }
+
+  return deviceNames.join(', ');
+};
+
+// 获取所有设备名称
+const getAllDeviceNames = (deviceIds) => {
+  if (!deviceIds || deviceIds.length === 0) return '无设备';
+
+  const deviceNames = deviceIds
+    .map(id => deviceMap.value[id]?.deviceCode || '未知设备')
+    .filter(name => name !== '未知设备');
+
+  return deviceNames.join(', ') || '无有效设备';
+};
+
+// 获取责任人名称
+const getResponsiblePersonNames = (responsiblePersonIds) => {
+  if (!responsiblePersonIds || responsiblePersonIds.length === 0) return '';
+
+  const personNames = responsiblePersonIds
+    .map(id => {
+      const person = responsiblePersonList.value.find(p => p.id === id);
+      return person ? person.nickname : '';
+    })
+    .filter(name => name);
+
+  if (personNames.length === 0) return '';
+  if (personNames.length > 2) {
+    return `${personNames[0]}, ${personNames[1]}...`;
+  }
+
+  return personNames.join(', ');
+};
+
+// 获取所有责任人名称
+const getAllResponsiblePersonNames = (responsiblePersonIds) => {
+  if (!responsiblePersonIds || responsiblePersonIds.length === 0) return '无责任人';
+
+  const personNames = responsiblePersonIds
+    .map(id => {
+      const person = responsiblePersonList.value.find(p => p.id === id);
+      return person ? person.nickname : '未知人员';
+    })
+    .filter(name => name !== '未知人员');
+
+  return personNames.join(', ') || '无有效责任人';
+};
+
+// 返回上一页
+const goBack = () => {
+  push({ name: 'IotProjectInfo' });
+};
+
+// 加载项目详情
+const loadProjectDetail = async () => {
+  formLoading.value = true;
+  try {
+    // 获取项目基本信息
+    const projectInfo = await IotProjectInfoApi.getIotProjectInfo(params.id as string);
+    formData.value = { ...projectInfo };
+
+    // 获取任务列表
+    const queryParams = {
+      projectId: params.id
+    };
+    const taskData = await IotProjectTaskApi.getIotProjectTaskPage(queryParams);
+    taskList.value = taskData.list;
+
+    // 收集所有设备ID和责任人ID
+    const allDeviceIds = new Set();
+    const allResponsiblePersonIds = new Set();
+
+    taskList.value.forEach(item => {
+      if (item.deviceIds?.length) {
+        item.deviceIds.forEach(id => allDeviceIds.add(id));
+      }
+      if (item.responsiblePerson?.length) {
+        item.responsiblePerson.forEach(id => allResponsiblePersonIds.add(id));
+      }
+    });
+
+    // 批量获取设备信息
+    if (allDeviceIds.size > 0) {
+      const deviceIdsArray = Array.from(allDeviceIds);
+      const devices = await IotDeviceApi.getDevicesByDepts({
+        deviceIds: deviceIdsArray
+      });
+
+      // 更新设备映射表
+      devices.forEach(device => {
+        deviceMap.value[device.id] = device;
+      });
+    }
+
+    // 批量获取责任人信息
+    if (allResponsiblePersonIds.size > 0) {
+      const personIdsArray = Array.from(allResponsiblePersonIds);
+      const persons = await UserApi.companyDeptsEmployee({
+        userIds: personIdsArray
+      });
+      responsiblePersonList.value = persons;
+    }
+  } catch (error) {
+    console.error('加载项目详情失败:', error);
+  } finally {
+    formLoading.value = false;
+  }
+};
+
+onMounted(async () => {
+  // 加载部门列表
+  deptList.value = handleTree(await DeptApi.companyLevelChildrenDepts());
+  // 加载项目详情
+  await loadProjectDetail();
+});
+</script>
+
+<style scoped>
+.device-names {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 120px;
+  display: inline-block;
+}
+
+.responsible-names {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 120px;
+  display: inline-block;
+}
+
+.card-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.text {
+  font-size: 14px;
+}
+
+.item {
+  margin-bottom: 18px;
+}
+
+.box-card {
+  width: 100%;
+}
+</style>

+ 15 - 1
src/views/pms/iotprojectinfo/index.vue

@@ -79,7 +79,13 @@
         </template>
       </el-table-column>
       <el-table-column label="客户名称" align="center" prop="manufactureName" />
-      <el-table-column label="合同名称" align="center" prop="contractName" />
+      <el-table-column label="合同名称" align="center" prop="contractName" >
+        <template #default="scope">
+          <el-link type="primary" @click="goToDetail(scope.row.id)">
+            {{ scope.row.contractName }}
+          </el-link>
+        </template>
+      </el-table-column>>
       <el-table-column label="合同编号" align="center" prop="contractCode" />
       <el-table-column label="工作量" align="center">
         <el-table-column label="总数" align="center" prop="workloadTotal" />
@@ -213,6 +219,14 @@ const resetQuery = () => {
   handleQuery()
 }
 
+// 跳转到项目详情页面
+const goToDetail = (id: number) => {
+  push({
+    name: 'IotProjectInfoDetail',
+    params: { id }
+  })
+}
+
 /** 添加/修改操作 */
 const formRef = ref()
 const openForm = (type: string, id?: number) => {

+ 49 - 4
src/views/pms/iotprojecttask/IotProjectTaskForm.vue

@@ -10,7 +10,7 @@
       <el-row>
         <el-col :span="12">
           <el-form-item label="合同名称" prop="contractName">
-            <el-select v-model="formData.contractId" placeholder="请选择" @change="getProjectInfo">
+            <el-select v-model="formData.contractId" placeholder="请选择" @change="getProjectInfo" disabled>
               <el-option
                 v-for="item in projectList"
                 :key="item.id"
@@ -98,12 +98,14 @@
     <div class="content">
       <div class="toolbar">
         <div class="actions">
+          <!--
           <el-button type="primary" @click="addNewRow" icon="plus" >
             新增行
           </el-button>
+
           <el-button type="success" @click="saveAll" :disabled="editingRowsCount === 0" icon="check">
             保存所有更改
-          </el-button>
+          </el-button> -->
         </div>
       </div>
 
@@ -161,7 +163,16 @@
           <el-table-column prop="deptIds" label="施工队伍" >
             <template #default="{ row }">
               <span v-if="!row.editing">
-                {{ getDeptNames(row.deptIds) }}
+                <el-tooltip
+                  effect="dark"
+                  :content="getAllDeptNames(row.deptIds)"
+                  placement="top"
+                  :disabled="!row.deptIds || row.deptIds.length <= 1"
+                >
+                  <span class="dept-names">
+                    {{ getDeptNames(row.deptIds) }}
+                  </span>
+                </el-tooltip>
               </span>
               <div v-else>
                 <el-tree-select
@@ -211,7 +222,7 @@
               <el-tooltip
                 :content="getAllResponsiblePersonNames(row.responsiblePerson)"
                 placement="top"
-                :disabled="!row.responsiblePerson || row.responsiblePerson.length <= 2"
+                :disabled="!row.responsiblePerson || row.responsiblePerson.length <= 1"
               >
                 <span v-if="!row.editing" class="responsible-names">
                   {{ getResponsiblePersonNames(row.responsiblePerson) }}
@@ -484,9 +495,34 @@ const getDeptNames = (deptIds) => {
   };
 
   deptIds.forEach(id => findDept(deptList.value, id));
+  if (names.length > 1) {
+    return `${names[0]}...`;
+  }
   return names.join(', ');
 };
 
+const getAllDeptNames = (deptIds) => {
+  if (!deptIds || deptIds.length === 0) return '无施工队伍';
+
+  const names = [];
+  const findDept = (list, id) => {
+    for (const item of list) {
+      if (item.id === id) {
+        names.push(item.name);
+        return true;
+      }
+      if (item.children && findDept(item.children, id)) {
+        return true;
+      }
+    }
+    return false;
+  };
+
+  deptIds.forEach(id => findDept(deptList.value, id));
+
+  return names.join(', ') || '无有效施工队伍';
+};
+
 const getDeviceNames = (deviceIds: number[]) => {
   if (!deviceIds || deviceIds.length === 0) return '';
 
@@ -1153,4 +1189,13 @@ const deleteRow = (index) => {
   max-width: 200px; /* 根据实际列宽调整 */
 }
 
+/* 添加部门名称的样式 */
+.dept-names {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 200px; /* 根据实际列宽调整 */
+  display: inline-block;
+  vertical-align: bottom;
+}
 </style>

+ 120 - 37
src/views/pms/iotprojecttask/index.vue

@@ -148,8 +148,36 @@
     :title="`${currentRow?.contractName} - ${currentRow?.wellName} - 任务计划`"
     width="80%"
   >
+    <div class="mb-15px">
+      <el-button type="primary" @click="addNewRow">
+        <Icon icon="ep:plus" class="mr-5px" /> 新增行
+      </el-button>
+    </div>
+
     <el-table :data="planList" border stripe>
-      <el-table-column label="施工状态" prop="name" min-width="200" />
+      <el-table-column label="序号" width="60" align="center">
+        <template #default="scope">
+          {{ scope.$index + 1 }}
+        </template>
+      </el-table-column>
+      <el-table-column label="施工状态" min-width="200">
+        <template #default="scope">
+          <el-select
+            v-model="scope.row.status"
+            placeholder="请选择施工状态"
+            clearable
+            class="w-full"
+            @change="onStatusChange(scope.row)"
+          >
+            <el-option
+              v-for="dict in workProgressDictOptions"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </template>
+      </el-table-column>
       <el-table-column label="开始时间" min-width="200">
         <template #default="scope">
           <el-date-picker
@@ -157,6 +185,7 @@
             type="datetime"
             placeholder="选择开始时间"
             value-format="YYYY-MM-DD HH:mm:ss"
+            class="w-full"
           />
         </template>
       </el-table-column>
@@ -167,9 +196,18 @@
             type="datetime"
             placeholder="选择结束时间"
             value-format="YYYY-MM-DD HH:mm:ss"
+            class="w-full"
+            v-if="rowShowEndTime(scope.row)"
           />
         </template>
       </el-table-column>
+      <el-table-column label="操作" width="100" align="center">
+        <template #default="scope">
+          <el-button link type="danger" @click="removeRow(scope.$index)">
+            删除
+          </el-button>
+        </template>
+      </el-table-column>
     </el-table>
 
     <template #footer>
@@ -193,6 +231,9 @@ import IotProjectTaskForm from './IotProjectTaskForm.vue'
 import * as DictDataApi from '@/api/system/dict/dict.data'
 import { DictDataVO } from '@/api/system/dict/dict.data'
 import dayjs from 'dayjs'
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { ref, reactive, onMounted, computed } from 'vue'
+import { useRouter } from 'vue-router'
 
 /** 项目信息任务拆分 列表 */
 defineOptions({ name: 'IotProjectTask' })
@@ -230,11 +271,15 @@ const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
 const { push } = useRouter() // 路由跳转
 
+const COMPLETED_STATUS = 5;
+
 // 计划相关状态
 const planDialogVisible = ref(false)
-const planList = ref<Array<{name: string, value: string, startTime: string, endTime: string}>>([])
+// const planList = ref<Array<{name: string, value: string, startTime: string, endTime: string}>>([])
+const planList = ref<Array<{id?: number, status: number, startTime: string, endTime: string, showEndTime: boolean}>>([])
 const saveLoading = ref(false)
 const currentRow = ref<IotProjectTaskVO | null>(null)
+const workProgressDictOptions = ref<any[]>([]) // 施工进度字典选项
 
 /** 时间戳转换为日期时间字符串(使用dayjs处理) */
 const timestampToDateTime = (timestamp: number | null): string => {
@@ -242,6 +287,16 @@ const timestampToDateTime = (timestamp: number | null): string => {
   return dayjs(timestamp).format('YYYY-MM-DD HH:mm:ss')
 }
 
+/** 获取施工进度字典数据 */
+const getWorkProgressDictOptions = async () => {
+  try {
+    workProgressDictOptions.value = getIntDictOptions(DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE)
+  } catch (error) {
+    console.error('获取施工进度字典失败:', error)
+    workProgressDictOptions.value = []
+  }
+}
+
 /** 时间戳转换为日期时间字符串(修正时区问题)
 const timestampToDateTime = (timestamp: number | null): string => {
   if (!timestamp) return ''
@@ -263,42 +318,28 @@ const timestampToDateTime = (timestamp: number | null): string => {
 /** 打开计划对话框 */
 const openPlanDialog = async (row: IotProjectTaskVO) => {
   currentRow.value = row
+  planList.value = [] // 清空计划列表
   try {
-    // 并行获取数据字典和已有计划数据
-    const [dictData, taskSchedules] = await Promise.all([
-      DictDataApi.getDictDataPage(dictQueryParams),
-      IotProjectTaskScheduleApi.getIotProjectTaskSchedules({ taskId: row.id })
-    ])
-
-    // 获取数据字典 - 这里假设有一个获取计划项目字典的接口
-    //  const dictData = await DictDataApi.getDictDataPage(dictQueryParams)
+    // 获取施工进度字典选项
+    await getWorkProgressDictOptions()
 
-    // 对字典数据按照 sort 升序排序
-    const sortedDictData = dictData.list.sort((a: DictDataVO, b: DictDataVO) => a.sort - b.sort)
+    // 获取已有计划数据
+    const taskSchedules = await IotProjectTaskScheduleApi.getIotProjectTaskSchedules({ taskId: row.id })
 
-    // 将已有计划数据转换为以status为键的映射
-    const existingPlansMap = new Map()
     if (taskSchedules && taskSchedules.length > 0) {
-      console.log('任务计划已经存在数据了')
-      taskSchedules.forEach((plan: any) => {
-        existingPlansMap.set(plan.status, {
+      // 如果有数据,则使用接口返回的数据初始化表格
+      planList.value = taskSchedules.map((plan: any) => {
+        const statusNum = Number(plan.status);
+        return {
+          id: plan.id,
+          status: statusNum,
           startTime: timestampToDateTime(plan.startTime),
-          endTime: timestampToDateTime(plan.endTime)
-        })
+          endTime: timestampToDateTime(plan.endTime),
+          showEndTime: statusNum !== COMPLETED_STATUS // 如果已是完工状态,则不显示结束时间列
+        }
       })
     }
-
-    // 初始化计划列表,合并字典数据和已有计划数据
-    planList.value = sortedDictData.map((item: DictDataVO) => {
-      const existingPlan = existingPlansMap.get(Number(item.value))
-
-      return {
-        name: item.label,
-        value: item.value,
-        startTime: existingPlan ? existingPlan.startTime : '',
-        endTime: existingPlan ? existingPlan.endTime : ''
-      }
-    })
+    // 如果没有数据,planList.value保持为空数组
 
     planDialogVisible.value = true
   } catch (error) {
@@ -307,18 +348,58 @@ const openPlanDialog = async (row: IotProjectTaskVO) => {
   }
 }
 
+/** 判断某一行是否应该显示结束时间列 */
+const rowShowEndTime = (row) => {
+  return row.showEndTime;
+}
+
+/** 处理施工状态变化 */
+const onStatusChange = (row) => {
+  // 当状态变为“完工”时,隐藏结束时间列并清空结束时间;否则显示
+  if (row.status === COMPLETED_STATUS) {
+    row.showEndTime = false;
+    row.endTime = ''; // 清空结束时间
+  } else {
+    row.showEndTime = true;
+  }
+}
+
+/** 新增行 */
+const addNewRow = () => {
+  planList.value.push({
+    status: undefined, // 默认值或空值
+    startTime: '',
+    endTime: '',
+    showEndTime: true
+  })
+}
+
+/** 删除行 */
+const removeRow = (index: number) => {
+  planList.value.splice(index, 1)
+}
+
 /** 保存计划 */
 const savePlan = async () => {
   try {
     saveLoading.value = true
 
-    // 准备提交数据,符合新接口格式
+    // 验证数据
+    for (let i = 0; i < planList.value.length; i++) {
+      const item = planList.value[i]
+      if (!item.status) {
+        message.error(`第${i + 1}行请选择施工状态`)
+        return
+      }
+    }
+
+    // 准备提交数据
     const submitData = planList.value.map(item => ({
-      taskId: currentRow.value?.id, // 取自当前行的id
-      status: Number(item.value), // 取自planList中的value值,转换为数字
-      description: item.name, // 取自planList中的name值
-      startTime: item.startTime ? new Date(item.startTime).getTime().toString() : null, // 转换为时间戳字符串
-      endTime: item.endTime ? new Date(item.endTime).getTime().toString() : null // 转换为时间戳字符串
+      id: item.id, // 更新时使用
+      taskId: currentRow.value?.id,
+      status: Number(item.status),
+      startTime: item.startTime ? new Date(item.startTime).getTime() : null,
+      endTime: (item.status !== COMPLETED_STATUS && item.endTime) ? new Date(item.endTime).getTime() : null
     }))
 
     // 调用保存接口
@@ -399,5 +480,7 @@ const handleExport = async () => {
 /** 初始化 **/
 onMounted(() => {
   getList()
+  // 预加载字典数据
+  getWorkProgressDictOptions()
 })
 </script>