From c82c62232ea03bd592510e418f6ed998d7c61580 Mon Sep 17 00:00:00 2001 From: sankeyangshu <1260323835@qq.com> Date: Tue, 3 Dec 2024 18:09:14 +0800 Subject: [PATCH] feat: add BoatDialog --- .env.development | 4 +- src/api/Manifest/index.ts | 12 +- src/styles/element.scss | 2 + src/types/boatInfo.ts | 1 + src/types/manifest.ts | 8 + src/views/Boat/components/BoatDialog.vue | 218 ++++++++++++++++++ src/views/Boat/components/BoatTable.vue | 20 +- .../Manifest/components/ManifestTable.vue | 37 ++- 8 files changed, 278 insertions(+), 24 deletions(-) create mode 100644 src/views/Boat/components/BoatDialog.vue diff --git a/.env.development b/.env.development index 285170f..4967fcb 100644 --- a/.env.development +++ b/.env.development @@ -8,5 +8,5 @@ NODE_ENV = 'development' # 本地环境接口地址 # 如果没有跨域问题,直接在这里配置即可 # VITE_APP_BASE_API = 'http://192.168.1.116:8080' -VITE_APP_BASE_API = 'http://121.41.36.72:8080' -# VITE_APP_BASE_API = 'https://3lp9319797lh.vicp.fun' +# VITE_APP_BASE_API = 'http://121.41.36.72:8080' +VITE_APP_BASE_API = 'http://www.cvlip.com' diff --git a/src/api/Manifest/index.ts b/src/api/Manifest/index.ts index 9047296..da59a92 100644 --- a/src/api/Manifest/index.ts +++ b/src/api/Manifest/index.ts @@ -1,5 +1,5 @@ import { PageRowsResult } from '@/types'; -import { ManifestPageType, ManifestType } from '@/types/manifest'; +import { ManifestListType, ManifestPageType, ManifestType } from '@/types/manifest'; import http from '@/utils/request'; // api接口 @@ -7,6 +7,7 @@ const api = { manifestDel: '/cargo/manifest/delete', // 删除 manifestGet: '/cargo/manifest/get', // 获取 manifestPage: '/cargo/manifest/subscribe/page', // 我订阅的分页列表 + manifestList: '/cargo/manifest/subscribe/list', // 我订阅的非分页列表 manifestSave: '/cargo/manifest/save', // 保存 manifestImport: '/cargo/manifest/import', // 舱单导入 manifestExport: '/cargo/manifest/tmp/export', // 下载模版 @@ -40,6 +41,15 @@ export function getManifestPageAPI(data: Partial) { return http.post>(api.manifestPage, data); } +/** + * 舱单非分页列表 + * @param {ManifestListType} data 查询参数 + * @return 返回请求分页列表接口的结果 + * */ +export function getManifestListAPI(data: ManifestListType) { + return http.postParams(api.manifestList, data); +} + /** * 舱单保存 * @param {ManifestType} data 参数 diff --git a/src/styles/element.scss b/src/styles/element.scss index 29f4b83..64df796 100644 --- a/src/styles/element.scss +++ b/src/styles/element.scss @@ -5,6 +5,8 @@ } .el-table .el-table__header th { background: #005478 !important; + border-right: 1px solid #555 !important; + border-bottom: none !important; } .el-table, .el-table__expanded-cell { diff --git a/src/types/boatInfo.ts b/src/types/boatInfo.ts index ca141b8..e664a05 100644 --- a/src/types/boatInfo.ts +++ b/src/types/boatInfo.ts @@ -26,6 +26,7 @@ export interface BoatInfoType { tradeType: string; loadPortId: number | string; loadPort: PortType; + dischargePort: PortType; dischargePortId: number | string; ship: ShipType; route: BoatRouteType; diff --git a/src/types/manifest.ts b/src/types/manifest.ts index 74247ea..fdf2a58 100644 --- a/src/types/manifest.ts +++ b/src/types/manifest.ts @@ -51,6 +51,14 @@ export interface ManifestPageType extends PageRowsType { subWharfId: number; } +/** + * 舱单非分页参数类型 + */ +export interface ManifestListType { + scheduleId: number | string; + desk?: number | string; +} + /** * 舱单明细类型 */ diff --git a/src/views/Boat/components/BoatDialog.vue b/src/views/Boat/components/BoatDialog.vue new file mode 100644 index 0000000..42bc1e8 --- /dev/null +++ b/src/views/Boat/components/BoatDialog.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/src/views/Boat/components/BoatTable.vue b/src/views/Boat/components/BoatTable.vue index 47655ee..3b6ae46 100644 --- a/src/views/Boat/components/BoatTable.vue +++ b/src/views/Boat/components/BoatTable.vue @@ -10,6 +10,7 @@ max-height="400px" v-el-table-infinite-scroll="tableDataLoad" :infinite-scroll-disabled="disabled" + @row-click="onClickOpenDetail" > @@ -41,13 +42,13 @@ /> - + @@ -59,6 +60,8 @@
仅列出最近十日收到的订阅船期信息
+ + @@ -66,17 +69,16 @@ import dayjs from 'dayjs'; import { ElMessage, ElMessageBox } from 'element-plus'; import { computed, ref } from 'vue'; -import { - getSailScheduleExportAPI, - getSailScheduleGetAPI, - getSailSchedulePageAPI, -} from '@/api/Boat/info'; +import { getSailScheduleExportAPI, getSailSchedulePageAPI } from '@/api/Boat/info'; import { BoatInfoType } from '@/types/boatInfo'; +import BoatDialog from './BoatDialog.vue'; const handleTableData = (data: BoatInfoType[]) => { for (const item of data) { item.departureDatePlan = dayjs(item.departureDatePlan).format('YYYY-MM-DD HH:mm'); item.departureDateActual = dayjs(item.departureDateActual).format('YYYY-MM-DD HH:mm'); + item.createDate = dayjs(item.createDate).format('YYYY-MM-DD HH:mm'); + item.updateDate = dayjs(item.updateDate).format('YYYY-MM-DD HH:mm'); } return data; }; @@ -159,9 +161,9 @@ const onClickExport = () => { }; // 查看详情 +const boatDialogRef = ref | null>(null); const onClickOpenDetail = async (row: BoatInfoType) => { - const { data } = await getSailScheduleGetAPI({ id: row.id }); - console.log('🚀 ~ file: BoatTable.vue:146 ~ onClickOpenDetail ~ data:', data); + boatDialogRef.value?.isShowDialog(row); }; diff --git a/src/views/Manifest/components/ManifestTable.vue b/src/views/Manifest/components/ManifestTable.vue index 919b79f..c4121f3 100644 --- a/src/views/Manifest/components/ManifestTable.vue +++ b/src/views/Manifest/components/ManifestTable.vue @@ -27,7 +27,7 @@
@@ -57,6 +57,7 @@ :data="tableState.tableData" style="width: 100%; height: 100%" > + @@ -100,7 +101,7 @@ 舱单导出
-