diff --git a/src/api/port/portTransit.js b/src/api/port/portTransit.js
index f3a84fa..953de60 100644
--- a/src/api/port/portTransit.js
+++ b/src/api/port/portTransit.js
@@ -8,3 +8,5 @@ export const getTransitList = data => createAPI('/portTransitCycle/list', 'POST'
export const updateTransit = data => createAPI('/portTransitCycle/save', 'POST', data)
// 查询运输选项列表
export const searchTransportOptions = data => createAPI('/portTransitCycle/calculateArrivalTime', 'POST', data)
+// 启用的运输方式,PO 筛选下拉使用
+export const listActiveShipMethods = data => createAPI('/portTransitCycle/shipMethodList', 'POST', data || {})
diff --git a/src/views/modules/order/com_poOrderSearchBar.vue b/src/views/modules/order/com_poOrderSearchBar.vue
new file mode 100644
index 0000000..c7ff293
--- /dev/null
+++ b/src/views/modules/order/com_poOrderSearchBar.vue
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
diff --git a/src/views/modules/order/com_poOrder_CustomerPicker.vue b/src/views/modules/order/com_poOrder_CustomerPicker.vue
index c919748..d042eea 100644
--- a/src/views/modules/order/com_poOrder_CustomerPicker.vue
+++ b/src/views/modules/order/com_poOrder_CustomerPicker.vue
@@ -1,6 +1,26 @@
-
-
+
+
+
+
+
+
+ 当前账号无 Customer 权限
+
+
+
+
diff --git a/src/views/modules/order/poOrder.vue b/src/views/modules/order/poOrder.vue
index f5d0306..cc02b6c 100644
--- a/src/views/modules/order/poOrder.vue
+++ b/src/views/modules/order/poOrder.vue
@@ -1,45 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
- Part No
-
-
-
- 供应商编码
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
查询
@@ -66,7 +40,7 @@
label="操作"
header-align="center"
align="center"
- width="170">
+ width="100">
trimSearchText(item)).filter(Boolean)
+}
+
+/**
+ * Telex Release 页面值转库值。
+ * Yes 对应 true,No 对应 false;未选择时返回空,查询全部(含空值)。
+ */
+function mapTelexReleaseToDb (value) {
+ const text = trimSearchText(value)
+ if (text === 'Yes') {
+ return 'true'
+ }
+ if (text === 'No') {
+ return 'false'
+ }
+ return ''
+}
+
+/**
+ * 组装查询/导出参数。
+ * 有高级条件时走 advancedPage,顶部筛选一并带上。
+ * 顶部条件使用独立字段,不把页面值送进旧的 buyer/poNo/status 条件。
*/
export function buildPoOrderQueryParams ({ searchData, advancedQueryData, page, limit }) {
+ const source = searchData || {}
const conditions = getActiveAdvancedConditions(advancedQueryData)
const baseParams = {
- site: searchData.site,
+ site: source.site,
page,
limit,
- customer: searchData.customer || '',
- buyer: searchData.buyer || '',
- poNo: searchData.poNo || '',
- sku: searchData.sku || '',
- // rqrq - 英文筛选独立传参,禁止把显示值送入原始业务 status。
- statusDisplayFilter: searchData.status || '',
- orderType: searchData.orderType || '',
- supplierNo: searchData.supplierNo || '',
- supplierName: searchData.supplierName || '',
- partNo: searchData.partNo || ''
+ customer: trimSearchText(source.customer),
+ plannerAccount: trimSearchText(source.plannerAccount),
+ buyerKeyword: trimSearchText(source.buyer),
+ supplierNameKeyword: trimSearchText(source.supplierName),
+ poNoKeyword: trimSearchText(source.poNo),
+ itemKeyword: trimSearchText(source.item),
+ flexidKeyword: trimSearchText(source.flexid),
+ shipViaList: normalizeSearchList(source.shipViaList),
+ statusDisplayList: normalizeSearchList(source.statusDisplayList),
+ destinationList: normalizeSearchList(source.destinationList),
+ telexReleaseValue: mapTelexReleaseToDb(source.telexRelease),
+ enquiryDateStart: trimSearchText(source.enquiryDateStart),
+ enquiryDateEnd: trimSearchText(source.enquiryDateEnd),
+ issueDateStart: trimSearchText(source.issueDateStart),
+ issueDateEnd: trimSearchText(source.issueDateEnd),
+ etaDateStart: trimSearchText(source.etaDateStart),
+ etaDateEnd: trimSearchText(source.etaDateEnd),
+ obdDateStart: trimSearchText(source.obdDateStart),
+ obdDateEnd: trimSearchText(source.obdDateEnd),
+ crdDateStart: trimSearchText(source.crdDateStart),
+ crdDateEnd: trimSearchText(source.crdDateEnd)
}
if (conditions.length > 0) {
return {
@@ -127,7 +199,7 @@ export function buildPoOrderQueryParams ({ searchData, advancedQueryData, page,
}
}
return {
- params: { ...searchData, status: '', statusDisplayFilter: searchData.status || '', page, limit },
+ params: baseParams,
useAdvanced: false
}
}
diff --git a/src/views/modules/order/poOrderSearchOptionsMixin.js b/src/views/modules/order/poOrderSearchOptionsMixin.js
new file mode 100644
index 0000000..4b91fe7
--- /dev/null
+++ b/src/views/modules/order/poOrderSearchOptionsMixin.js
@@ -0,0 +1,89 @@
+import { searchPortList } from '@/api/port/portInfo.js'
+import { listActiveShipMethods } from '@/api/port/portTransit.js'
+
+/**
+ * PO 顶部筛选的运输方式、目的港选项。
+ * 运输方式取 ship_method.method_desc,与新增时写入的 ship_via 一致。
+ * 目的港取 is_destination_port = Y 的港口,查询值用港口编码。
+ */
+export default {
+ data () {
+ return {
+ shipMethodOptions: [],
+ destinationOptions: [],
+ shipMethodOptionsLoading: false,
+ destinationOptionsLoading: false
+ }
+ },
+ created () {
+ this.loadShipMethodOptions()
+ this.loadDestinationOptions()
+ },
+ methods: {
+ /**
+ * 加载运输方式下拉。
+ * 走启用运输方式接口,只查 active = Y,不再执行快捷查询里 where 1=1 的动态 SQL。
+ * 选项值和显示都用 methodDesc,与订单头 ship_via 一致。失败时清空选项并提示。
+ */
+ loadShipMethodOptions () {
+ if (this.shipMethodOptionsLoading) {
+ return
+ }
+ this.shipMethodOptionsLoading = true
+ listActiveShipMethods({}).then(({ data }) => {
+ if (!data || data.code !== 0) {
+ throw new Error((data && data.msg) || '加载运输方式失败')
+ }
+ const rows = Array.isArray(data.rows) ? data.rows : []
+ const seen = new Set()
+ this.shipMethodOptions = rows.reduce((options, row) => {
+ const label = String((row && row.methodDesc) || '').trim()
+ if (!label || seen.has(label)) {
+ return options
+ }
+ seen.add(label)
+ options.push({ label, value: label })
+ return options
+ }, [])
+ }).catch(error => {
+ this.shipMethodOptions = []
+ this.$message.error(error.message || '加载运输方式失败')
+ }).finally(() => {
+ this.shipMethodOptionsLoading = false
+ })
+ },
+
+ /**
+ * 加载目的港下拉。
+ * 只取目的港主数据,选项值是港口编码,显示为编码加名称。
+ * 查询按编码精确匹配 c_destination。加载失败时清空选项并提示。
+ */
+ loadDestinationOptions () {
+ if (this.destinationOptionsLoading) {
+ return
+ }
+ this.destinationOptionsLoading = true
+ searchPortList({ isDestinationPort: 'Y' }).then(({ data }) => {
+ if (!data || data.code !== 0) {
+ throw new Error((data && data.msg) || '加载目的港失败')
+ }
+ const rows = Array.isArray(data.rows) ? data.rows : []
+ this.destinationOptions = rows
+ .filter(row => row && String(row.portCode || '').trim())
+ .map(row => {
+ const portCode = String(row.portCode).trim()
+ const portName = String(row.portName || '').trim()
+ return {
+ label: portName && portName !== portCode ? `${portCode} ${portName}` : portCode,
+ value: portCode
+ }
+ })
+ }).catch(error => {
+ this.destinationOptions = []
+ this.$message.error(error.message || '加载目的港失败')
+ }).finally(() => {
+ this.destinationOptionsLoading = false
+ })
+ }
+ }
+}
diff --git a/src/views/modules/order/poOrder_search.vue b/src/views/modules/order/poOrder_search.vue
index cfaf86f..c259f9b 100644
--- a/src/views/modules/order/poOrder_search.vue
+++ b/src/views/modules/order/poOrder_search.vue
@@ -1,45 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Part No
-
-
-
- 供应商编码
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -117,7 +91,6 @@
@refresh-status-options="loadPoStatusMappings"
@query="handleSearch" />
-
@@ -126,6 +99,7 @@ import { searchPoDetailPage, searchPoDetailAdvancedPage, getPoFieldSchema } from
import {
createAdvancedQueryData,
createAdvancedQueryDataFromSchema,
+ createPoOrderSearchData,
buildPoOrderQueryParams
} from './poOrderAdvancedQueryHelper.js'
import {
@@ -139,22 +113,23 @@ import InspectionDetailList from './com_inspectionDetailList.vue'
import PoPartAttribute from './com_poPartAttribute.vue'
import PoOrderDetail from './com_poOrderDetail.vue'
import PoOrderAdvancedQuery from './com_poOrderAdvancedQuery.vue'
-import ChooselistEam from '@/views/modules/common/Chooselist_eam.vue'
import ComPoOrderCustomerPicker from './com_poOrder_CustomerPicker.vue'
+import ComPoOrderSearchBar from './com_poOrderSearchBar.vue'
import poOrderStatusMappingMixin from './poOrderStatusMappingMixin.js'
-import { PO_ORDER_TYPE_OPTIONS, formatPoOrderTypeLabel } from './poOrderTypeOptions.js'
+import poOrderSearchOptionsMixin from './poOrderSearchOptionsMixin.js'
+import { formatPoOrderTypeLabel } from './poOrderTypeOptions.js'
import { searchPartInfo } from '@/api/part/partInfo.js'
export default {
- mixins: [poOrderStatusMappingMixin], // rqrq - 列表、下拉和导出共用状态映射
+ mixins: [poOrderStatusMappingMixin, poOrderSearchOptionsMixin], // rqrq - 状态映射与顶部筛选下拉共用
components: {
LogisticsPoList,
InspectionDetailList,
PoPartAttribute,
PoOrderDetail,
PoOrderAdvancedQuery,
- ChooselistEam,
- ComPoOrderCustomerPicker
+ ComPoOrderCustomerPicker,
+ ComPoOrderSearchBar
},
name: 'PoOrderQuery',
data() {
@@ -169,26 +144,11 @@ export default {
dataList: [],
currentRow: {},
advancedQueryVisible: false,
- eamTagNo: '',
- poOrderTypeSearchOptions: [{ label: '全部', value: '' }, ...PO_ORDER_TYPE_OPTIONS],
/** 高级查询条件对象(查询/导出均读取;仅弹窗内「重置」可清空) */
advancedQueryData: createAdvancedQueryData(),
fieldSchemaFields: [],
baseColumnList: null,
- searchData: {
- site: this.$store.state.user.site,
- customer: '',
- buyer: '',
- poNo: '',
- orderType: '',
- partNo: '',
- supplierNo: '',
- sku: '',
- status: '',
- supplierName: '',
- feeDateStart: '',
- feeDateEnd: ''
- },
+ searchData: createPoOrderSearchData(this.$store.state.user.site),
// 列配置(与原始页面保持一致,但隐藏编辑相关列)
columnList: [
{
@@ -718,52 +678,13 @@ export default {
})
},
- /** 外部重置:仅清空顶部基础条件,不清 advancedQueryData */
+ /** 重置顶部筛选,保留当前 Customer。不清高级查询条件。 */
resetSearch() {
const currentCustomer = this.searchData.customer
- this.searchData = {
- site: this.$store.state.user.site,
- customer: currentCustomer,
- buyer: '',
- poNo: '',
- orderType: '',
- partNo: '',
- supplierNo: '',
- sku: '',
- status: '',
- supplierName: '',
- feeDateStart: '',
- feeDateEnd: ''
- }
+ this.searchData = createPoOrderSearchData(this.$store.state.user.site, currentCustomer)
this.pageIndex = 1
this.getDataList()
},
-
- openSearchBaseList (val) {
- this.eamTagNo = val
- let strVal = ''
- let conSql = ''
- if (val === 520) {
- strVal = this.searchData.supplierNo || ''
- conSql = " and supplier_no <> '' "
- } else if (val === 2017) {
- strVal = this.searchData.partNo || ''
- conSql = " and part_no <> '' "
- }
- this.$nextTick(() => {
- this.$refs.eamList.init(val, strVal, conSql)
- })
- },
-
- getEamData (val) {
- if (this.eamTagNo === 520) {
- this.searchData.supplierNo = val.supplier_no || val.code || ''
- this.searchData.supplierName = val.supplier_name || val.name || ''
- } else if (this.eamTagNo === 2017) {
- this.searchData.partNo = val.part_no || val.code || ''
- }
- this.eamTagNo = ''
- },
// 导出
exportExcel () {
if (!this.searchData.customer) {
diff --git a/src/views/modules/order/poOrder_search_en.vue b/src/views/modules/order/poOrder_search_en.vue
index e0ec6de..1a2eedd 100644
--- a/src/views/modules/order/poOrder_search_en.vue
+++ b/src/views/modules/order/poOrder_search_en.vue
@@ -1,45 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Part No
-
-
-
- Supplier Code
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -118,7 +92,6 @@
@refresh-status-options="loadPoStatusMappings"
@query="handleSearch" />
-
@@ -127,6 +100,7 @@ import { searchPoDetailPage, searchPoDetailAdvancedPage, getPoFieldSchema } from
import {
createAdvancedQueryData,
createAdvancedQueryDataFromSchema,
+ createPoOrderSearchData,
buildPoOrderQueryParams
} from './poOrderAdvancedQueryHelper.js'
import {
@@ -140,22 +114,23 @@ import InspectionDetailList from './com_inspectionDetailList.vue'
import PoPartAttribute from './com_poPartAttribute.vue'
import PoOrderDetail from './com_poOrderDetail.vue'
import PoOrderAdvancedQuery from './com_poOrderAdvancedQuery.vue'
-import ChooselistEam from '@/views/modules/common/Chooselist_eam.vue'
import ComPoOrderCustomerPicker from './com_poOrder_CustomerPicker.vue'
+import ComPoOrderSearchBar from './com_poOrderSearchBar.vue'
import poOrderStatusMappingMixin from './poOrderStatusMappingMixin.js'
-import { PO_ORDER_TYPE_OPTIONS, formatPoOrderTypeLabel } from './poOrderTypeOptions.js'
+import poOrderSearchOptionsMixin from './poOrderSearchOptionsMixin.js'
+import { formatPoOrderTypeLabel } from './poOrderTypeOptions.js'
import { searchPartInfo } from '@/api/part/partInfo.js'
export default {
- mixins: [poOrderStatusMappingMixin], // rqrq - 列表、下拉和导出共用状态映射
+ mixins: [poOrderStatusMappingMixin, poOrderSearchOptionsMixin], // rqrq - 状态映射与顶部筛选下拉共用
components: {
LogisticsPoList,
InspectionDetailList,
PoPartAttribute,
PoOrderDetail,
PoOrderAdvancedQuery,
- ChooselistEam,
- ComPoOrderCustomerPicker
+ ComPoOrderCustomerPicker,
+ ComPoOrderSearchBar
},
name: 'PoOrderQueryEn',
data() {
@@ -170,26 +145,11 @@ export default {
dataList: [],
currentRow: {},
advancedQueryVisible: false,
- eamTagNo: '',
- poOrderTypeSearchOptions: [{ label: 'All', value: '' }, ...PO_ORDER_TYPE_OPTIONS],
/** Advanced query object (read by search/export; only reset in dialog) */
advancedQueryData: createAdvancedQueryData(),
fieldSchemaFields: [],
baseColumnList: null,
- searchData: {
- site: this.$store.state.user.site,
- customer: '',
- buyer: '',
- poNo: '',
- orderType: '',
- partNo: '',
- supplierNo: '',
- sku: '',
- status: '',
- supplierName: '',
- feeDateStart: '',
- feeDateEnd: ''
- },
+ searchData: createPoOrderSearchData(this.$store.state.user.site),
// Column config (consistent with original page, hides edit related columns)
columnList: [
{
@@ -719,52 +679,13 @@ export default {
})
},
- /** External reset: only clears top basic conditions, not advancedQueryData */
+ /** 重置顶部筛选,保留当前 Customer。不清高级查询条件。 */
resetSearch() {
const currentCustomer = this.searchData.customer
- this.searchData = {
- site: this.$store.state.user.site,
- customer: currentCustomer,
- buyer: '',
- poNo: '',
- orderType: '',
- partNo: '',
- supplierNo: '',
- sku: '',
- status: '',
- supplierName: '',
- feeDateStart: '',
- feeDateEnd: ''
- }
+ this.searchData = createPoOrderSearchData(this.$store.state.user.site, currentCustomer)
this.pageIndex = 1
this.getDataList()
},
-
- openSearchBaseList (val) {
- this.eamTagNo = val
- let strVal = ''
- let conSql = ''
- if (val === 520) {
- strVal = this.searchData.supplierNo || ''
- conSql = " and supplier_no <> '' "
- } else if (val === 2017) {
- strVal = this.searchData.partNo || ''
- conSql = " and part_no <> '' "
- }
- this.$nextTick(() => {
- this.$refs.eamList.init(val, strVal, conSql)
- })
- },
-
- getEamData (val) {
- if (this.eamTagNo === 520) {
- this.searchData.supplierNo = val.supplier_no || val.code || ''
- this.searchData.supplierName = val.supplier_name || val.name || ''
- } else if (this.eamTagNo === 2017) {
- this.searchData.partNo = val.part_no || val.code || ''
- }
- this.eamTagNo = ''
- },
// Export
exportExcel () {
if (!this.searchData.customer) {