| | |
| | | |
| | | <script> |
| | | import { customerId } from '@/utils/status.js'; |
| | | import { mapMutations } from 'vuex'; |
| | | export default { |
| | | onLoad(params) { |
| | | onLoad(params) { |
| | | this.role = params.role; |
| | | if (params.fleetId) { |
| | | this.fleetId = params.fleetId; |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['lengthchange']), |
| | | init() {}, |
| | | addToHuoDaiOrDriver() { |
| | | switch (this.role) { |
| | |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '未成功添加'); |
| | | } |
| | | console.log('邀请货代', res); |
| | | }); |
| | | }, |
| | | // 邀请司机 |
| | |
| | | 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.$u.toast(res.data ? res.data : '操作成功'); |
| | | this.$u.toast(res.msg ? res.msg : '操作成功'); |
| | | this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => { |
| | | this.lengthchange(response.data.length); |
| | | }); |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg, |
| | | title: res.msg ? res.msg : '操作失败', |
| | | icon: 'null', |
| | | duration: 2000 |
| | | }); |