| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 页面加载时,启动定时器,每隔30秒自动保存 |
| | | this.autoSaveTimer = setInterval(() => { |
| | | // 1. 工单为开工状态不自动保存 |
| | | if (this.statusForm && this.statusForm.status === '开工') { |
| | | return; |
| | | } |
| | | // 2. 送检时间为空也不自动保存 |
| | | if (!this.maShoutTime) { |
| | | return; |
| | | } |
| | | this.save(); // 满足条件才自动保存 |
| | | }, 1 * 30 * 1000); // 30秒 |
| | | }, |
| | | mounted() { |
| | | // 页面加载时,启动定时器,每隔30秒自动保存 |
| | | this.autoSaveTimer = setInterval(() => { |
| | | // 1. 调机完成时间有了就不自动保存 |
| | | if (this.maEndTime) { |
| | | return; |
| | | } |
| | | // 2. 送检时间为空也不自动保存 |
| | | if (!this.maShoutTime) { |
| | | return; |
| | | } |
| | | this.save(); // 满足条件才自动保存 |
| | | }, 1 * 30 * 1000); // 30秒 |
| | | }, |
| | | beforeDestroy() { |
| | | // 页面卸载时清理定时器 |
| | | clearInterval(this.autoSaveTimer); |