| | |
| | | getStartBtnText(item) { |
| | | const isSelected = this.isShowTableData.length > 0 && this.isShowTableData[0].daa001 === item.daa001; |
| | | if (isSelected) { |
| | | return '转跳报工界面'; |
| | | // 检查是否有调机时间 |
| | | if (this.isShowTableData[0].maShoutTime) { |
| | | return '转跳报工界面'; |
| | | } else { |
| | | return '转跳上下刀界面'; |
| | | } |
| | | } |
| | | return '开工'; |
| | | }, |
| | |
| | | const isSelected = this.isShowTableData.length > 0 && this.isShowTableData[0].daa001 === item.daa001; |
| | | |
| | | if (isSelected) { |
| | | // 如果已选中,则先跳转到主界面,然后跳转到报工界面 |
| | | // 如果已选中,先跳转到主界面 |
| | | this.toDetail(item); |
| | | // 延迟跳转到报工界面 |
| | | |
| | | // 延迟跳转:根据是否有调机时间决定跳转到哪个界面 |
| | | setTimeout(() => { |
| | | this.currentTab = 4; |
| | | if (this.isShowTableData[0].maShoutTime) { |
| | | // 有调机时间,跳转到报工界面 |
| | | this.currentTab = 4; |
| | | } else { |
| | | // 没有调机时间,跳转到上下刀界面 |
| | | this.currentTab = 2; |
| | | } |
| | | }, 100); |
| | | } else { |
| | | // 如果未选中,则执行开工逻辑 |
| | |
| | | editDate: editDate, |
| | | item: orderSelect |
| | | } |
| | | }).then(res => { |
| | | }).then(async res => { |
| | | if (res.data.tbBillList) { |
| | | this.getWomdaaIsShow(); |
| | | uni.showToast({ |
| | | title: '开工成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }); |
| | | |
| | | // 调用后端方法绑定数采标志 |
| | | const bindSuccess = await this.bindDataCollectionFlag(item.daa001); |
| | | |
| | | // 绑定成功后再提示开工成功 |
| | | if (bindSuccess) { |
| | | uni.showToast({ |
| | | title: '开工成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 新增:绑定数采标志方法 |
| | | async bindDataCollectionFlag(orderNo) { |
| | | try { |
| | | const res = await this.$post({ |
| | | url: '/MesOrderDataCollection/BindDataCollectionFlag', |
| | | data: { |
| | | machineNo: this.machineNo, |
| | | orderNo: orderNo |
| | | } |
| | | }); |
| | | |
| | | if (res && res.status === 0) { |
| | | console.log('数采标志绑定成功'); |
| | | this.$showMessage('数采标志绑定成功'); |
| | | return true; |
| | | } else { |
| | | console.error('数采标志绑定失败:', res.message || '未知错误'); |
| | | this.$showMessage('数采标志绑定失败'); |
| | | return false; |
| | | } |
| | | } catch (err) { |
| | | console.error('绑定数采标志错误:', err); |
| | | this.$showMessage('绑定数采标志失败'); |
| | | return false; |
| | | } |
| | | }, |
| | | |
| | | // 处理暂停(使用清空重选的逻辑) |
| | | async handlePauseWork(item) { |
| | | if (!this.machineNo) { |