This commit is contained in:
THK3121 2023-08-23 11:35:09 +08:00
parent 5399625d7d
commit 1bb374e0fb
7 changed files with 265 additions and 141 deletions

View File

@ -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: "取件码不能为空",

View File

@ -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">订单编号:&nbsp;&nbsp;{{goodsDetil.logistics.order_sn}}
@ -87,7 +85,6 @@
</view>
</view>
<!-- 已送达 -->
<view class="left" v-if="goodsDetil.logistics.status==2">
<view class="list">

View File

@ -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 {}
return {
showPop: false,
keywords: "",
orderlist: [],
is_captain: "",
take_code: "",
order_id: "",
}
}
},
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
// })
// }
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()
})
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()
},
}
</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>

View File

@ -247,7 +247,7 @@ export const oaHomeData = [{
{
text: '驿站',
icon: '../../static/img/home/GRCW.png',
url: '/subpkg/finance/finance',
url: '/pages/logistics/post',
// captain: true
},
// {

View File

@ -22,10 +22,18 @@
</view>
</view>
<view class="">
<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>
<text>{item.master_phone}</text>

View File

@ -5,15 +5,15 @@
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 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">
@ -25,8 +25,8 @@
<text>行驶总里程: </text>
<text>{ item.phone }</text>
<view style="float: right;">
<u-checkbox-group>
<u-checkbox active-color="#0122C7" v-model="checked" shape="square"
<u-checkbox-group v-model="checked">
<u-checkbox active-color="#0122C7" :label="item" :name="item" shape="square"
label=""></u-checkbox>
</u-checkbox-group>
@ -43,6 +43,18 @@
</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>
<view v-else>
@ -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("签约咯")
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;

View File

@ -59,7 +59,9 @@
taskTricycleDetail,
taskAddTricycleCoordinate
} from "@/api/task.js"
import { Toast } from "../../libs/uniApi";
import {
Toast
} from "../../libs/uniApi";
export default {
components: {
mybtn
@ -92,39 +94,41 @@ import { Toast } from "../../libs/uniApi";
polyline: [],
task_id: -1,
address: {
terminus:{
terminus: {
status: 1
},
transfer:{
transfer: {
status: 1
}
}
}
},
onLoad(options){
onLoad(options) {
this.task_id = options.task_id;
this.initPosition();
this.locationFn();
},
methods: {
//
async initPosition(){
let res = await taskTricycleDetail({id: this.task_id});
async initPosition() {
let res = await taskTricycleDetail({
id: this.task_id
});
this.address = res.data.extend;
if(res.data.extend?.update?.terminus?.lnglat[0]){ //,
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 { // ,
} 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]){
if (res.data.extend?.update?.transfer?.lnglat[0]) {
this.address.transfer['status'] = 2;
this.status = 3;
}else this.address.transfer['status'] = 1;
} else this.address.transfer['status'] = 1;
},
//
locationFn() {
@ -229,9 +233,9 @@ import { Toast } from "../../libs/uniApi";
// console.log(this.getDistance(this.markers[0], this.markers[1]))
if ((this.getDistance(this.markers[0], this.markers[1]) >> 0) > 10000) {
return Toast('距离目标位置过远');
}else {
} else {
let data;
if(this.status==1)data = {
if (this.status == 1) data = {
id: this.task_id,
terminus: {
lnglat: [
@ -249,10 +253,10 @@ import { Toast } from "../../libs/uniApi";
]
}
};
taskAddTricycleCoordinate(data).then(()=>{
taskAddTricycleCoordinate(data).then(() => {
uni.hideLoading()
Toast('上传成功!')
if(this.status==1){
if (this.status == 1) {
this.initPosition();
this.locationFn();
}