Bläddra i källkod

pms 日报 施工状态 数据字典 功能优化

zhangcl 1 vecka sedan
förälder
incheckning
b1e9d76fc2
2 ändrade filer med 8 tillägg och 8 borttagningar
  1. 1 1
      src/views/pms/iotprojectinfo/index.vue
  2. 7 7
      src/views/pms/iotprojecttask/index.vue

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

@@ -847,7 +847,7 @@ const openTimelineDialog = async (row: any) => {
 /** 获取任务进度字典数据 */
 const getTaskScheduleDictOptions = async () => {
   try {
-    taskScheduleDictOptions.value = getIntDictOptions(DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE)
+    taskScheduleDictOptions.value = getStrDictOptions(DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE)
   } catch (error) {
     console.error('获取任务进度字典失败:', error)
     taskScheduleDictOptions.value = []

+ 7 - 7
src/views/pms/iotprojecttask/index.vue

@@ -243,7 +243,7 @@ import download from '@/utils/download'
 import { IotProjectTaskScheduleApi } from '@/api/pms/iotprojecttaskschedule'
 import { IotProjectTaskApi, IotProjectTaskVO} from '@/api/pms/iotprojecttask'
 import dayjs from 'dayjs'
-import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
 import { ref, reactive, onMounted, computed, nextTick, watch, onUnmounted } from 'vue'
 import { useRouter } from 'vue-router'
 
@@ -283,7 +283,7 @@ const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
 const { push } = useRouter() // 路由跳转
 
-const COMPLETED_STATUS = 6;
+const COMPLETED_STATUS = 'wg';
 
 // 表格引用
 const tableRef = ref()
@@ -326,7 +326,7 @@ const getTextWidth = (text: string, fontSize = 14) => {
 // 计划相关状态
 const planDialogVisible = ref(false)
 // 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 planList = ref<Array<{id?: number, status: string, startTime: string, endTime: string, showEndTime: boolean}>>([])
 const saveLoading = ref(false)
 const currentRow = ref<IotProjectTaskVO | null>(null)
 const workProgressDictOptions = ref<any[]>([]) // 施工进度字典选项
@@ -377,7 +377,7 @@ const timestampToDateTime = (timestamp: number | string | null | undefined): str
 /** 获取施工进度字典数据 */
 const getWorkProgressDictOptions = async () => {
   try {
-    workProgressDictOptions.value = getIntDictOptions(DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE)
+    workProgressDictOptions.value = getStrDictOptions(DICT_TYPE.PMS_PROJECT_TASK_SCHEDULE)
   } catch (error) {
     console.error('获取施工进度字典失败:', error)
     workProgressDictOptions.value = []
@@ -398,7 +398,7 @@ const openPlanDialog = async (row: IotProjectTaskVO) => {
     if (taskSchedules && taskSchedules.length > 0) {
       // 如果有数据,则使用接口返回的数据初始化表格
       planList.value = taskSchedules.map((plan: any) => {
-        const statusNum = Number(plan.status);
+        const statusNum = plan.status;
         return {
           id: plan.id,
           status: statusNum,
@@ -436,7 +436,7 @@ const onStatusChange = (row) => {
 /** 新增行 */
 const addNewRow = () => {
   planList.value.push({
-    status: undefined, // 默认值或空值
+    status: '', // 默认值或空值
     startTime: '',
     endTime: '',
     showEndTime: true
@@ -466,7 +466,7 @@ const savePlan = async () => {
     const submitData = planList.value.map(item => ({
       id: item.id, // 更新时使用
       taskId: currentRow.value?.id,
-      status: Number(item.status),
+      status: item.status,
       startTime: item.startTime ? new Date(item.startTime).getTime() : null,
       endTime: (item.status !== COMPLETED_STATUS && item.endTime) ? new Date(item.endTime).getTime() : null
     }))