002201 2 years ago
parent
commit
74fd256ea3

+ 2 - 1
src/views/purchase/apply/add/index.vue

@@ -85,7 +85,8 @@ export default {
     async useRowAdd(prop) {
       const {
         $notify,
-        params: { tabColumns, puOrgName, supplierName },
+        tabColumns,
+        params: { puOrgName, supplierName },
       } = this;
       if (!supplierName) {
         return $notify.info("请选择供应商");

+ 3 - 2
src/views/purchase/apply/edit/index.vue

@@ -91,8 +91,9 @@ export default {
     //
     async useRowAdd(prop) {
       const {
-        $notify,
-        params: { tabColumns, puOrgName, supplierName },
+      $notify,
+        tabColumns,
+        params: {  puOrgName, supplierName },
       } = this;
       if (!supplierName) {
         return $notify.info("请选择供应商");

+ 25 - 21
src/views/purchase/task/close/index.vue

@@ -10,28 +10,32 @@ export default {
   methods: {
     //
     open(prop) {
-      this.$confirm("是否关闭数据项?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info",
-      })
-        .then(async () => {
-          try {
-            this.loading = true;
-            const { demandItemId } = prop;
-            const { code } = await SHUTDOWN(demandItemId);
-            if (code === 200) {
-              this.$emit("success");
-            }
-          } catch (err) {
-            // catch
-          } finally {
-            // finally
-          }
+      return new Promise((resolve, reject) => {
+        this.$confirm("是否关闭数据项?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "info",
         })
-        .catch((err) => {
-          console.error(err);
-        });
+          .then(async () => {
+            try {
+              this.loading = true;
+              const { demandItemId } = prop;
+              const { code } = await SHUTDOWN(demandItemId);
+              if (code === 200) {
+                resolve(true);
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              reject(false);
+              console.error(err);
+            } finally {
+              // finally
+            }
+          })
+          .catch(() => reject(false));
+      });
     },
   },
   created() {},

+ 6 - 6
src/views/purchase/task/see/index.vue

@@ -21,11 +21,6 @@ export default {
   computed: {},
   watch: {},
   methods: {
-    //
-    open(prop) {
-      this.visible = true;
-      this.fetchItem(prop);
-    },
     // 查 询
     async fetchItem(prop) {
       try {
@@ -33,8 +28,9 @@ export default {
         const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
+          return true;
         } else {
-          this.$notify.warning({ title: msg });
+          return false;
         }
       } catch (err) {
         // catch
@@ -43,6 +39,10 @@ export default {
         this.loading = false;
       }
     },
+    //
+    open(prop) {
+      this.visible = this.fetchItem(prop);
+    },
   },
   created() {},
   mounted() {},