| | |
| | | } |
| | | }, |
| | | // 自动带出工单刀具信息 |
| | | async fetchDefaultToolFromWorkOrder() { |
| | | if (!this.workOrderNo) return; |
| | | try { |
| | | const res = await this.$post({ |
| | | url: '/Womdaa/GetWomdaasByShow', |
| | | data: JSON.stringify({ daa001: this.workOrderNo }), |
| | | headers: { 'Content-Type': 'application/json' } |
| | | }); |
| | | if (res.status === 0 && Array.isArray(res.data?.tbBillList) && res.data.tbBillList.length > 0) { |
| | | const tool = res.data.tbBillList[0]; |
| | | this.selectedToolNo = tool.cutterId || tool.cutteR_ID || ''; |
| | | this.toolName = tool.cutterName || tool.cutteR_NAME || ''; |
| | | this.toolModel = tool.cutterModel || tool.cutteR_MODEL || ''; |
| | | } |
| | | } catch (e) { |
| | | console.warn('自动带出工单刀具失败', e); |
| | | } |
| | | }, |
| | | async fetchDefaultToolFromWorkOrder() { |
| | | if (!this.machineNo) return; // 注意:这里用机台号 |
| | | try { |
| | | const res = await this.$post({ |
| | | url: '/Womdaa/GetWomdaasByShow', |
| | | data: JSON.stringify({ machineNo: this.machineNo }), |
| | | headers: { 'Content-Type': 'application/json' } |
| | | }); |
| | | if (res.status === 0 && Array.isArray(res.data?.tbBillList) && res.data.tbBillList.length > 0) { |
| | | const tool = res.data.tbBillList[0]; |
| | | this.selectedToolNo = tool.cutterId || tool.cutteR_ID || ''; |
| | | this.toolName = tool.cutterName || tool.cutteR_NAME || ''; |
| | | this.toolModel = tool.cutterModel || tool.cutteR_MODEL || ''; |
| | | } |
| | | } catch (e) { |
| | | console.warn('自动带出工单刀具失败', e); |
| | | } |
| | | }, |
| | | formatDateTime(dateTimeStr) { |
| | | if (!dateTimeStr) return ''; |
| | | try { |