| | |
| | | } |
| | | return str; |
| | | }, |
| | | cancel() { |
| | | if (!this.machineNo) { |
| | | return; |
| | | } |
| | | |
| | | methods: { |
| | | // 刀具绑定判断钩子 |
| | | hasBindedCutter() { |
| | | const currentOrder = this.isShowTableData[0]; |
| | | if ( |
| | | return ( |
| | | currentOrder && |
| | | ( |
| | | (currentOrder.outToolId && currentOrder.outToolId.toString().trim() !== '') || |
| | | (currentOrder.outToolCode && currentOrder.outToolCode.trim() !== '') || |
| | | (currentOrder.outToolName && currentOrder.outToolName.trim() !== '') |
| | | ) |
| | | ) { |
| | | ); |
| | | }, |
| | | |
| | | cancel() { |
| | | if (!this.machineNo) { |
| | | return; |
| | | } |
| | | |
| | | // 使用钩子判断 |
| | | if (this.hasBindedCutter()) { |
| | | uni.showToast({ |
| | | title: '当前工单已绑定刀具,不能清空重选', |
| | | icon: 'error', |
| | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | formatDate(date) { |
| | | let year = date.getFullYear(); // 获取年份 |
| | | let month = String(date.getMonth() + 1).padStart(2, '0'); // 获取月份并补零 |