Commit 93b54feb authored by huhaiqing's avatar huhaiqing

海运操作功能完善

parent fe444933
......@@ -151,6 +151,13 @@ export function billCreate(data) {
* @return {*}
*/
export function bargeCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-barge/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-barge/create",
method: "post",
......@@ -166,6 +173,13 @@ export function bargeCreate(data) {
* @return {*}
*/
export function shippingCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-shipping/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-shipping/create",
method: "post",
......@@ -181,6 +195,13 @@ export function shippingCreate(data) {
* @return {*}
*/
export function ladingCopyCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-lading-copy/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-lading-copy/create",
method: "post",
......@@ -196,6 +217,13 @@ export function ladingCopyCreate(data) {
* @return {*}
*/
export function clearanceDocCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-clearance-doc/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-clearance-doc/create",
method: "post",
......@@ -211,6 +239,13 @@ export function clearanceDocCreate(data) {
* @return {*}
*/
export function arrivalCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-arrival/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-arrival/create",
method: "post",
......@@ -226,6 +261,13 @@ export function arrivalCreate(data) {
* @return {*}
*/
export function clearanceCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-clearance/update",
method: "put",
data,
});
}
return request({
url: "/ecw/box-clearance/create",
method: "post",
......
<template>
<div>
<el-form ref="arrivalForm" :rules="rules" :model="arrivalObj" label-width="120px">
<el-form-item label="预计到港时间">{{arrivalObj.expectedTime}}</el-form-item>
<el-form-item label="预计到港时间">{{getExpectedTime()}}</el-form-item>
<el-form-item label="实际到港时间" prop="apRealTime">
<el-date-picker type="datetime" placeholder="请选择日期" v-model="arrivalObj.apRealTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
......@@ -33,6 +33,7 @@
import regError from "./regError";
import dayjs from "dayjs";
import { arrivalCreate, serviceMsg } from "@/api/ecw/boxSea";
import { formatDateStr } from "../utils";
/**
* 到港
......@@ -57,17 +58,29 @@ export default {
showMsg: false,
};
},
watch: {
// 预计到港时间
"arrivalObj.expectedTime"(val) {
this.compareDate(val, this.arrivalObj.apConfirmTime);
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, [
"apRealTime",
"apConfirmTime",
"apUnloadPortTime",
]);
this.arrivalObj = oldData;
},
watch: {
// 确认到港时间
"arrivalObj.apConfirmTime"(val) {
this.compareDate(this.arrivalObj.expectedTime, val);
this.compareDate(this.getExpectedTime(), val);
},
},
methods: {
// 获取预计到港时间
getExpectedTime() {
return dayjs(
this.$attrs.shipmentObj.shippingInfo.dtEstArrivalTime
).format("YYYY-MM-DD");
},
// 时间比较
compareDate(expectedTime, apConfirmTime) {
this.showMsg = false;
......@@ -76,7 +89,7 @@ export default {
if (expectedTime) date1 = dayjs(expectedTime);
if (apConfirmTime) date2 = dayjs(apConfirmTime);
if (date1 && date2) {
const days = date2.date() - date1.date();
const days = date2.diff(date1, "day");
if (days > 5) {
this.showMsg = true;
}
......@@ -96,15 +109,15 @@ export default {
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel() {
this.$emit("closeDialog");
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
......
......@@ -37,6 +37,7 @@
<script>
import { bargeCreate, serviceMsg } from "@/api/ecw/boxSea";
import userSelect from "./common/userSelect.vue";
import { constantDict, formatDateStr, formatNumberString } from "../utils";
/**
* 驳船
......@@ -49,17 +50,8 @@ export default {
return {
// 驳船对象
bargeObj: {},
// 驳船
bargeStatus: [
{
value: "1",
label: "无驳船",
},
{
value: "2",
label: "有驳船",
},
],
// 驳船状态
bargeStatus: constantDict.bgExmtStatus,
// 校验
rules: {
bgExmtStatus: [{ required: true, message: "必填", trigger: "change" }],
......@@ -69,7 +61,8 @@ export default {
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
console.log(oldData)
oldData = formatDateStr(oldData, ["bgEstShipTime", "bgRealShipTime"]);
oldData = formatNumberString(oldData, ["bgExmtStatus"]);
this.bargeObj = oldData;
},
methods: {
......
......@@ -29,6 +29,12 @@ export default {
blCopyObj: {},
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
this.blCopyObj = oldData;
this.blCopyObj.copyUrl = [];
},
methods: {
/** 提交 */
onSubmit(operateType) {
......@@ -40,15 +46,15 @@ export default {
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel() {
this.$emit("closeDialog");
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
......
......@@ -72,6 +72,7 @@
<script>
import { clearanceDocCreate, serviceMsg } from "@/api/ecw/boxSea";
import { constantDict, formatDateStr, formatNumberString } from "../utils";
/**
* 清关文件
*/
......@@ -83,29 +84,27 @@ export default {
// 清关文件对象
cDocObj: {},
// 出单方式
method: [
{
value: "1",
label: "电放",
},
{
value: "2",
label: "正本",
},
],
method: constantDict.billingMethod,
// 选项
status: [
{
value: "1",
label: "无需",
},
{
value: "2",
label: "已做",
},
],
status: constantDict.isFile,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, [
"cdElectricTime",
"cdSendTime",
"cdAgentlistTime",
"cdSoncapTime",
]);
oldData = formatNumberString(oldData, [
"cdOutBillType",
"cdAgentlistType",
"cdSoncapType",
]);
this.cDocObj = oldData;
},
methods: {
/** 提交 */
onSubmit(operateType) {
......@@ -117,15 +116,15 @@ export default {
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel() {
this.$emit("closeDialog");
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
......
<template>
<div>
<el-form ref="cusClearanceForm" :rules="rules" :model="cusClearanceObj" label-width="120px">
<el-form-item label="清关代理">{{cusClearanceObj.clAgentId}}</el-form-item>
<el-form-item label="清关代理">{{getClAgent('label')}}</el-form-item>
<el-form-item label="预计清关时间" prop="clEstTime">
<el-date-picker type="date" placeholder="请选择日期" v-model="cusClearanceObj.clEstTime" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
......@@ -29,6 +29,7 @@
import regError from "./regError";
import dayjs from "dayjs";
import { clearanceCreate, serviceMsg } from "@/api/ecw/boxSea";
import { formatDateStr } from "../utils";
/**
* 清关
......@@ -54,6 +55,12 @@ export default {
showMsg: false,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["clEstTime", "clClearTime"]);
this.cusClearanceObj = oldData;
},
watch: {
// 预计清关时间
"cusClearanceObj.clEstTime"(val) {
......@@ -65,6 +72,16 @@ export default {
},
},
methods: {
getClAgent(type) {
const agentId = this.$attrs.shipmentObj.agentInfo.agentId;
if (type === "label") {
return (
this.$attrs.allSupplier.find((item) => item.id === agentId)
?.companyZh ?? agentId
);
}
return agentId;
},
// 时间比较
compareDate(clEstTime, clClearTime) {
this.showMsg = false;
......@@ -72,7 +89,7 @@ export default {
date2 = null;
if (clEstTime) date1 = dayjs(clEstTime);
if (clClearTime) date2 = dayjs(clClearTime);
if (date1 && date2 && date2 !== date1) {
if (date1 && date2 && !date2.isSame(date1)) {
this.showMsg = true;
}
},
......@@ -87,18 +104,19 @@ export default {
clearanceCreate({
...this.cusClearanceObj,
shipmentId: this.$attrs.shipmentObj.id,
clAgentId: this.getClAgent(),
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel() {
this.$emit("closeDialog");
cancel(type) {
this.$emit("closeDialog", type);
},
},
};
......
......@@ -2,6 +2,7 @@
<div class="app-departure">
<el-form ref="departureForm" :rules="rules" :model="departureObj" label-width="120px">
<el-form-item label="预计开船时间">
{{getSailingTime()}}
</el-form-item>
<el-form-item label="实际开船时间">
<el-date-picker type="datetime" placeholder="请选择日期" v-model="departureObj.dtRealShipTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
......@@ -31,6 +32,8 @@
<script>
import regError from "./regError";
import { shippingCreate, serviceMsg } from "@/api/ecw/boxSea";
import dayjs from "dayjs";
import { formatDateStr } from "../utils";
/**
* 起运
......@@ -55,25 +58,27 @@ export default {
showMsg: false,
};
},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["dtRealShipTime", "dtEstArrivalTime"]);
this.departureObj = oldData;
},
watch: {
// 实际开船时间
"departureObj.dtRealShipTime"(val) {
this.compareDate(val, this.departureObj.dtEstArrivalTime);
},
// 预计到港时间
"departureObj.dtEstArrivalTime"(val) {
this.compareDate(this.departureObj.dtRealShipTime, val);
this.compareDate(val, this.getSailingTime());
},
},
methods: {
// 时间比较
compareDate(dtRealShipTime, dtEstArrivalTime) {
compareDate(dtRealShipTime, sailTime) {
this.showMsg = false;
let date1 = null,
date2 = null;
if (dtRealShipTime) date1 = new Date(dtRealShipTime);
if (dtEstArrivalTime) date2 = new Date(dtEstArrivalTime);
if (date1 && date2 && date1 > date2) {
if (dtRealShipTime) date1 = dayjs(dtRealShipTime);
if (sailTime) date2 = dayjs(sailTime);
if (date1 && date2 && date1.isAfter(date2)) {
this.showMsg = true;
}
},
......@@ -91,15 +96,21 @@ export default {
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel();
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel() {
this.$emit("closeDialog");
cancel(type) {
this.$emit("closeDialog", type);
},
// 预计开船时间
getSailingTime() {
return dayjs(this.$attrs.shipmentObj.bookSeaInfo.sailTime).format(
"YYYY-MM-DD"
);
},
},
};
......
......@@ -2,20 +2,20 @@
<div>
<el-form ref="unloadingForm" :model="unloadingObj" label-width="100px">
<el-form-item label="网点">
<el-select v-model="unloadingObj.outlets" placeholder="请选择网点">
<el-select v-model="unloadingObj.ulOutletsId" placeholder="请选择网点">
</el-select>
</el-form-item>
<el-form-item label="到仓时间">
<el-date-picker type="date" placeholder="请选择日期" v-model="unloadingObj.warehouseTime" value-format="yyyy-MM-dd"></el-date-picker>
<el-date-picker type="date" placeholder="请选择日期" v-model="unloadingObj.ulWarehouseTime" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="卸柜时间">
<el-date-picker type="datetime" placeholder="请选择日期" v-model="unloadingObj.unloadingTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<el-date-picker type="datetime" placeholder="请选择日期" v-model="unloadingObj.ulBoxTime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-form>
<el-row class="operate-button">
<el-button type="primary">保存</el-button>
<el-button type="success" @click="onSubmit">提交</el-button>
<el-button type="primary" @click="onSubmit(1)">保存</el-button>
<el-button type=" success" @click="onSubmit(2)">提交</el-button>
<el-button @click="cancel">关闭</el-button>
<el-button type="danger" @click="startUnloading">开始卸柜</el-button>
</el-row>
......@@ -29,6 +29,8 @@
<script>
import startUnloading from "./startUnloading.vue";
import { clearanceCreate, serviceMsg } from "@/api/ecw/boxSea";
import { formatDateStr } from "../../utils";
/**
* 卸柜
......@@ -40,27 +42,44 @@ export default {
data() {
return {
// 清关对象
unloadingObj: {
agent: "test111",
},
unloadingObj: {},
// 弹窗状态
dialogVisible: false,
};
},
watch: {},
created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.$attrs.shipmentObj[voName] };
oldData = formatDateStr(oldData, ["ulWarehouseTime", "ulBoxTime"]);
this.unloadingObj = oldData;
},
methods: {
/** 提交 */
onSubmit() {
onSubmit(operateType) {
this.$refs["unloadingForm"].validate((valid) => {
if (valid) {
// TODO 判断是否已经卸柜
if (operateType === 2) {
const { ulStatus } = this.$attrs.shipmentObj;
if (ulStatus !== 145) {
this.$message.warning("请先通过卸柜审批");
return;
}
}
clearanceCreate({
...this.unloadingObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType,
}).then((res) => {
serviceMsg(res, this).then(() => {
this.cancel("submit");
});
});
}
});
},
/** 取消 */
cancel() {
this.$emit("closeDialog");
cancel(type) {
this.$emit("closeDialog", "type");
},
// 开始卸柜
startUnloading() {
......
......@@ -253,6 +253,7 @@ export default {
{
title: "驳船",
key: "bgExmtStatus",
type: "bgExmtStatus",
},
{
title: "业务员",
......@@ -279,14 +280,17 @@ export default {
{
title: "agent list",
key: "cdAgentlistType",
type: "isFile",
},
{
title: "soncap",
key: "cdSoncapType",
type: "isFile",
},
{
title: "出单方式",
key: "cdOutBillType",
type: "billingMethod",
},
{
title: "寄送时间",
......@@ -302,14 +306,17 @@ export default {
{
title: "实际到港时间",
key: "apRealTime",
type: "date",
},
{
title: "确认到港",
key: "apConfirmTime",
type: "date",
},
{
title: "卸港时间",
key: "apUnloadPortTime",
type: "date",
},
{
title: "业务员",
......@@ -389,6 +396,9 @@ export default {
val = this.getDict(type, String(val));
break;
case "saExmtStatus":
case "bgExmtStatus":
case "isFile":
case "billingMethod":
val = this.getConstant(type, String(val));
break;
}
......@@ -402,7 +412,7 @@ export default {
},
getDock(id) {
return (
this.$attrs.allSupplier.find((item) => item.id === id)?.countryZh ?? id
this.$attrs.allDocks.find((item) => item.id === id)?.titleZh ?? id
);
},
getWarehouse(id) {
......
......@@ -391,6 +391,39 @@ const constantDict = {
label: "已配",
},
],
// 驳船
bgExmtStatus: [
{
value: "1",
label: "无驳船",
},
{
value: "2",
label: "有驳船",
},
],
// 出单方式
billingMethod: [
{
value: "1",
label: "电放",
},
{
value: "2",
label: "正本",
},
],
// 是否有文件
isFile: [
{
value: "1",
label: "无需",
},
{
value: "2",
label: "已做",
},
],
};
function formatStringNumber(obj, keys) {
......
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