| | |
| | | export default { |
| | | onLoad(params) { |
| | | console.log('转发的提煤单id', params.orderPlanId, params.carNum); |
| | | if (params.carNumSurplus1 || params.carNumSurplusHuodai) { |
| | | if (params.carNumSurplus1 != 0) { |
| | | this.forwardSurplus = params.carNumSurplus1; |
| | | } else if (params.carNumSurplusHuodai != 0) { |
| | | this.forwardSurplus = params.carNumSurplusHuodai; |
| | | } |
| | | } |
| | | this.forwardForm.orderPlanId = params.orderPlanId; |
| | | this.carNumTatal = params.carNum; |
| | | }, |
| | | data() { |
| | | return { |
| | | forwardSurplus: 0, |
| | | paramsName: {}, |
| | | huoDaiData: [], |
| | | fleetData: [], |
| | | carNumTatal: null, |
| | | name: '', |
| | | forwardForm: { |
| | | orderPlanId: null, |
| | |
| | | checkboxChange(value) { |
| | | console.log('复选框变化', value); |
| | | if (value.length != 0) { |
| | | this.forwardForm.nums = this.carNumTatal; |
| | | this.forwardForm.nums = this.forwardSurplus; |
| | | } else { |
| | | this.forwardForm.nums = null; |
| | | } |
| | |
| | | }, |
| | | // 提交 |
| | | submitForm() { |
| | | this.$reqPost('forward', this.forwardForm, 'params').then(res => { |
| | | if (res.code == 0) { |
| | | this.$u.toast('提交成功'); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ delta: 1 }); |
| | | }, 1000); |
| | | } |
| | | }); |
| | | if (isNaN(Number(this.forwardForm.nums)) || Number(this.forwardForm.nums) <= 0) { |
| | | this.$u.toast('请输入合法数字'); |
| | | } else if (Number(this.forwardForm.nums) > Number(this.forwardSurplus)) { |
| | | this.$u.toast('超过最大订单剩余量'); |
| | | } else { |
| | | this.$reqPost('forward', this.forwardForm, 'params').then(res => { |
| | | if (res.code == 0) { |
| | | this.$u.toast('提交成功'); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ delta: 1 }); |
| | | }, 1000); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | tabClick(item) { |
| | | console.log('tab点击', item); |