cz 1 год назад
Родитель
Сommit
19862db782
2 измененных файлов с 35 добавлено и 11 удалено
  1. 34 10
      src/components/process/EHSD/Purchase.vue
  2. 1 1
      vite.config.js

+ 34 - 10
src/components/process/EHSD/Purchase.vue

@@ -90,6 +90,14 @@
               <el-select
                 v-model="formData.data.sellCorporationId"
                 style="width: 100%"
+                filterable
+                remote
+                reserve-keyword
+                placeholder="请输入关键字"
+                remote-show-suffix
+                :remote-method="remoteMethod"
+                :loading="loadingSearch"
+                @input="remoteMethod"
                 @change="changeSupplier"
               >
                 <el-option
@@ -955,17 +963,15 @@ const getDict = () => {
       };
     });
   });
-  proxy
-    .post("/supplierInfo/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      supplierList.value = res.rows.map((item) => {
-        return {
-          ...item,
-          label: item.name,
-          value: item.id,
-        };
-      });
+  proxy.post("/supplierInfo/page", { pageNum: 1, pageSize: 50 }).then((res) => {
+    supplierList.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
     });
+  });
 };
 getDict();
 const getCityData = (id, type, isChange) => {
@@ -1875,6 +1881,24 @@ const getHtmlVal = (val) => {
   }
   return "";
 };
+
+const loadingSearch = ref(false);
+const remoteMethod = (keyword) => {
+  if (keyword && typeof keyword === "string") {
+    loadingSearch.value = true;
+    proxy.post("/supplierInfo/page", { keyword }).then((res) => {
+      supplierList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+      loadingSearch.value = false;
+    });
+  }
+  return;
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
vite.config.js

@@ -41,7 +41,7 @@ export default defineConfig(({
         '/dev-api': {
           target: 'http://139.9.102.170:9901/test-api',
           // 正式地址
-          // target: "http://139.9.102.170:9900/prod-api",
+          // target:"http://139.9.102.170:9900/prod-api",
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         }