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