Commit 2ccab2b7 authored by wanglianghe's avatar wanglianghe

到港,todo,realHeadTravelTime,voyage

parent 3c2659f7
<template>
<div>
<el-form ref="arrivalForm" :rules="rules" :model="arrivalObj" label-width="120px">
<el-form-item :label="$t('预计到港时间')">{{getExpectedTime()}}</el-form-item>
<el-form ref="arrivalForm" :rules="rules" :model="airArrivalInfo" label-width="120px">
<!-- <el-form-item :label="$t('预计到港时间')">{{getExpectedTime()}}</el-form-item>
<el-form-item :label="$t('实际到港时间')" prop="apRealTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apRealTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
......@@ -9,10 +9,19 @@
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apConfirmTime" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
<p class="message-area" v-show="showMsg">{{$t('请确认是否有异常,如有异常请进行异常登记')}}</p>
</el-form-item> -->
<el-form-item :label="$t('实际二程起飞时间')" prop="actSecondTime" v-show="this.$attrs.shipmentObj.bookAirInfo.voyage">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.actSecondTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('预计到港时间')" prop="estTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.estTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
<el-form-item :label="$t('卸港时间')">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="arrivalObj.apUnloadPortTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<el-form-item :label="$t('实际到港时间')" prop="actTime">
<el-date-picker type="datetime" :placeholder="$t('请选择日期')" v-model="airArrivalInfo.actTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-row class="operate-button">
......@@ -32,7 +41,7 @@
<script>
import regError from "../../regError";
import dayjs from "dayjs";
import { arrivalCreate } from "@/api/ecw/boxSea";
import { arrivalCreate } from "@/api/ecw/boxSeaAir";
import { formatDateStr, serviceMsg } from "../utils";
/**
......@@ -47,12 +56,15 @@ export default {
data() {
return {
// 到港对象
arrivalObj: {},
airArrivalInfo: {},
// 校验
rules: {
apRealTime: [
actSecondTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
],
actTime: [
{ required: true, message: this.$t("必填"), trigger: "change" },
]
},
// 弹窗配置
dialogVisible: false,
......@@ -68,16 +80,23 @@ export default {
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(
oldData,
["apRealTime", "apConfirmTime"],
["actSecondTime", "estTime", "actTime"],
"YYYY-MM-DD HH:mm:ss"
);
oldData = formatDateStr(oldData, ["apUnloadPortTime"]);
this.arrivalObj = oldData;
this.airArrivalInfo = oldData;
},
watch: {
// 确认到港时间
"arrivalObj.apConfirmTime"(val) {
this.compareDate(this.getExpectedTime(), val);
// 实际二程起飞时间
"airArrivalInfo.actSecondTime"(val) {
this.compareDate(this.getHeadTravelTime(), val);
},
"airArrivalInfo.estTime"(val) {
this.compareDate(this.airArrivalInfo.actTime, val);
},
"airArrivalInfo.actTime"(val) {
this.compareDate(this.airArrivalInfo.estTime, val);
},
},
methods: {
......@@ -88,10 +107,10 @@ export default {
}
},
// 获取预计到港时间
getExpectedTime() {
getHeadTravelTime() {
const { shippingInfo } = this.$attrs.shipmentObj;
if (shippingInfo) {
return dayjs(shippingInfo.dtEstArrivalTime).format(
return dayjs(shippingInfo.realHeadTravelTime).format(
"YYYY-MM-DD HH:mm:ss"
);
}
......@@ -120,7 +139,7 @@ export default {
this.$refs["arrivalForm"].validate((valid) => {
if (valid) {
arrivalCreate({
...this.arrivalObj,
...this.airArrivalInfo,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
......
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