qukaidi 3 anos atrás
pai
commit
81f57590c4
1 arquivos alterados com 7 adições e 11 exclusões
  1. 7 11
      src/views/maintenance/rebate/index.vue

+ 7 - 11
src/views/maintenance/rebate/index.vue

@@ -11,9 +11,9 @@
               <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow(row)" circle>
               </el-button>
             </template>
-            <template slot="menu">
-              <el-button size="small" icon="el-icon-edit" type="text" @click.stop="rowCell(row, index)">
-                {{ row.insideList.length > 0 && row.insideList[index].$cellEdit ?
+            <template slot="menu" slot-scope="{row,index}">
+              <el-button size="small" icon="el-icon-edit" type="text" @click.stop="rowCell(row)">
+                {{ row.$cellEdit ?
                     "保存" :
                     "修改"
                 }}</el-button>
@@ -207,18 +207,14 @@ export default {
       }
     },
     //编辑
-    rowCell(row, index) {
-      // this.$refs.crud.rowCell(row, index)
-      console.log(row.insideList)
-      if (row.insideList[index].$cellEdit) {
+    rowCell(row) {
+      if (row.$cellEdit) {
         typeSave(row).then(res => {
           this.$message.success('保存成功')
-          row.insideList[index].$cellEdit = false
+          this.$set(row, "$cellEdit", false);
         })
-        // done()
-        // this.saveProfit = row.profitReturn
       } else {
-        row.insideList[index].$cellEdit = true
+        this.$set(row, "$cellEdit", true);
       }
     },
     // 修改保存调用