This commit is contained in:
MeSHard
2025-11-14 17:23:25 +08:00
commit 0dbbf978d3
507 changed files with 43048 additions and 0 deletions

170
pages/order/addAlarm.vue Normal file
View 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
View 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
View 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>

View 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>

View 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>

View 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
View 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
View 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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{item.reporter_name}}</view>
<view class="name_1 flex">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{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>

View 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
View 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>