| | |
| | | this.getEditData(e.linterid, e.HBillNo) |
| | | } else { |
| | | this.getNewData() |
| | | if(e.HBarCode){ |
| | | this.hform.HBarCode=e.HBarCode |
| | | setTimeout(() => { |
| | | this.toInCode(e); |
| | | }, 1000) |
| | | } |
| | | |
| | | } |
| | | this.getHMaterList() |
| | | this.getHProcList() |
| | |
| | | this.getHCenterList() |
| | | |
| | | this.getDefValByUser() |
| | | |
| | | }, |
| | | methods: { |
| | | //选中全部文本 |
| | |
| | | } else { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)', |
| | | content: res.data.Message + '。是否继续新增下一道工序?(点击取消返回新增页面)', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | console.log('用户点击确定'); |
| | | uni.redirectTo({ |
| | | url: '/pages/gongxuOut/form?OperationType=1' |
| | | }) |
| | | this.getNextProc() |
| | | // uni.redirectTo({ |
| | | // url: '/pages/gongxuOut/form?OperationType=1' |
| | | // }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | }, 50) |
| | | // setTimeout(() => { |
| | | // uni.navigateBack(); |
| | | // }, 50) |
| | | uni.redirectTo({ |
| | | url: '/pages/gongxuOut/form?OperationType=1' |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | getNextProc(){ |
| | | uni.request({ |
| | | url: this.serverUrl + '/LEMS/MES_Sc_ProcessExchangeBillQuerySub_Json', |
| | | method: 'GET', |
| | | dataType: "json", |
| | | data: { |
| | | sWhere:this.hform.HProcExchHinteID |
| | | }, |
| | | success: (res) => { |
| | | console.log(1, res); |
| | | if (res.data.count == 1) { |
| | | let processList = res.data.data |
| | | |
| | | // 1. 先过滤出 HSEQNumber === 'N' 的数据 |
| | | processList = processList.filter(item => item.HSEQNumber === this.hform.HSEQNumber); |
| | | |
| | | //当前工序编号 |
| | | const currentIndex = processList.findIndex(item => item["工序号"] === this.hform.HProcNo); |
| | | // 获取下一个工序(如果存在) |
| | | const nextProcess = currentIndex !== -1 && currentIndex < processList.length - 1 |
| | | ? processList[currentIndex + 1] : null; |
| | | if(!nextProcess){ |
| | | uni.showToast({ |
| | | title: '没有下一道工序即将跳转新增页面', |
| | | icon: 'none' |
| | | }) |
| | | uni.redirectTo({ |
| | | url: '/pages/gongxuOut/form?OperationType=1' |
| | | }) |
| | | }else{ |
| | | this.hform.HProcNo=nextProcess["工序号"]; |
| | | const HNextBarCode = this.hform.HBarCode+"@"+this.hform.HProcNo+"@"+this.hform.HSEQNumber |
| | | uni.redirectTo({ |
| | | url: '/pages/gongxuOut/form?OperationType=1&HBarCode='+HNextBarCode |
| | | }) |
| | | } |
| | | }else{ |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '获取下一道工序失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | fail: (res) => { |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |