From 12bcbe75bc54e81ad6ae98b045210f79b5c6a6c0 Mon Sep 17 00:00:00 2001 From: qiankanghui Date: Wed, 21 Oct 2026 13:23:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(inspection):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=BF=90=E8=BE=93=E6=96=B9=E5=BC=8F=E4=B8=8B=E6=8B=89=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E4=B8=BA=E5=8A=A8=E6=80=81=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将检验请求列表中的运输方式选项改为动态绑定shipMethodOptions - 添加listActiveShipMethods API调用来获取启用的运输方式 - 在页面初始化时加载运输方式选项数据 - 优化运输方式选择的数据结构和显示逻辑 --- .../inspection/inspectionRequestList.vue | 49 ++++++++++++++--- src/views/modules/order/poOrder.vue | 10 ++-- src/views/modules/port/portTransit.vue | 55 ++++++++++++------- 3 files changed, 79 insertions(+), 35 deletions(-) diff --git a/src/views/modules/inspection/inspectionRequestList.vue b/src/views/modules/inspection/inspectionRequestList.vue index 6187adb..fe2afa0 100644 --- a/src/views/modules/inspection/inspectionRequestList.vue +++ b/src/views/modules/inspection/inspectionRequestList.vue @@ -407,9 +407,12 @@ @@ -473,9 +476,12 @@ @@ -919,9 +925,12 @@ @@ -1124,6 +1133,7 @@ import ComInspectionRequestAttachmentTab from './com_inspectionRequestAttachment import ComInspectionRequestFeeTab from './com_inspectionRequestFeeTab.vue' import { fetchSupplierDetail } from '@/utils/supplierChooselistHelper' import excel from '@/utils/excel-util.js' +import { listActiveShipMethods } from '@/api/port/portTransit.js' export default { props: { @@ -1161,6 +1171,7 @@ export default { currentRow: {}, tagNo: '', searchType: '', + shipMethodOptions: [], // 供应商模式上下文:来自 /sys/user/info(user.supplierNo / user.supplierName) currentSupplierNo: '', currentSupplierName: '', @@ -1701,12 +1712,32 @@ export default { removeMainTableResizeListener () { window.removeEventListener('resize', this.handleMainTableResize) }, + /** + * 加载启用的运输方式下拉选项。 + * 数据来源:POST /portTransitCycle/shipMethodList(仅 active=Y) + * 以 methodDesc 作为选项 label 与 value,与订单/港口周期表存储的运输方式描述保持一致。 + */ + loadShipMethodOptions () { + return listActiveShipMethods().then(({ data }) => { + if (data && data.code === 0) { + this.shipMethodOptions = (data.rows || []).map(item => ({ + label: item.methodDesc, + value: item.methodDesc + })) + } else { + this.shipMethodOptions = [] + } + }).catch(() => { + this.shipMethodOptions = [] + }) + }, /** * 页面初始化入口: * - 通用模式:直接查询; * - 供应商模式:先加载当前用户供应商信息,再按供应商过滤查询。 */ async initPageData () { + this.loadShipMethodOptions() if (!this.isSupplierPageMode) { this.getMainData() return diff --git a/src/views/modules/order/poOrder.vue b/src/views/modules/order/poOrder.vue index 239d4d6..009f02f 100644 --- a/src/views/modules/order/poOrder.vue +++ b/src/views/modules/order/poOrder.vue @@ -3965,7 +3965,7 @@ export default { return } - if (tag === 2019) { + if (tag === 532) { const via = data.method_desc || data.methodDesc || data.shipVia || '' if (ctx === 'add') { this.addForm.shipVia = via @@ -4927,7 +4927,7 @@ export default { }) }, - // 新增 schema 中若展示运输方式(ship_via / S_Method),则默认填充为海运 + // 新增 schema 中若展示运输方式(ship_via / S_Method),则默认填充为 Ocean applyAddDefaultShipViaBySchema (targetForm) { if (!targetForm || !Array.isArray(this.addFormSchemaFields) || !this.addFormSchemaFields.length) { return @@ -4942,7 +4942,7 @@ export default { } const current = targetForm[prop] if (current === undefined || current === null || String(current).trim() === '') { - this.$set(targetForm, prop, '海运') + this.$set(targetForm, prop, 'Ocean') } }, @@ -5298,7 +5298,7 @@ export default { }, openAddShipViaSelect (target = 'master') { const context = target === 'detail' ? 'addDetail' : 'add' - this.openEamList(2019, '', '', context, 'shipVia') + this.openEamList(532, '', '', context, 'shipVia') }, buildMergedAddDetailForm (detailRow) { @@ -5438,7 +5438,7 @@ export default { openShipViaSelect (row) { this.currentShipViaRow = row - this.openEamList(2019, '', '', 'row', 'shipVia') + this.openEamList(532, '', '', 'row', 'shipVia') }, /** diff --git a/src/views/modules/port/portTransit.vue b/src/views/modules/port/portTransit.vue index 594ede6..8c6dd84 100644 --- a/src/views/modules/port/portTransit.vue +++ b/src/views/modules/port/portTransit.vue @@ -95,7 +95,7 @@ -
+
运输周期
-