From 40c559dc4155783c39899a4bb44c26cb0efe40dd Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期二, 01 八月 2023 14:20:10 +0800
Subject: [PATCH] 流程模板和阶段与模板联动数据

---
 Source/UBCS-WEB/src/components/template/Stage.vue |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/template/Stage.vue b/Source/UBCS-WEB/src/components/template/Stage.vue
index 8fe6216..d1e2795 100644
--- a/Source/UBCS-WEB/src/components/template/Stage.vue
+++ b/Source/UBCS-WEB/src/components/template/Stage.vue
@@ -38,7 +38,11 @@
         }
     },
     watch: {
-
+      code: {
+        handler(newval, oldval) {
+          this.getDataList()
+        }
+      }
     },
     data() {
         const options = {
@@ -127,17 +131,19 @@
         },
         // 鑾峰彇鍒楄〃
         async getDataList() {
-            this.loading = false
-            const { pageSize, currentPage } = this.page
-            let param = { size: pageSize, current: currentPage }
-            const response = await getFlowpathList({ ...param, ...{ templateId: this.code } })
+          this.loading = false
+          if (this.code) {
+            const {pageSize, currentPage} = this.page
+            let param = {size: pageSize, current: currentPage}
+            const response = await getFlowpathList({...param, ...{templateId: this.code}})
             if (response.status === 200) {
-                console.log(response)
-                this.loading = false
-                const data = response.data.data
-                this.data = data.records
-                this.page.total = data.total
+              console.log(response)
+              this.loading = false
+              const data = response.data.data
+              this.data = data.records
+              this.page.total = data.total
             } else this.loading = false
+          }
         },
         // 鑾峰彇闃舵鍒楄〃
         async getStagelist() {

--
Gitblit v1.9.3