Browse Source

修改参数问题

zq940222 3 weeks ago
parent
commit
60ccd0e08c
1 changed files with 18 additions and 14 deletions
  1. 18 14
      src/views/adweb/data/customsData.vue

+ 18 - 14
src/views/adweb/data/customsData.vue

@@ -30,11 +30,11 @@
             <a-input v-model:value="form.supplier" placeholder="供应商" />
           </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.supplierReg" placeholder="供应商注册号" />
           </a-form-item>
-        </a-col>
+        </a-col> -->
         <a-col :span="6">
           <a-form-item label="供应商地址" labelAlign="left">
             <a-input v-model:value="form.supplierAddress" placeholder="供应商地址" />
@@ -55,11 +55,11 @@
             <a-input v-model:value="form.buyer" placeholder="采购商" />
           </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.buyerReg" placeholder="采购商注册号" />
           </a-form-item>
-        </a-col>
+        </a-col> -->
         <a-col :span="6">
           <a-form-item label="采购商地址" labelAlign="left">
             <a-input v-model:value="form.buyerAddress" placeholder="采购商地址" />
@@ -651,11 +651,11 @@ const form = ref({
   startDate: dayjs().subtract(1, 'year'), // Set start date to one year ago
   endDate: dayjs(), // Set end date to today
   supplier: '',
-  supplierReg: '',
+  // supplierReg: '',
   supplierAddress: '',
   options: ['excludeNVL'],
   buyer: '',
-  buyerReg: '',
+  // buyerReg: '',
   buyerAddress: '',
   buyerOptions: ['excludeNVL'],
   originCountry: '',
@@ -697,12 +697,12 @@ const handleSearch = async () => {
     // 表单参数
     prod_desc: form.value.product,
     hs_code: form.value.hsCode,
-    supplier: form.value.supplier,
-    supplier_reg: form.value.supplierReg,
-    supplier_address: form.value.supplierAddress,
-    buyer: form.value.buyer,
-    buyer_reg: form.value.buyerReg,
-    buyer_address: form.value.buyerAddress,
+    supplier_t: form.value.supplier,
+    // supplier_reg: form.value.supplierReg,
+    supplier_addr: form.value.supplierAddress,
+    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,
@@ -733,9 +733,13 @@ const handleSearch = async () => {
     buyer_ex_nvl: form.value.buyerOptions?.includes('excludeNVL'),
   };
 
-  // 移除所有 undefined 和空字符串的属性
+  // 移除所有 undefined、null 和空字符串的属性
   Object.keys(params).forEach((key) => {
-    if (params[key] === undefined || params[key] === '') {
+    if (params[key] === undefined || params[key] === null || params[key] === '') {
+      delete params[key];
+    }
+    // 处理数组类型的参数
+    if (Array.isArray(params[key]) && params[key].length === 0) {
       delete params[key];
     }
   });