| | |
| | | <view class="huodai-list"> |
| | | <u-swipe-action> |
| | | <u-cell-group :border="false"> |
| | | <u-swipe-action-item :options="options1" v-for="(item, index) in huoDaiData" :index="index" :name="item.id" :key="index" @click="deleteHuoDaiClick"> |
| | | <u-cell :title="item.name" value="详情" @click="toFreightForwarderDetails(item.id)"></u-cell> |
| | | <u-swipe-action-item :options="options1" v-for="(item, index) in huoDaiData" :index="index" :name="item.userId" :key="index" @click="deleteHuoDaiClick"> |
| | | <u-cell :title="item.name" value="详情" @click="toFreightForwarderDetails(item.userId)"></u-cell> |
| | | </u-swipe-action-item> |
| | | </u-cell-group> |
| | | </u-swipe-action> |
| | |
| | | <u-swipe-action> |
| | | <u-cell-group :border="false"> |
| | | <u-swipe-action-item :options="options1" v-for="(item, index) in fleetData" :index="index" :name="item.id" :key="index" @click="deleteFleetClick"> |
| | | <u-cell :title="item.name" value="25辆" @click="tofleetDetails(item.id)"></u-cell> |
| | | <u-cell :title="item.name" :value="item.userSijisum + '辆'" @click="tofleetDetails(item.id)"></u-cell> |
| | | </u-swipe-action-item> |
| | | </u-cell-group> |
| | | </u-swipe-action> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="statistics"><u-button text="发运统计" type="primary" @click="statistics"></u-button></view> |
| | | <view class="logout"><u-button text="退出登录" type="primary" @click="logout()"></u-button></view> |
| | | |
| | | <!-- 新建车队弹出框 --> |
| | |
| | | |
| | | <script> |
| | | import combinedTitle from '@/components/combined-title/combined-title.vue'; |
| | | import { customerId ,redirectLogin} from '@/utils/status'; |
| | | import { customerId, redirectLogin } from '@/utils/status'; |
| | | export default { |
| | | components: { |
| | | combinedTitle |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }); |
| | | this.getAllHuoDaiByCustomerId(); |
| | | this.getFleet(); |
| | | uni.hideLoading(); |
| | | }, |
| | | // 获取货代列表 |
| | | getAllHuoDaiByCustomerId() { |
| | | this.$reqGet('getAllHuoDaiByCustomerId', { customerId }).then(res => { |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }); |
| | | this.$reqGet('getAllHuoDaiByCustomerId').then(res => { |
| | | uni.hideLoading(); |
| | | this.huoDaiData = res.data; |
| | | console.log('货代列表', res); |
| | | }); |
| | | }, |
| | | // 获取车队列表 |
| | | getFleet() { |
| | | this.$reqGet('getFleet', { customerId }).then(res => { |
| | | uni.showLoading({ |
| | | title: '加载中...' |
| | | }); |
| | | this.$reqGet('getFleet').then(res => { |
| | | uni.hideLoading(); |
| | | this.fleetData = res.data; |
| | | console.log('车队列表', res); |
| | | }); |
| | | }, |
| | | // 添加货代 |
| | |
| | | }, |
| | | // 添加车队 |
| | | addFleet() { |
| | | console.log('添加车队'); |
| | | this.updateGroupShow = true; |
| | | }, |
| | | addNewFleetPopupClose() { |
| | |
| | | // 新建车队 |
| | | this.$reqPost('saveFleet', this.addGroupForm, 'params').then(res => { |
| | | uni.hideLoading(); |
| | | console.log('新建车队', res); |
| | | this.getFleet(); |
| | | if (res.code == 0) { |
| | | this.$u.toast('添加成功'); |
| | | this.getFleet(); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '添加失败'); |
| | | } |
| | | }); |
| | | this.updateGroupShow = false; |
| | | }, |
| | | // 删除货代 |
| | | deleteHuoDaiClick(args) { |
| | | console.log(args.name, '货代id'); |
| | | console.log(args, '货代id'); |
| | | this.deleteHuoDaiId = args.name; |
| | | this.deleteHuoDaiShow = true; |
| | | this.huoDaiData.forEach(item => { |
| | | if (item.id == this.deleteHuoDaiId) { |
| | | this.deleteHuoDaiContent = '确认删除货代' + item.huoDaiName; |
| | | if (item.userId == this.deleteHuoDaiId) { |
| | | this.deleteHuoDaiContent = '确认删除货代' + item.name + '吗?'; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params').then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code == 0) { |
| | | this.$u.toast('删除成功'); |
| | | if (res.data) { |
| | | this.$u.toast('删除成功'); |
| | | this.getAllHuoDaiByCustomerId(); |
| | | } else { |
| | | this.$u.toast('删除失败'); |
| | | } |
| | | } |
| | | this.getAllHuoDaiByCustomerId(); |
| | | }); |
| | | }, |
| | | // 删除车队 |
| | |
| | | console.log('删除车队', res); |
| | | if (res.code == 0) { |
| | | this.$u.toast('删除成功'); |
| | | } else { |
| | | this.$u.toast(res.msg ? res.msg : '删除失败'); |
| | | } |
| | | uni.hideLoading(); |
| | | this.getFleet(); |
| | | }); |
| | | }, |
| | | // 货代详情 |
| | | toFreightForwarderDetails(id) { |
| | | toFreightForwarderDetails(userId) { |
| | | uni.navigateTo({ |
| | | url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?huoDaiId=${id}` |
| | | url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?userId=${userId}` |
| | | }); |
| | | }, |
| | | // 车队详情 |
| | |
| | | this.logoutShow = true; |
| | | }, |
| | | logoutConfirm() { |
| | | redirectLogin() |
| | | redirectLogin(); |
| | | }, |
| | | logoutCancel() { |
| | | this.logoutShow = false; |
| | | }, |
| | | // 跳转发运统计页面 |
| | | statistics() { |
| | | uni.navigateTo({ |
| | | url: '/pages/customer-page/customer-my/faYunstatistics/faYunstatistics' |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .statistics { |
| | | margin-top: vww(10); |
| | | margin-bottom: vww(10); |
| | | } |
| | | ::v-deep.customer-my { |
| | | width: 94%; |
| | | margin: 0 auto; |