From 478c5cfc1a2995949e3a3cc026cd269371d3f365 Mon Sep 17 00:00:00 2001
From: liangbin <15536829364@163.com>
Date: Mon, 19 Jan 2026 14:32:27 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E5=B7=A5=E5=8D=95=E7=BC=96=E8=BE=91):=20?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A7=BB=E5=8A=A8=E7=90=83=E6=9C=BA=E7=94=B3?=
=?UTF-8?q?=E9=A2=86=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在WorkNote组件中添加申领按钮并绑定openApplyForMachine事件
- 新增ApplyForMachine组件用于球机申领表单
- 修改index.vue实现球机申领流程跳转
- 调整步骤导航逻辑支持子步骤
---
.../compoents/ApplyForMachine.vue | 147 ++++++++++++++++++
.../WorkOrderEdit/compoents/WorkNote.vue | 14 +-
src/pages/WorkOrderEdit/index.vue | 102 ++++++++----
3 files changed, 232 insertions(+), 31 deletions(-)
create mode 100644 src/pages/WorkOrderEdit/compoents/ApplyForMachine.vue
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');
+}