inti
This commit is contained in:
257
pages/car/addCar.vue
Normal file
257
pages/car/addCar.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" labelWidth="120">
|
||||
|
||||
<u-form-item label="车牌号码" prop="form.vehicleNo" borderBottom ref="item1" required>
|
||||
|
||||
<car-number-input class="car-number-input" @numberInputResult="numberInputResult"
|
||||
:defaultStr="form.vehicleNo"></car-number-input>
|
||||
|
||||
<u--input v-model="form.vehicleNo" border="none" maxlength="8" placeholder="请输入车牌号码"></u--input>
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="车辆类型" prop="form.vehicleType" borderBottom ref="item1">
|
||||
<picker @change="bindPickerChange" :value="index" :range="array">
|
||||
<view class="uni-input">{{index ? array[index] : '请选择车辆类型'}}</view>
|
||||
</picker>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="驾驶证" prop="form.car_jsz" borderBottom ref="item1" required>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||
:maxCount="1"></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="牵引车车牌号" prop="form.phone" borderBottom ref="item1">
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入牵引车车牌号"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="牵引车道运证" prop="form.phone" borderBottom ref="item1">
|
||||
<u-upload :fileList="fileList2" @afterRead="afterRead2" @delete="deletePic2" name="1" multiple
|
||||
:maxCount="1"></u-upload> </u-form-item>
|
||||
<u-form-item label="牵引车行驶证" prop="form.phone" borderBottom ref="item1">
|
||||
<u-upload :fileList="fileList3" @afterRead="afterRead3" @delete="deletePic3" name="1" multiple
|
||||
:maxCount="1"></u-upload> </u-form-item> -->
|
||||
|
||||
<!-- <u-form-item label="车辆品牌/型号" prop="form.phone" borderBottom ref="item1" >
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
|
||||
<!-- <u-form-item label="车辆颜色" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="车辆照片" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="载重能力(吨)" prop="form.phone" borderBottom ref="item1" >
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
|
||||
|
||||
<!-- <u-form-item label="容积(立方米)" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="车辆长度(米)" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="燃油类型(柴油、汽油、电动等)" prop="form.phone" borderBottom ref="item1" >
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
|
||||
|
||||
<!-- <u-form-item label="车辆识别代号(VIN)" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="发动机号" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
|
||||
<!-- <u-form-item label="道路运输证号" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="车辆状态(空闲、运输中、维修中)" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="绑定司机" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="购买日期/注册日期" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="年检到期日期" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="保险公司" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
|
||||
|
||||
<!-- <u-form-item label="保险单号" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="保险到期日期" prop="form.name" borderBottom ref="item1" >
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder=""></u--input>
|
||||
</u-form-item> -->
|
||||
|
||||
|
||||
</u--form>
|
||||
|
||||
<u-button type="primary" class="btn" text="提交信息" shape="circle" @click="add"></u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
id: "",
|
||||
vehicleNo: "",
|
||||
vehicleType: "",
|
||||
car_jsz: "",
|
||||
qy_carNo: "",
|
||||
qy_dyz: "",
|
||||
qy_xsz: ""
|
||||
},
|
||||
rules: {},
|
||||
array: ['货车', '卡车', '厢式货车'],
|
||||
index: null,
|
||||
fileList1: [],
|
||||
fileList2: [],
|
||||
fileList3: [],
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.form.vehicleNo = option.vehicleNo
|
||||
this.form.id = option.id
|
||||
},
|
||||
|
||||
methods: {
|
||||
async add() {
|
||||
|
||||
if (this.form.vehicleNo == '' || this.form.vehicleNo.trim().length != 7 && this.form.vehicleNo.trim()
|
||||
.length != 8) {
|
||||
uni.showToast({
|
||||
title: '请填写正确的车牌号',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if (this.form.id) {
|
||||
await post('/myapi/api/yq_driver/updateBindVehicle', {
|
||||
...this.form
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/car/car'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
await post('/myapi/api/yq_driver/bindVehicle', {
|
||||
...this.form
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '绑定成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/car/car'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
numberInputResult(e) {
|
||||
this.form.vehicleNo = e
|
||||
},
|
||||
bindPickerChange: function(e) {
|
||||
this.index = e.detail.value
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1);
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = this[`fileList${event.name}`].length;
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中",
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url);
|
||||
let item = this[`fileList${event.name}`][fileListLen];
|
||||
this[`fileList${event.name}`].splice(
|
||||
fileListLen,
|
||||
1,
|
||||
Object.assign(item, {
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result,
|
||||
})
|
||||
);
|
||||
fileListLen++;
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uni.uploadFile({
|
||||
url: "http://192.168.2.21:7001/upload", // 仅为示例,非真实的接口地址
|
||||
filePath: url,
|
||||
name: "file",
|
||||
formData: {
|
||||
user: "test",
|
||||
},
|
||||
success: (res) => {
|
||||
setTimeout(() => {
|
||||
resolve(res.data.data);
|
||||
}, 1000);
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
|
||||
.car-number-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tag_title {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
336
pages/car/car.vue
Normal file
336
pages/car/car.vue
Normal file
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="add_btn">
|
||||
<u-button type="primary" size="small" text="绑定车辆" @click="addCar" icon="plus-circle"></u-button>
|
||||
</view>
|
||||
|
||||
<view class="card" :style="{ backgroundColor: item.color_color }" v-for="(item,index) in list">
|
||||
<div class="vehicle-image" :style="{ backgroundColor: item.color_bg }">
|
||||
<u-icon name="car-fill" color="#ffffff" size="90"></u-icon>
|
||||
<div class="vehicle-number">{{item.vehicleNo}}</div>
|
||||
<div class="vehicle-status " :style="{ backgroundColor: item.color_bg }">{{item.color_name}}</div>
|
||||
<!-- status-available -->
|
||||
</div>
|
||||
<view class="vehicle-details">
|
||||
<view class="vehicle-title">
|
||||
<!-- <view class="vehicle-type" :style="{ backgroundColor: item.color_bg }">{{item.color_name}}</view> -->
|
||||
</view>
|
||||
<div class="vehicle-driver">
|
||||
<div class="driver-avatar">{{config.account.slice(0, 1)}}</div>
|
||||
<div class="driver-info">
|
||||
<div class="driver-name">{{config.account.slice(0, 1)}}师傅</div>
|
||||
<div class="driver-phone">{{config.phone.slice(0, 3)}}****{{config.phone.slice(7, 11)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
<view class="vehicle-actions">
|
||||
<view class="action-btn">
|
||||
<u-button type="primary" size="small" text="入园申请" @click="enParkReport(item.vehicleNo)"></u-button>
|
||||
</view>
|
||||
<view class="action-btn">
|
||||
<u-button type="success" size="small" text="编辑" @click="updateBindVehicle(item)"></u-button>
|
||||
</view>
|
||||
<view class="action-btn">
|
||||
<u-button type="error" size="small" text="解除绑定" @click="unbindVehicle(item)"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '../../common/config';
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
color: [{
|
||||
dai: {
|
||||
color: '#dadbde40',
|
||||
bg: '#dadbde'
|
||||
}
|
||||
},
|
||||
{
|
||||
lv: {
|
||||
color: '#00ff001a',
|
||||
bg: '#0f0'
|
||||
}
|
||||
},
|
||||
{
|
||||
huang: {
|
||||
color: '#ffff001a',
|
||||
bg: '#ff0'
|
||||
}
|
||||
},
|
||||
{
|
||||
huong: {
|
||||
color: '#ff00001a',
|
||||
bg: '#f00'
|
||||
}
|
||||
},
|
||||
|
||||
],
|
||||
list: [],
|
||||
color_1: '',
|
||||
config:config.driverInfo
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getCarList()
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
onPullDownRefresh() {
|
||||
setTimeout(() => {
|
||||
this.getCarList()
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
},
|
||||
addCar() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/car/addCar'
|
||||
})
|
||||
},
|
||||
async getCarList() {
|
||||
await post('/myapi/api/yq_driver/carList').then(res => {
|
||||
res.data.map((value, index) => {
|
||||
if (value.qr_color == 1) {
|
||||
value.color_name = '绿码'
|
||||
value.color_bg = '#0f0'
|
||||
value.color_color = '#00ff001a'
|
||||
} else if (value.qr_color == 2) {
|
||||
value.color_name = '黄码'
|
||||
value.color_bg = '#ff0'
|
||||
value.color_color = '#ffff001a'
|
||||
} else if (value.qr_color == 3) {
|
||||
value.color_name = '红码'
|
||||
value.color_bg = '#f00'
|
||||
value.color_color = '#ff00001a'
|
||||
}
|
||||
})
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
enParkReport(vehicleNo) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/addPark?vehicleNo=' + vehicleNo
|
||||
})
|
||||
},
|
||||
updateBindVehicle(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/car/addCar?id=' + item.id + '&vehicleNo=' + item.vehicleNo
|
||||
})
|
||||
},
|
||||
async unbindVehicle(item) {
|
||||
|
||||
const modalRes = await new Promise((resolve) => {
|
||||
uni.showModal({
|
||||
title: '解除绑定',
|
||||
content: '是否确定解除绑定?',
|
||||
success: resolve
|
||||
})
|
||||
})
|
||||
|
||||
if (!modalRes.confirm) return
|
||||
|
||||
|
||||
|
||||
const result = await post('/myapi/api/yq_driver/unbindVehicle', {
|
||||
vehicleNo: item.vehicleNo
|
||||
})
|
||||
|
||||
if (result.code == 1) {
|
||||
uni.showToast({
|
||||
title: '解绑成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/car/car'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 10px 20px;
|
||||
position: relative;
|
||||
|
||||
.add_btn {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 0px;
|
||||
// width: 300px;
|
||||
// left: 50%;
|
||||
// transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.card {
|
||||
|
||||
background: white;
|
||||
border-radius: 15px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.vehicle-image {
|
||||
height: 160px;
|
||||
background: linear-gradient(135deg, #1a6dcc, #0d4a9e);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: white;
|
||||
font-size: 40px;
|
||||
position: relative;
|
||||
|
||||
.vehicle-number {
|
||||
position: absolute;
|
||||
bottom: 15px;
|
||||
left: 15px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: white;
|
||||
padding: 5px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
// .status-available {
|
||||
// background: #2ecc71;
|
||||
// }
|
||||
|
||||
.vehicle-status {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
padding: 4px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
|
||||
.vehicle-details {
|
||||
padding: 20px;
|
||||
flex-grow: 1;
|
||||
|
||||
.vehicle-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #1a3a6d;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
.vehicle-type {
|
||||
font-size: 14px;
|
||||
color: #4d4949;
|
||||
padding: 3px 10px;
|
||||
// border-radius: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.vehicle-info {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 12px;
|
||||
margin-top: 15px;
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.info-label {
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.vehicle-driver {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
border-top: 1px dashed #c9c5c5;
|
||||
|
||||
.driver-avatar {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background: #1a6dcc;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
margin-right: 10px;
|
||||
|
||||
.driver-info {
|
||||
flex: 1;
|
||||
|
||||
.driver-name {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.driver-phone {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.vehicle-actions {
|
||||
padding: 15px 20px;
|
||||
// background: #f9fbfd;
|
||||
border-top: 1px solid #c9c5c5;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.action-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
padding: 5px 10px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
51
pages/index/details.vue
Normal file
51
pages/index/details.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<view style="text-align: center;margin: 10px 0;">
|
||||
<h3>{{info.title}}</h3>
|
||||
</view>
|
||||
|
||||
<view style="padding: 5px 20px;">
|
||||
<rich-text :nodes="info.content"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
scrollTop: 0,
|
||||
info: null,
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.id) {
|
||||
this.articleInfo(options.id)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
articleInfo(id) {
|
||||
get('/myapi/api/yq_driver/articleInfo', {
|
||||
id
|
||||
}).then(res => {
|
||||
this.info = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding-top: 2px;
|
||||
background-color: #f4f4f4;
|
||||
height: calc(100vh - 46px);
|
||||
|
||||
}
|
||||
</style>
|
||||
98
pages/index/index.vue
Normal file
98
pages/index/index.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="u-page">
|
||||
<u-subsection :list="list1" :current="curNow" @change="sectionChange"></u-subsection>
|
||||
<view class="list">
|
||||
<text>司机姓名</text>
|
||||
<text>危化物名称</text>
|
||||
<text>提交时间</text>
|
||||
<text>审核状态</text>
|
||||
</view>
|
||||
|
||||
<u-list @scrolltolower="scrolltolower">
|
||||
<u-list-item v-for="(item, index) in indexList" :key="index">
|
||||
|
||||
|
||||
<view class="list">
|
||||
<u-avatar slot="icon" shape="square" size="35" :src="item.url"
|
||||
customStyle="margin: -3px 5px -3px 0"></u-avatar>
|
||||
|
||||
<text>{{item.name}}</text>
|
||||
<text>{{item.huowu}}</text>
|
||||
<text class="time">{{item.time}}</text>
|
||||
|
||||
<u-tag text="待审核" class="tag" size="mini" type="warning" v-if="item.status == 1"></u-tag>
|
||||
<u-tag text="通过" class="tag" size="mini" type="success" v-if="item.status == 2"></u-tag>
|
||||
<u-tag text="拒绝" class="tag" size="mini" type="error" v-if="item.status == 3"></u-tag>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!--
|
||||
|
||||
登录注册
|
||||
绑定车牌 -》 车辆码 -》违章信息
|
||||
上传运单
|
||||
|
||||
-->
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
indexList: [],
|
||||
list1: ['全部', '待审核', '通过', '拒绝'],
|
||||
curNow: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadmore();
|
||||
},
|
||||
methods: {
|
||||
scrolltolower() {
|
||||
this.loadmore();
|
||||
},
|
||||
loadmore() {
|
||||
for (let i = 0; i < 30; i++) {
|
||||
this.indexList.push({
|
||||
name: '司机姓名' + (i + 1),
|
||||
status: Math.floor(Math.random() * 3) + 1,
|
||||
huowu: '危化物名称',
|
||||
time: '2025-07-11 8:00'
|
||||
});
|
||||
}
|
||||
},
|
||||
sectionChange(index) {
|
||||
this.curNow = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.list {
|
||||
border-bottom: 1px solid #6666661a;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tag {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.u-tabs__wrapper__nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
position: relative;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
127
pages/index/message.vue
Normal file
127
pages/index/message.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<u-subsection :list="top_list" :current="current" keyName="name" activeColor="#f56c6c" mode="subsection"
|
||||
@change="sectionChange"></u-subsection>
|
||||
|
||||
<view class="list">
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
|
||||
@scrolltolower="lower" @scroll="scroll">
|
||||
<view class="card" v-for="(item,index) in list" @click="toNotice(item.id)">
|
||||
<view class="title">品类库与应急预案关联书本名称 <u-icon name="arrow-right" size="12"></u-icon></view>
|
||||
<view class="name_1 flex"><u-icon name="car-fill" class="icon-right" color="#2979ff"
|
||||
size="12"></u-icon>应急类别:应急预案库</view>
|
||||
<view class="name_2 flex"><u-icon name="car-fill" class="icon-right" color="#ddbb0b"
|
||||
size="12"></u-icon>预案名称:{{item.car ? item.car.name : ''}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
top_list: [{
|
||||
name: '应急预案库'
|
||||
}, {
|
||||
name: '重大事故'
|
||||
}],
|
||||
current: 0,
|
||||
scrollTop: 0,
|
||||
list:[],
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
onPullDownRefresh() {
|
||||
setTimeout(() => {
|
||||
this.getList()
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
},
|
||||
async getList(){
|
||||
await get('/myapi/api/yq_driver/alarmList',{cate_id:this.current}).then(res => {
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
sectionChange(current) {
|
||||
this.current = current
|
||||
this.getList()
|
||||
},
|
||||
toNotice(id){
|
||||
uni.navigateTo({
|
||||
url:'/pages/index/messageDetails?id='+id
|
||||
})
|
||||
},
|
||||
upper: function(e) {
|
||||
console.log(e)
|
||||
},
|
||||
lower: function(e) {
|
||||
console.log(e)
|
||||
},
|
||||
scroll: function(e) {
|
||||
console.log(e)
|
||||
this.old.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding-top: 2px;
|
||||
background-color: #f4f4f4;
|
||||
height: calc(100vh - 46px);
|
||||
|
||||
.list {
|
||||
padding: 5px 20px;
|
||||
|
||||
.scroll-Y {
|
||||
height: calc(100vh - 86px);
|
||||
|
||||
.card {
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
|
||||
.icon-right {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.name_1 {
|
||||
margin: 10px 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
54
pages/index/messageDetails.vue
Normal file
54
pages/index/messageDetails.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<view style="text-align: center;margin: 10px 0;">
|
||||
<h2>{{info.name}}</h2>
|
||||
<h4>{{info.label_name}}--{{info.sds_name}}</h4>
|
||||
|
||||
<image :src="info.label_url"></image>
|
||||
|
||||
<image :src="info.sds_url"></image>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.id) {
|
||||
this.alarmInfo(options.id)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
alarmInfo(id) {
|
||||
get('/myapi/api/yq_driver/alarmInfo', {
|
||||
id
|
||||
}).then(res => {
|
||||
this.info = res.data.car
|
||||
|
||||
console.log(this.info)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding-top: 2px;
|
||||
background-color: #f4f4f4;
|
||||
height: calc(100vh - 46px);
|
||||
|
||||
}
|
||||
</style>
|
||||
86
pages/index/notice.vue
Normal file
86
pages/index/notice.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="list">
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
|
||||
@scrolltolower="lower" @scroll="scroll">
|
||||
<view class="card" v-for="(item,index) in list" @click="toNotice(item.id)">
|
||||
<view class="title">{{index + 1}}.{{item.title}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
scrollTop: 0,
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
sectionChange(current) {
|
||||
this.current = current
|
||||
},
|
||||
toNotice(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/details?id='+id
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
get('/myapi/api/yq_driver/articleList').then(res => {
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
upper: function(e) {
|
||||
console.log(e)
|
||||
},
|
||||
lower: function(e) {
|
||||
console.log(e)
|
||||
},
|
||||
scroll: function(e) {
|
||||
console.log(e)
|
||||
this.old.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding-top: 2px;
|
||||
background-color: #f4f4f4;
|
||||
height: calc(100vh - 46px);
|
||||
|
||||
.list {
|
||||
padding: 5px 20px;
|
||||
|
||||
.scroll-Y {
|
||||
height: calc(100vh - 86px);
|
||||
|
||||
.card {
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
436
pages/my/index.vue
Normal file
436
pages/my/index.vue
Normal file
@@ -0,0 +1,436 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<view class="top-bg"></view>
|
||||
|
||||
<view class="user-info ">
|
||||
<view class="avatar">
|
||||
|
||||
<u--image :showLoading="true" :src="userInfo.head" width="100px" height="100px" shape="circle"
|
||||
v-if="userInfo.head"></u--image>
|
||||
|
||||
<u-icon name="account-fill" color="#ffffff" size="80" v-else></u-icon>
|
||||
</view>
|
||||
|
||||
<view class="user-details">
|
||||
|
||||
<!-- <u-tag text="黄码" type="warning" class="tag" v-if="color==1"></u-tag>
|
||||
<u-tag text="绿码" type="success" class="tag" v-else-if="color == 2">></u-tag>
|
||||
<u-tag text="红码" type="error" class="tag" v-else></u-tag> -->
|
||||
|
||||
<view class="user-name">{{userInfo.account}}</view>
|
||||
<view class="user-contact">
|
||||
<u-icon name="phone-fill" color="#1a6dcc" size="18"></u-icon>
|
||||
<span>{{userInfo.phone}}</span>
|
||||
</view>
|
||||
<!-- <view class="user-contact">
|
||||
<u-icon name="email-fill" color="#1a6dcc" size="18"></u-icon>
|
||||
<span>{{userInfo.email}}</span>
|
||||
</view> -->
|
||||
<u-button text="修改资料" class="updateInfoBtn" type="primary" size="small" shape="circle"
|
||||
@click="toDriverInfo(1)"></u-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="stats-cards animated">
|
||||
<view class="stat-card">
|
||||
<view class="stat-value">{{userInfo.mouth}}</view>
|
||||
<view class="stat-label">本月运单</view>
|
||||
</view>
|
||||
<view class="stat-card">
|
||||
<view class="stat-value">{{userInfo.lv}}</view>
|
||||
<view class="stat-label">完成率</view>
|
||||
</view>
|
||||
<view class="stat-card">
|
||||
<view class="stat-value">{{userInfo.onPassage}}</view>
|
||||
<view class="stat-label">在途中</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="menu-section">
|
||||
<view class="section-title">
|
||||
<view class="title_left">
|
||||
<u-icon name="list-dot" color="#1a6dcc" size="20" :bold="true"></u-icon>
|
||||
<span>功能模块</span>
|
||||
</view>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="menu-grid">
|
||||
<view class="menu-item" @click="toNav('order/park')">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="file-text" color="#1a6dcc" size="28"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">园区入园上报</view>
|
||||
</view>
|
||||
<view class="menu-item" @click="toNav('order/waybill')">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="order" color="#1a6dcc" size="28"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">电子运单上报</view>
|
||||
</view>
|
||||
<view class="menu-item" @click="toNav('order/alarm')">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="info-circle" color="#1a6dcc" size="28"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">车辆事故上报</view>
|
||||
</view>
|
||||
<view class="menu-item" @click="toMap">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="map" color="#1a6dcc" size="28"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">路径导航</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section-title">
|
||||
<view class="title_left">
|
||||
<u-icon name="setting" color="#1a6dcc" size="20" :bold="true"></u-icon>
|
||||
<span>账户设置</span>
|
||||
</view>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="menu-grid">
|
||||
<view class="menu-item" @click="toDriverInfo(2)">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="home" size="28" color="#1a6dcc"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">个人信息</view>
|
||||
</view>
|
||||
<view class="menu-item" @click="toNav('car/car')">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="grid" size="28" color="#1a6dcc"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">车辆信息</view>
|
||||
</view>
|
||||
<view class="menu-item" @click="toNav('index/message')">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="bell" size="28" color="#1a6dcc"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">报警信息接收</view>
|
||||
</view>
|
||||
<view class="menu-item" @click="toNav('index/notice')">
|
||||
<view class="menu-icon">
|
||||
<u-icon name="question-circle" size="28" color="#1a6dcc"></u-icon>
|
||||
</view>
|
||||
<view class="menu-label">帮助中心</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="margin-bottom: 20px;">
|
||||
<u-button type="primary" class="btn" text="退出登录" size="small" shape="circle" @click="logout"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '../../common/config';
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
src: "./static/1752220647221.jpg",
|
||||
userInfo: {
|
||||
name: '张三',
|
||||
mobile: '158****888',
|
||||
email: '1'
|
||||
},
|
||||
color: 2
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!config.driverInfo) {
|
||||
this.getDriverInfo()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPullDownRefresh() {
|
||||
setTimeout(() => {
|
||||
this.getDriverInfo()
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
},
|
||||
toNav2(nav, num) {
|
||||
uni.switchTab({
|
||||
url: '/pages/' + nav + '?type=' + num,
|
||||
});
|
||||
},
|
||||
toNav(nav) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/' + nav,
|
||||
});
|
||||
},
|
||||
logout() {
|
||||
|
||||
uni.showLoading({
|
||||
title: '退出中'
|
||||
})
|
||||
|
||||
uni.removeStorageSync('token');
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '退出成功',
|
||||
icon: "none"
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/login'
|
||||
})
|
||||
}, 1500)
|
||||
|
||||
}, 1500)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
toMap() {
|
||||
uni.showToast({
|
||||
title: '暂未开放',
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
async getDriverInfo() {
|
||||
await post('/myapi/api/yq_driver/getDriverInfo').then(res => {
|
||||
this.userInfo = res.data
|
||||
config.driverInfo = res.data
|
||||
|
||||
})
|
||||
},
|
||||
toDriverInfo(type) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/update?type=' + type
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
|
||||
.top-bg {
|
||||
height: 120px;
|
||||
|
||||
background: linear-gradient(135deg, #1a6dcc, #0d4a9e);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -50%;
|
||||
left: -50%;
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
}
|
||||
|
||||
.user-info {
|
||||
position: relative;
|
||||
margin-top: -80px;
|
||||
padding: 25px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: white;
|
||||
border-radius: 20px;
|
||||
margin: -80px 20px 0;
|
||||
box-shadow: 0 10px 30px rgba(0, 61, 165, 0.15);
|
||||
z-index: 10;
|
||||
transition: all 0.3s ease;
|
||||
// background: url('@/static/user-bg.jpg');
|
||||
// background-size: cover;
|
||||
|
||||
.avatar {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
border: 4px solid white;
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
||||
background: linear-gradient(45deg, #4a90e2, #1a6dcc);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
font-size: 40px;
|
||||
margin-right: 20px;
|
||||
|
||||
.u-avatar__image--circle {
|
||||
width: 100%;
|
||||
height: 100%
|
||||
}
|
||||
}
|
||||
|
||||
.user-details {
|
||||
flex: 1;
|
||||
|
||||
.tag {
|
||||
width: 50px;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: #1a3a6d;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.user-contact {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
color: #666;
|
||||
font-size: 15px;
|
||||
|
||||
.u-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.updateInfoBtn {
|
||||
background: linear-gradient(to right, #1a6dcca1, #0d4a9ecf);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 20px;
|
||||
border-radius: 50px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
font-size: 15px;
|
||||
box-shadow: 0 4px 15px rgba(26, 109, 204, 0.3);
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.stats-cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 15px;
|
||||
padding: 25px 20px 15px;
|
||||
|
||||
.stat-card {
|
||||
background: white;
|
||||
border-radius: 15px;
|
||||
padding: 15px 10px;
|
||||
text-align: center;
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid #eef2f7;
|
||||
|
||||
.stat-value {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #1a6dcc;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #777;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-section {
|
||||
padding: 0 20px;
|
||||
margin-top: 10px;
|
||||
|
||||
.section-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #1a3a6d;
|
||||
padding: 15px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.title_left {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.u-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.btn {}
|
||||
}
|
||||
|
||||
.menu-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 10px;
|
||||
margin-bottom: 25px;
|
||||
|
||||
.menu-item {
|
||||
background: white;
|
||||
border-radius: 15px;
|
||||
padding: 15px 10px;
|
||||
text-align: center;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
border: 1px solid #eef2f7;
|
||||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.menu-label {
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
font-weight: 500;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
font-size: 24px;
|
||||
color: #1a6dcc;
|
||||
margin-bottom: 12px;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
background: rgba(26, 109, 204, 0.1);
|
||||
border-radius: 50%;
|
||||
margin: 0 auto 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
background-color: #f4f4f4;
|
||||
height: calc(100vh - 100px);
|
||||
}
|
||||
</style>
|
||||
124
pages/my/login.vue
Normal file
124
pages/my/login.vue
Normal file
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view style="width: 100%;">
|
||||
<image style="width: 100%; height: 200px; background-color: #eeeeee;"
|
||||
src="@/static/2021111015193250849.jpg"></image>
|
||||
</view>
|
||||
<view class="title">
|
||||
<h1>危化品车辆运单平台</h1>
|
||||
</view>
|
||||
<view class="login">
|
||||
<u--form class="form" labelPosition="left" :model="userInfo" ref="uForm">
|
||||
<u-form-item label="账号:" prop="userInfo.account" borderBottom ref="item1">
|
||||
<u--input v-model="userInfo.account" border="none" maxlength="20"
|
||||
placeholder="请输入账号"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="密码:" prop="userInfo.password" borderBottom>
|
||||
<u--input v-model="userInfo.password" border="none" type="password" maxlength="20"
|
||||
placeholder="请输入密码"></u--input>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
<view class="register">
|
||||
<u--text type="primary" text="没有账号,前往注册?" @click="register"></u--text>
|
||||
</view>
|
||||
<u-button type="primary" class="btn" text="登录" shape="circle" @click="login"></u-button>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {
|
||||
account: '',
|
||||
password: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
if (uni.getStorageSync('token')) {
|
||||
this.login()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
register() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/register'
|
||||
})
|
||||
},
|
||||
login() {
|
||||
uni.showLoading({
|
||||
title: '登录中'
|
||||
})
|
||||
|
||||
post('/myapi/api/yq_driver/login', {
|
||||
...this.userInfo
|
||||
}).then(res => {
|
||||
|
||||
setTimeout(() => {
|
||||
uni.setStorageSync('token', res.data.token)
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '登录成功!',
|
||||
icon: "none"
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/my/index'
|
||||
})
|
||||
}, 500)
|
||||
|
||||
}, 500)
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
height: calc(100vh - 50px);
|
||||
|
||||
.title {
|
||||
position: fixed;
|
||||
top: 110px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.login {
|
||||
// border: 1px solid #f4f4f4;
|
||||
// border-radius: 15px;
|
||||
padding: 20px 0;
|
||||
width: 80%;
|
||||
|
||||
|
||||
.form {
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
.register {
|
||||
width: 80%;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 80%;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
204
pages/my/register.vue
Normal file
204
pages/my/register.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<u--form labelPosition="top" :model="userInfo" :rules="rules" ref="uForm" labelWidth="120">
|
||||
<u-form-item label="真实姓名" prop="userInfo.account" borderBottom ref="item1" required>
|
||||
<u--input v-model="userInfo.account" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="性别" prop="userInfo.sex" borderBottom @click="showSex = true;" ref="item1">
|
||||
<u--input v-model="userInfo.sex" disabled disabledColor="#ffffff" placeholder="请选择性别"
|
||||
border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item> -->
|
||||
<u-form-item label="手机号码" prop="userInfo.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="userInfo.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="电子邮箱" prop="userInfo.email" borderBottom ref="item1">
|
||||
<u--input v-model="userInfo.email" border="none" maxlength="20" placeholder="请输入电子邮箱"></u--input>
|
||||
</u-form-item> -->
|
||||
<!-- <u-form-item label="用户类型" prop="userInfo.type" borderBottom @click="showType = true;" ref="item1">
|
||||
<u--input v-model="userInfo.type" disabled disabledColor="#ffffff" placeholder="请选择类型"
|
||||
border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="企业名称" prop="userInfo.enterprise" borderBottom ref="item1" v-if="userInfo.type == '企业'">
|
||||
<u--input v-model="userInfo.enterprise" border="none" maxlength="20" placeholder="请输入企业名称"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="职位" prop="userInfo.position" borderBottom ref="item1">
|
||||
<u--input v-model="userInfo.position" border="none" maxlength="10" placeholder="请输入职位名称"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="常用发货地址" prop="userInfo.shipping_address" borderBottom ref="item1">
|
||||
<u--input v-model="userInfo.shipping_address" border="none" maxlength="100"
|
||||
placeholder="请输入常用发货地址"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="常用收货地址" prop="userInfo.receiving_address" borderBottom ref="item1">
|
||||
<u--input v-model="userInfo.receiving_address" border="none" maxlength="100"
|
||||
placeholder="请输入常用收货地址"></u--input>
|
||||
</u-form-item> -->
|
||||
</u--form>
|
||||
<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="" @close="showSex = false"
|
||||
@select="sexSelect">
|
||||
</u-action-sheet>
|
||||
<u-action-sheet :show="showType" :actions="typeActions" title="请选择类型" description="" @close="showType = false"
|
||||
@select="typeSelect">
|
||||
</u-action-sheet>
|
||||
|
||||
<view class="agreement">
|
||||
<view class="content">
|
||||
<u-checkbox-group v-model="agreement1" placement="row">
|
||||
<u-checkbox label=""></u-checkbox>
|
||||
请阅读和勾选
|
||||
<u--text type="primary" text="用户协议" @click="agreement(1)"></u--text>
|
||||
、
|
||||
<u--text type="primary" text="隐私政策" @click="agreement(2)"></u--text>
|
||||
协议
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-button type="primary" class="btn" text="注册" shape="circle" @click="register"></u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
import {
|
||||
config
|
||||
} from '@/common/config.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showSex: false,
|
||||
showType: false,
|
||||
|
||||
userInfo: {
|
||||
account: '',
|
||||
sex: '男',
|
||||
phone: '',
|
||||
email: '',
|
||||
type: '个人',
|
||||
enterprise: '',
|
||||
position: '',
|
||||
shipping_address: '',
|
||||
receiving_address: '',
|
||||
},
|
||||
|
||||
actions: [{
|
||||
name: '男',
|
||||
},
|
||||
{
|
||||
name: '女',
|
||||
},
|
||||
],
|
||||
typeActions: [{
|
||||
name: '个人',
|
||||
},
|
||||
{
|
||||
name: '企业',
|
||||
},
|
||||
],
|
||||
rules: {
|
||||
|
||||
},
|
||||
agreement1: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sexSelect(e) {
|
||||
this.userInfo.sex = e.name
|
||||
this.$refs.uForm.validateField('userInfo.sex')
|
||||
},
|
||||
typeSelect(e) {
|
||||
this.userInfo.type = e.name
|
||||
this.$refs.uForm.validateField('userInfo.type')
|
||||
},
|
||||
agreement(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/details?id=' + id
|
||||
})
|
||||
},
|
||||
async register() {
|
||||
console.log()
|
||||
if (this.agreement1.length !== 1) {
|
||||
uni.showToast({
|
||||
title: '请阅读并勾选相关协议!',
|
||||
icon: "none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
uni.showLoading({
|
||||
title: '注册中'
|
||||
})
|
||||
|
||||
post('/myapi/api/yq_driver/register', {
|
||||
...this.userInfo
|
||||
}).then(res => {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '恭喜你,注册成功!',
|
||||
icon: "none"
|
||||
})
|
||||
uni.setStorageSync('token', res.data.token)
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '正在登录',
|
||||
icon: "none"
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/my/index'
|
||||
})
|
||||
}, 500)
|
||||
}, 1500)
|
||||
|
||||
}, 1500)
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 10px 20px;
|
||||
|
||||
.btn {
|
||||
margin-top: 10px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.agreement {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
margin: 10px 0 20px;
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .u-checkbox__icon-wrap--square {
|
||||
border-radius: 15px !important;
|
||||
}
|
||||
</style>
|
||||
208
pages/my/update.vue
Normal file
208
pages/my/update.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u--form labelPosition="top" :model="form" :rules="rules" ref="uForm" labelWidth="120">
|
||||
<u-form-item label="姓名" prop="form.account" borderBottom>
|
||||
<u--input v-model="form.account" border="none" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="手机号" prop="form.phone" borderBottom>
|
||||
<u--input v-model="form.phone" border="none" placeholder="请输入手机号"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="密码" prop="form.password" borderBottom>
|
||||
<u--input v-model="form.password" border="none" placeholder="不修改密码不填此项"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="头像" prop="form.head" borderBottom>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||
:maxCount="1"></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证" prop="form.card_image" borderBottom>
|
||||
<u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple
|
||||
:maxCount="2"></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="驾驶证" prop="form.license_image" borderBottom>
|
||||
<u-upload :fileList="fileList3" @afterRead="afterRead" @delete="deletePic" name="3" multiple
|
||||
:maxCount="1"></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="牵引车车牌号" prop="form.tractor_no" borderBottom>
|
||||
<u--input v-model="form.tractor_no" border="none" maxlength="11" placeholder="请输入牵引车车牌号"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="牵引车道运证" prop="form.tractor_image" borderBottom>
|
||||
<u-upload :fileList="fileList4" @afterRead="afterRead" @delete="deletePic" name="4" multiple
|
||||
:maxCount="1"></u-upload> </u-form-item>
|
||||
<u-form-item label="牵引车行驶证" prop="form.traactor_license_image" borderBottom>
|
||||
<u-upload :fileList="fileList5" @afterRead="afterRead" @delete="deletePic" name="5" multiple
|
||||
:maxCount="1"></u-upload> </u-form-item>
|
||||
</u--form>
|
||||
|
||||
<u-button type="primary" class="btn" v-if="show" text="提交信息" shape="circle" @click="add"></u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '../../common/config';
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
tractor_no: "", //牵引车牌号
|
||||
head: "", //头像
|
||||
card_image: "", //身份证
|
||||
tractor_image: "", //牵引车道运证
|
||||
traactor_license_image: "", //牵引车行驶证
|
||||
license_image: "", //驾驶证
|
||||
account: "", //账号
|
||||
password: "", //密码
|
||||
nick_name: "", //昵称
|
||||
phone: "" //电话
|
||||
},
|
||||
rules: {},
|
||||
array: ['货车', '卡车', '厢式货车'],
|
||||
index: null,
|
||||
fileList1: [],
|
||||
fileList2: [],
|
||||
fileList3: [],
|
||||
fileList4: [],
|
||||
fileList5: [],
|
||||
show: true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.type == 2) {
|
||||
this.show = false
|
||||
uni.setNavigationBarTitle({
|
||||
title: '个人信息'
|
||||
});
|
||||
}
|
||||
const driver_info = config.driverInfo
|
||||
this.form = {
|
||||
...driver_info
|
||||
}
|
||||
this.form.password = ''
|
||||
this.fileList1 = this.imageArr(this.form.head)
|
||||
this.fileList2 = this.form.card_image ? this.form.card_image.split(',') : []
|
||||
this.fileList3 = this.form.license_image ? this.form.license_image.split(',') : []
|
||||
this.fileList4 = this.form.tractor_image ? this.form.tractor_image.split(',') : []
|
||||
this.fileList5 = this.form.traactor_license_image ? this.form.traactor_license_image.split(',') : []
|
||||
},
|
||||
methods: {
|
||||
async add() {
|
||||
|
||||
this.form.head = this.imageStr(this.fileList1)
|
||||
this.form.card_image = this.imageStr(this.fileList2)
|
||||
this.form.license_image = this.imageStr(this.fileList3)
|
||||
this.form.tractor_image = this.imageStr(this.fileList4)
|
||||
this.form.traactor_license_image = this.imageStr(this.fileList5)
|
||||
|
||||
await post('/myapi/api/yq_driver/updateDriverInfo', {
|
||||
...this.form
|
||||
}).then((res) => {
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
config.driverInfo = res.data
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/my/index'
|
||||
})
|
||||
}, 800)
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
imageStr(arr) {
|
||||
return arr
|
||||
.filter(item => item.url)
|
||||
.map(item => item.url)
|
||||
.join(',')
|
||||
},
|
||||
imageArr(str) {
|
||||
if (str) {
|
||||
var arr = []
|
||||
str.split(',').map(item => {
|
||||
arr.push({
|
||||
url: item
|
||||
})
|
||||
})
|
||||
return arr
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
},
|
||||
bindPickerChange: function(e) {
|
||||
this.index = e.detail.value
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1);
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = this[`fileList${event.name}`].length;
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中",
|
||||
});
|
||||
});
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url);
|
||||
console.log('result', result)
|
||||
let item = this[`fileList${event.name}`][fileListLen];
|
||||
this[`fileList${event.name}`].splice(
|
||||
fileListLen,
|
||||
1,
|
||||
Object.assign(item, {
|
||||
status: "success",
|
||||
message: "",
|
||||
url: result,
|
||||
})
|
||||
);
|
||||
fileListLen++;
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uni.uploadFile({
|
||||
url: "/myapi/api/yq_driver/upload",
|
||||
filePath: url,
|
||||
name: "file",
|
||||
header: {
|
||||
token: uni.getStorageSync('token'),
|
||||
},
|
||||
success: (res) => {
|
||||
const data = JSON.parse(res.data);
|
||||
resolve(data.data.fullurl);
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
|
||||
.tag_title {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
170
pages/order/addAlarm.vue
Normal file
170
pages/order/addAlarm.vue
Normal file
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" labelWidth="120">
|
||||
|
||||
<u-form-item label="有无挂车" prop="form.has_mount" borderBottom ref="item1">
|
||||
<u-radio-group v-model="form.has_mount" placement="row" @change="groupChange">
|
||||
<u-radio shape="square" name="1" label="有"></u-radio>
|
||||
<span style="width: 40px;"></span>
|
||||
<u-radio shape="square" name="0" label="无"></u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="挂车车牌" prop="form.mount_license" borderBottom ref="item1">
|
||||
<car-number-input class="car-number-input" @numberInputResult="numberInputResult2"
|
||||
:defaultStr="form.mount_license"></car-number-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="牵引车" prop="form.license" borderBottom ref="item1">
|
||||
<car-number-input class="car-number-input" @numberInputResult="numberInputResult"
|
||||
:defaultStr="form.license"></car-number-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="手机号" prop="form.phone" borderBottom ref="item1">
|
||||
<u--input v-model="form.phone" border="none" placeholder="请输入手机号"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="位置" prop="form.perimeter_location" borderBottom ref="item1">
|
||||
<view class="input_sbtn" style="display: flex;">
|
||||
<u--input v-model="form.perimeter_location" border="none" placeholder="请输入位置"></u--input>
|
||||
<u-button text="定位" size="small" style="width: 80px;" @click="toMap"></u-button>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="身份证号" prop="form.id_card" borderBottom ref="item1">
|
||||
<u--input v-model="form.id_card" border="none" placeholder="请输入身份证号" maxLenght="18"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="事件类型" prop="name" borderBottom ref="item1">
|
||||
<view class="input_sbtn" style="display: flex;" @click="show_event = true">
|
||||
<u--input v-model="form.name" border="none" placeholder="请选择事件类型"></u--input>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="其他情况说明" labelPosition="top" prop="describe" borderBottom ref="item1">
|
||||
<u--textarea style="margin-top: 10px;" v-model="form.describe" placeholder="请输入..."></u--textarea>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
|
||||
<u-button type="primary" class="btn" text="提交信息" shape="circle" @click="add"></u-button>
|
||||
|
||||
<u-picker :show="show_event" :columns="columns_event" keyName="name" @confirm="confirmEvent"
|
||||
@cancel="show_event = false"></u-picker>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
scrollTop: 0,
|
||||
show_event: false,
|
||||
columns_event: [
|
||||
['超速行驶', '禁行路段行驶', '禁停路段停车', '超最大可进入数', '未上报车辆进入', '车辆问题', 'GPS瞬移']
|
||||
],
|
||||
form: {
|
||||
has_mount: "0", //有无挂车
|
||||
mission: 0, //入园目的
|
||||
license: "", //牵引车牌号
|
||||
mount_license: "", //挂车车牌
|
||||
phone: "", //手机号
|
||||
name: "", //事件名称
|
||||
type: "", //事件类型
|
||||
id_card: "", //身份证
|
||||
describe: "", //事件描述
|
||||
perimeter_location: "", //位置
|
||||
perimeter_point: "" //经纬度
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getEarlyList()
|
||||
},
|
||||
methods: {
|
||||
async add() {
|
||||
if (this.has_mount == 1 && this.form.license.trim().length != 7 && this.form.license.trim().length !=
|
||||
8) {
|
||||
uni.showToast({
|
||||
title: '请输入挂车车牌',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
await post('/myapi/api/yq_driver/troubleReport', {
|
||||
...this.form
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '上报成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/alarm'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
},
|
||||
groupChange(e) {
|
||||
this.has_mount = e
|
||||
},
|
||||
confirmEvent(e) {
|
||||
this.form.name = e.value[0]
|
||||
this.form.type = e.indexs[0] + 1
|
||||
this.show_event = false
|
||||
},
|
||||
numberInputResult(e) {
|
||||
this.form.license = e
|
||||
},
|
||||
numberInputResult2(e) {
|
||||
this.form.mount_license = e
|
||||
},
|
||||
toMap() {
|
||||
uni.showToast({
|
||||
title: '暂未开放!请手动输入位置!',
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
scroll: function(e) {
|
||||
this.old.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
async getEarlyList(){
|
||||
await get.getEarlyList().then(res=>{
|
||||
this.columns_event = [
|
||||
res.data.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name
|
||||
})),
|
||||
];
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.car-number-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 20px;
|
||||
|
||||
.tag_title {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
140
pages/order/addPark.vue
Normal file
140
pages/order/addPark.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" labelWidth="120">
|
||||
<u-form-item label="有无挂车" prop="form.has_mount" borderBottom ref="item1">
|
||||
<u-radio-group v-model="form.has_mount" placement="row" @change="groupChange">
|
||||
<u-radio shape="square" name="1" label="有"></u-radio>
|
||||
<span style="width: 40px;"></span>
|
||||
<u-radio shape="square" name="0" label="无"></u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="挂车车牌" prop="form.mount_license" borderBottom ref="item1">
|
||||
<!-- <view class="input_sbtn" style="display: flex;" @click="show_cate = true">
|
||||
<u--input v-model="form.mount_license" border="none" placeholder="请选择挂车车牌"></u--input>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view> -->
|
||||
<car-number-input class="car-number-input" @numberInputResult="numberInputResult2"
|
||||
:defaultStr="form.mount_license"></car-number-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="牵引车" prop="form.tractor_license" borderBottom ref="item1">
|
||||
<car-number-input class="car-number-input" @numberInputResult="numberInputResult"
|
||||
:defaultStr="form.tractor_license"></car-number-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="手机号" prop="form.phone_num" borderBottom ref="item1">
|
||||
<u--input v-model="form.phone_num" border="none" placeholder="请输入手机号"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="入园目的" prop="form.mission_name" borderBottom ref="item1">
|
||||
<view class="input_sbtn" style="display: flex;" @click="show_mudi = true">
|
||||
<u--input v-model="form.mission_name" border="none" placeholder="请选择入园目的"></u--input>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
</u--form>
|
||||
|
||||
<u-button type="primary" class="btn" text="提交信息" shape="circle" @click="add"></u-button>
|
||||
|
||||
<u-picker :show="show_mudi" :columns="columns_mudi" @confirm="confirmMudi"></u-picker>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '../../common/config'
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show_mudi: false,
|
||||
columns_mudi: [
|
||||
['装货/卸货', '维修/洗车/停车', '常驻', '维修', '洗车', '停车', '检测', '洗罐']
|
||||
],
|
||||
|
||||
form: {
|
||||
has_mount: "0",//有无挂车
|
||||
mission: "",//入园目的
|
||||
mission_name: "",//入园目的--显示名称
|
||||
tractor_license: "", //牵引车牌号
|
||||
mount_license:"",//挂车车牌
|
||||
phone_num:config.driverInfo.phone,//手机号
|
||||
reporter_name:config.driverInfo.account
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option.vehicleNo){
|
||||
this.form.tractor_license = option.vehicleNo
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async add() {
|
||||
|
||||
if(this.form.has_mount == 1 && this.form.mount_license.trim().length != 7 && this.form.mount_license.trim().length != 8){
|
||||
uni.showToast({
|
||||
title:'请输入挂车车牌',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
await post('/myapi/api/yq_driver/enParkReport', {
|
||||
...this.form
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '上报成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/park'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
groupChange(e) {
|
||||
this.has_mount = e
|
||||
},
|
||||
confirmMudi(e) {
|
||||
this.form.mission_name = e.value[0]
|
||||
this.form.mission = e.indexs[0] + 1
|
||||
this.show_mudi = false
|
||||
},
|
||||
numberInputResult(e) {
|
||||
this.form.tractor_license = e
|
||||
},numberInputResult2(e) {
|
||||
this.form.mount_license = e
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.car-number-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 20px;
|
||||
|
||||
.tag_title {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
124
pages/order/alarm.vue
Normal file
124
pages/order/alarm.vue
Normal file
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="add_btn">
|
||||
<u-button type="primary" size="small" text="去上报" style="width: 80px;" @click="addAlarm"
|
||||
icon="plus-circle"></u-button>
|
||||
</view>
|
||||
<view class="list">
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
|
||||
@scrolltolower="lower" @scroll="scroll">
|
||||
<view class="card" v-for="(item,index) in list" @click="toDetail(item.id)">
|
||||
<view class="title">{{item.license}}</view>
|
||||
|
||||
<view class="name_1 flex">事件类型:{{item.name}}</view>
|
||||
|
||||
<view class="name_1 flex">上报时间:{{item.create_time}}</view>
|
||||
|
||||
<view class="name_1 flex">
|
||||
<u-tag text="已通过" type="success" v-if="item.status == 1"></u-tag>
|
||||
<u-tag text="拒绝" type="warning" v-else-if="item.status == 2"></u-tag>
|
||||
<u-tag text="审核中" type="error" v-else></u-tag>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getAlarmList()
|
||||
},
|
||||
methods: {
|
||||
onPullDownRefresh() {
|
||||
setTimeout(() => {
|
||||
this.getAlarmList()
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
},
|
||||
addAlarm(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/order/addAlarm'
|
||||
})
|
||||
},
|
||||
async getAlarmList() {
|
||||
await get('/myapi/api/yq_driver/troubleList').then((res) => {
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
toDetail(id){
|
||||
uni.navigateTo({
|
||||
url:'/pages/order/detailAlarm?id='+id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
|
||||
|
||||
.add_btn {
|
||||
position: fixed;
|
||||
top: 50px;
|
||||
right: 10px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
.scroll-Y {
|
||||
height: calc(100vh - 86px);
|
||||
|
||||
.card {
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #f4f4f4;
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
|
||||
.icon-right {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.name_1 {
|
||||
margin: 10px 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
49
pages/order/detailAlarm.vue
Normal file
49
pages/order/detailAlarm.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view>牵引车牌:{{info.license}}</view>
|
||||
<view>挂车车牌:{{info.mount_license}}</view>
|
||||
<view>手机号:{{info.phone}}</view>
|
||||
<view>身份证号:{{info.id_card}}</view>
|
||||
<view>事故类型:{{info.name}}</view>
|
||||
<view>事故地点:{{info.perimeter_location}}</view>
|
||||
<view>事故描述:{{info.describe}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: {
|
||||
id: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.id) {
|
||||
this.info.id = option.id
|
||||
this.getTroubleTnfo()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getTroubleTnfo() {
|
||||
await get('/myapi/api/yq_driver/troubleInfo', {
|
||||
id: this.info.id
|
||||
}).then((res) => {
|
||||
this.info = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
line-height: 30px;
|
||||
}
|
||||
</style>
|
||||
47
pages/order/detailPark.vue
Normal file
47
pages/order/detailPark.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view>姓名:{{info.reporter_name}}</view>
|
||||
<view>牵引车牌:{{info.tractor_license}}</view>
|
||||
<view>挂车车牌:{{info.mount_license}}</view>
|
||||
<view>手机号:{{info.phone_num}}</view>
|
||||
<view>入园目的:{{info.mission_text}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: {
|
||||
id: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.id) {
|
||||
this.info.id = option.id
|
||||
this.getParkInfo()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getParkInfo() {
|
||||
await get('/myapi/api/yq_driver/enParkInfo', {
|
||||
id: this.info.id
|
||||
}).then((res) => {
|
||||
this.info = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
line-height: 30px;
|
||||
}
|
||||
</style>
|
||||
54
pages/order/ordeDetails.vue
Normal file
54
pages/order/ordeDetails.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view><span>运单号:</span>{{info.waybill_order}}</view>
|
||||
<view>姓名:{{info.waybill_name}}</view>
|
||||
<view>提货日期:{{info.waybill_date}}</view>
|
||||
<view>牵引车牌:{{info.tow_license}}</view>
|
||||
<view>挂车车牌:{{info.mount_license}}</view>
|
||||
<view>手机号:{{info.driver_tel}}</view>
|
||||
<view>产品名称:{{info.sale_product}}</view>
|
||||
<view>装货单位:{{info.waybill_loading}}</view>
|
||||
<view>卸货单位:{{info.waybill_unloading}}</view>
|
||||
<view>入园目的:{{info.w_mission}}</view>
|
||||
<view>装卸货品类:{{info.cargocategory}}</view>
|
||||
<view>数量:{{info.cargocount}}(吨)</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: {
|
||||
id: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.id) {
|
||||
this.info.id = option.id
|
||||
this.getWaybillInfo()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getWaybillInfo() {
|
||||
await get('/myapi/api/yq_driver/waybillInfo', {
|
||||
id: this.info.id
|
||||
}).then((res) => {
|
||||
this.info = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
line-height: 30px;
|
||||
}
|
||||
</style>
|
||||
143
pages/order/order.vue
Normal file
143
pages/order/order.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<u-subsection :list="top_list" :current="current" keyName="name" activeColor="#f56c6c" mode="subsection"
|
||||
@change="sectionChange"></u-subsection>
|
||||
|
||||
<view class="list">
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
|
||||
@scrolltolower="lower">
|
||||
<view class="card" v-for="(item,index) in list" @click="toDetails(item.id)">
|
||||
<view class="title">运单编号:{{item.waybill_order}}<u-icon name="arrow-right"
|
||||
size="12"></u-icon></view>
|
||||
<view class="name_1 flex">车牌号:{{item.tow_license}}</view>
|
||||
<view class="name_1 flex">入园目的:{{item.w_mission}}</view>
|
||||
<view class="name_1 flex"><u-icon name="car-fill" class="icon-right" color="#2979ff"
|
||||
size="12"></u-icon>销售产品:{{item.sale_product}}</view>
|
||||
<view class="name_2 flex" v-if="item.w_mission == '装货'">
|
||||
<u-icon name="car-fill" class="icon-right" color="#ddbb0b" size="12"></u-icon>
|
||||
装货单位:{{item.waybill_loading}}
|
||||
</view>
|
||||
<view class="name_2 flex" v-else>
|
||||
<u-icon name="car-fill" class="icon-right" color="#ddbb0b" size="12"></u-icon>
|
||||
卸货单位:{{item.waybill_unloading}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
top_list: [{
|
||||
name: '全部'
|
||||
}, {
|
||||
name: '未查验'
|
||||
}, {
|
||||
name: '通过'
|
||||
}, {
|
||||
name: '未通过'
|
||||
}],
|
||||
current: 0,
|
||||
scrollTop: 0,
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getWaybillList()
|
||||
},
|
||||
methods: {
|
||||
onPullDownRefresh() {
|
||||
setTimeout(() => {
|
||||
this.getWaybillList()
|
||||
uni.stopPullDownRefresh();
|
||||
}, 2000);
|
||||
},
|
||||
sectionChange(current) {
|
||||
this.current = current
|
||||
this.getWaybillList()
|
||||
},
|
||||
toDetails(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/ordeDetails?id=' + id
|
||||
})
|
||||
},
|
||||
upper: function(e) {
|
||||
console.log(e)
|
||||
},
|
||||
lower: function(e) {
|
||||
console.log(e)
|
||||
},
|
||||
scroll: function(e) {
|
||||
console.log(e)
|
||||
this.old.scrollTop = e.detail.scrollTop
|
||||
},
|
||||
async getWaybillList() {
|
||||
await get('/myapi/api/yq_driver/waybillList', {
|
||||
current: this.current
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding-top: 2px;
|
||||
background-color: #f4f4f4;
|
||||
height: calc(100vh - 46px);
|
||||
|
||||
.list {
|
||||
padding: 5px 20px;
|
||||
|
||||
.scroll-Y {
|
||||
height: calc(100vh - 86px);
|
||||
|
||||
.card {
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
|
||||
.icon-right {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.name_1 {
|
||||
margin: 10px 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
128
pages/order/park.vue
Normal file
128
pages/order/park.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="add_btn">
|
||||
<u-button type="primary" size="small" text="去上报" style="width: 80px;" @click="addPark"
|
||||
icon="plus-circle"></u-button>
|
||||
</view>
|
||||
<view class="list">
|
||||
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
|
||||
@scrolltolower="lower" @scroll="scroll">
|
||||
<view class="card" v-for="(item,index) in list" @click="toDetail(item.id)">
|
||||
<view class="title">{{item.tractor_license}}</view>
|
||||
|
||||
<view class="name_1 flex">姓 名:{{item.reporter_name}}</view>
|
||||
|
||||
<view class="name_1 flex">电 话:{{item.phone_num}}</view>
|
||||
|
||||
<view class="name_1 flex">入园目的:{{item.mission_text}}</view>
|
||||
|
||||
<view class="name_1 flex">上报时间:{{item.create_time}}</view>
|
||||
|
||||
<view class="name_1 flex">
|
||||
<u-tag text="已通过" type="success" v-if="item.status == 1"></u-tag>
|
||||
<u-tag text="拒绝" type="warning" v-else-if="item.status == 2"></u-tag>
|
||||
<u-tag text="审核中" type="error" v-else></u-tag>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getParkList()
|
||||
},
|
||||
methods: {
|
||||
onPullDownRefresh() {
|
||||
setTimeout(() => {
|
||||
this.getParkList()
|
||||
uni.stopPullDownRefresh();
|
||||
}, 500);
|
||||
},
|
||||
addPark(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/order/addPark'
|
||||
})
|
||||
},
|
||||
async getParkList() {
|
||||
await get('/myapi/api/yq_driver/parkList').then((res) => {
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
toDetail(id){
|
||||
uni.navigateTo({
|
||||
url:'/pages/order/detailPark?id='+id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
|
||||
|
||||
.add_btn {
|
||||
position: fixed;
|
||||
top: 50px;
|
||||
right: 10px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
.scroll-Y {
|
||||
height: calc(100vh - 86px);
|
||||
|
||||
.card {
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #f4f4f4;
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
|
||||
.icon-right {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.name_1 {
|
||||
margin: 10px 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
205
pages/order/waybill - 副本.vue
Normal file
205
pages/order/waybill - 副本.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" labelWidth="120">
|
||||
<view class="tag_title">
|
||||
<u-tag text="托运方" size="mini"></u-tag>
|
||||
</view>
|
||||
<u-form-item label="名称" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="信用代码" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="联系电话" prop="form.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
<view class="tag_title">
|
||||
<u-tag text="收货方" size="mini"></u-tag>
|
||||
</view>
|
||||
<u-form-item label="名称" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="信用代码" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="联系电话" prop="form.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
<view class="tag_title">
|
||||
<u-tag text="装货方" size="mini"></u-tag>
|
||||
</view>
|
||||
<u-form-item label="名称" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="信用代码" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="联系电话" prop="form.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
|
||||
<view class="tag_title">
|
||||
<u-tag text="运输信息" size="mini"></u-tag>
|
||||
</view>
|
||||
<u-form-item label="起运地" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="行政区" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="目的地" prop="form.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="行政区" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="起运日期" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="预计完成日期" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="车辆路线" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="途径省" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="城市配送" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
<view class="tag_title">
|
||||
<u-tag text="货物信息" size="mini"></u-tag>
|
||||
</view>
|
||||
<u-form-item label="名称" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="国际编号" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="类别" prop="form.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="包装类别" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="包装规格" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="货物单位" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="货物重量" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="应急措施" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="tag_title">
|
||||
<u-tag text="车辆信息" size="mini"></u-tag>
|
||||
</view>
|
||||
<u-form-item label="车牌号" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="车牌颜色" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="道路运输证书" prop="form.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="挂车车牌号" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="道路运输证书" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="罐体编号" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="罐体容积" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
<view class="tag_title">
|
||||
<u-tag text="人员信息" size="mini"></u-tag>
|
||||
</view>
|
||||
<u-form-item label="驾驶员" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="资格证书" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="联系方式" prop="form.phone" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.phone" border="none" maxlength="11" placeholder="请输入手机号码"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="押运员" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="资格证书" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="联系方式" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="双驾双押" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="调度人" prop="form.name" borderBottom ref="item1" required>
|
||||
<u--input v-model="form.name" border="none" maxlength="5" placeholder="请输入真实姓名"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
</u--form>
|
||||
|
||||
<u-button type="primary" class="btn" text="提交信息" shape="circle" @click="add"></u-button>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
|
||||
},
|
||||
rules:{}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
add(){
|
||||
console.log(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container{
|
||||
padding: 20px;
|
||||
.tag_title {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.btn{
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
236
pages/order/waybill.vue
Normal file
236
pages/order/waybill.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" labelWidth="120">
|
||||
|
||||
|
||||
<u-form-item label="姓名" prop="form.waybill_name" borderBottom ref="item1">
|
||||
<u--input v-model="form.waybill_name" border="none" placeholder="请输入运单上报人"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="提货日期" prop="form.waybill_date" borderBottom ref="item1">
|
||||
<view class="input_sbtn" style="display: flex;" @click="show_calendar = true">
|
||||
<u--input v-model="form.waybill_date" border="none" placeholder="请选择提货日期"></u--input>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</u-form-item>
|
||||
<u-form-item label="牵引车牌" prop="form.tow_license" borderBottom ref="item1">
|
||||
<car-number-input class="car-number-input" @numberInputResult="numberInputResult"
|
||||
:defaultStr="form.tow_license"></car-number-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="挂车车牌" prop="form.mount_license" borderBottom ref="item1">
|
||||
<car-number-input class="car-number-input" @numberInputResult="numberInputResult2"
|
||||
:defaultStr="form.mount_license"></car-number-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="手机号" prop="form.driver_tel" borderBottom ref="item1">
|
||||
<u--input v-model="form.driver_tel" border="none" placeholder="请输入手机号"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="产品名称" prop="form.sale_product" borderBottom ref="item1">
|
||||
<u--input v-model="form.sale_product" border="none" placeholder="请输入产品名称"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="装货单位" prop="form.waybill_loading" borderBottom ref="item1">
|
||||
<view class="input_sbtn" style="display: flex;">
|
||||
<u--input v-model="form.waybill_loading" border="none" placeholder="请输入装货单位"></u--input>
|
||||
<u-button text="选择企业" size="small" style="width: 60px;" @click="show_qiye = true"></u-button>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="卸货单位" prop="form.waybill_unloading" borderBottom ref="item1">
|
||||
<u--input v-model="form.waybill_unloading" border="none" placeholder="请输入卸货单位"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="入园目的" prop="form.w_mission" borderBottom ref="item1">
|
||||
<view class="input_sbtn" style="display: flex;" @click="show_mudi = true">
|
||||
<u--input v-model="form.w_mission" border="none" placeholder="请选择入园目的"></u--input>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</u-form-item>
|
||||
<u-form-item label="装卸货品类" prop="form.cargocategory" borderBottom ref="item1">
|
||||
<view class="input_sbtn" style="display: flex;" @click="show_cate = true">
|
||||
<u--input v-model="form.cargocategory" border="none" placeholder="请选择货物品类"></u--input>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="数量(吨)" prop="cargocount" borderBottom ref="item1">
|
||||
<u--input v-model="form.cargocount" border="none" type="number" placeholder="请输入装卸货数量"></u--input>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
</u--form>
|
||||
|
||||
<u-button type="primary" class="btn" text="提交信息" shape="circle" @click="add"></u-button>
|
||||
|
||||
<u-picker :show="show_mudi" :columns="columns_mudi" @confirm="confirmMudi"
|
||||
@cancel="show_mudi = false"></u-picker>
|
||||
|
||||
<u-picker :show="show_qiye" :columns="enterpriseData" keyName="name" @confirm="confirmQiye"
|
||||
@cancel="show_qiye = false"></u-picker>
|
||||
|
||||
<u-picker :show="show_cate" ref="uPicker" keyName="name" :columns="columns" @confirm="confirmCate"
|
||||
@change="changeHandler" @cancel="show_cate = false"></u-picker>
|
||||
|
||||
<u-calendar :show="show_calendar" @confirm="confirm_calendar"></u-calendar>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '../../common/config'
|
||||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/request.js'
|
||||
export default {
|
||||
data() {
|
||||
const currentDate = this.getDate({
|
||||
format: true
|
||||
})
|
||||
return {
|
||||
show_calendar: false,
|
||||
show_mudi: false,
|
||||
columns_mudi: [
|
||||
['装货', '卸货']
|
||||
],
|
||||
show_cate: false,
|
||||
columns: [],
|
||||
columnData: [],
|
||||
form: {
|
||||
w_mission: "", //入园目的
|
||||
cargocategory: "", //装/卸货品类
|
||||
waybill_date: currentDate,
|
||||
tow_license: "", //牵引车牌号
|
||||
mount_license: "", //挂车车牌号
|
||||
driver_tel: config.driverInfo.phone, //司机电话
|
||||
sale_product: "", //销售产品
|
||||
waybill_name: config.driverInfo.account, //运单人
|
||||
waybill_loading: "", //装货单位
|
||||
waybill_unloading: "", //卸货单位
|
||||
cargocount: "", //装/卸货数量
|
||||
},
|
||||
rules: {},
|
||||
categoryData: [],
|
||||
enterpriseData: [],
|
||||
show_qiye:false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getProductCate()
|
||||
this.getEnterpriseList()
|
||||
},
|
||||
methods: {
|
||||
async add() {
|
||||
await post('/myapi/api/yq_driver/waybillReport',{...this.form}).then((res) => {
|
||||
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title:'上报成功',
|
||||
icon:'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.switchTab({
|
||||
url:'/pages/order/order'
|
||||
})
|
||||
},500)
|
||||
}
|
||||
})
|
||||
},
|
||||
confirmMudi(e) {
|
||||
this.form.w_mission = e.value[0]
|
||||
this.show_mudi = false
|
||||
},
|
||||
confirmCate(e) {
|
||||
this.form.cargocategory = e.value[1].name
|
||||
this.form.cargocategoryId = e.value[1].id
|
||||
this.show_cate = false
|
||||
},
|
||||
changeHandler(e) {
|
||||
if (e.columnIndex === 0) { // 仅在第一列变化时更新
|
||||
const parentIndex = e.index;
|
||||
// 更新第二列数据
|
||||
this.$set(this.columns, 1, this.categoryData[parentIndex].son || []);
|
||||
}
|
||||
},
|
||||
confirm_calendar(e) {
|
||||
this.form.waybill_date = e[0]
|
||||
this.show_calendar = false
|
||||
},
|
||||
confirmQiye(e) {
|
||||
this.form.waybill_loading = e.value[0].name
|
||||
this.show_qiye = false
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
if (type === 'start') {
|
||||
year = year - 10;
|
||||
} else if (type === 'end') {
|
||||
year = year + 10;
|
||||
}
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
numberInputResult(e) {
|
||||
this.form.tow_license = e
|
||||
},
|
||||
numberInputResult2(e) {
|
||||
this.form.mount_license = e
|
||||
},
|
||||
async getProductCate() {
|
||||
await get('/myapi/api/yq_driver/getProductCate').then((res) => {
|
||||
|
||||
if (res.data && res.data.length > 0) {
|
||||
this.categoryData = res.data
|
||||
// 初始化columns:第一列是顶级分类,第二列是第一个顶级分类的子分类
|
||||
// 第一列:父级分类
|
||||
this.columns = [
|
||||
// 第一列:父级分类
|
||||
res.data.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name
|
||||
})),
|
||||
// 第二列:第一个父级的子分类
|
||||
res.data[0].son || []
|
||||
];
|
||||
}
|
||||
})
|
||||
},
|
||||
async getEnterpriseList() {
|
||||
await get('/myapi/api/yq_driver/getEnterpriseList').then((res) => {
|
||||
this.enterpriseData = [
|
||||
res.data.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name
|
||||
})),
|
||||
];
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.u-form-item__body__right__icon {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.car-number-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 20px;
|
||||
|
||||
.tag_title {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user