Browse Source

feature:优化

ZZH-wl 1 năm trước cách đây
mục cha
commit
ce7e6b2605
2 tập tin đã thay đổi với 10 bổ sung9 xóa
  1. 1 3
      src/views/consult/detail.vue
  2. 9 6
      src/views/consult/index.vue

+ 1 - 3
src/views/consult/detail.vue

@@ -178,9 +178,7 @@
       },
       // 返回
       back() {
-        this.$router.push({
-          path: '/consult',
-        })
+        this.$router.go(-1)
       },
     },
   }

+ 9 - 6
src/views/consult/index.vue

@@ -7,6 +7,9 @@
 -->
 <template>
   <div class="contract-container">
+    <FollowUp ref="followUpAdd" @consultSave="consultSave" />
+    <Edit ref="edit" @consultSave="consultSave" />
+
     <vab-query-form>
       <vab-query-form-top-panel>
         <el-form :inline="true" label-width="0px" :model="queryForm" @submit.native.prevent>
@@ -89,16 +92,14 @@
       :total="total"
       @current-change="handleCurrentChange"
       @size-change="handleSizeChange" />
-    <Edit ref="edit" @consultSave="consultSave" />
-    <FollowUp ref="followUp" @consultSave="consultSave" />
   </div>
 </template>
 
 <script>
   import to from 'await-to-js'
   import consultApi from '@/api/consult'
+  import FollowUp from '@/views/consult/components/FollowUp'
   import Edit from './components/Edit'
-  import FollowUp from './components/FollowUp'
   import TableTool from '@/components/table/TableTool'
 
   export default {
@@ -268,10 +269,12 @@
         this.queryData()
       },
       async handleEdit(row = null) {
-        row ? this.$refs.edit.init(row.id) : this.$refs.edit.init()
+        row ? await this.$refs.edit.init(row.id) : await this.$refs.edit.init()
       },
-      async handleFollowUp(row = null) {
-        row ? this.$refs.followUp.init(row.id) : this.$refs.followUp.init()
+      handleFollowUp(row = null) {
+        this.$nextTick(() => {
+          row ? this.$refs.followUpAdd.init(row.id) : this.$refs.followUpAdd.init()
+        })
       },
       handleDetail(row) {
         this.$router.push({