| | |
| | | </u-form-item>--> |
| | | </u--form> |
| | | </view> |
| | | <view class="addBtn"><u-button text="邀请" type="primary" @click="addToHuoDaiOrDriver"></u-button></view> |
| | | <view class="addBtn"> |
| | | <u-button text="邀请" :loading="yaoqingLoading" type="primary" @click="addToHuoDaiOrDriver"></u-button> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | name: '', |
| | | phone: '', |
| | | carNo: '', |
| | | customerId |
| | | customerId, |
| | | yaoqingLoading: false, //邀请loading |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | // 邀请货代 |
| | | bindHuoDai() { |
| | | this.yaoqingLoading = true |
| | | // this.$reqPost('bindHuoDai', { customerId: this.customerId, name: this.name, phone: this.phone }, 'params').then(res => { |
| | | this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }, 'params').then(res => { |
| | | if (res.code == 0) { |
| | | this.yaoqingLoading = false |
| | | this.$u.toast('添加成功'); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '未成功添加'); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.yaoqingLoading = false |
| | | }).finally(() => { |
| | | this.yaoqingLoading = false |
| | | }); |
| | | }, |
| | | // 邀请司机 |
| | | bindUserFleet() { |
| | | this.yaoqingLoading = true |
| | | this.$reqPost('bindUserFleet', { fleetId: this.fleetId, name: this.name, phone: this.phone, carNo: this.carNo }, 'params').then(res => { |
| | | console.log('邀请司机', res); |
| | | if (res.code == 0) { |
| | | this.yaoqingLoading = false |
| | | this.$u.toast(res.msg ? res.msg : '操作成功'); |
| | | this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => { |
| | | this.lengthchange(response.data.length); |
| | |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.yaoqingLoading = false |
| | | }).finally(() => { |
| | | this.yaoqingLoading = false |
| | | }); |
| | | } |
| | | } |
| | | }; |