| | |
| | | <text>{{ item.carNum }}</text> |
| | | 张 |
| | | </view> |
| | | <view class="card-left__utils"><u-button @tap.stop="qiangDanBtn(item.orderPlanId)" text="抢单" type="primary" shape="circle"></u-button></view> |
| | | <view class="card-left__utils"><u-button @tap.stop="qiangDan(item.orderPlanId)" text="抢单" type="primary" shape="circle"></u-button></view> |
| | | </template> |
| | | <template v-slot:right-top> |
| | | <view class="right-top"> |
| | |
| | | // 抢单模态框 |
| | | qiangDanShow: false, |
| | | qiangDanTitle: '抢单提示', |
| | | qiangDanContent: '' |
| | | qiangDanContent: '', |
| | | qiangDanOrderPlanId:null |
| | | }; |
| | | }, |
| | | onShow() { |
| | |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }); |
| | | // this.$reqGet('qiangDanList', { id: customerId }).then(res => { |
| | | this.$reqGet('qiangDanList').then(res => { |
| | | console.log('抢单列表', res); |
| | | uni.hideLoading(); |
| | | this.driverBillOfLoadingData = res.data; |
| | | }); |
| | | }, |
| | | // 抢单按钮 |
| | | qiangDanBtn(value) { |
| | | if (value.taskNum == 0) { |
| | | if (value.tmcCount == 0) { |
| | | this.qiangDan(value.orderPlanId); |
| | | } else { |
| | | this.qiangDanOrderPlanId = value.orderPlanId |
| | | this.qiangDanShow = true |
| | | this.qiangDanContent = `已抢${value.tmcCount}单,确定抢单?` |
| | | } |
| | | }, |
| | | // 抢单模态框 |
| | | qiangDanConfirm() {}, |
| | | qiangDanConfirm() { |
| | | this.qiangDanContent = '' |
| | | this.qiangDan(this.qiangDanOrderPlanId); |
| | | }, |
| | | qiangDanCancel() { |
| | | this.qiangDanShow = false; |
| | | }, |
| | | // 抢单请求 |
| | | qiangDan(id) { |
| | | // this.$reqPost('qiangDan', { orderPlanId: id, wxUserId: customerId }, 'params').then(res => { |
| | | this.$reqPost('qiangDan', { orderPlanId: id }, 'params').then(res => { |
| | | if (res.code == 0) { |
| | | this.$u.toast('抢单成功'); |
| | | } else { |
| | | this.$u.toast(res.data ? res.data : '抢单失败'); |
| | | } |
| | | console.log('抢单', res); |
| | | this.qiangDanList(); |
| | | }); |
| | | }, |