|  |  |  | 
|---|
|  |  |  | import { mapState, mapMutations } from 'vuex'; | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | onShow() {}, | 
|---|
|  |  |  | onLaunch() {}, | 
|---|
|  |  |  | onHide() { | 
|---|
|  |  |  | console.log('appvue隐藏后台'); | 
|---|
|  |  |  | this.changeisconnect(false); | 
|---|
|  |  |  | if (!this.globalisconnect) { | 
|---|
|  |  |  | console.log(this.globalisUploadimg); | 
|---|
|  |  |  | if (!this.globalisconnect && !this.globalisUploadimg) { | 
|---|
|  |  |  | uni.switchTab({ | 
|---|
|  |  |  | url: '/pages/tabbar-page/index-tabbar/index-tabbar' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | ...mapMutations(['changeisconnect']) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | computed: { | 
|---|
|  |  |  | ...mapState(['globalisconnect']) | 
|---|
|  |  |  | ...mapState(['globalisconnect', 'globalisUploadimg']) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | 
|---|
|  |  |  | .second-line { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: vww(30); | 
|---|
|  |  |  | margin-left: vww(12); | 
|---|
|  |  |  | margin-left: vww(16); | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: flex-start; | 
|---|
|  |  |  | 
|---|
|  |  |  | <u-swipe-action-item | 
|---|
|  |  |  | :options="options1" | 
|---|
|  |  |  | v-for="(item, index) in huoDaiData" | 
|---|
|  |  |  | :index="index" | 
|---|
|  |  |  | :index="item.userId" | 
|---|
|  |  |  | :name="item.userId" | 
|---|
|  |  |  | :key="index" | 
|---|
|  |  |  | @click="deleteHuoDaiClick" | 
|---|
|  |  |  | 
|---|
|  |  |  | <u-swipe-action-item | 
|---|
|  |  |  | :options="options1" | 
|---|
|  |  |  | v-for="(item, index) in fleetData" | 
|---|
|  |  |  | :index="index" | 
|---|
|  |  |  | :index="item.id" | 
|---|
|  |  |  | :name="item.id" | 
|---|
|  |  |  | :key="index" | 
|---|
|  |  |  | @click="deleteFleetClick" | 
|---|
|  |  |  | 
|---|
|  |  |  | title: '加载中...' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // 新建车队 | 
|---|
|  |  |  | this.$reqPost('saveFleet', this.addGroupForm, 'params').then(res => { | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | this.$u.toast('添加成功'); | 
|---|
|  |  |  | this.$reqPost('saveFleet', this.addGroupForm, 'params') | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | console.log(res, '新建车队'); | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | this.$u.toast('添加成功'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$u.toast(res.msg ? res.msg : '添加失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(r => { | 
|---|
|  |  |  | this.getFleet(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$u.toast(res.msg ? res.msg : '添加失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | this.updateGroupShow = false; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 删除货代 | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.showLoading({ | 
|---|
|  |  |  | title: '加载中...' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params').then(res => { | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | if (res.data) { | 
|---|
|  |  |  | this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params') | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | this.$u.toast('删除成功'); | 
|---|
|  |  |  | this.getAllHuoDaiByCustomerId(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$u.toast('删除失败'); | 
|---|
|  |  |  | this.$u.toast(res.msg ? res.msg : '删除失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(r => { | 
|---|
|  |  |  | this.getAllHuoDaiByCustomerId(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 删除车队 | 
|---|
|  |  |  | deleteFleetClick(args) { | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.showLoading({ | 
|---|
|  |  |  | title: '加载中...' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | this.$reqPost('deleteFleet', { id: this.deleteFleetId }, 'params').then(res => { | 
|---|
|  |  |  | console.log('删除车队', res); | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | this.$u.toast('删除成功'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$u.toast(res.msg ? res.msg : '删除失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | this.getFleet(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | this.$reqPost('deleteFleet', { id: this.deleteFleetId }, 'params') | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | console.log('删除车队', res); | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | this.$u.toast('删除成功'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$u.toast(res.msg ? res.msg : '删除失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.getFleet(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 货代详情 | 
|---|
|  |  |  | toFreightForwarderDetails(userId) { | 
|---|
|  |  |  | 
|---|
|  |  |  | handler(v) { | 
|---|
|  |  |  | this.weighData.weigh = this.realTimeWeigh = v; | 
|---|
|  |  |  | console.log(this.realTimeWeigh, '真实重量改变了'); | 
|---|
|  |  |  | // setTimeout(() => { | 
|---|
|  |  |  | //     this.weighData.weigh = this.realTimeWeigh = v; | 
|---|
|  |  |  | // }, 0); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | deep: true, | 
|---|
|  |  |  | immediate: true | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="first-line"> | 
|---|
|  |  |  | <view class="main-information"> | 
|---|
|  |  |  | <view class="sign">装</view> | 
|---|
|  |  |  | <view class="filedname"> | 
|---|
|  |  |  | <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.deptName.slice(0, 16) }}</text> | 
|---|
|  |  |  | <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.customerName.slice(0, 16) }}</text> | 
|---|
|  |  |  | <text v-show="item.deptName.length >= 15 || item.customerName.length >= 15">...</text> | 
|---|
|  |  |  | <view class="filedname exceedHide"> | 
|---|
|  |  |  | <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.deptName }}</text> | 
|---|
|  |  |  | <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.customerName }}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="main-divider"></view> | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="first-extra"> | 
|---|
|  |  |  | <view class="main-information"> | 
|---|
|  |  |  | <view class="sign">卸</view> | 
|---|
|  |  |  | <view class="filedname"> | 
|---|
|  |  |  | <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.customerName.slice(0, 16) }}</text> | 
|---|
|  |  |  | <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.deptName.slice(0, 16) }}</text> | 
|---|
|  |  |  | <text v-show="item.customerName.length >= 15 || item.deptName.length >= 15">...</text> | 
|---|
|  |  |  | <view class="filedname exceedHide"> | 
|---|
|  |  |  | <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.customerName }}</text> | 
|---|
|  |  |  | <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.deptName }}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .exceedHide { | 
|---|
|  |  |  | white-space: nowrap; | 
|---|
|  |  |  | overflow: hidden; | 
|---|
|  |  |  | text-overflow: ellipsis; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ::v-deep.freightForwarder-index { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | margin: 0 auto; | 
|---|
|  |  |  | 
|---|
|  |  |  | clearable | 
|---|
|  |  |  | maxlength="32" | 
|---|
|  |  |  | type="text" | 
|---|
|  |  |  | placeholder="请输入用户名" | 
|---|
|  |  |  | placeholder="请输入手机号" | 
|---|
|  |  |  | prefixIcon="account" | 
|---|
|  |  |  | prefixIconStyle="font-size: 22px;color: #909399" | 
|---|
|  |  |  | ></u--input> | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="card-block"> | 
|---|
|  |  |  | <view class="forward-card" v-for="(val, index) in jhOrderPlanForwardList" :key="index"> | 
|---|
|  |  |  | <u-swipe-action> | 
|---|
|  |  |  | <u-swipe-action-item :options="options1" @click="deleteGroup(index, val)"> | 
|---|
|  |  |  | <u-swipe-action-item :options="options1" @click="deleteGroup(index, val)" :index="index" :name="val.xsUserId || val.fleetId"> | 
|---|
|  |  |  | <view class="card-content"> | 
|---|
|  |  |  | <u--form labelPosition="left" :model="forwardForm" ref="form1"> | 
|---|
|  |  |  | <u-form-item label="转发对象" labelWidth="21%" ref="item1" @click="forwardObjectClick(index)"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <text>{{ duration || '' }}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- <view class="" @click="awaken"><button type="default">跳转</button></view> --> | 
|---|
|  |  |  | <view class="open-button" @click="awaken"><button type="default">跳转</button></view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 唤醒 | 
|---|
|  |  |  | awaken() { | 
|---|
|  |  |  | uni.getSystemInfo({ | 
|---|
|  |  |  | success: function(res) { | 
|---|
|  |  |  | if (res.platform == 'android') { | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `intent://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${ | 
|---|
|  |  |  | _this.toLocation.longitude | 
|---|
|  |  |  | }&to=name&policy=0&referer=myapp#Intent;scheme=qqmap;package=com.tencent.map;end` | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } else if (res.platform == 'ios') { | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `qqmap://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${ | 
|---|
|  |  |  | _this.toLocation.longitude | 
|---|
|  |  |  | }&to=name&policy=0&referer=myapp` | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '当前设备不支持地图导航', | 
|---|
|  |  |  | icon: 'none' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | uni.openLocation({ | 
|---|
|  |  |  | latitude: this.markers[1].latitude, | 
|---|
|  |  |  | longitude: this.markers[1].longitude, | 
|---|
|  |  |  | name: '目的地位置', | 
|---|
|  |  |  | address: '目的地位置' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .open-button { | 
|---|
|  |  |  | width: 200rpx; | 
|---|
|  |  |  | margin: 10rpx 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | 
|---|
|  |  |  | <u-form-item prop="carNo" label="车牌号" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required> | 
|---|
|  |  |  | <u--input v-model="registerFormModel.carNo" placeholder="请输入内容" clearable></u--input> | 
|---|
|  |  |  | </u-form-item> | 
|---|
|  |  |  | <u-form-item prop="carImg" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required> | 
|---|
|  |  |  | <u-form-item prop="carImg" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required @click="beforeRead"> | 
|---|
|  |  |  | <u-upload | 
|---|
|  |  |  | :fileList="fileList1" | 
|---|
|  |  |  | deletable | 
|---|
|  |  |  | 
|---|
|  |  |  | mode="widthFix" style="width: 250px;height: 150px;"></image> --> | 
|---|
|  |  |  | </u-upload> | 
|---|
|  |  |  | </u-form-item> | 
|---|
|  |  |  | <u-form-item prop="drivingImg" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required> | 
|---|
|  |  |  | <u-form-item prop="drivingImg" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required @click="beforeRead"> | 
|---|
|  |  |  | <u-upload | 
|---|
|  |  |  | :fileList="fileList2" | 
|---|
|  |  |  | deletable | 
|---|
|  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import { apiRegister } from '@/api/publicInterface.js'; | 
|---|
|  |  |  | import { BaseUrl } from '@/api/publicInterface.js'; | 
|---|
|  |  |  | import { mapMutations } from 'vuex'; | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | // onLoad: function() { | 
|---|
|  |  |  | //   // 查看是否授权 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | ...mapMutations(['changeisUploadimg']), | 
|---|
|  |  |  | registerClick() { | 
|---|
|  |  |  | if (this.registerFormModel.password == this.registerFormModel.confirmPassword) { | 
|---|
|  |  |  | this.$refs.regesterFormRef | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.redirectTo({ url: '/pages/login/login' }); | 
|---|
|  |  |  | }, 1000); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$u.toast(res.data.data ? res.data.data : '添加失败'); | 
|---|
|  |  |  | this.$u.toast(res.msg ? res.msg : '添加失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(err => { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 上传图片方法 | 
|---|
|  |  |  | beforeRead() { | 
|---|
|  |  |  | this.changeisUploadimg(true); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 删除图片 | 
|---|
|  |  |  | deletePic(event) { | 
|---|
|  |  |  | this.changeisUploadimg(true); | 
|---|
|  |  |  | this[`fileList${event.name}`].splice(event.index, 1); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 新增图片 | 
|---|
|  |  |  | 
|---|
|  |  |  | weight: '', | 
|---|
|  |  |  | userId: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | globalisconnect: false | 
|---|
|  |  |  | globalisconnect: false, | 
|---|
|  |  |  | globalisUploadimg: false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | mutations: { | 
|---|
|  |  |  | lengthchange(state, payload) { | 
|---|
|  |  |  | 
|---|
|  |  |  | // 改版全局websocket状态 | 
|---|
|  |  |  | changeisconnect(state, payload) { | 
|---|
|  |  |  | state.globalisconnect = payload | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeisUploadimg(state, payload) { | 
|---|
|  |  |  | state.globalisUploadimg = payload | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|