| | |
| | | }) |
| | | // 动态过滤tabs,保证isShow为true/false |
| | | const filteredTabs = computed(() => { |
| | | const tabStatus = permission.value?.tickets_tab_status === true |
| | | const tabPending = permission.value?.tickets_tab_pending === true//待审核 |
| | | const tabMyTickets = permission.value?.tickets_tab_mytickets === true //我的工单 |
| | | const tabALL = permission.value?.tickets_allWorkOrders === true //全部工单 |
| | |
| | | }); |
| | | const stepStatusList = computed(() => { |
| | | // “我发起的工单”tab用默认流程,其它tab用接口返回的stepInfos |
| | | if (activeTab.value === 'myTickets') { |
| | | if (workType.value === 1) { |
| | | return ['3', '4'] |
| | | } |
| | | return fixedStatuses.value |
| | | } |
| | | // if (activeTab.value === 'myTickets') { |
| | | // if (workType.value === 1) { |
| | | // return ['3', '4'] |
| | | // } |
| | | // return fixedStatuses.value |
| | | // } |
| | | // 其它tab直接用接口返回的stepInfos |
| | | return stepInfos.value.map(step => String(step.status)) |
| | | }) |
| | |
| | | const steps = Array.isArray(stepResponse.data.data) |
| | | ? stepResponse.data.data |
| | | : stepResponse.data.data?.steps || [] |
| | | console.log('steps',steps); |
| | | |
| | | const finishedStep = steps.find(s => String(s.status) === '4') |
| | | totalTime.value = finishedStep && finishedStep.total_time ? finishedStep.total_time : '' |
| | | |
| | | if (activeTab.value !== 'myTickets') { |
| | | // if (activeTab.value !== 'myTickets') { |
| | | // stepInfos.value = steps.map(step => ({ |
| | | // status: String(step.status), |
| | | // name: step.name, |
| | | // time: step.time, |
| | | // create_time: step.create_time, |
| | | // })) |
| | | // } else { |
| | | // const statusArr = workType.value === 1 ? ['3', '4'] : fixedStatuses.value |
| | | // stepInfos.value = statusArr.map(status => { |
| | | // const step = steps.find(s => String(s.status) === String(status)) |
| | | // return { |
| | | // status, |
| | | // name: step ? step.name : '', |
| | | // time: step ? step.time : null, |
| | | // create_time: step ? step.create_time : null, |
| | | // } |
| | | // }) |
| | | // stepInfos.value = steps.map(step => ({ |
| | | // status: String(step.status), |
| | | // name: step.name, |
| | | // time: step.time, |
| | | // create_time: step.create_time, |
| | | // })) |
| | | // } |
| | | stepInfos.value = steps.map(step => ({ |
| | | status: String(step.status), |
| | | name: step.name, |
| | | time: step.time, |
| | | create_time: step.create_time, |
| | | })) |
| | | } else { |
| | | const statusArr = workType.value === 1 ? ['3', '4'] : fixedStatuses.value |
| | | stepInfos.value = statusArr.map(status => { |
| | | const step = steps.find(s => String(s.status) === String(status)) |
| | | return { |
| | | status, |
| | | name: step ? step.name : '', |
| | | time: step ? step.time : null, |
| | | create_time: step ? step.create_time : null, |
| | | } |
| | | }) |
| | | } |
| | | return true |
| | | } catch (error) { |
| | | console.error('获取步骤信息失败:', error) |