Commit 90f65b22 authored by 贺世双's avatar 贺世双

已提空箱

parent 1c9ee0e7
......@@ -89,9 +89,9 @@
"enablePullDownRefresh": false
}
}, {
"path": "reserveDock/reserveDock",
"path": "shipmentEmptyBox/shipmentEmptyBox",
"style": {
"navigationBarTitleText": "预约站点",
"navigationBarTitleText": "已提空箱",
"enablePullDownRefresh": false
}
}, {
......
......@@ -215,13 +215,13 @@
}
},
//提空箱操作-支架
onDispatchCar(){
onEmptyBox(){
this.choose = []
if (this.message.length >0) {
this.choose = this.message
getApp().globalData.choose = this.choose
uni.navigateTo({
url: `/subpkg/shipmentDispatch/shipmentDispatch`,
url: `/subpkg/shipmentEmptyBox/shipmentEmptyBox`,
})
} else {
uni.showToast({
......
<template>
<view class="reserveDock content_box">
<view class="consumer_code">
<text user-select>运单号:{{shipmentNo}}</text>
</view>
<view class="stops-list">
<view class="panel-title font_bolder">预约到站时间</view>
<u-empty mode="data" textSize='32' iconSize="160" text="暂无可预约站点" v-if="!stopsDatas.length" />
<view class="routine_radius_card" v-for="item in stopsDatas" :key="item.stopsId">
<u--form>
<u-form-item :label="item.locationName" labelWidth="40%">
<u-input border="none" readonly inputAlign="right" placeholder="选择时间" placeholderClass="input-tip"
:value="item.arrivalTime ? `${item.arrivalTime}-${item.departureTime}` : ''"/>
<u-icon slot="right" name="arrow-right" @click="onNavReserveDetail" :index="item" />
</u-form-item>
<u-form-item label="道口" labelWidth="40%" v-if="item.dockId">
<u-input border="none" readonly inputAlign="right" :value="item.dockName" />
<u-icon slot="right" name="1" color="#fff" />
</u-form-item>
</u--form>
</view>
</view>
</view>
</template>
<script>
import { findShipmentStops } from '../../api/apiList'
import { formatGMT } from '../../utils/util'
const app = getApp()
export default {
data() {
return {
stopsDatas: [], //站点列表
shipmentNo: '', //运单号
shipmentId: '', //运单ID
}
},
onLoad(options) {
const { shipmentData } = JSON.parse(options.data)
const { shipmentNo, shipmentId } = app.globalData.shipmentInfo
this.shipmentNo = shipmentNo
this.shipmentId = shipmentId
},
onShow() {
this.initStops()
},
methods: {
//初始化站点列表
initStops() {
const reqData = {
"args": {
"pageNum": 1,
"pageSize": 100,
"restrictions": [{
"field": "shipment.id",
"type": "EQ",
"value": this.shipmentId
}]
}
}
findShipmentStops(reqData).then(res => {
let stopsDatas = res.data.data.datas
let ArrData = []
// stopsDatas.sort((a, b) => (a.stopNumber - b.stopNumber || b.loadStop - a.loadStop)) //站点排序
stopsDatas.map(stop => {
ArrData.push({
stopsId: stop.id,
locationName: stop['location.name'],
locationId: stop['location.id'],
dockId: stop['dock.id'],
dockName: stop['dock.name'],
arrivalTime: formatGMT(stop['planArrivalTime'], 'H'),
departureTime: formatGMT(stop['planDepartureTime'], 'H')
})
})
this.stopsDatas = ArrData
})
},
//跳转预约到站时间
onNavReserveDetail(stopInfo) {
const {stopsId, locationId} = stopInfo
const data = { stopsId, locationId }
uni.navigateTo({
url: `/subpkg/reserveDockTime/reserveDockTime?data=${JSON.stringify(data)}`,
})
}
}
}
</script>
<style lang="scss">
.reserveDock {
.stops-list {
margin-top: 50rpx;
.panel-title {
margin: 0 10rpx 20rpx;
}
.routine_radius_card {
margin-bottom: 40rpx;
.input-tip {
font-size: 28rpx;
color: #999999;
}
.u-form-item__body {
padding: 4rpx;
.u-form-item__body__left__content__label {
font-size: 28rpx;
font-weight: bolder;
}
.u-icon {
margin-left: 20rpx;
}
}
}
}
}
</style>
<template>
<view class="shipmentEmptyBox-list content_box">
<view class="shipmentEmptyBox-item">
<!-- 基本信息 -->
<view class="module-title flex">
<text class="font_bolder">已提空箱</text>
</view>
<!-- 注册内容 -->
<u--form :model="formData" :rules="rules" ref="myForm" errorType='none'>
<view class="basic-info">
<u-form-item prop="container_no" required label="箱号" labelWidth="25%" borderBottom>
<u-input :disabledColor="'#ffffff'" placeholder="请输入箱号" border="none" v-model="formData.container_no" />
</u-form-item>
<u-form-item prop="seal_no" label="封号" labelWidth="25%" borderBottom>
<u-input :disabledColor="'#ffffff'" placeholder="请输入封号" border="none" v-model="formData.seal_no" />
</u-form-item>
<u-form-item prop="tare_weight" label="皮重" labelWidth="25%" borderBottom>
<u-input :disabledColor="'#ffffff'" placeholder="请输入皮重" border="none" v-model="formData.tare_weight" />
</u-form-item>
<u-form-item prop="empty_container_address" label="提箱地点" labelWidth="25%" borderBottom>
<u-input :disabledColor="'#ffffff'" placeholder="请输入提箱地点" border="none" v-model="formData.empty_container_address" />
</u-form-item>
<u-form-item prop="empty_container_finish_time" label="提箱时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('empty_container_finish_time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择提箱时间"
:value="convertTime(formData.empty_container_finish_time)" />
</view>
</u-form-item>
</view>
</u--form>
</view>
<!-- 底部按钮 -->
<view class="operation-btn flex_sb">
<button class="backBtn common_btn" @click="onNavBack">返回</button>
<button class="submitBtn common_btn" @click="onSubmitForm">确认</button>
</view>
<!-- 时间选择 -->
<bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate"
@onSelsectDate="onSelsectDate" />
</view>
</template>
<script>
import {searchTruckList, searchDriverList,
getMassShipmentTruckList} from '../../api/apiList.js'
export default {
name: 'shipmentDispatch',
options: { styleIsolation: 'shared' },
data() {
return {
pageNum: 1, //页码
pageSize: 10, //每页条数
isEmpty: true, //是否为空
rows: [], //当前展开面板
formData: {
container_no: "", //箱号
seal_no:"",//封号
tare_weight: "", //皮重
empty_container_address:"",//提箱地点
empty_container_finish_time: "", //提箱时间
},
rules: {
'container_no': { required: true },//箱号
},
showPopup: false, //时间选择
visibleKey: '', //当前显示字段的key
optionEnums: [], //候选项枚举
popTitle: '', //弹窗标题
visible: false, //类型选择
}
},
onLoad(options) {
const data = getApp().globalData.choose;//勾选的数据
const isEmpty = !Object.keys(data).length
},
methods: {
// 时间选择
onSelsectDate(dateInfo) {
const {
timestamp
} = dateInfo
this.setFormData(timestamp)
this.showPopup = false
},
//关闭时间选择框
onVisibleDate(type) {
if (type) {
this.visibleKey = type
}
this.showPopup = !this.showPopup
},
// 提交表单数据
onSubmitForm() {
const rows = getApp().globalData.choose;
this.formData.rows= rows;
this.formData.ship_event_code="empty_equipment_dispatched";//已提空箱
this.formData.empty_container_finish_time= this.convertTimeHh24(this.formData.empty_container_finish_time)
console.log(this.formData)
var baseData = {
"aux": {
"rows":rows,
"aux":this.formData,
},
}
console.log('已提空箱确认===========')
//派车确认操作
getMassShipmentTruckList(baseData).then(res => {
if (res.data.data.messageType === 'success') {
uni.showToast({
title: '操作成功!',
duration: 1000
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
})
},
//设置显示枚举
setViewEnums(optionEnums, key) {
let viewEnums = {}
optionEnums.map(item => {
viewEnums[item.value] = item.label
})
this[key] = viewEnums
},
//确认选择
onConfirmPicker(value) {
this.setFormData(value)
this.visible = false
this.visible1 = false
this.visible2 = false
},
//页面展示时间戳转换为日期
convertTime(timestamp) {
if (!timestamp) return
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() + 1;
var date = nowDate.getDate();
return `${year}-${ month}-${date}`
},
//页面展示时间戳转换为年月日时分秒
convertTimeHh24(timestamp) {
if (!timestamp) return
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() < 10 ? '0' + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
var date = nowDate.getDate();
return `${year}-${ month}-${date} 00:00:00`
},
//设置formData
setFormData(value) {
const key = this.visibleKey
if (key.includes('.')) { //对象特殊处理
const keys = key.split('.')
this.formData[keys[0]][keys[1]] = value
} else {
this.formData[key] = value
}
},
}
}
</script>
<style lang="scss">
.shipmentEmptyBox-list {
.module-title {
margin-top: 20rpx;
//padding: 15rpx 0rpx 16rpx;
//background-color:#a2a2a2;
.vertical-separate {
height: 40rpx;
border-left: 7rpx solid #797979;
margin-right: 20rpx;
}
}
.select-container {
min-width: 70vw;
height: 50vh;
padding: 30rpx;
font-weight: 400;
.popTitle {
color: #8C8C8C;
font-size: 32rpx;
text-align: center;
margin-bottom: 44rpx;
}
.select-list{
height: 460rpx;
}
}
.shipmentEmptyBox-item {
padding: 32rpx;
margin-bottom: 24rpx;
background: #FFFFFF;
.detail-title {
font-size: 28rpx;
padding: 8rpx 0 30rpx;
border-bottom: 1rpx solid #E5E5E5;
.t-icon-order {
width: 50rpx;
height: 50rpx;
margin-right: 20rpx;
}
}
/deep/.custom-cell-row {
margin-top: 10rpx;
.custom-cell-label {
color: #8C8C8C;
}
}
.outer-frame {
margin-top: 32rpx;
border-radius: 16rpx;
border: 2rpx solid #F0F0F0;
overflow: hidden;
.foldPanel-title {
color: #2E75E6;
font-size: 28rpx;
padding-left: 20rpx;
height: 96rpx;
background: rgba(46, 117, 230, .1);
.foldPanel-right-icon {
margin-right: 20rpx;
}
}
/deep/.cargo-detail-table {
background: #FFFFFF;
padding-bottom: 10rpx;
.detail-row-title {
color: #8C8C8C;
background: #FAFAFA;
padding: 20rpx 0;
}
.detail-col-item {
margin: 20rpx;
.cargo-title {
font-size: 28rpx;
padding-left: 20rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
.snapshoot image {
margin: 20rpx 15rpx;
width: 140rpx;
height: 140rpx;
}
/deep/.basic-info,
/deep/.driving-license {
padding: 0 10rpx;
background-color: #ffffff;
.input-tip {
font-size: 28rpx;
color: #BFBFBF;
}
.u-form-item__body__left__content__label {
color: #8C8C8C;
font-size: 28rpx;
}
.u-form-item__body {
padding: 25rpx 0;
}
.u-icon {
margin-left: 20rpx;
}
.u-upload__wrap>view {
width: 100%;
}
.previewImages {
width: 100%;
.previewImg {
width: 100% !important;
height: 240rpx !important;
}
}
.uploadeBtn {
width: 100% !important;
height: 240rpx !important;
margin-bottom: 30rpx;
margin-left: 0 !important;
}
.orderTotal {
display: none;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment