guhongwei 5 년 전
부모
커밋
cfa428d061
3개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 4
      src/layout/otheruser/otheruserList.vue
  2. 2 1
      src/views/otheruser/detail.vue
  3. 5 1
      src/views/otheruser/index.vue

+ 1 - 4
src/layout/otheruser/otheruserList.vue

@@ -13,7 +13,7 @@
           </el-table-column>
           <el-table-column fixed="right" label="操作" align="center">
             <template slot-scope="scope">
-              <el-button @click="handleClick(scope.row)" type="text"><i class="el-icon-edit"></i></el-button>
+              <el-button @click="$router.push({ path: '/otheruser/detail', query: { id: scope.$index } })" type="text"><i class="el-icon-edit"></i></el-button>
               <el-button @click.native.prevent="deleteRow(scope.$index, debtTable)" type="text"><i class="el-icon-delete"></i></el-button>
             </template>
           </el-table-column>
@@ -34,9 +34,6 @@ export default {
   created() {},
   computed: {},
   methods: {
-    handleClick(id) {
-      this.$emit('handleClick', id);
-    },
     deleteRow(id) {
       this.$emit('deleteRow', id);
     },

+ 2 - 1
src/views/otheruser/detail.vue

@@ -41,10 +41,11 @@ export default {
     // 提交
     submitForm(form) {
       console.log(form);
+      this.resetForm();
     },
     // 取消
     resetForm() {
-      console.log('返回');
+      this.$router.push({ path: '/otheruser/index' });
     },
     // 返回
     goBack() {

+ 5 - 1
src/views/otheruser/index.vue

@@ -8,7 +8,7 @@
         <searchInfo></searchInfo>
       </el-col>
       <el-col :span="24" class="main">
-        <otheruserList :debtTable="debtTable"></otheruserList>
+        <otheruserList :debtTable="debtTable" @deleteRow="deleteRow"></otheruserList>
       </el-col>
     </el-col>
   </div>
@@ -55,6 +55,10 @@ export default {
     clickBtn() {
       this.$router.push({ path: '/otheruser/detail' });
     },
+    // 删除
+    deleteRow(id) {
+      console.log(id);
+    },
   },
 };
 </script>