Commit b58a0ec1 authored by huhaiqing's avatar huhaiqing

订舱拖车修改功能开发

parent e03f1a79
...@@ -8,6 +8,14 @@ import request from "@/utils/request"; ...@@ -8,6 +8,14 @@ import request from "@/utils/request";
* @return {*} * @return {*}
*/ */
export function booking(data) { export function booking(data) {
if (data.id) {
return request({
url: "/ecw/box-book-sea/update",
method: "put",
data,
});
}
return request({ return request({
url: "/ecw/box-book-sea/create", url: "/ecw/box-book-sea/create",
method: "post", method: "post",
...@@ -23,6 +31,13 @@ export function booking(data) { ...@@ -23,6 +31,13 @@ export function booking(data) {
* @return {*} * @return {*}
*/ */
export function trailer(data) { export function trailer(data) {
if (data.id) {
return request({
url: "/ecw/box-trailer/update",
method: "put",
data,
});
}
return request({ return request({
url: "/ecw/box-trailer/create", url: "/ecw/box-trailer/create",
method: "post", method: "post",
......
...@@ -89,6 +89,7 @@ import { booking, serviceMsg } from "@/api/ecw/boxSea"; ...@@ -89,6 +89,7 @@ import { booking, serviceMsg } from "@/api/ecw/boxSea";
import supplierSelect from "./common/supplierSelect.vue"; import supplierSelect from "./common/supplierSelect.vue";
import dockSelect from "./common/dockSelect.vue"; import dockSelect from "./common/dockSelect.vue";
import userSelect from "./common/userSelect.vue"; import userSelect from "./common/userSelect.vue";
import { formatStringNumber, formatDateStr } from "../utils";
/** /**
* 订舱 * 订舱
*/ */
...@@ -114,7 +115,13 @@ export default { ...@@ -114,7 +115,13 @@ export default {
}, },
}; };
}, },
created() {}, created() {
const voName = this.$attrs.currNode.voName;
let oldData = { ...this.shipmentObj[voName] };
oldData = formatStringNumber(oldData, ["shipCompanyType", "spaceCompany"]);
oldData = formatDateStr(oldData, ["sailTime", "bargeTime"]);
this.bookingObj = oldData;
},
methods: { methods: {
/** 提交 */ /** 提交 */
onSubmit() { onSubmit() {
...@@ -126,15 +133,15 @@ export default { ...@@ -126,15 +133,15 @@ export default {
operateType: 2, operateType: 2,
}).then((res) => { }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.cancel(); this.cancel("submit");
}); });
}); });
} }
}); });
}, },
/** 取消 */ /** 取消 */
cancel() { cancel(type) {
this.$emit("closeDialog"); this.$emit("closeDialog", type);
}, },
}, },
}; };
......
...@@ -39,6 +39,11 @@ ...@@ -39,6 +39,11 @@
<script> <script>
import { trailer, serviceMsg } from "@/api/ecw/boxSea"; import { trailer, serviceMsg } from "@/api/ecw/boxSea";
import supplierSelect from "./common/supplierSelect.vue"; import supplierSelect from "./common/supplierSelect.vue";
import {
formatStringNumber,
formatDateStr,
formatNumberString,
} from "../utils";
/** /**
* 拖车 * 拖车
*/ */
...@@ -56,6 +61,15 @@ export default { ...@@ -56,6 +61,15 @@ export default {
}, },
}; };
}, },
created() {
const { currNode, shipmentObj } = this.$attrs;
const voName = currNode.voName;
let oldData = { ...shipmentObj[voName] };
oldData = formatNumberString(oldData, ["tlContainerStatus"]);
oldData = formatStringNumber(oldData, ["tlCompanyId"]);
oldData = formatDateStr(oldData, ["tlTime"]);
this.trailerObj = oldData;
},
methods: { methods: {
/** 提交 */ /** 提交 */
onSubmit(operateType) { onSubmit(operateType) {
...@@ -67,15 +81,15 @@ export default { ...@@ -67,15 +81,15 @@ export default {
operateType, operateType,
}).then((res) => { }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.cancel(); this.cancel("submit");
}); });
}); });
} }
}); });
}, },
/** 取消 */ /** 取消 */
cancel() { cancel(type) {
this.$emit("closeDialog"); this.$emit("closeDialog", type);
}, },
}, },
}; };
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</el-scrollbar> </el-scrollbar>
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog custom-class="shipping-dialog" :title="dialogConfig.title" :visible.sync="dialogConfig.dialogVisible" :width="dialogConfig.width" :fullscreen="dialogConfig.fullscreen" :close-on-click-modal=false :modal-append-to-body=false append-to-body destroy-on-close> <el-dialog custom-class="shipping-dialog" :title="dialogConfig.title" :visible.sync="dialogConfig.dialogVisible" :width="dialogConfig.width" :fullscreen="dialogConfig.fullscreen" :close-on-click-modal=false :modal-append-to-body=false append-to-body>
<component v-bind:is="currentComponent" @closeDialog="closeDialog" v-bind="$attrs" :shipmentObj="shipmentObj"></component> <component v-bind:is="currentComponent" v-if="dialogConfig.dialogVisible" @closeDialog="closeDialog" v-bind="$attrs" :shipmentObj="shipmentObj" :currNode="currNode"></component>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -89,13 +89,18 @@ export default { ...@@ -89,13 +89,18 @@ export default {
currIndex: 0, currIndex: 0,
// 当前步骤节点状态 // 当前步骤节点状态
currNodeStatus: "", currNodeStatus: "",
// 当前节点
currNode: {},
}; };
}, },
created() {}, created() {},
methods: { methods: {
/** 关闭弹窗 */ /** 关闭弹窗 */
closeDialog() { closeDialog(type) {
this.$set(this.dialogConfig, "dialogVisible", false); this.$set(this.dialogConfig, "dialogVisible", false);
if (type === "submit") {
this.$emit("getBoxInfo");
}
}, },
/** 节点点击 */ /** 节点点击 */
nodeClick(currIndex, node) { nodeClick(currIndex, node) {
...@@ -103,6 +108,7 @@ export default { ...@@ -103,6 +108,7 @@ export default {
this.$message.error("请先完成上一步"); this.$message.error("请先完成上一步");
return; return;
} }
this.currNode = node;
this.currentComponent = `${node.type}Widget`; this.currentComponent = `${node.type}Widget`;
this.$set(this.dialogConfig, "width", "500px"); this.$set(this.dialogConfig, "width", "500px");
this.$set(this.dialogConfig, "title", node.title); this.$set(this.dialogConfig, "title", node.title);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-scrollbar :vertical="true"> <el-scrollbar :vertical="true">
<div class="shipping-step"> <div class="shipping-step">
<template v-for="(step, index) in flatSeaStep"> <template v-for="(step, index) in flatSeaStep">
<div :key="index" v-if="shipmentObj[step.voName]" class="step-table"> <div :key="index" v-if="shipmentObj[step.voName] && columnsMapping[step.voName]" class="step-table">
<div class="step-title">{{step.title}}</div> <div class="step-title">{{step.title}}</div>
<div v-for="(data, index) in columnsMapping[step.voName]" :key="index" class="step-content"> <div v-for="(data, index) in columnsMapping[step.voName]" :key="index" class="step-content">
<p>{{data.title}}</p> <p>{{data.title}}</p>
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
{ {
title: "拖车公司", title: "拖车公司",
key: "tlCompanyId", key: "tlCompanyId",
type: "supplier",
}, },
{ {
title: "拖车时间", title: "拖车时间",
...@@ -116,10 +117,6 @@ export default { ...@@ -116,10 +117,6 @@ export default {
title: "联系方式", title: "联系方式",
key: "tlDriverContact", key: "tlDriverContact",
}, },
{
title: "联系方式",
key: "tlDriverContact",
},
{ {
title: "业务员", title: "业务员",
key: "operator", key: "operator",
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</el-card> </el-card>
<!-- 海运流程图 --> <!-- 海运流程图 -->
<seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" @setStatus="setStatus" /> <seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" @setStatus="setStatus" @getBoxInfo="getBoxInfo" />
<!-- 海运步骤图 --> <!-- 海运步骤图 -->
<seaStepDetail :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" /> <seaStepDetail :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" />
...@@ -43,7 +43,7 @@ import { getWarehouseList } from "@/api/ecw/warehouse"; ...@@ -43,7 +43,7 @@ import { getWarehouseList } from "@/api/ecw/warehouse";
import { getSupplierPage } from "@/api/ecw/supplier"; import { getSupplierPage } from "@/api/ecw/supplier";
import { getDockPage } from "@/api/ecw/dock"; import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user"; import { listUser } from "@/api/system/user";
import { statusName, seaBaseData } from "./constant"; import { statusName, seaBaseData } from "./utils";
/** /**
* 海运操作主页面 * 海运操作主页面
...@@ -74,11 +74,7 @@ export default { ...@@ -74,11 +74,7 @@ export default {
}; };
}, },
created() { created() {
// 出货 this.getBoxInfo();
getbox(this.shipmentId).then((res) => {
const { data } = res;
this.shipmentObj = data ?? {};
});
// 仓库 // 仓库
getWarehouseList().then((r) => { getWarehouseList().then((r) => {
this.warehouseList = r.data; this.warehouseList = r.data;
...@@ -114,6 +110,13 @@ export default { ...@@ -114,6 +110,13 @@ export default {
setStatus(status) { setStatus(status) {
this.statusLabel = statusName.get(status); this.statusLabel = statusName.get(status);
}, },
// 出货
getBoxInfo() {
getbox(this.shipmentId).then((res) => {
const { data } = res;
this.shipmentObj = data ?? {};
});
},
}, },
}; };
</script> </script>
......
import dayjs from "dayjs";
const statusName = new Map(); const statusName = new Map();
statusName.set(11, "未订舱"); statusName.set(11, "未订舱");
...@@ -377,4 +379,37 @@ const seaBaseData = [ ...@@ -377,4 +379,37 @@ const seaBaseData = [
], ],
]; ];
export { statusName, seaBaseData }; function formatStringNumber(obj, keys) {
for (const [key, value] of Object.entries(obj)) {
if (keys.includes(key) && !Number.isNaN(Number(value))) {
obj[key] = Number(value);
}
}
return obj;
}
function formatNumberString(obj, keys) {
for (const [key, value] of Object.entries(obj)) {
if (keys.includes(key) && value) {
obj[key] = String(value);
}
}
return obj;
}
function formatDateStr(obj, keys) {
for (const [key, value] of Object.entries(obj)) {
if (keys.includes(key) && dayjs(value).isValid()) {
obj[key] = dayjs(value).format("YYYY-MM-DD");
}
}
return obj;
}
export {
statusName,
seaBaseData,
formatStringNumber,
formatDateStr,
formatNumberString,
};
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