| | |
| | | qiangDanShow: false, |
| | | qiangDanTitle: '抢单提示', |
| | | qiangDanContent: '', |
| | | qiangDanOrderPlanId: null |
| | | qiangDanOrderPlanId: null, |
| | | fleetId: '' |
| | | }; |
| | | }, |
| | | onShow() { |
| | |
| | | // 抢单按钮 |
| | | qiangDanBtn(value) { |
| | | if (value.tmcCount == '0') { |
| | | this.qiangDan(value.orderPlanId); |
| | | this.qiangDan(value.orderPlanId, value.fleetId); |
| | | } else { |
| | | this.qiangDanOrderPlanId = value.orderPlanId; |
| | | this.fleetId = value.fleetId; |
| | | this.qiangDanShow = true; |
| | | this.qiangDanContent = `已抢${value.tmcCount}单,确定抢单?`; |
| | | } |
| | |
| | | // 抢单模态框 |
| | | qiangDanConfirm() { |
| | | this.qiangDanContent = ''; |
| | | this.qiangDan(this.qiangDanOrderPlanId); |
| | | this.qiangDan(this.qiangDanOrderPlanId, this.fleetId); |
| | | }, |
| | | qiangDanCancel() { |
| | | this.qiangDanShow = false; |
| | | }, |
| | | // 抢单请求 |
| | | qiangDan(id) { |
| | | this.$reqPost('qiangDan', { orderPlanId: id }, 'params').then(res => { |
| | | qiangDan(id, fleetId) { |
| | | this.$reqPost('qiangDan', { orderPlanId: id, fleetId: fleetId }, 'params').then(res => { |
| | | if (res.code == 0) { |
| | | this.$u.toast('抢单成功'); |
| | | this.qiangDanShow = false; |
| | | this.qiangDanList(); |
| | | } else { |
| | | this.$u.toast(res.data ? res.data : '抢单失败'); |
| | | this.qiangDanShow = false; |
| | | } |
| | | this.qiangDanList(); |
| | | }); |
| | | }, |
| | | list3CardIconClick(value) { |