驿站
This commit is contained in:
parent
5399625d7d
commit
1bb374e0fb
@ -68,7 +68,6 @@
|
||||
},
|
||||
|
||||
showToast() {
|
||||
// 6
|
||||
this.$refs.uToast.show({
|
||||
type: 'success',
|
||||
title: '成功主题(带图标)',
|
||||
@ -78,7 +77,6 @@
|
||||
},
|
||||
showToast2() {
|
||||
// 6
|
||||
|
||||
this.$refs.uToast.show({
|
||||
type: 'error',
|
||||
message: "取件码不能为空",
|
||||
|
@ -3,8 +3,6 @@
|
||||
<view v-if='showLoading'>
|
||||
<u-loading-page :loading="showLoading"></u-loading-page>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-else>
|
||||
<view class="order">
|
||||
<p class="tit" v-if="goodsDetil.logistics.status==1">订单编号: {{goodsDetil.logistics.order_sn}}
|
||||
@ -87,7 +85,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 已送达 -->
|
||||
<view class="left" v-if="goodsDetil.logistics.status==2">
|
||||
<view class="list">
|
||||
|
@ -4,8 +4,24 @@
|
||||
v-model="keywords"></u-search>
|
||||
|
||||
|
||||
<view class="cards">
|
||||
<view class="cards" v-for="item,index in orderlist" :key="index">
|
||||
<view class="li">订单编号: {{item.order_sn}}</view>
|
||||
<view class="li">取货时间: {{item.qh_time}}</view>
|
||||
<view class="li">手机号: {{item.receiver_phone}}</view>
|
||||
<view class="btn_li">收货人姓名: {{fuzzyName(item.receiver_name)}} <u-button type="primary" class="btn"
|
||||
@click="doneFn(item.id)"><u-icon name="car-fill" color="white" size="25"
|
||||
style="margin-right: 10rpx;;"></u-icon>
|
||||
货物送达</u-button></view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<u-modal :show="showPop" @close="showPop=false" title="请输入收件码" @confirm="confirm"
|
||||
:closeOnClickOverlay="true">
|
||||
<view class="slot-content">
|
||||
<u--input placeholder="请输入收件码" type="number" border="surround" v-model="take_code"></u--input>
|
||||
</view>
|
||||
</u-modal>
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -14,35 +30,102 @@
|
||||
import {
|
||||
getList
|
||||
} from "@/api/logistics.js"
|
||||
|
||||
import {
|
||||
doneDelivery
|
||||
} from "@/api/logistics.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showPop: false,
|
||||
keywords: "",
|
||||
orderlist: [],
|
||||
is_captain: "",
|
||||
take_code: "",
|
||||
order_id: "",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fuzzyName(name) {
|
||||
let length = name.length;
|
||||
let fuzzyChars = "*".repeat(length - 1);
|
||||
return name[0] + fuzzyChars;
|
||||
},
|
||||
showToast() {
|
||||
this.$refs.uToast.show({
|
||||
type: 'success',
|
||||
title: '成功主题(带图标)',
|
||||
message: "操作成功",
|
||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
||||
})
|
||||
},
|
||||
doneFn(id) {
|
||||
this.order_id = id
|
||||
this.showPop = true
|
||||
},
|
||||
confirm() {
|
||||
if (!this.take_code) return
|
||||
doneDelivery({
|
||||
take_code: this.take_code,
|
||||
logistics_id: this.order_id,
|
||||
}).then(res => {
|
||||
this.showToast()
|
||||
|
||||
return {}
|
||||
}
|
||||
}
|
||||
})
|
||||
this.showPop = false
|
||||
this.getOrderList()
|
||||
},
|
||||
getOrderList() {
|
||||
console.log("列表更新")
|
||||
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
||||
getList({
|
||||
status: 1,
|
||||
user_id: id,
|
||||
keywords: this.keywords,
|
||||
user_type: this.is_captain
|
||||
}).then(res => {
|
||||
this.orderlist = []
|
||||
this.orderlist = res.data.data
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.is_captain = JSON.parse(uni.getStorageSync('USER_INFO')).is_captain
|
||||
this.getOrderList()
|
||||
},
|
||||
|
||||
|
||||
|
||||
methods: {
|
||||
// getOrderList() {
|
||||
// console.log("列表更新")
|
||||
// let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
||||
// getList({
|
||||
// status: 1,
|
||||
// user_id: id,
|
||||
// keywords: this.keywords,
|
||||
// user_type: this.is_captain
|
||||
// }).then(res => {
|
||||
// this.orderlist = []
|
||||
// this.orderlist = res.data.data
|
||||
// })
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
padding: 30rpx;
|
||||
|
||||
.cards {
|
||||
padding: 2vw;
|
||||
border-radius: 15rpx;
|
||||
background-color: white;
|
||||
margin: 30rpx 0;
|
||||
|
||||
.li {
|
||||
// margin: 10rpx 0;
|
||||
height: 43rpx;
|
||||
}
|
||||
|
||||
.btn_li {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 43rpx;
|
||||
|
||||
.btn {
|
||||
background-color: #FF7C32;
|
||||
border: 0;
|
||||
border-radius: 2vw;
|
||||
width: auto;
|
||||
height: 60rpx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -247,7 +247,7 @@ export const oaHomeData = [{
|
||||
{
|
||||
text: '驿站',
|
||||
icon: '../../static/img/home/GRCW.png',
|
||||
url: '/subpkg/finance/finance',
|
||||
url: '/pages/logistics/post',
|
||||
// captain: true
|
||||
},
|
||||
// {
|
||||
|
@ -22,9 +22,17 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="">
|
||||
<text>担任职务 :</text>
|
||||
<text>{item.master_position}</text>
|
||||
<view class="is_contract">
|
||||
<view>
|
||||
<text>担任职务 :</text>
|
||||
<text>{item.master_position}</text>
|
||||
</view>
|
||||
<view>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox active-color="#0122C7" v-model="checked" shape="square" label=""></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="" @click="copyPhone()">
|
||||
<text>联系电话 :</text>
|
||||
|
@ -5,40 +5,52 @@
|
||||
inactiveStyle="color:#fff" activeStyle="color:#fff"></u-tabs>
|
||||
</u-sticky>
|
||||
<view class="serch">
|
||||
<u-search placeholder="搜索你的订单" :show-action="true" bg-color="white" v-model="keywords"></u-search>
|
||||
<u-search placeholder="输入车牌号进行搜索" :show-action="true" bg-color="white" v-model="keywords"></u-search>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="curNow==0" class="personnel_list">
|
||||
<view class="cards">
|
||||
<view class="cards_head">
|
||||
<text>XSDSDSD</text>
|
||||
|
||||
</view>
|
||||
<view class="cards_content">
|
||||
<view class="right">
|
||||
<view class="li">
|
||||
<text>车牌号: </text>
|
||||
<text> { item.name }</text>
|
||||
</view>
|
||||
<view class="li">
|
||||
<text>行驶总里程: </text>
|
||||
<text>{ item.phone }</text>
|
||||
<view style="float: right;">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox active-color="#0122C7" v-model="checked" shape="square"
|
||||
label=""></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<view v-if="dataList.length">
|
||||
<view class="cards" v-for="item,index in dataList" :key="index">
|
||||
<view class="cards_head">
|
||||
<text>XSDSDSD</text>
|
||||
</view>
|
||||
<view class="cards_content">
|
||||
<view class="right">
|
||||
<view class="li">
|
||||
<text>车牌号: </text>
|
||||
<text> { item.name }</text>
|
||||
</view>
|
||||
<view class="li">
|
||||
<text>行驶总里程: </text>
|
||||
<text>{ item.phone }</text>
|
||||
<view style="float: right;">
|
||||
<u-checkbox-group v-model="checked">
|
||||
<u-checkbox active-color="#0122C7" :label="item" :name="item" shape="square"
|
||||
label=""></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="li">
|
||||
<text>本公司签约时间: </text>
|
||||
<text> 所属片区 </text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="li">
|
||||
<text>本公司签约时间: </text>
|
||||
<text> 所属片区 </text>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-else>
|
||||
<!-- dsdssaddddddddddddddddddddddddddddddddddddddd -->
|
||||
<view class="empty">
|
||||
<!-- <u-empty></u-empty> -->
|
||||
<view>
|
||||
当前没有可以签约的的车辆,快去签约新车吧!
|
||||
</view>
|
||||
<u-button type="primary" class="btn"> 签约新车</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -103,6 +115,10 @@
|
||||
|
||||
<script>
|
||||
import mybtn from "@/components/mybtn/mybtn.vue"
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi";
|
||||
// Toast("请至少选择一辆车")
|
||||
export default {
|
||||
components: {
|
||||
mybtn
|
||||
@ -110,6 +126,7 @@
|
||||
name: "vehicle",
|
||||
data() {
|
||||
return {
|
||||
dataList: [],
|
||||
tabLists: [{
|
||||
name: '未出租',
|
||||
}, {
|
||||
@ -124,8 +141,11 @@
|
||||
},
|
||||
methods: {
|
||||
signFn() {
|
||||
console.log("签约咯")
|
||||
this.toDetail("/subpkg/property/chosseCompany")
|
||||
console.log(this.checked)
|
||||
if (!this.checked.length) Toast("请至少选择一辆车")
|
||||
else {
|
||||
this.toDetail("/subpkg/property/chosseCompany")
|
||||
}
|
||||
},
|
||||
|
||||
toDetail(url) {
|
||||
@ -151,6 +171,20 @@
|
||||
padding: 28rpx 0;
|
||||
margin-bottom: 130rpx;
|
||||
|
||||
.empty {
|
||||
padding-top: 100rpx;
|
||||
text-align: center;
|
||||
|
||||
.btn {
|
||||
width: 30vw;
|
||||
margin-top: 10rpx;
|
||||
|
||||
}
|
||||
|
||||
// height: 80vh;
|
||||
// background-color: red;
|
||||
}
|
||||
|
||||
.cards {
|
||||
margin: 0 auto;
|
||||
margin-bottom: 28rpx;
|
||||
|
@ -15,10 +15,10 @@
|
||||
<view class="map_address">
|
||||
<view class="li">
|
||||
<view style="display: flex;justify-content: left;">
|
||||
<view style="flex-shrink: 0;margin-right: 14rpx;">
|
||||
<text class="cir" style="background-color: #40BC5E;"></text>
|
||||
中转站:
|
||||
</view>
|
||||
<view style="flex-shrink: 0;margin-right: 14rpx;">
|
||||
<text class="cir" style="background-color: #40BC5E;"></text>
|
||||
中转站:
|
||||
</view>
|
||||
<view v-if="address.terminus">{{address.terminus.address}}</view>
|
||||
</view>
|
||||
<view :class="{lg_status1:address.terminus.status==2,lg_status2:address.terminus.status==1}">
|
||||
@ -28,13 +28,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="li">
|
||||
<view style="display: flex;justify-content: left;">
|
||||
<view style="flex-shrink: 0;margin-right: 14rpx;">
|
||||
<text class="cir" style="background-color: #40BC5E;"></text>
|
||||
终 点:
|
||||
</view>
|
||||
<view v-if="address.transfer">{{address.transfer.address}}</view>
|
||||
</view>
|
||||
<view style="display: flex;justify-content: left;">
|
||||
<view style="flex-shrink: 0;margin-right: 14rpx;">
|
||||
<text class="cir" style="background-color: #40BC5E;"></text>
|
||||
终 点:
|
||||
</view>
|
||||
<view v-if="address.transfer">{{address.transfer.address}}</view>
|
||||
</view>
|
||||
<view :class="{lg_status1:address.transfer.status==2,lg_status2:address.transfer.status==1}">
|
||||
<text class="cir" style="background-color: transparent;"></text>
|
||||
<text class="status">车辆状态:</text><text v-if="address.transfer.status==2">已完成</text>
|
||||
@ -44,9 +44,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<mybtn v-if="status==1" @click="getFn" text="抵达地点(中转站) 1/2"></mybtn>
|
||||
<mybtn v-if="status==1" @click="getFn" text="抵达地点(中转站) 1/2"></mybtn>
|
||||
<mybtn v-else-if="status==2" @click="getFn" text="抵达地点(终点) 2/2"></mybtn>
|
||||
<mybtn v-else-if="status==3" text="任务已完成" my_btn_disabled></mybtn>
|
||||
|
||||
@ -55,11 +55,13 @@
|
||||
|
||||
<script>
|
||||
import mybtn from "@/components/mybtn/mybtn.vue"
|
||||
import {
|
||||
taskTricycleDetail,
|
||||
taskAddTricycleCoordinate
|
||||
} from "@/api/task.js"
|
||||
import { Toast } from "../../libs/uniApi";
|
||||
import {
|
||||
taskTricycleDetail,
|
||||
taskAddTricycleCoordinate
|
||||
} from "@/api/task.js"
|
||||
import {
|
||||
Toast
|
||||
} from "../../libs/uniApi";
|
||||
export default {
|
||||
components: {
|
||||
mybtn
|
||||
@ -90,42 +92,44 @@ import { Toast } from "../../libs/uniApi";
|
||||
}
|
||||
],
|
||||
polyline: [],
|
||||
task_id: -1,
|
||||
address: {
|
||||
terminus:{
|
||||
status: 1
|
||||
},
|
||||
transfer:{
|
||||
status: 1
|
||||
}
|
||||
}
|
||||
task_id: -1,
|
||||
address: {
|
||||
terminus: {
|
||||
status: 1
|
||||
},
|
||||
transfer: {
|
||||
status: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options){
|
||||
this.task_id = options.task_id;
|
||||
this.initPosition();
|
||||
this.locationFn();
|
||||
},
|
||||
onLoad(options) {
|
||||
this.task_id = options.task_id;
|
||||
this.initPosition();
|
||||
this.locationFn();
|
||||
},
|
||||
methods: {
|
||||
// 获取位置
|
||||
async initPosition(){
|
||||
let res = await taskTricycleDetail({id: this.task_id});
|
||||
this.address = res.data.extend;
|
||||
if(res.data.extend?.update?.terminus?.lnglat[0]){ //已抵达中转站,更新目标点为终点
|
||||
this.markers[0].latitude = +res.data.extend.transfer.lnglat[1];
|
||||
this.markers[0].longitude = +res.data.extend.transfer.lnglat[0];
|
||||
this.status = 2;
|
||||
this.address.terminus['status'] = 2;
|
||||
}else { // 未抵达中转站,设置中转站为目标点
|
||||
this.markers[0].latitude = +res.data.extend.terminus.lnglat[1];
|
||||
this.markers[0].longitude = +res.data.extend.terminus.lnglat[0];
|
||||
this.address.terminus['status'] = 1;
|
||||
}
|
||||
if(res.data.extend?.update?.transfer?.lnglat[0]){
|
||||
this.address.transfer['status'] = 2;
|
||||
this.status = 3;
|
||||
}else this.address.transfer['status'] = 1;
|
||||
},
|
||||
async initPosition() {
|
||||
let res = await taskTricycleDetail({
|
||||
id: this.task_id
|
||||
});
|
||||
this.address = res.data.extend;
|
||||
if (res.data.extend?.update?.terminus?.lnglat[0]) { //已抵达中转站,更新目标点为终点
|
||||
this.markers[0].latitude = +res.data.extend.transfer.lnglat[1];
|
||||
this.markers[0].longitude = +res.data.extend.transfer.lnglat[0];
|
||||
this.status = 2;
|
||||
this.address.terminus['status'] = 2;
|
||||
} else { // 未抵达中转站,设置中转站为目标点
|
||||
this.markers[0].latitude = +res.data.extend.terminus.lnglat[1];
|
||||
this.markers[0].longitude = +res.data.extend.terminus.lnglat[0];
|
||||
this.address.terminus['status'] = 1;
|
||||
}
|
||||
if (res.data.extend?.update?.transfer?.lnglat[0]) {
|
||||
this.address.transfer['status'] = 2;
|
||||
this.status = 3;
|
||||
} else this.address.transfer['status'] = 1;
|
||||
},
|
||||
// 位置
|
||||
locationFn() {
|
||||
let that = this
|
||||
@ -219,45 +223,45 @@ import { Toast } from "../../libs/uniApi";
|
||||
const distance = 6378137 * c;
|
||||
return distance;
|
||||
},
|
||||
// 上报位置
|
||||
// 上报位置
|
||||
getFn() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
this.locationFn()
|
||||
// console.log(this.getDistance(this.markers[0], this.markers[1]))
|
||||
if ((this.getDistance(this.markers[0], this.markers[1]) >> 0) > 10000) {
|
||||
return Toast('距离目标位置过远');
|
||||
}else {
|
||||
let data;
|
||||
if(this.status==1)data = {
|
||||
id: this.task_id,
|
||||
terminus: {
|
||||
lnglat: [
|
||||
this.markers[1].longitude,
|
||||
this.markers[1].latitude
|
||||
]
|
||||
}
|
||||
};
|
||||
else data = {
|
||||
id: this.task_id,
|
||||
transfer: {
|
||||
lnglat: [
|
||||
this.markers[1].longitude,
|
||||
this.markers[1].latitude
|
||||
]
|
||||
}
|
||||
};
|
||||
taskAddTricycleCoordinate(data).then(()=>{
|
||||
uni.hideLoading()
|
||||
Toast('上传成功!')
|
||||
if(this.status==1){
|
||||
this.initPosition();
|
||||
this.locationFn();
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
let data;
|
||||
if (this.status == 1) data = {
|
||||
id: this.task_id,
|
||||
terminus: {
|
||||
lnglat: [
|
||||
this.markers[1].longitude,
|
||||
this.markers[1].latitude
|
||||
]
|
||||
}
|
||||
};
|
||||
else data = {
|
||||
id: this.task_id,
|
||||
transfer: {
|
||||
lnglat: [
|
||||
this.markers[1].longitude,
|
||||
this.markers[1].latitude
|
||||
]
|
||||
}
|
||||
};
|
||||
taskAddTricycleCoordinate(data).then(() => {
|
||||
uni.hideLoading()
|
||||
Toast('上传成功!')
|
||||
if (this.status == 1) {
|
||||
this.initPosition();
|
||||
this.locationFn();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getDriverLine() {
|
||||
const that = this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user