| | |
| | | },
|
| | | method: method, //'GET','POST'
|
| | | dataType: 'json',
|
| | | timeout: 30000, // 30秒超时
|
| | | success: (res) => {
|
| | | !hideLoading && uni.hideLoading()
|
| | | resolve(res.data)
|
| | |
|
| | | },
|
| | | fail: (res) => {
|
| | | // !hideLoading && toast("网络不给力,请稍后再试~")
|
| | | //wx.hideLoading()
|
| | | !hideLoading && uni.hideLoading()
|
| | | // 判断是否为超时错误
|
| | | const isTimeout = res.errMsg && (res.errMsg.includes('timeout') || res.errMsg.includes('超时'))
|
| | | uni.showToast({
|
| | | title: isTimeout ? '网络请求超时,请检查网络连接' : '网络请求失败,请稍后重试',
|
| | | icon: 'none',
|
| | | duration: 3000
|
| | | })
|
| | | reject(res)
|
| | | }
|
| | | })
|
| | |
| | | this.submitConfirm(this.agvStationInput); |
| | | }, |
| | | // 提交组托请求 |
| | | async submitConfirm(agvStation) { |
| | | this.repeatClick = true |
| | | async submitConfirm(agvStation) { |
| | | this.repeatClick = true |
| | | try { |
| | | const newArr = this.list.map(item => { |
| | | |
| | | return { |
| | |
| | | position: 'top' |
| | | }) |
| | | } |
| | | } finally { |
| | | // 无论请求成功还是失败,都释放按钮锁定 |
| | | this.repeatClick = false |
| | | }, |
| | | } |
| | | }, |
| | | async getRece() { |
| | | const { |
| | | code, |
| | | data, |
| | | msg |
| | | } = await request('/areas/receipt', {}, 'get') |
| | | if (code === 200) { |
| | | this.range = data.map(item => ({ |
| | | value: item.id, |
| | | text: item.warehouseId$ + "-- " + item.name |
| | | })); |
| | | } |
| | | }, |
| | | const { |
| | | code, |
| | | data, |
| | | msg |
| | | } = await request('/areas/receipt', {}, 'get') |
| | | if (code === 200) { |
| | | this.range = data.map(item => ({ |
| | | value: item.id, |
| | | text: item.warehouseId$ + "-- " + item.name |
| | | })); |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |