diff --git a/src/api/order/poOrder.js b/src/api/order/poOrder.js index 74fb070..8c1e3c1 100644 --- a/src/api/order/poOrder.js +++ b/src/api/order/poOrder.js @@ -16,6 +16,9 @@ export const deletePoDetail = (data) => createAPI(`/pODetail/delete`, 'post', da //批量更新 export const batchUpdatePoDetail = (data) => createAPI(`/pODetail/batchUpdatePoDetail`, 'post', data) +/** 编辑模式同步运输周期:按行内港口/运输方式重取 ori_transit_cycle 并连带重算相关日期 */ +export const syncOriTransitCycle = (data) => createAPI(`/pODetail/syncOriTransitCycle`, 'post', data) + /** 关闭 PO 订单行(status → 已关闭) */ export const closePoDetail = (data) => createAPI(`/pODetail/closePoDetail`, 'post', data) 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..d11e38a 100644 --- a/src/views/modules/order/poOrder.vue +++ b/src/views/modules/order/poOrder.vue @@ -23,6 +23,7 @@ {{ editMode ? '确定' : '编辑' }} 取消 + 同步运输周期 新增 查看价格表 拆单到新PO @@ -30,12 +31,20 @@ + @current-change="onTableCurrentChange" + @selection-change="onSyncSelectionChange"> + + ({ + site: r.site, + orderNo: r.orderNo, + itemNo: r.itemNo, + customer: r.customer, + departure: r.departure, + destination: r.destination, + shipVia: r.shipVia, + wantReceiveDate: r.wantReceiveDate, + narrival: r.narrival + })) + this.$confirm(`将同步 ${rows.length} 行的运输周期与相关日期,确定继续?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + syncOriTransitCycle(payload).then(({ data }) => { + if (data && data.code === 0) { + const d = data.data || {} + const s = d.summary || {} + let msg = `同步完成:成功 ${s.successCount || 0} 条` + if (s.unmatchedCount) msg += `,其中 ${s.unmatchedCount} 条未匹配到周期` + if (s.skipCount) msg += `,跳过 ${s.skipCount} 条` + this.$message.success(msg) + this.syncSelection = [] + this.getDataList() + } else { + this.$message.error((data && data.msg) || '同步失败') + } + }).catch(error => { + this.$message.error('同步失败: ' + error.message) + }) + }).catch(() => {}) + }, + formatCodeOptionLabel (code, name) { if (!name) { return code || '' @@ -4927,7 +4984,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 +4999,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 +5355,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 +5495,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 @@ -
+
运输周期
-