|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<!-- 操作员切换模块 --> |
|
|
|
<div class="customer-css"> |
|
|
|
<el-dialog :title="titleCon" v-bind="$attrs" v-on="$listeners" width="800px" :close-on-click-modal="false"> |
|
|
|
<el-dialog :title="titleCon" v-bind="$attrs" v-on="$listeners" width="800px" :close-on-click-modal="false" :before-close="handleDialogClose"> |
|
|
|
<!-- 上部分:添加操作员 --> |
|
|
|
<el-form v-if="!isAttendanceMode" :inline="true" @submit.native.prevent label-position="top" label-width="100px" style="margin-bottom: 15px;"> |
|
|
|
<el-row> |
|
|
|
@ -110,7 +110,7 @@ |
|
|
|
<!-- 底部:保存和关闭按钮 --> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="saveOperatorData">{{ buttons.saveButton }}</el-button> |
|
|
|
<el-button @click="closeDialog">{{ buttons.closeButton }}</el-button> |
|
|
|
<el-button @click="closeDialog(false)">{{ buttons.closeButton }}</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<!--列表的组件--> |
|
|
|
@ -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,24 +293,34 @@ 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; |
|
|
|
this.operatorData.operatorId = this.$store.state.user.name; |
|
|
|
@ -535,8 +555,8 @@ export default { |
|
|
|
this.operatorData.status = 'Y'; |
|
|
|
this.operatorFlag = true; |
|
|
|
|
|
|
|
// 关闭弹窗并进入机台工作台 |
|
|
|
this.closeDialog(); |
|
|
|
// 关闭弹窗并进入机台工作台(传 true 表示是保存操作,一定要导航) |
|
|
|
this.closeDialog(true); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|