固定资产共功能完善

This commit is contained in:
THK3121 2023-08-24 18:32:34 +08:00
parent 896de4dd12
commit f63c1416b9
3 changed files with 657 additions and 15 deletions

View File

@ -512,6 +512,15 @@
"navigationBarTextStyle": "white"
}
}, {
"path": "property/vehicle_a",
"style": {
"navigationBarTitleText": "三轮车详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
}

View File

@ -8,7 +8,6 @@
<u-search placeholder="输入车牌号进行搜索" :show-action="true" bg-color="white" v-model="keywords"></u-search>
</view>
<view v-if="curNow==0" class="personnel_list">
<view v-if="dataList.length">
<view class="cards" v-for="item,index in dataList" :key="index">
@ -42,23 +41,24 @@
</view>
</view>
</view>
<view v-else>
<!-- dsdssaddddddddddddddddddddddddddddddddddddddd -->
<view v-if="dataList.length==0&&!isNewCheck">
<view class="empty">
<!-- <u-empty></u-empty> -->
<view>
当前没有可以签约的的车辆,快去签约新车吧!
</view>
<u-button type="primary" class="btn"> 签约新车</u-button>
<u-button @click="showPop=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
签约新车</u-button>
</view>
</view>
<view style="padding: 0 60rpx;" v-if="isNewCheck">
你已发起租赁{{newCarNum}}两新车的申请,后台正在为您加急处理中,请稍后~~
</view>
</view>
<view v-else>
<view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')">
<view class="personnel_list" @click="toDetail('/subpkg/property/vehicle_a')">
<view class="cards">
<view class="cards_head">
<text>车牌号</text>
@ -103,11 +103,22 @@
</view>
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
:title="newcarTit">
<view class="slot-content">
<u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
</view>
</u-modal>
<view class="" v-if='!curNow && dataList.length>0'>
<view class="add" @click="showPop=true">
<u-icon name="plus-circle" color="#0122C7" size="60"></u-icon>
签约新车
</view>
<mybtn position="position" text="签约" @click="signFn">
<u-icon name="edit-pen-fill" color="white" size="20"></u-icon>
</mybtn>
</view>
<mybtn position="position" v-if='!curNow' text="签约" @click="signFn">
<u-icon name="edit-pen-fill" color="white" size="20"></u-icon>
</mybtn>
</view>
@ -126,7 +137,9 @@
name: "vehicle",
data() {
return {
dataList: [],
isNewCheck: false,
showPop: false,
dataList: [1, 2, 3],
tabLists: [{
name: '未出租',
}, {
@ -135,6 +148,8 @@
curNow: 0,
checked: 0,
keywords: "",
newCarNum: "",
newcarTit: "请输入你想要的车辆数量"
};
@ -147,7 +162,14 @@
this.toDetail("/subpkg/property/chosseCompany")
}
},
confirm() {
if (!this.newCarNum) return
console.log(this.newCarNum)
this.showPop = false
this.isNewCheck = true
// this.newCarNum = ""
},
toDetail(url) {
uni.navigateTo({
url
@ -167,20 +189,31 @@
margin: 28rpx 28rpx 0 28rpx;
}
.add {
position: fixed;
bottom: 100rpx;
right: 0;
}
.personnel_list {
padding: 28rpx 0;
margin-bottom: 130rpx;
.empty {
padding-top: 100rpx;
padding-top: 200rpx;
text-align: center;
.btn {
width: 30vw;
margin-top: 10rpx;
margin: 10rpx auto;
}
// height: 80vh;
// background-color: red;
}

View File

@ -0,0 +1,600 @@
<template>
<view>
<view v-if="false">
<view class="content">
<view class="map" style="position: relative;">
<map :class="mapClass" id="map" @markertap='mapFun' :enable-zoom="true" :polyline="polyline"
:markers='markers' :scale="scale" style="width:100%;height: 100%;"
:latitude="markers[0].latitude" :enable-scroll="true" :longitude="markers[0].longitude">
</map>
</view>
<view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')">
<view class="cards">
<view class="cards_head">
<text>车牌号</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>
<view class="li">
<text>承租公司: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>负责人: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>联系方式: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>所属区域: </text>
<text> 所属片区 </text>
</view>
<view class="li">
<text>承租时间: </text>
<text> 所属片区 </text>
</view>
</view>
</view>
<view class="fooot">
<!-- <mybtn></mybtn> -->
<u-button text="续约" color="#0122C7"></u-button>
</view>
</view>
</view>
</view>
</view>
<view class="" v-else>
<view class="" v-if="!isMycar">
<view class="empty_car">
<view>
您还没有所属车辆哦,请等待镇公司发放车辆或使用自有车辆并绑定系统
</view>
<u-button @click="showPop=true" type="primary" class="btn_cls">
上传自有车辆</u-button>
</view>
<view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
title="请输入车牌号">
<view class="slot-content">
<u--input placeholder="请输入内容" v-model="myCarnum"></u--input>
</view>
</u-modal>
</view>
</view>
<view style="text-align: center;margin-top: 100rpx;" v-if="isMycar">
您上传自有车两,系统正在审核中,请耐心等待
</view>
</view>
</view>
</template>
<script>
import mybtn from "@/components/mybtn/mybtn.vue"
import {
taskTricycleDetail,
taskAddTricycleCoordinate
} from "@/api/task.js"
import {
Toast
} from "../../libs/uniApi";
export default {
components: {
mybtn
},
data() {
return {
isMycar: false,
myCarnum: "",
modelShow: false,
status: 1,
mapClass: 'custom-map',
showLoading: true,
showPop: false,
goodsDetil: undefined,
scale: 17,
nowAddress: "无",
markers: [
//
{
id: 1,
latitude: 28.8733,
longitude: 105.445717,
iconPath: '../../static/img/logistics/WZ.png', //
},
//
{
id: 2,
latitude: undefined,
longitude: undefined,
iconPath: '../../static/img/logistics/QS.png', //
}
],
polyline: [],
task_id: -1,
address: {
terminus: {
status: 1
},
transfer: {
status: 1
}
}
}
},
onLoad(options) {
this.task_id = options.task_id;
this.initPosition();
this.locationFn();
},
methods: {
confirm() {
if (this.myCarnum) {
console.log(this.myCarnum)
this.showPop = false
this.isMycar = true
}
},
//
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] || res.data.status == 3) {
this.address.transfer['status'] = 2;
this.status = 3;
} else this.address.transfer['status'] = 1;
if (res.data.status == 5) {
this.status = 5;
}
},
//
locationFn() {
let that = this
//#ifdef APP
uni.getLocation({
type: 'gcj02',
geocode: true,
isHighAccuracy: true,
success: function async (res) {
that.markers[1].latitude = res.latitude
that.markers[1].longitude = res.longitude
that.getDriverLine()
}
});
//#endif
},
//
test() {
if (this.is_captain) return
var packageName = 'com.autonavi.minimap';
var main = plus.android.runtimeMainActivity();
var packageManager = main.getPackageManager();
var PackageManager = plus.android.importClass(packageManager)
var packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
if (packageInfo) {
var Uri = plus.android.importClass("android.net.Uri");
var url =
`amapuri://route/plan?sourceApplication=maxuslife+
&sid=A&slat=36.702558&slon=116.876678&sname=我的位置&did=B&dlat=${this.markers[0].latitude}&dlon=${this.markers[0].longitude}&dname=${this.goodsDetil.logistics.shop_name}&dev=0&t=0`;
var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
var uri = Uri.parse(url);
//SchemeURIdata
intent.setData(uri);
intent.setPackage("com.autonavi.minimap");
var main = plus.android.runtimeMainActivity();
main.startActivity(intent);
} else {
// alert('' + packageName + '')
uni.showToast({
title: `只支持高德地图`,
icon: 'none'
})
}
console.log("唤醒高德线路规划")
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
mapFun() {
uni.openLocation({
latitude: Number(this.goodsDetil.logistics.shop_lat),
longitude: Number(this.goodsDetil.logistics.shop_long),
address: this.goodsDetil.logistics.shop_address,
name: this.goodsDetil.logistics.shop_name,
scale: 15,
});
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
},
//
getDistance(point1, point2) {
const rad = Math.PI / 180.0;
const lat1 = point1.latitude;
const lng1 = point1.longitude;
const lat2 = point2.latitude;
const lng2 = point2.longitude;
const dlat = lat2 - lat1;
const dlng = lng2 - lng1;
const a =
Math.sin(dlat / 2 * rad) * Math.sin(dlat / 2 * rad) +
Math.cos(lat1 * rad) * Math.cos(lat2 * rad) *
Math.sin(dlng / 2 * rad) * Math.sin(dlng / 2 * rad);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = 6378137 * c;
return distance;
},
//
getFn() {
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('上传成功!')
this.initPosition();
this.locationFn();
})
}
},
getDriverLine() {
const that = this;
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
const origin = `${this.markers[1].longitude},${this.markers[1].latitude}`;
const destination = `${this.markers[0].longitude},${this.markers[0].latitude}`;
uni.request({
// url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=${origin}&destination=${destination}`,
success: (res) => {
const data = res.data.data;
var points = [];
if (data.paths && data.paths[0] && data.paths[0].steps) {
var steps = data.paths[0].steps;
for (var i = 0; i < steps.length; i++) {
//points
var poLen = steps[i].polyline.split(";");
for (var j = 0; j < poLen.length; j++) {
points.push({
longitude: parseFloat(poLen[j].split(",")[0]),
latitude: parseFloat(poLen[j].split(",")[1]),
});
}
}
that.runningRoute = data.paths[0].steps[0].instruction;
}
that.polyline = [{
points: points,
color: "#0091ff",
dottedLine: true,
width: 30,
}, ];
},
fail: function(res) {
console.log("获取路线失败", res);
},
});
},
},
onPullDownRefresh() {
// this.getOrderList();
// this.getIndexList()
uni.stopPullDownRefresh();
},
}
</script>
<style lang='scss' scoped>
.serch {
margin: 28rpx 28rpx 0 28rpx;
}
.add {
position: fixed;
bottom: 100rpx;
right: 0;
}
.empty_car {
padding: 200rpx 50rpx;
/* text-align: center; */
.btn_cls {
background-color: #0122C7;
border: none;
width: 40vw;
margin: 20rpx auto;
}
}
.personnel_list {
padding: 28rpx 0;
margin-bottom: 130rpx;
.empty {
padding-top: 200rpx;
text-align: center;
.btn {
width: 30vw;
margin-top: 10rpx;
margin: 10rpx auto;
}
// height: 80vh;
// background-color: red;
}
.cards {
margin: 0 auto;
margin-bottom: 28rpx;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
opacity: 1;
overflow: hidden;
// box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.cards_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
}
.cards_content {
padding: 10rpx 28rpx;
display: flex;
justify-content: space-between;
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;
.cir {
width: 120rpx;
height: 120rpx;
background-color: #ffffff;
margin-left: 25rpx;
border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
.li {
margin: 10rpx 0;
width: 85vw;
.check_box {
// background-color: #ff0000;
// color: red;
}
// background-color: red;
text:nth-child(1) {
margin-right: 20rpx;
}
}
}
}
}
}
.cover {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(#000, 0.3);
.cover_model {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 650rpx;
/* height: 300rpx; */
background-color: #fff;
border-radius: 6px;
display: flex;
flex-direction: column;
justify-content: space-between;
.model_title {
height: 92rpx;
line-height: 92rpx;
text-align: center;
font-size: 16px;
font-weight: bold;
}
.model_content {
margin: 12px 25px 25px 25px;
font-size: 15px;
}
.model_btn {
display: flex;
height: 96rpx;
font-size: 16px;
.item {
flex: 1;
text-align: center;
line-height: 96rpx;
}
.model_confirm {
color: #0122c7;
}
}
}
}
.red {
color: #ff0000;
}
.green {
color: #40bc5e;
}
.yellow {
color: #ff7c32;
}
.custom-map /deep/ .polyline {
stroke-width: 20px;
}
.content {
padding: 2vh 3vw;
background-color: #F5F5F5;
height: 100vh;
box-sizing: border-box;
}
.map {
height: 40vh;
border-radius: 2vw;
overflow: hidden;
}
.map_address {
background-color: white;
padding: 20rpx 10rpx;
border-radius: 0 0 14rpx 14rpx;
.li {
margin: 20rpx 0;
line-height: 40rpx;
}
.cir {
display: inline-block;
width: 2vw;
height: 2vw;
border-radius: 2vw;
margin: 0 20rpx;
}
}
.map_btn {
width: 50px;
height: 50px;
position: absolute;
bottom: 0px;
right: 0;
z-index: 9999999;
}
.btn {
position: fixed;
bottom: 20rpx;
width: 90vw;
left: 50%;
transform: translateX(-50%);
}
</style>