cz hace 1 año
padre
commit
9d6c65ea8e
Se han modificado 1 ficheros con 68 adiciones y 21 borrados
  1. 68 21
      src/components/process/PurchasePayment.vue

+ 68 - 21
src/components/process/PurchasePayment.vue

@@ -7,6 +7,43 @@
       :rules="rules"
       ref="submit"
     >
+      <template #supplyId>
+        <div style="width: 100%">
+          <el-form-item prop="supplyId">
+            <el-select
+              v-model="formData.data.supplyId"
+              filterable
+              remote
+              reserve-keyword
+              placeholder="请输入关键字"
+              remote-show-suffix
+              :remote-method="remoteMethod"
+              :loading="loadingSearch"
+              @input="remoteMethod"
+              style="width: 100%"
+              @change="changeSupply"
+              v-if="
+                [30].includes(route.query.processType) ||
+                !route.query.processType
+              "
+            >
+              <el-option
+                v-for="item in supplierList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+            <el-select
+              v-model="formData.data.supplyName"
+              disabled
+              v-else
+              style="width: 100%"
+            >
+            </el-select>
+          </el-form-item>
+        </div>
+      </template>
       <template #deadline>
         <div style="width: 100%">
           <el-date-picker
@@ -221,14 +258,9 @@ const formConfig = computed(() => {
       label: "",
     },
     {
-      type: "select",
-      label: "供应商",
-      prop: "supplyId",
-      data: supplierList.value,
-      fn: (val) => {
-        changeSupply(val);
-      },
-      style: "width: 100%",
+      type: "slot",
+      slotName: "supplyId",
+      label: "",
     },
     {
       type: "slot",
@@ -443,18 +475,17 @@ const getDict = () => {
         });
       }
     });
-  proxy
-    .post("/supplierInfo/page", { pageNum: 1, pageSize: 999 })
-    .then((res) => {
-      if (res.rows && res.rows.length > 0) {
-        supplierList.value = res.rows.map((item) => {
-          return {
-            label: item.name,
-            value: item.id,
-          };
-        });
-      }
-    });
+  proxy.post("/supplierInfo/page", { pageNum: 1, pageSize: 50 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      supplierList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
   proxy
     .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
     .then((res) => {
@@ -485,7 +516,7 @@ const onPreviewFile = (file) => {
 const changeSupply = async (val) => {
   if (val) {
     await proxy
-      .get("/purchase/getListBySupplyId", { supplyId: val })
+      .get("/ehsdPurchase/getListBySupplyId", { supplyId: val })
       .then((res) => {
         if (res.data && res.data.length > 0) {
           contractList.value = res.data.map((item) => {
@@ -844,6 +875,22 @@ const getDecisionAids = () => {
     emit("auxiliaryChange", list);
   });
 };
+
+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((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+      loadingSearch.value = false;
+    });
+  }
+  return;
+};
 </script>
 
 <style lang="scss" scoped>