This commit is contained in:
weipengfei 2023-08-30 11:39:41 +08:00
commit 16805da789
6 changed files with 268 additions and 225 deletions

70
App.vue
View File

@ -1,51 +1,55 @@
<script> <script>
//#ifdef APP-PLUS //#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush"); const jpushModule = uni.requireNativePlugin("JG-JPush");
import Updater from '@/uni_modules/guyue-updater/index'; import Updater from '@/uni_modules/guyue-updater/index';
// #endif // #endif
export default { export default {
onLaunch: async function() { onLaunch: async function() {
// let noticeArr = []
// jpushModule.addNotificationListener(res => {
// if (!noticeArr.includes(res.messageID)) {
// const audioContext = uni.createInnerAudioContext()
// //
// audioContext.src = `/static/audio/order.mp3`;
// // console.log(res.messageID)
// audioContext.play()
// noticeArr.push(res.messageID)
// console.log("app")
// }
// })
console.log('App Launch') console.log('App Launch')
this.$store.dispatch('initConfig'); this.$store.dispatch('initConfig');
try { try {
if (!this.$store.state.app.token) uni.reLaunch({ if (!this.$store.state.app.token) uni.reLaunch({
url: '/pages/oaLogin/oaLogin' url: '/pages/oaLogin/oaLogin'
}) })
} catch (e) { } catch (e) {
uni.reLaunch({ uni.reLaunch({
url: '/pages/oaLogin/oaLogin' url: '/pages/oaLogin/oaLogin'
}) })
} }
}, },
onShow: function() { onShow: function() {
const audioContext = uni.createInnerAudioContext() const audioContext = uni.createInnerAudioContext()
// //
audioContext.src = './static/mp3/order.mp3' audioContext.src = '/static/mp3/order.mp3'
let noticeArr = []
// //
//#ifdef APP-PLUS //#ifdef APP-PLUS
jpushModule.addNotificationListener(res => { jpushModule.addNotificationListener(res => {
if (!noticeArr.includes(res.messageID)) { if (res.notificationEventType == 'notificationOpened') return
console.log(res.messageID) audioContext.play()
audioContext.play() uni.vibrateLong();
noticeArr.push(res.messageID) console.log("app的监听")
console.log("app的")
uni.vibrateLong({
success: function() {
console.log('success');
}
});
}
}) })
// //
// Updater.update({ // Updater.update({
// title: '', // title: '',
// content: '1. UI\n2. UI\n3. UI\n4. UI\n', // content: '1. UI\n2. UI\n3. UI\n4. UI\n',
// versionName: '1.3.6', // versionName: '1.3.6',
// downUrl: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/__UNI__B5B1EDD__20230816174515.apk', // downUrl: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/__UNI__B5B1EDD__20230816174515.apk',
// force: false, // // force: false, //
// quiet: false // // quiet: false //
// }) // })
// #endif // #endif
console.log('App Show') console.log('App Show')
}, },

View File

@ -1,19 +1,24 @@
import oahttp from "@/utils/logistics.js"; import oahttp from "@/utils/oahttp.js";;
/** /**
* 车辆列表 * 车辆列表
*/ */
export const getvehicleList = (data) => oahttp.get('/courierLstData', data) // https://worker-task.lihaink.cn/api/vehicle/addCar
export const getvehicleListApi = (data) => oahttp.get('/vehicle/vehicleIndex', data)
// 车辆详情 // 车辆详情
export const getvehicleDetail = (data) => oahttp.get('/courierLstData', data) export const getvehicleDetailApi = (data) => oahttp.get('/courierLstData', data)
// 车辆上传
export const upVehicleApi = (data) => oahttp.post('/vehicle/addCar', data)
// 申请用车
export const applycarApi = (data) => oahttp.post('/vehicle/addCar', data)
// 显示轨迹 // 显示轨迹
export const locusApi = (data) => oahttp.get('/courierLstData', data) export const locusApi = (data) => oahttp.get('/courierLstData', data)
// 签约列表 // 签约列表
export const getAgencyList = (data) => oahttp.get('/courierLstData', data) export const getAgencyListApi = (data) => oahttp.get('/courierLstData', data)
// 签约公司详情 // 签约公司详情
export const getAgencyDetail = (data) => oahttp.get('/courierLstData', data) export const getAgencyDetailApi = (data) => oahttp.get('/courierLstData', data)
// 车辆租赁 // 车辆租赁
export const leaseApi = (data) => oahttp.get('/courierLstData', data) export const leaseApi = (data) => oahttp.post('/vehicle/setContractByTownCompany', data)
// 生成合同 // 生成合同
export const contractApi = (data) => oahttp.get('/courierLstData', data) export const contractApi = (data) => oahttp.get('/courierLstData', data)
// 申请驳回 // 申请驳回

View File

@ -6,8 +6,25 @@
class="home_header" class="home_header"
:class="!ApproveList.length > 0 ? 'home_header_no_data' : ''" :class="!ApproveList.length > 0 ? 'home_header_no_data' : ''"
> >
<view style="position: absolute;bottom: 0;left: 0;overflow: hidden;border-radius: 0 0 30rpx 30rpx;"> <view
<hx-lottie :options="options" ref="lottie" style="width: 100vw;height: 440rpx;transform: scale(1.2);background-color: #0122c7;"/> style="
position: absolute;
bottom: 0;
left: 0;
overflow: hidden;
border-radius: 0 0 30rpx 30rpx;
"
>
<hx-lottie
:options="options"
ref="lottie"
style="
width: 100vw;
height: 440rpx;
transform: scale(1.2);
background-color: #0122c7;
"
/>
</view> </view>
<!-- #ifdef APP-PLUS||H5 --> <!-- #ifdef APP-PLUS||H5 -->
<view style="height: var(--status-bar-height)"></view> <view style="height: var(--status-bar-height)"></view>
@ -123,6 +140,7 @@
<!-- <block v-if="myTaskList.length>0"> <!-- <block v-if="myTaskList.length>0">
<taskCard></taskCard> <taskCard></taskCard>
</block> --> </block> -->
<!-- <button @click="test">按钮</button> -->
<view v-if="orderList.length > 0"> <view v-if="orderList.length > 0">
<globalPopup ref="globalPopup"></globalPopup> <globalPopup ref="globalPopup"></globalPopup>
<logistiBriefCard <logistiBriefCard
@ -277,24 +295,24 @@ export default {
// this.initOaHomeDada(); // this.initOaHomeDada();
this.getOrderList(); this.getOrderList();
// console.log(this.oaHomeData, this.oaHomeData.length==0); // console.log(this.oaHomeData, this.oaHomeData.length==0);
if(this.oaHomeData.length==0){ if (this.oaHomeData.length == 0) {
this.$nextTick(()=>{ this.$nextTick(() => {
this.$store.dispatch('initConfig'); this.$store.dispatch('initConfig');
}) })
} }
}, },
computed: { computed: {
oaHomeData(){ oaHomeData () {
const route = getCurrentPages()[0]?.route; const route = getCurrentPages()[0]?.route;
let arr = []; let arr = [];
this.$store.state.config?.config?.menu?.forEach((item)=>{ this.$store.state.config?.config?.menu?.forEach((item) => {
if(item.paths.includes(route)){ if (item.paths.includes(route)) {
arr=item.children; arr = item.children;
} }
}) })
if(arr.length>=8){ if (arr.length >= 8) {
arr = arr.slice(0, 7); arr = arr.slice(0, 7);
let obj = this.$store.state.config?.config?.menu?.find(item=>item.paths.includes('/pages/moreFun/moreFun')); let obj = this.$store.state.config?.config?.menu?.find(item => item.paths.includes('/pages/moreFun/moreFun'));
arr.push(obj); arr.push(obj);
} }
return arr; return arr;
@ -384,29 +402,29 @@ export default {
}); });
}, },
navTo (url) { navTo (url) {
if(url){ if (url) {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}); });
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success() { success () {
uni.hideLoading() uni.hideLoading()
}, },
fail () { fail () {
uni.switchTab({ uni.switchTab({
url: url, url: url,
success() { success () {
uni.hideLoading() uni.hideLoading()
}, },
fail() { fail () {
uni.hideLoading() uni.hideLoading()
} }
}); });
}, },
}) })
}else Toast('暂未开放') } else Toast('暂未开放')
}, },
navTwo (url, key) { navTwo (url, key) {
// let role_id = this.$store.state.app?.userInfo?.admin?.role_id || null; // let role_id = this.$store.state.app?.userInfo?.admin?.role_id || null;
@ -514,6 +532,7 @@ export default {
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
} }
.head_text { .head_text {
font-size: 33rpx; font-size: 33rpx;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -63,7 +63,7 @@
<view class="btns"> <view class="btns">
<u-button type="primary" @click="showPop=true" style="margin-bottom: 20rpx;width: 100%;" color="#FF7C32" <u-button type="primary" @click="showPop=true" style="margin-bottom: 20rpx;width: 100%;" color="#FF7C32"
text="申请驳回"></u-button> text="申请驳回"></u-button>
<u-button type="primary" text="生成合同" color="#0122C7"></u-button> <u-button type="primary" text="生成合同" @tap="contractFn" color="#0122C7"></u-button>
</view> </view>
<view class=""> <view class="">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true" <u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
@ -86,19 +86,36 @@
contractApi, contractApi,
overruleApi overruleApi
} from "@/api/property.js" } from "@/api/property.js"
import {
Toast
} from "../../libs/uniApi"
export default { export default {
data() { data() {
return { return {
dataList: [],
overruleValue: "", overruleValue: "",
showPop: false, showPop: false,
checked: [], checked: [],
carList: [1, 2] carList: [1, 2]
} }
}, },
onLaunch() {
getAgencyDetail().then(res => {
this.dataList = res
})
},
methods: { methods: {
confirm() { confirm() {
console.log(this.overruleValue) // console.log(this.overruleValue)
this.showPop = false overruleApi().then(res => {
Toast("操作成功")
this.showPop = false
})
},
contractFn() {
contractApi().then(res => {
Toast("操作成功")
})
}, },
navTo(url) { navTo(url) {
uni.navigateTo({ uni.navigateTo({
@ -113,11 +130,9 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.date { .date {
padding: 10rpx 28rpx 0; padding: 10rpx 28rpx 0;
} }
.cards { .cards {
margin: 28rpx; margin: 28rpx;
width: 694rpx; width: 694rpx;
background: #ffffff; background: #ffffff;

View File

@ -1,180 +1,156 @@
<template> <template>
<view> <view class="">
<!-- <view class="serch"> <!-- 没有测含量 -->
<u-search placeholder="输入车牌号进行搜索" :show-action="true" bg-color="white" v-model="keywords" @search="serchFn" <view class="noCar" v-if='dataList.length==0'>
@custom="serchFn"></u-search> <!-- 申请 -->
</view> --> <view class="" v-if="step==1">
<view class="info">
<text>可监管车辆数量 10</text>
<view @click="showPop=true" class="not_leased">
<view class=""> <view class="">
租赁 10 你还没有所属车辆哦,请向镇公司申请用车或使用自有车辆并绑定系统
</view> </view>
<view class="triangle-up" v-if="1"> <view class="" style="margin: 20rpx 0;">
<u-button @tap="applycarFn" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
申请用车</u-button>
</view> </view>
<view class="message_bottom" v-if="1"> <view class="">
可再租赁车辆:2 <u-button @tap="show=true" type="primary" style="background-color: #0122C7;border: none;"
class="btn">
上传自有车辆</u-button>
</view>
<u-modal :show="show" @close="show=false" @confirm="upCarFn" :closeOnClickOverlay="true" title="车辆上传">
<view class="slot-content">
<u--input placeholder="请输入您的车牌号" v-model="carLicense"></u--input>
</view>
</u-modal>
</view>
<!-- 等待 -->
<view class="" v-if='step==2'>
<view class="">
您已上传自用车辆,系统正在审核中,请耐心等待
</view> </view>
</view> </view>
<text>自有车辆 10</text>
</view> </view>
<!-- 公告栏 --> <view v-else>
<view class="application_tit"> <!-- <view class="serch">
<view class="head" @click="navgo('/subpkg/property/agencyList')"> <u-search placeholder="输入车牌号进行搜索" :show-action="true" bg-color="white" v-model="keywords" @search="serchFn"
<text>签约申请</text> @custom="serchFn"></u-search>
<view style="display: flex;"> </view> -->
<text>更多 </text> <view class="info">
<u-icon name="arrow-right"></u-icon> <text>可监管车辆数量 10</text>
<view @click="showPop=true" class="not_leased">
<view class="">
租赁 10
</view>
<view class="triangle-up" v-if="1">
</view>
<view class="message_bottom" v-if="1">
可再租赁车辆:2
</view>
</view> </view>
<text>自有车辆 10</text>
</view> </view>
<view class="content"> <!-- 公告栏 -->
<view class="li" @click="navgo('/subpkg/property/chosseCompany')" <view class="application_tit">
v-for="item,index in applicationList.slice(0, 2)"> <view class="head" @click="navgo('/subpkg/property/agencyList')">
<view class="date"> <text>签约申请</text>
<!-- {{item.}} --> <view style="display: flex;">
</view> <text>更多 </text>
<view class="text">
<!-- {{item.}} -->
</view>
<view class="detail">
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> </view>
<view class="content">
</view> <view class="li" @click="navgo('/subpkg/property/chosseCompany')"
</view> v-for="item,index in applicationList.slice(0, 2)">
<view class="date">
<view v-if="true" class="personnel_list"> <!-- {{item.}} -->
<view v-if="dataList.length"> </view>
<view class="cards" v-for="item,index in dataList" :key="index" <view class="text">
@click="navgo('/subpkg/property/vehicle_a')"> <!-- {{item.}} -->
<view class="cards_head"> </view>
<text><!-- {{item.}} --></text> <view class="detail">
<u-icon name="arrow-right"></u-icon>
</view>
</view> </view>
<view class="cards_content">
<view class="right"> </view>
<!-- 已出租 --> </view>
<view v-if="1">
<view class="li"> <view v-if="true" class="personnel_list">
<text>使用人: </text> <view v-if="dataList.length">
<text> <!-- {{item.}} --></text> <view class="cards" v-for="item,index in dataList" :key="index"
<view style="float: right;"> @click="navgo('/subpkg/property/vehicle_a')">
<text style="color: green;" v-if="true">自有车辆</text> <view class="cards_head">
<text style="color: orange;" v-else>租赁车辆</text> <text><!-- {{item.}} --></text>
</view>
<view class="cards_content">
<view class="right">
<!-- 已出租 -->
<view v-if="1">
<view class="li">
<text>使用人: </text>
<text> <!-- {{item.}} --></text>
<view style="float: right;">
<text style="color: green;" v-if="true">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view>
<view class="li">
<text>联系方式: </text>
<text><!-- {{item.}} --></text>
</view>
<view class="li">
<text>所属公司: </text>
<text> <!-- {{item.}} --> </text>
</view>
<view class="li">
<text>签约时间: </text>
<text> <!-- {{item.}} --> </text>
</view> </view>
</view>
<view class="li">
<text>联系方式: </text>
<text><!-- {{item.}} --></text>
</view>
<view class="li">
<text>所属公司: </text>
<text> <!-- {{item.}} --> </text>
</view>
<view class="li">
<text>签约时间: </text>
<text> <!-- {{item.}} --> </text>
</view>
</view>
<!-- 未出租 -->
<view class="" v-else>
<view class="li">
<text>车牌号: </text>
<text> <!-- {{item.}} --></text>
<view style="float: right;">
<text style="color: green;" v-if="true">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view> </view>
<view class="li"> <!-- 未出租 -->
暂未出租快去选择承租对象吧 <view class="" v-else>
<view class="li">
<text>车牌号: </text>
<text> <!-- {{item.}} --></text>
<view style="float: right;">
<text style="color: green;" v-if="true">自有车辆</text>
<text style="color: orange;" v-else>租赁车辆</text>
</view>
</view>
<view class="li">
暂未出租快去选择承租对象吧
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> <view v-if="dataList.length==0&&!isNewCheck">
<view v-if="dataList.length==0&&!isNewCheck"> <view class="empty">
<view class="empty"> <!-- <view>
<!-- <view> 当前没有可以签约的的车辆,快去签约新车吧!
当前没有可以签约的的车辆,快去签约新车吧! </view> -->
</view> --> <!-- <u-button @click="showPop=true" type="primary" style="background-color: #0122C7;border: none;"
<!-- <u-button @click="showPop=true" type="primary" style="background-color: #0122C7;border: none;" class="btn">
class="btn"> 签约新车</u-button> -->
签约新车</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_a')">
<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>
</view> </view>
<!-- <view style="padding: 0 60rpx;" v-if="isNewCheck">
你已发起租赁{{newCarNum}}两新车的申请,后台正在为您加急处理中,请稍后~~
</view> -->
</view> </view>
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true"
</view> --> :title="`请输入您需要租赁的车辆数量(上限为${dataList[0]})`">
<view class="slot-content">
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" :closeOnClickOverlay="true" <u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input>
:title="newcarTit"> </view>
<view class="slot-content"> </u-modal>
<u--input placeholder="请输入内容" type="number" v-model="newCarNum"></u--input> <!-- <u-modal @close="show=false" @cancel="show=false" @confirm="relieveFn" :show="show" :showCancelButton="true"
</view> :showConfirmButton='true' :content='content'></u-modal> -->
</u-modal>
<!-- <u-modal @close="show=false" @cancel="show=false" @confirm="relieveFn" :show="show" :showCancelButton="true"
:showConfirmButton='true' :content='content'></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> </view>
</view> </view>
@ -184,9 +160,10 @@
<script> <script>
import { import {
getvehicleList, getvehicleListApi,
getAgencyList, getAgencyListApi,
leaseApi leaseApi,
upVehicleApi
} from "@/api/property.js" } from "@/api/property.js"
// import mybtn from "@/components/mybtn/mybtn.vue" // import mybtn from "@/components/mybtn/mybtn.vue"
import { import {
@ -200,10 +177,13 @@
name: "vehicle", name: "vehicle",
data() { data() {
return { return {
step: 1,
applicationList: [1, 1], applicationList: [1, 1],
isNewCheck: true, // isNewCheck: true,
show: false,
carLicense: "",
showPop: false, showPop: false,
dataList: [1, 2, 3], dataList: [],
tabLists: [{ tabLists: [{
name: '未出租', name: '未出租',
}, { }, {
@ -218,10 +198,11 @@
}; };
}, },
onLoad() { onLoad() {
getvehicleList().then(res => { getvehicleListApi().then(res => {
console.log(res)
// this.getvehicleList = res // this.getvehicleList = res
}) })
getAgencyList().then(res => { getAgencyListApi().then(res => {
// this.applicationList=res // this.applicationList=res
}) })
@ -230,18 +211,32 @@
methods: { methods: {
applycarFn() {
this.step = 2
},
upCarFn() {
upVehicleApi({
license: this.carLicense
}).then(res => {
this.show = false
})
console.log(this.carLicense)
},
signFn() { signFn() {
this.toDetail("/subpkg/property/chosseCompany") this.toDetail("/subpkg/property/chosseCompany")
}, },
// serchFn() {
// console.log(this.keywords)
// },
confirm() { confirm() {
if (!this.newCarNum) return if (!this.newCarNum) return
// leaseApi().then(res=>{}) leaseApi({
num: Number(this.newCarNum)
}).then(res => {
this.newCarNum = ""
Toast(res.msg)
})
this.showPop = false this.showPop = false
this.isNewCheck = true
// this.isNewCheck = true
}, },
@ -265,6 +260,11 @@
margin: 28rpx 28rpx 0 28rpx; margin: 28rpx 28rpx 0 28rpx;
} }
.noCar {
// background-color: red;
padding: 50rpx;
}
.info { .info {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;

View File

@ -22,7 +22,7 @@
<view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')"> <view class="personnel_list" @click="toDetail('/subpkg/property/vehicle')">
<view class="cards"> <view class="cards">
<view class="cards_head"> <view class="cards_head">
<text><!-- <!-- {{datas.}} --> --></text> <text><!-- <!-- {{datas.}} --></text>
</view> </view>
<view class="cards_content"> <view class="cards_content">
<view class="right"> <view class="right">