|
@@ -81,32 +81,32 @@
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="重量范围" labelAlign="left">
|
|
|
<a-input-group compact>
|
|
|
- <a-input style="width: 50%" v-model="form.weightMin" placeholder="最小值" />
|
|
|
- <a-input style="width: 50%" v-model="form.weightMax" placeholder="最大值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.weightMin" placeholder="最小值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.weightMax" placeholder="最大值" />
|
|
|
</a-input-group>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="数量范围" labelAlign="left">
|
|
|
<a-input-group compact>
|
|
|
- <a-input style="width: 50%" v-model="form.quantityMin" placeholder="最小值" />
|
|
|
- <a-input style="width: 50%" v-model="form.quantityMax" placeholder="最大值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.quantityMin" placeholder="最小值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.quantityMax" placeholder="最大值" />
|
|
|
</a-input-group>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="金额范围" labelAlign="left">
|
|
|
<a-input-group compact>
|
|
|
- <a-input style="width: 50%" v-model="form.amountMin" placeholder="最小值" />
|
|
|
- <a-input style="width: 50%" v-model="form.amountMax" placeholder="最大值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.amountMin" placeholder="最小值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.amountMax" placeholder="最大值" />
|
|
|
</a-input-group>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="TEU范围" labelAlign="left">
|
|
|
<a-input-group compact>
|
|
|
- <a-input style="width: 50%" v-model="form.teuMin" placeholder="最小值" />
|
|
|
- <a-input style="width: 50%" v-model="form.teuMax" placeholder="最大值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.teuMin" placeholder="最小值" />
|
|
|
+ <a-input style="width: 50%" v-model:value="form.teuMax" placeholder="最大值" />
|
|
|
</a-input-group>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -114,41 +114,55 @@
|
|
|
<a-row :gutter="16">
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="原产国" labelAlign="left">
|
|
|
- <a-input v-model:value="form.originCountry" placeholder="原产国" />
|
|
|
+ <a-select
|
|
|
+ v-model:value="form.originCountry"
|
|
|
+ mode="multiple"
|
|
|
+ placeholder="原产国"
|
|
|
+ :options="countryOptions"
|
|
|
+ :filterOption="filterCountryOption"
|
|
|
+ showSearch
|
|
|
+ />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="6">
|
|
|
- <a-form-item label="启运港" labelAlign="left">
|
|
|
- <a-input v-model:value="form.origPort" placeholder="启运港" />
|
|
|
+ <!-- <a-col :span="6">
|
|
|
+ <a-form-item label="起运港" labelAlign="left">
|
|
|
+ <a-input v-model:value="form.origPort" placeholder="起运港" />
|
|
|
</a-form-item>
|
|
|
- </a-col>
|
|
|
+ </a-col> -->
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="目的国" labelAlign="left">
|
|
|
- <a-input v-model:value="form.destinationCountry" placeholder="目的国" />
|
|
|
+ <a-select
|
|
|
+ v-model:value="form.destinationCountry"
|
|
|
+ mode="multiple"
|
|
|
+ placeholder="目的国"
|
|
|
+ :options="countryOptions"
|
|
|
+ :filterOption="filterCountryOption"
|
|
|
+ showSearch
|
|
|
+ />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :span="6">
|
|
|
+ <!-- <a-col :span="6">
|
|
|
<a-form-item label="目的港" labelAlign="left">
|
|
|
<a-input v-model:value="form.destPort" placeholder="目的港" />
|
|
|
</a-form-item>
|
|
|
- </a-col>
|
|
|
+ </a-col> -->
|
|
|
</a-row>
|
|
|
<a-row :gutter="16">
|
|
|
- <a-col :span="6">
|
|
|
+ <!-- <a-col :span="6">
|
|
|
<a-form-item label="海关" labelAlign="left">
|
|
|
<a-input v-model:value="form.customs" placeholder="海关" />
|
|
|
</a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="6">
|
|
|
+ </a-col> -->
|
|
|
+ <!-- <a-col :span="6">
|
|
|
<a-form-item label="运输方式" labelAlign="left">
|
|
|
<a-input v-model:value="form.transportMode" placeholder="运输方式" />
|
|
|
</a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="6">
|
|
|
+ </a-col> -->
|
|
|
+ <!-- <a-col :span="6">
|
|
|
<a-form-item label="成交方式" labelAlign="left">
|
|
|
<a-input v-model:value="form.incoterms" placeholder="成交方式" />
|
|
|
</a-form-item>
|
|
|
- </a-col>
|
|
|
+ </a-col> -->
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="主单号" labelAlign="left">
|
|
|
<a-input v-model:value="form.mainOrderNo" placeholder="主单号" />
|
|
@@ -658,8 +672,8 @@ const form = ref({
|
|
|
// buyerReg: '',
|
|
|
buyerAddress: '',
|
|
|
buyerOptions: ['excludeNVL'],
|
|
|
- originCountry: '',
|
|
|
- destinationCountry: '',
|
|
|
+ originCountry: [] as string[],
|
|
|
+ destinationCountry: [] as string[],
|
|
|
port: '',
|
|
|
transportMode: '',
|
|
|
weightMin: null,
|
|
@@ -686,12 +700,122 @@ const form = ref({
|
|
|
// 添加控制数据展示的状态
|
|
|
const showDataContent = ref(false);
|
|
|
|
|
|
+// 添加 country options (you can populate this with actual country data)
|
|
|
+const countryOptions = ref([
|
|
|
+ { value: 'CN', label: '中国' },
|
|
|
+ { value: 'IN', label: '印度' },
|
|
|
+ { value: 'VN', label: '越南' },
|
|
|
+ { value: 'US', label: '美国' },
|
|
|
+ { value: 'MX', label: '墨西哥' },
|
|
|
+ { value: 'RU', label: '俄罗斯' },
|
|
|
+ { value: 'DE', label: '德国' },
|
|
|
+ { value: 'JP', label: '日本' },
|
|
|
+ { value: 'TR', label: '土耳其' },
|
|
|
+ { value: 'KR', label: '韩国' },
|
|
|
+ { value: 'ID', label: '印度尼西亚' },
|
|
|
+ { value: 'IT', label: '意大利' },
|
|
|
+ { value: 'TW', label: '中国台湾' },
|
|
|
+ { value: 'HK', label: '中国香港' },
|
|
|
+ { value: 'SG', label: '新加坡' },
|
|
|
+ { value: 'TH', label: '泰国' },
|
|
|
+ { value: 'GB', label: '英国' },
|
|
|
+ { value: 'ES', label: '西班牙' },
|
|
|
+ { value: 'BR', label: '巴西' },
|
|
|
+ { value: 'FR', label: '法国' },
|
|
|
+ { value: 'EC', label: '厄瓜多尔' },
|
|
|
+ { value: 'BE', label: '比利时' },
|
|
|
+ { value: 'CO', label: '哥伦比亚' },
|
|
|
+ { value: 'MY', label: '马来西亚' },
|
|
|
+ { value: 'BD', label: '孟加拉国' },
|
|
|
+ { value: 'PL', label: '波兰' },
|
|
|
+ { value: 'ZA', label: '南非' },
|
|
|
+ { value: 'NL', label: '荷兰' },
|
|
|
+ { value: 'AR', label: '阿根廷' },
|
|
|
+ { value: 'PE', label: '秘鲁' },
|
|
|
+ { value: 'CL', label: '智利' },
|
|
|
+ { value: 'CH', label: '瑞士' },
|
|
|
+ { value: 'PK', label: '巴基斯坦' },
|
|
|
+ { value: 'PH', label: '菲律宾' },
|
|
|
+ { value: 'UA', label: '乌克兰' },
|
|
|
+ { value: 'PA', label: '巴拿马' },
|
|
|
+ { value: 'CZ', label: '捷克' },
|
|
|
+ { value: 'LK', label: '斯里兰卡' },
|
|
|
+ { value: 'SE', label: '瑞典' },
|
|
|
+ { value: 'CA', label: '加拿大' },
|
|
|
+ { value: 'KZ', label: '哈萨克斯坦' },
|
|
|
+ { value: 'CR', label: '哥斯达黎加' },
|
|
|
+ { value: 'AT', label: '奥地利' },
|
|
|
+ { value: 'AE', label: '阿联酋' },
|
|
|
+ { value: 'PT', label: '葡萄牙' },
|
|
|
+ { value: 'LT', label: '立陶宛' },
|
|
|
+ { value: 'HU', label: '匈牙利' },
|
|
|
+ { value: 'RO', label: '罗马尼亚' },
|
|
|
+ { value: 'AU', label: '澳大利亚' },
|
|
|
+ { value: 'DK', label: '丹麦' },
|
|
|
+ { value: 'UZ', label: '乌兹别克斯坦' },
|
|
|
+ { value: 'GT', label: '危地马拉' },
|
|
|
+ { value: 'FI', label: '芬兰' },
|
|
|
+ { value: 'IL', label: '以色列' },
|
|
|
+ { value: 'UY', label: '乌拉圭' },
|
|
|
+ { value: 'KH', label: '柬埔寨' },
|
|
|
+ { value: 'MA', label: '摩洛哥' },
|
|
|
+ { value: 'BY', label: '白俄罗斯' },
|
|
|
+ { value: 'SK', label: '斯洛伐克' },
|
|
|
+ { value: 'IE', label: '爱尔兰' },
|
|
|
+ { value: 'PY', label: '巴拉圭' },
|
|
|
+ { value: 'EG', label: '埃及' },
|
|
|
+ { value: 'HN', label: '洪都拉斯' },
|
|
|
+ { value: 'BG', label: '保加利亚' },
|
|
|
+ { value: 'MO', label: '中国澳门' },
|
|
|
+ { value: 'MD', label: '摩尔多瓦' },
|
|
|
+ { value: 'SA', label: '沙特阿拉伯' },
|
|
|
+ { value: 'NZ', label: '新西兰' },
|
|
|
+ { value: 'SI', label: '斯洛文尼亚' },
|
|
|
+ { value: 'UG', label: '乌干达' },
|
|
|
+ { value: 'DO', label: '多米尼加' },
|
|
|
+ { value: 'GR', label: '希腊' },
|
|
|
+ { value: 'ET', label: '埃塞俄比亚' },
|
|
|
+ { value: 'SV', label: '萨尔瓦多' },
|
|
|
+ { value: 'MM', label: '缅甸' },
|
|
|
+ { value: 'KE', label: '肯尼亚' },
|
|
|
+ { value: 'OM', label: '阿曼' },
|
|
|
+ { value: 'BS', label: '巴哈马' },
|
|
|
+ { value: 'LV', label: '拉脱维亚' },
|
|
|
+ { value: 'RS', label: '塞尔维亚' },
|
|
|
+ { value: 'TN', label: '突尼斯' },
|
|
|
+ { value: 'EE', label: '爱沙尼亚' },
|
|
|
+ { value: 'BZ', label: '伯利兹' },
|
|
|
+ { value: 'NI', label: '尼加拉瓜' },
|
|
|
+ { value: 'CI', label: '科特迪瓦' },
|
|
|
+ { value: 'VG', label: '英属维尔京群岛' },
|
|
|
+ { value: 'IR', label: '伊朗' },
|
|
|
+ { value: 'NO', label: '挪威' },
|
|
|
+ { value: 'JM', label: '牙买加' },
|
|
|
+ { value: 'WS', label: '萨摩亚' },
|
|
|
+ { value: 'TZ', label: '坦桑尼亚' },
|
|
|
+ { value: 'LU', label: '卢森堡' },
|
|
|
+ { value: 'NP', label: '尼泊尔' },
|
|
|
+ { value: 'SC', label: '塞舌尔' },
|
|
|
+ { value: 'AZ', label: '阿塞拜疆' },
|
|
|
+ { value: 'HR', label: '克罗地亚' },
|
|
|
+ { value: 'LI', label: '列支敦士登' },
|
|
|
+ { value: 'BW', label: '博茨瓦纳' },
|
|
|
+ { value: 'HT', label: '海地' },
|
|
|
+ { value: 'GE', label: '格鲁吉亚' }
|
|
|
+]);
|
|
|
+
|
|
|
// 修改 handleSearch 方法
|
|
|
const handleSearch = async () => {
|
|
|
+ // 清空 queryParam
|
|
|
+ Object.keys(queryParam).forEach((key) => {
|
|
|
+ delete queryParam[key];
|
|
|
+ });
|
|
|
+
|
|
|
showDataContent.value = true;
|
|
|
|
|
|
// 构建查询参数
|
|
|
const params = {
|
|
|
+ source_type: 1,
|
|
|
// 动态获取数据源
|
|
|
data_source: [...selectedImport.value, ...selectedExport.value],
|
|
|
// 表单参数
|
|
@@ -703,28 +827,29 @@ const handleSearch = async () => {
|
|
|
buyer_t: form.value.buyer,
|
|
|
// buyer_reg: form.value.buyerReg,
|
|
|
buyer_addr: form.value.buyerAddress,
|
|
|
- origin_country: form.value.originCountry,
|
|
|
- destination_country: form.value.destinationCountry,
|
|
|
- orig_port: form.value.origPort,
|
|
|
- dest_port: form.value.destPort,
|
|
|
- customs: form.value.customs,
|
|
|
+ orig_country_code: form.value.originCountry.length > 0 ? form.value.originCountry : undefined,
|
|
|
+ dest_country_code: form.value.destinationCountry.length > 0 ? form.value.destinationCountry : undefined,
|
|
|
+ // orig_port_t: form.value.origPort,
|
|
|
+ // dest_port_t: form.value.destPort,
|
|
|
+ // customs: form.value.customs,
|
|
|
transport_mode: form.value.transportMode,
|
|
|
incoterms: form.value.incoterms,
|
|
|
- main_order_no: form.value.mainOrderNo,
|
|
|
- sub_order_no: form.value.subOrderNo,
|
|
|
+ master_bill_no: form.value.mainOrderNo,
|
|
|
+ sub_bill_no: form.value.subOrderNo,
|
|
|
container_no: form.value.containerNo,
|
|
|
- carrier: form.value.carrier,
|
|
|
- ship_name: form.value.shipName,
|
|
|
+ carrier_name: form.value.carrier,
|
|
|
+ vessel_name: form.value.shipName,
|
|
|
brand: form.value.brand,
|
|
|
+ others: form.value.other,
|
|
|
|
|
|
// 日期处理
|
|
|
date: form.value.startDate && form.value.endDate ? [form.value.startDate.format('YYYYMMDD'), form.value.endDate.format('YYYYMMDD')] : undefined,
|
|
|
|
|
|
// 范围值处理
|
|
|
- weight: form.value.weightMin || form.value.weightMax ? [form.value.weightMin || '', form.value.weightMax || ''] : undefined,
|
|
|
- quantity: form.value.quantityMin || form.value.quantityMax ? [form.value.quantityMin || '', form.value.quantityMax || ''] : undefined,
|
|
|
- amount: form.value.amountMin || form.value.amountMax ? [form.value.amountMin || '', form.value.amountMax || ''] : undefined,
|
|
|
- teu: form.value.teuMin || form.value.teuMax ? [form.value.teuMin || '', form.value.teuMax || ''] : undefined,
|
|
|
+ weight: form.value.weightMin || form.value.weightMax ? handleRangeValue(form.value.weightMin, form.value.weightMax) : undefined,
|
|
|
+ quantity: form.value.quantityMin || form.value.quantityMax ? handleRangeValue(form.value.quantityMin, form.value.quantityMax) : undefined,
|
|
|
+ amount: form.value.amountMin || form.value.amountMax ? handleRangeValue(form.value.amountMin, form.value.amountMax) : undefined,
|
|
|
+ teu: form.value.teuMin || form.value.teuMax ? handleRangeValue(form.value.teuMin, form.value.teuMax) : undefined,
|
|
|
|
|
|
// 选项处理
|
|
|
supplier_ex_log: form.value.options?.includes('excludeLogistics'),
|
|
@@ -733,19 +858,30 @@ const handleSearch = async () => {
|
|
|
buyer_ex_nvl: form.value.buyerOptions?.includes('excludeNVL'),
|
|
|
};
|
|
|
|
|
|
- // 移除所有 undefined、null 和空字符串的属性
|
|
|
+ // 清除空值参数
|
|
|
Object.keys(params).forEach((key) => {
|
|
|
- if (params[key] === undefined || params[key] === null || params[key] === '') {
|
|
|
- delete params[key];
|
|
|
- }
|
|
|
- // 处理数组类型的参数
|
|
|
- if (Array.isArray(params[key]) && params[key].length === 0) {
|
|
|
+ const value = params[key];
|
|
|
+ if (value === undefined || value === null || value === '') {
|
|
|
delete params[key];
|
|
|
+ } else if (Array.isArray(value)) {
|
|
|
+ // 处理数组类型的参数
|
|
|
+ if (value.length === 0 || value.every(item => item === '' || item === null || item === undefined)) {
|
|
|
+ delete params[key];
|
|
|
+ } else {
|
|
|
+ // 过滤掉数组中的空值
|
|
|
+ params[key] = value.filter(item => item !== '' && item !== null && item !== undefined);
|
|
|
+ }
|
|
|
+ } else if (typeof value === 'object') {
|
|
|
+ // 处理对象类型的参数
|
|
|
+ if (Object.keys(value).length === 0) {
|
|
|
+ delete params[key];
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 将参数保存到 queryParam 以供其他地方使用
|
|
|
Object.assign(queryParam, params);
|
|
|
+
|
|
|
if (activeTabKey.value === 'transaction') {
|
|
|
pagination.value.current = 1; // Reset to first page
|
|
|
await handleTableChange(pagination.value);
|
|
@@ -758,6 +894,14 @@ const handleSearch = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// 修改 handleRangeValue 函数
|
|
|
+const handleRangeValue = (min: string | null, max: string | null) => {
|
|
|
+ if (min || max) {
|
|
|
+ return [min || '*', max || '*'];
|
|
|
+ }
|
|
|
+ return undefined;
|
|
|
+};
|
|
|
+
|
|
|
const showAdvancedSearch = ref(false);
|
|
|
|
|
|
const toggleAdvancedSearch = () => {
|
|
@@ -1358,6 +1502,11 @@ const handleImportSelectAll = (e) => {
|
|
|
const handleExportSelectAll = (e) => {
|
|
|
selectedExport.value = e.target.checked ? Object.values(exportCountries.value) : []
|
|
|
}
|
|
|
+
|
|
|
+// 新增过滤函数
|
|
|
+const filterCountryOption = (input: string, option: { label: string; value: string }) => {
|
|
|
+ return option.label.toLowerCase().includes(input.toLowerCase());
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|