From 15e172394ee1fa1d35847190bf2dc6c083bda20c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com>
Date: Wed, 18 Oct 2023 17:29:57 +0800
Subject: [PATCH] 10/18
---
src/Views/BookingOrder/index.vue | 281 +++++++++++++++++++++++++++----
src/api/Index.js | 13 +-
src/components/SearchBox.vue | 2 +
src/components/TableBox.vue | 2 +-
4 files changed, 259 insertions(+), 39 deletions(-)
diff --git a/src/Views/BookingOrder/index.vue b/src/Views/BookingOrder/index.vue
index c2a4c5f..f88e194 100644
--- a/src/Views/BookingOrder/index.vue
+++ b/src/Views/BookingOrder/index.vue
@@ -23,6 +23,17 @@
:before-close="dialogF"
:fullscreen="true"
>
+
+ 刷新
+ 保存
+
+ 上一票
+
+
+ 下一票
+
+ 返回
+
@@ -90,7 +101,10 @@
-
+
+
+
+ 服务项目
+
+
+ {{ item.value }}
+
+
船舶动态
@@ -888,9 +914,28 @@
文件列表
-
- {{ item.fileName }}
-
+
+
+
+
+ {{ item.fileName }}
+
+
+
+
+ {{ item.typeName }}
+
+
+
+ {{ item.createByName ? item.createByName : "-" }}
+
+
+
+ {{ item.createTime }}
+
+
+
+
@@ -1097,11 +1142,15 @@ import SearchBox from "@/components/SearchBox.vue";
import TableBox from "@/components/TableBox.vue";
import {
bookingOrderList,
+ bookingOrderSave,
bookingOrderInfo,
bookingTemplateSave,
bookingTemplateDelete,
+ tenantDownFile,
} from "@/api/Index";
+import { useStore } from "vuex";
import { ref, reactive } from "vue";
+import { ElMessage } from "element-plus";
export default {
name: "ViewBooking",
components: {
@@ -1109,6 +1158,7 @@ export default {
TableBox,
},
setup() {
+ const store = useStore();
const dialogFormVisible = ref(false);
const DialogForm = ref({});
const bizStatusData = [
@@ -1129,39 +1179,29 @@ export default {
name: "已驳回",
},
];
-
+ // 主提单号,订单编号,开船日期,船公司
const SearchBoxData = reactive([
{
- title: "业务状态",
- EType: "Select",
- DName: "bizStatus",
- SelectList: bizStatusData,
- },
- {
- title: "代码",
+ title: "主提单号",
EType: "Input",
- DName: "title",
+ DName: "mblNo",
},
{
- title: "名称",
+ title: "订单编号",
EType: "Input",
- DName: "name",
+ DName: "billNo",
},
{
- title: "地址",
- EType: "Input",
- DName: "addr",
- },
- {
- title: "模板内容",
- EType: "Input",
- DName: "content",
+ title: "开船日期",
+ EType: "DatePicker",
+ DName: "etdBegin",
+ DName2: "etdEnd",
},
{
- title: "订舱日期",
- EType: "DatePicker",
- DName: "createTimeBegin",
- DName2: "createTimeEnd",
+ title: "船公司",
+ EType: "Select",
+ DName: "carrierCode",
+ SelectList: store.state.Data.Carrierlist,
},
]);
const ClickAdd = () => {
@@ -1187,25 +1227,33 @@ export default {
// return ;
};
const TableData = reactive([
+ { label: "船公司代号", prop: "carrierCode" },
{ label: "订单编号", prop: "billNo" },
+ { label: "主提单号", prop: "mblNo" },
{
- label: "业务状态",
- prop: "bizStatus",
- StateType: "multiple",
- StateChange: bizStatusData,
+ label: "船名/航次",
+ prop: "vessel",
+ multiple: true,
+ multipleData: ["vessel", "voyageNo"],
},
- { label: "船公司代号", prop: "carrierCode" },
- { label: "提单号", prop: "mblNo" },
+ { label: "开船日期", prop: "etdBegin" },
{
- label: "船名/航次",
+ label: "箱型/箱量",
prop: "vessel",
multiple: true,
multipleData: ["vessel", "voyageNo"],
},
- { label: "订舱日期", prop: "createTime", width: "100" },
- { label: "操作人", prop: "createByName" },
+ {
+ label: "业务状态",
+ prop: "bizStatus",
+ StateType: "multiple",
+ StateChange: bizStatusData,
+ },
+
+ // { label: "订舱日期", prop: "createTime", width: "100" },
+ // { label: "操作人", prop: "createByName" },
// { label: "航次", prop: "createTimeEnd" },
- { label: "开船日期", prop: "etdBegin" },
+
// { label: "航次", prop: "etdEnd" },
{
label: "操作",
@@ -1268,6 +1316,113 @@ export default {
const TableRowDblclick = (e) => {
ClickEdit(e);
};
+ const FnClick = (uploadFile) => {
+ console.log(uploadFile);
+ tenantDownFile({
+ businessLicenseUrl: uploadFile.filePath,
+ }).then((res) => {
+ console.log(res);
+ const blob = new Blob([res]);
+ // for IE
+ if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+ const fileName = uploadFile.fileName;
+ window.navigator.msSaveOrOpenBlob(blob, fileName);
+ } else {
+ // for Non-IE (chrome, firefox etc.)
+ const fileName = uploadFile.fileName;
+ const elink = document.createElement("a");
+ elink.download = fileName;
+ elink.style.display = "none";
+ elink.href = URL.createObjectURL(blob);
+ document.body.appendChild(elink);
+ elink.click();
+ URL.revokeObjectURL(elink.href);
+ document.body.removeChild(elink);
+ }
+ });
+ };
+ const FnRefresh = () => {
+ ClickEdit(DialogForm.value);
+ };
+ const FnSave = () => {
+ let ApiData = {
+ customRemark: DialogForm.value.customRemark,
+ id: DialogForm.value.id,
+ };
+ bookingOrderSave(ApiData).then((res) => {
+ if (res.code == 200) {
+ ElMessage({
+ message: "保存成功",
+ type: "success",
+ });
+ }
+ });
+ };
+ const FnChangePage = (type) => {
+ let NID = "";
+ let currentPage = TableBoxRef.value.search_data.currentPage;
+ let pageSize = TableBoxRef.value.search_data.pageSize;
+ let total = TableBoxRef.value.search_data.total;
+ let TData = TableBoxRef.value.TData;
+ TData.forEach((item, index) => {
+ if (item.id == DialogForm.value.id) {
+ if (type === "prev") {
+ if (index == 0) {
+ if (currentPage == 1) {
+ ElMessage({
+ message: "已是第一票",
+ type: "warning",
+ });
+ } else {
+ --TableBoxRef.value.search_data.currentPage;
+ TableBoxRef.value.Search();
+ let ApiData = { ...TableBoxRef.value.search_data };
+ console.log("查询", ApiData);
+ bookingOrderList(ApiData).then((res) => {
+ if (res.code == 200) {
+ console.log(res.data.list);
+ NID = res.data.list[9].id;
+ ClickEdit({ id: NID });
+ }
+ });
+ }
+ } else {
+ NID = TData[index - 1].id;
+ }
+ } else {
+ console.log(TData);
+ if (index < TData.length - 1) {
+ console.log(index, TData.length - 1);
+ NID = TData[index + 1].id;
+ } else {
+ let Y = Math.ceil(total / pageSize);
+ console.log(Y);
+ if (currentPage < Y) {
+ ++TableBoxRef.value.search_data.currentPage;
+ TableBoxRef.value.Search();
+ let ApiData = { ...TableBoxRef.value.search_data };
+ console.log("查询", ApiData);
+ bookingOrderList(ApiData).then((res) => {
+ if (res.code == 200) {
+ console.log(res.data.list);
+ NID = res.data.list[0].id;
+ ClickEdit({ id: NID });
+ }
+ });
+ } else {
+ ElMessage({
+ message: "已是最后一票",
+ type: "warning",
+ });
+ }
+ }
+ }
+ }
+ });
+ if (NID) {
+ ClickEdit({ id: NID });
+ }
+ };
return {
bizStatusData,
DialogForm,
@@ -1284,6 +1439,10 @@ export default {
dialogF,
dialogS,
TableRowDblclick,
+ FnClick,
+ FnRefresh,
+ FnSave,
+ FnChangePage,
};
},
};
@@ -1291,6 +1450,10 @@ export default {
diff --git a/src/api/Index.js b/src/api/Index.js
index 860c413..c4d6ed8 100644
--- a/src/api/Index.js
+++ b/src/api/Index.js
@@ -230,7 +230,17 @@ const bookingOrderList = (params) => {
},
});
};
-
+// 保存客户订单(2023-10增加)
+const bookingOrderSave = (data) => {
+ return request({
+ data: {
+ url: "/api/bookingAip/bookingOrder/save",
+ method: "post",
+ data,
+ // headers: { Authorization: localStorage.getItem("token") },
+ },
+ });
+};
// 船公司信息
const GetCarrierlist = (params) => {
return request({
@@ -544,6 +554,7 @@ export {
bookingTemplateDelete,
bookingOrderInfo,
bookingOrderList,
+ bookingOrderSave,
GetCarrierlist,
GetCtnlist,
Getportloadlist,
diff --git a/src/components/SearchBox.vue b/src/components/SearchBox.vue
index efb4c03..7817067 100644
--- a/src/components/SearchBox.vue
+++ b/src/components/SearchBox.vue
@@ -31,6 +31,7 @@
class="ECs"
v-model="Data[item.DName]"
:placeholder="`请输入${item.title}`"
+ clearable
/>
-
+