瀏覽代碼

feat: 详情跳转新标签页

zh 2 年之前
父節點
當前提交
c3b0d535b4

+ 26 - 4
src/views/commercialEngineering/crossDistrict/crossDistrictkList.vue

@@ -159,6 +159,9 @@ export default {
       ]
       ]
     }
     }
   },
   },
+  created() {
+    this.getCurrentRoute()
+  },
   methods: {
   methods: {
     // 列表请求函数
     // 列表请求函数
     getList(...p) {
     getList(...p) {
@@ -172,10 +175,14 @@ export default {
       if (item.colName === 'project_no') {
       if (item.colName === 'project_no') {
         defaultData.render = (h, { row, index, column }) => {
         defaultData.render = (h, { row, index, column }) => {
           return (<el-link type='primary' underline={false} onClick={() => {
           return (<el-link type='primary' underline={false} onClick={() => {
-            this.content = '详情'
-            this.module = 'detail'
-            this.detailId = row.id
-            this.visible = true
+            const page = this.$router.resolve({
+              path: '/commercialEngineering/crossDistrictkList',
+              query: {
+                detailId: row.id,
+                module: 'detail'
+              }
+            })
+            window.open(page.href, '_blank')
           }}>{row.projectNo}</el-link>)
           }}>{row.projectNo}</el-link>)
         }
         }
       }
       }
@@ -272,6 +279,8 @@ export default {
       }
       }
     },
     },
     handleClose() {
     handleClose() {
+      this.getCurrentRoute('OK')
+
       this.addOff(() => {
       this.addOff(() => {
         this.content = '新增'
         this.content = '新增'
         this.module = 'add'
         this.module = 'add'
@@ -282,6 +291,19 @@ export default {
         this.visible = false
         this.visible = false
         this.$refs.pageRef.refreshList()
         this.$refs.pageRef.refreshList()
       })()
       })()
+    },
+    getCurrentRoute(back) {
+      const { detailId, module } = this.$route.query
+      if (back === 'OK' && module === 'detail') {
+        this.$router.replace('/commercialEngineering/frockList')
+        return
+      }
+      if (detailId && module === 'detail') {
+        this.content = '详情'
+        this.detailId = detailId
+        this.module = module
+        this.visible = true
+      }
     }
     }
   }
   }
 }
 }

+ 25 - 4
src/views/commercialEngineering/frock/frockList.vue

@@ -156,6 +156,9 @@ export default {
       ]
       ]
     }
     }
   },
   },
+  created() {
+    this.getCurrentRoute()
+  },
   methods: {
   methods: {
     // 列表请求函数
     // 列表请求函数
     getList(...p) {
     getList(...p) {
@@ -169,10 +172,14 @@ export default {
       if (item.colName === 'project_no') {
       if (item.colName === 'project_no') {
         defaultData.render = (h, { row, index, column }) => {
         defaultData.render = (h, { row, index, column }) => {
           return (<el-link type='primary' underline={false} onClick={() => {
           return (<el-link type='primary' underline={false} onClick={() => {
-            this.content = '详情'
-            this.module = 'detail'
-            this.detailId = row.id
-            this.visible = true
+            const page = this.$router.resolve({
+              path: '/commercialEngineering/frockList',
+              query: {
+                detailId: row.id,
+                module: 'detail'
+              }
+            })
+            window.open(page.href, '_blank')
           }}>{row.projectNo}</el-link>)
           }}>{row.projectNo}</el-link>)
         }
         }
       }
       }
@@ -273,6 +280,7 @@ export default {
       }
       }
     },
     },
     handleClose() {
     handleClose() {
+      this.getCurrentRoute('OK')
       this.addOff(() => {
       this.addOff(() => {
         this.content = '新增'
         this.content = '新增'
         this.module = 'add'
         this.module = 'add'
@@ -283,6 +291,19 @@ export default {
         this.visible = false
         this.visible = false
         this.$refs.pageRef.refreshList()
         this.$refs.pageRef.refreshList()
       })()
       })()
+    },
+    getCurrentRoute(back) {
+      const { detailId, module } = this.$route.query
+      if (back === 'OK' && module === 'detail') {
+        this.$router.replace('/commercialEngineering/frockList')
+        return
+      }
+      if (detailId && module === 'detail') {
+        this.content = '详情'
+        this.detailId = detailId
+        this.module = module
+        this.visible = true
+      }
     }
     }
   }
   }
 }
 }

+ 25 - 4
src/views/commercialEngineering/homeDecoration/homeDecorationList.vue

@@ -165,6 +165,9 @@ export default {
       ]
       ]
     }
     }
   },
   },
+  created() {
+    this.getCurrentRoute()
+  },
   methods: {
   methods: {
     // 列表请求函数
     // 列表请求函数
     getList(...p) {
     getList(...p) {
@@ -178,10 +181,14 @@ export default {
       if (item.colName === 'project_no') {
       if (item.colName === 'project_no') {
         defaultData.render = (h, { row, index, column }) => {
         defaultData.render = (h, { row, index, column }) => {
           return (<el-link type='primary' underline={false} onClick={() => {
           return (<el-link type='primary' underline={false} onClick={() => {
-            this.content = '详情'
-            this.module = 'detail'
-            this.detailId = row.id
-            this.visible = true
+            const page = this.$router.resolve({
+              path: '/commercialEngineering/homeDecorationList',
+              query: {
+                detailId: row.id,
+                module: 'detail'
+              }
+            })
+            window.open(page.href, '_blank')
           }}>{row.projectNo}</el-link>)
           }}>{row.projectNo}</el-link>)
         }
         }
       }
       }
@@ -278,6 +285,7 @@ export default {
       }
       }
     },
     },
     handleClose() {
     handleClose() {
+      this.getCurrentRoute('OK')
       this.addOff(() => {
       this.addOff(() => {
         this.content = '新增'
         this.content = '新增'
         this.module = 'add'
         this.module = 'add'
@@ -288,6 +296,19 @@ export default {
         this.visible = false
         this.visible = false
         this.$refs.pageRef.refreshList()
         this.$refs.pageRef.refreshList()
       })()
       })()
+    },
+    getCurrentRoute(back) {
+      const { detailId, module } = this.$route.query
+      if (back === 'OK' && module === 'detail') {
+        this.$router.replace('/commercialEngineering/frockList')
+        return
+      }
+      if (detailId && module === 'detail') {
+        this.content = '详情'
+        this.detailId = detailId
+        this.module = module
+        this.visible = true
+      }
     }
     }
   }
   }
 }
 }