diff --git a/src/views/modules/qc/outboundNotification.vue b/src/views/modules/qc/outboundNotification.vue index 75340ed..7b77aea 100644 --- a/src/views/modules/qc/outboundNotification.vue +++ b/src/views/modules/qc/outboundNotification.vue @@ -313,22 +313,22 @@ @@ -421,33 +421,33 @@
- + @@ -110,7 +110,7 @@ @@ -174,6 +174,8 @@ export default { currentSchedule: {}, // 是否为考勤修改模式(不显示添加操作员功能) isAttendanceMode: false, + // 关闭时是否导航到机台工作台(默认true,从过站采集页面打开时传false) + navigateOnClose: true, buttons: { saveButton: '保存', closeButton: '关闭', @@ -273,8 +275,16 @@ export default { return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}:${String(date.getSeconds()).padStart(2, '0')}`; }, + /*处理对话框关闭(点击右上角X按钮时触发)*/ + handleDialogClose(done) { + // 调用关闭逻辑(不是保存操作) + this.closeDialog(false); + // 调用 done 完成关闭 + done(); + }, + /*关闭modal*/ - closeDialog() { + closeDialog(isSaveAction = false) { // 关闭弹窗 this.$emit('update:visible', false); @@ -283,23 +293,33 @@ export default { return; } - // 非考勤模式:即使用户不点击保存,也应该使用默认的当前登录人作为操作员 - // 设置默认操作员信息,并进入机台工作台 - this.operatorData.operatorId = this.$store.state.user.name; - this.operatorData.operatorName = this.$store.state.user.userDisplay; - this.operatorData.status = 'Y'; + // 判断是否需要导航到机台工作台 + // 1. 如果是保存操作(isSaveAction = true),则一定要导航 + // 2. 如果是关闭按钮操作,需要看 navigateOnClose 参数 + // - navigateOnClose = true(从机台工作台打开):导航(更新操作员信息) + // - navigateOnClose = false(从过站采集页面打开):不导航,直接返回主页面 + if (isSaveAction === true || this.navigateOnClose === true) { + // 设置默认操作员信息,并进入机台工作台 + this.operatorData.operatorId = this.$store.state.user.name; + this.operatorData.operatorName = this.$store.state.user.userDisplay; + this.operatorData.status = 'Y'; - // 调用初始化的方法,进入机台工作台 - this.$emit('initOperatorData', this.operatorData); + // 调用初始化的方法,进入机台工作台 + this.$emit('initOperatorData', this.operatorData); + } + // 如果 navigateOnClose = false 且不是保存操作,则只关闭对话框,返回主页面 }, //初始化的 - init(val, scheduleRow, isAttendanceMode = false) { + init(val, scheduleRow, isAttendanceMode = false, navigateOnClose = true) { // 保存派工单信息 this.currentSchedule = scheduleRow || {}; // 设置是否为考勤修改模式 this.isAttendanceMode = isAttendanceMode; + + // 设置关闭时是否导航(从过站采集页面打开时传false,从机台工作台打开时传true) + this.navigateOnClose = navigateOnClose; // 设置默认操作员为当前登录人 this.operatorData.operatorName = this.$store.state.user.userDisplay; @@ -535,8 +555,8 @@ export default { this.operatorData.status = 'Y'; this.operatorFlag = true; - // 关闭弹窗并进入机台工作台 - this.closeDialog(); + // 关闭弹窗并进入机台工作台(传 true 表示是保存操作,一定要导航) + this.closeDialog(true); }); }, diff --git a/src/views/modules/yieldReport/produce_order.vue b/src/views/modules/yieldReport/produce_order.vue index f29f0bf..0335a24 100644 --- a/src/views/modules/yieldReport/produce_order.vue +++ b/src/views/modules/yieldReport/produce_order.vue @@ -1923,7 +1923,7 @@ export default { // 打开操作员切换功能 this.showOperatorFlag = true this.$nextTick(() => { - this.$refs.comSwitchOperator.init(val, this.currentRow) + this.$refs.comSwitchOperator.init(val, this.currentRow, false, false) }) } if (data.code == 300) { @@ -1938,7 +1938,7 @@ export default { // 打开操作员切换功能 this.showOperatorFlag = true this.$nextTick(() => { - this.$refs.comSwitchOperator.init(val, this.currentRow) + this.$refs.comSwitchOperator.init(val, this.currentRow, false, false) }) }) } @@ -1948,7 +1948,7 @@ export default { let orderType = this.currentRow.orderType if (orderType === 'D') { this.showOperatorFlag = true - this.$refs.comSwitchOperator.init(val, this.currentRow) + this.$refs.comSwitchOperator.init(val, this.currentRow, false, false) } else { this.$message.error(this.labels.thisOrderIsNotSplitOrder) return false @@ -1958,7 +1958,7 @@ export default { let workCenterNo = this.currentRow.workCenterNo if (workCenterNo === 'FQC' || nextItemNo == 0) { this.showOperatorFlag = true - this.$refs.comSwitchOperator.init(val, this.currentRow) + this.$refs.comSwitchOperator.init(val, this.currentRow, false, false) } else { this.$message.error(this.labels.thisScheduleIsNotFqc) return false @@ -1971,7 +1971,7 @@ export default { // 打开操作员切换功能 this.showOperatorFlag = true this.$nextTick(() => { - this.$refs.comSwitchOperator.init(val, this.currentRow) + this.$refs.comSwitchOperator.init(val, this.currentRow, false, false) }) } else { this.$alert(this.labels.thisOrderIsNotSpecialOrder, '提示', { @@ -1984,7 +1984,7 @@ export default { // 打开操作员切换功能 this.showOperatorFlag = true this.$nextTick(() => { - this.$refs.comSwitchOperator.init(val, this.currentRow) + this.$refs.comSwitchOperator.init(val, this.currentRow, false, false) }) } }