diff --git a/src/pages/WorkOrderEdit/index.vue b/src/pages/WorkOrderEdit/index.vue index 18fe82f..af7b361 100644 --- a/src/pages/WorkOrderEdit/index.vue +++ b/src/pages/WorkOrderEdit/index.vue @@ -4,9 +4,9 @@ - + - + {{ currentStep.Title }} @@ -24,7 +24,7 @@ - + @@ -90,8 +90,24 @@ const stepList = ref([ ]) // 返回上一步 -const prevStep = (id) => { - if (id == '3a') { +const goBack = () => { + if (currentStep.value.id == '3a') { + currentStep.value = stepList.value.find(item => item.id == 3); + } if (currentStep.value.id == 1) { + goHome(); + } else { + currentStep.value = stepList.value.find(item => item.id == currentStep.value.id - 1); + } +} + +// 返回主页 +const goHome = () => { + uni.switchTab({ url: '/pages/WorkOrderApproval/index' }) +} + +// 点击上一步 +const prevStep = () => { + if (currentStep.value.id == '3a') { currentStep.value = stepList.value.find(item => item.id == 3); } else { currentStep.value = stepList.value.find(item => item.id == currentStep.value.id - 1); @@ -99,7 +115,7 @@ const prevStep = (id) => { } // 点击下一步 -const nextStep = (id) => { +const nextStep = () => { if (currentStep.value.id == 1) { console.log(basicsInfoRef.value.getFormData()); allData.value.BasicsInfo = basicsInfoRef.value.getFormData();