lxf 1 year ago
parent
commit
53f6e58a59

+ 25 - 25
src/views/processApproval/components/Contract.vue

@@ -783,6 +783,31 @@ const getDict = () => {
       });
     }
   });
+  if (["10", "20"].includes(route.query.processType)) {
+    proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfig[9].data = res.data.rows.map((item) => {
+          return {
+            ...item,
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
+  } else {
+    proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfig[9].data = res.data.rows.map((item) => {
+          return {
+            ...item,
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
+  }
 };
 getDict();
 const calculatedAmount = () => {
@@ -864,31 +889,6 @@ let status = ref(true);
 watch(
   refProps.queryData,
   () => {
-    if (["10", "20"].includes(route.query.processType)) {
-      proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-        if (res.data.rows && res.data.rows.length > 0) {
-          formConfig[9].data = res.data.rows.map((item) => {
-            return {
-              ...item,
-              label: item.name,
-              value: item.id,
-            };
-          });
-        }
-      });
-    } else {
-      proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
-        if (res.data.rows && res.data.rows.length > 0) {
-          formConfig[9].data = res.data.rows.map((item) => {
-            return {
-              ...item,
-              label: item.name,
-              value: item.id,
-            };
-          });
-        }
-      });
-    }
     if (refProps.queryData.value && ["10", "20", "30"].includes(route.query.processType)) {
       for (const key in refProps.queryData.value) {
         formData.data[key] = refProps.queryData.value[key];

+ 25 - 25
src/views/processApproval/components/PriceSheet.vue

@@ -668,6 +668,31 @@ const getDict = () => {
       });
     }
   });
+  if (["10", "20"].includes(route.query.processType)) {
+    proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfig[8].data = res.data.rows.map((item) => {
+          return {
+            ...item,
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
+  } else {
+    proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
+      if (res.data.rows && res.data.rows.length > 0) {
+        formConfig[8].data = res.data.rows.map((item) => {
+          return {
+            ...item,
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
+  }
 };
 getDict();
 const calculatedAmount = () => {
@@ -751,31 +776,6 @@ const status = ref(false);
 watch(
   refProps.queryData,
   () => {
-    if (["10", "20"].includes(route.query.processType)) {
-      proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
-        if (res.data.rows && res.data.rows.length > 0) {
-          formConfig[8].data = res.data.rows.map((item) => {
-            return {
-              ...item,
-              label: item.name,
-              value: item.id,
-            };
-          });
-        }
-      });
-    } else {
-      proxy.post("/customer/privateSeaPage", { pageNum: 1, pageSize: 999 }).then((res) => {
-        if (res.data.rows && res.data.rows.length > 0) {
-          formConfig[8].data = res.data.rows.map((item) => {
-            return {
-              ...item,
-              label: item.name,
-              value: item.id,
-            };
-          });
-        }
-      });
-    }
     if (refProps.queryData.value && ["10", "20", "30"].includes(route.query.processType)) {
       for (const key in refProps.queryData.value) {
         formData.data[key] = refProps.queryData.value[key];