浏览代码

商品分类 取消 商品 弹窗提醒

zhengjinyi 5 年之前
父节点
当前提交
d331bc78bf
共有 3 个文件被更改,包括 36 次插入18 次删除
  1. 12 6
      src/views/goods/list-commonly.vue
  2. 12 6
      src/views/goods/list-preferential.vue
  3. 12 6
      src/views/goods/list-preferred.vue

+ 12 - 6
src/views/goods/list-commonly.vue

@@ -83,7 +83,7 @@
       </el-table-column>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row.id)">取消</el-button>
+          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row)">取消</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -169,11 +169,17 @@ export default {
         this.fetchData()
         this.fetchData()
       })
       })
     },
     },
-    cancelGoods(id) {
-      canncelProduct({ id: id, modules: this.modulesId }).then(() => {
-        this.fetchData()
-      }).catch(() => {
-        this.fetchData()
+    cancelGoods(row) {
+      this.$confirm('确定取消该商品吗?取消后该商品将不在出现在本页面', '系统提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        canncelProduct({ id: row.id, modules: this.modulesId }).then(() => {
+          this.fetchData()
+        }).catch(() => {
+          this.fetchData()
+        })
       })
       })
     }
     }
   }
   }

+ 12 - 6
src/views/goods/list-preferential.vue

@@ -83,7 +83,7 @@
       </el-table-column>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row.id)">取消</el-button>
+          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row)">取消</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -169,11 +169,17 @@ export default {
         this.fetchData()
         this.fetchData()
       })
       })
     },
     },
-    cancelGoods(id) {
-      canncelProduct({ id: id, modules: this.modulesId }).then(() => {
-        this.fetchData()
-      }).catch(() => {
-        this.fetchData()
+    cancelGoods(row) {
+      this.$confirm('确定取消该商品吗?取消后该商品将不在出现在本页面', '系统提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        canncelProduct({ id: row.id, modules: this.modulesId }).then(() => {
+          this.fetchData()
+        }).catch(() => {
+          this.fetchData()
+        })
       })
       })
     }
     }
   }
   }

+ 12 - 6
src/views/goods/list-preferred.vue

@@ -83,7 +83,7 @@
       </el-table-column>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row.id)">取消</el-button>
+          <el-button type="primary" size="mini" style="width: 80px;margin:5px 0 0 0;" @click="cancelGoods(row)">取消</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
@@ -169,11 +169,17 @@ export default {
         this.fetchData()
         this.fetchData()
       })
       })
     },
     },
-    cancelGoods(id) {
-      canncelProduct({ id: id, modules: this.modulesId }).then(() => {
-        this.fetchData()
-      }).catch(() => {
-        this.fetchData()
+    cancelGoods(row) {
+      this.$confirm('确定取消该商品吗?取消后该商品将不在出现在本页面', '系统提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        canncelProduct({ id: row.id, modules: this.modulesId }).then(() => {
+          this.fetchData()
+        }).catch(() => {
+          this.fetchData()
+        })
       })
       })
     }
     }
   }
   }