diff --git a/src/pages/WorkOrderEdit/compoents/ApplyForMachine.vue b/src/pages/WorkOrderEdit/compoents/ApplyForMachine.vue new file mode 100644 index 0000000..7c888da --- /dev/null +++ b/src/pages/WorkOrderEdit/compoents/ApplyForMachine.vue @@ -0,0 +1,147 @@ + + + + \ No newline at end of file diff --git a/src/pages/WorkOrderEdit/compoents/WorkNote.vue b/src/pages/WorkOrderEdit/compoents/WorkNote.vue index 0b5a525..cf21b2f 100644 --- a/src/pages/WorkOrderEdit/compoents/WorkNote.vue +++ b/src/pages/WorkOrderEdit/compoents/WorkNote.vue @@ -130,7 +130,7 @@ - 申领移动球机 + 申领移动球机 @@ -143,6 +143,18 @@ import { generateGuid } from '@/utils/index.js'; import dayjs from 'dayjs'; import { ref, defineExpose } from 'vue' +// 定义props +const props = defineProps({ + allData: { + type: Object, + default: () => { }, + }, + openApplyForMachine: { + type: Function, + default: () => { }, + }, +}) + // 风险类型列表 const riskTypeList = ref([ { diff --git a/src/pages/WorkOrderEdit/index.vue b/src/pages/WorkOrderEdit/index.vue index 815c6a1..18fe82f 100644 --- a/src/pages/WorkOrderEdit/index.vue +++ b/src/pages/WorkOrderEdit/index.vue @@ -6,23 +6,26 @@ - + - {{stepList[currentStep - 1].Title}} + {{ currentStep.Title }} - - - - + + + + + + - - - + + + @@ -32,10 +35,19 @@ import BasicsInfo from './compoents/BasicsInfo.vue' import GatePassInfo from './compoents/GatePassInfo.vue' import WorkNote from './compoents/WorkNote.vue' import RiskControl from './compoents/RiskControl.vue' +import ApplyForMachine from './compoents/ApplyForMachine.vue' -const currentStep = ref(1)// 当前步骤 +const currentStep = ref({ + id: 1, + Title: '工单基础信息', + PrevBtnName: '返回上一页', + NextBtnName: '下一步(申请出入证)', +})// 当前步骤 const basicsInfoRef = ref(null); // 基础信息组件引用 const gatePassInfoRef = ref(null); // 出入证申请组件引用 +const workNoteRef = ref(null); // 工作票填写组件引用 +const riskControlRef = ref(null); // 风险控制卡填写组件引用 +const applyForMachineRef = ref(null); // 球机申领组件引用 // 各个页面汇总数据 const allData = ref({ @@ -45,7 +57,7 @@ const allData = ref({ // 步骤列表 const stepList = ref([ - { + { id: 1, Title: '工单基础信息', PrevBtnName: '保存草稿', @@ -61,33 +73,60 @@ const stepList = ref([ id: 3, Title: '填写工作票', PrevBtnName: '保存草稿', - NextBtnName: '提交+下一步(填写风险控制卡)', + NextBtnName: '提交+下一步(风险控制卡)', }, { - id: 3, + id: 4, Title: '填写风险控制卡', PrevBtnName: '保存草稿', NextBtnName: '提交监理审核', }, + { + id: '3a', + Title: '球机申领', + PrevBtnName: '取消申领', + NextBtnName: '返回申领', + }, ]) // 返回上一步 -const prevStep = () => { - currentStep.value--; +const prevStep = (id) => { + if (id == '3a') { + currentStep.value = stepList.value.find(item => item.id == 3); + } else { + currentStep.value = stepList.value.find(item => item.id == currentStep.value.id - 1); + } } // 点击下一步 -const nextStep = () => { - if (currentStep.value == 1) { +const nextStep = (id) => { + if (currentStep.value.id == 1) { console.log(basicsInfoRef.value.getFormData()); allData.value.BasicsInfo = basicsInfoRef.value.getFormData(); - } else if (currentStep.value == 2) { + } else if (currentStep.value.id == 2) { console.log(gatePassInfoRef.value.getFormData()); allData.value.GatePassInfo = gatePassInfoRef.value.getFormData(); + } else if (currentStep.value.id == 3) { + console.log(workNoteRef.value.getFormData()); + allData.value.WorkNote = workNoteRef.value.getFormData(); + } else if (currentStep.value.id == '3a') { + console.log(applyForMachineRef.value.getFormData()); + allData.value.ApplyForMachine = applyForMachineRef.value.getFormData(); + currentStep.value = stepList.value.find(item => item.id == 3); + return; + } else if (currentStep.value.id == 4) { + console.log(riskControlRef.value.getFormData()); + allData.value.RiskControl = riskControlRef.value.getFormData(); } - currentStep.value++; + + currentStep.value = stepList.value.find(item => item.id == currentStep.value.id + 1); } +// 打开球机申领 +const openApplyForMachine = (e) => { + console.log(e); + currentStep.value = stepList.value.find(item => item.id == '3a'); +}