| | |
| | | <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-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.id)"></u-cell> |
| | | </u-swipe-action-item> |
| | | </u-cell-group> |
| | |
| | | <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> |
| | |
| | | |
| | | <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 |
| | |
| | | }, |
| | | // 获取货代列表 |
| | | getAllHuoDaiByCustomerId() { |
| | | this.$reqGet('getAllHuoDaiByCustomerId', { customerId }).then(res => { |
| | | this.$reqGet('getAllHuoDaiByCustomerId').then(res => { |
| | | this.huoDaiData = res.data; |
| | | console.log('货代列表', res); |
| | | }); |
| | | }, |
| | | // 获取车队列表 |
| | | getFleet() { |
| | | this.$reqGet('getFleet', { customerId }).then(res => { |
| | | this.$reqGet('getFleet').then(res => { |
| | | this.fleetData = res.data; |
| | | console.log('车队列表', res); |
| | | }); |
| | |
| | | // 新建车队 |
| | | 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.data ? res.data : '添加失败'); |
| | | } |
| | | }); |
| | | 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(); |
| | | }); |
| | | }, |
| | | // 删除车队 |
| | |
| | | // 货代详情 |
| | | toFreightForwarderDetails(id) { |
| | | uni.navigateTo({ |
| | | url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?huoDaiId=${id}` |
| | | url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details` |
| | | }); |
| | | }, |
| | | // 车队详情 |
| | |
| | | this.logoutShow = true; |
| | | }, |
| | | logoutConfirm() { |
| | | redirectLogin() |
| | | redirectLogin(); |
| | | }, |
| | | logoutCancel() { |
| | | this.logoutShow = false; |