YY 2 年之前
父節點
當前提交
6f145d13c6
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      src/views/selfShop/goods/index.vue

+ 17 - 0
src/views/selfShop/goods/index.vue

@@ -175,6 +175,23 @@ export default {
       }
       return arr.join(';');
     },
+    // 保存
+    async toSave({ data }) {
+      data.shop = this.user.shop.id;
+      let res;
+      if (data.id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res)) {
+        this.$message({ type: `success`, message: `维护信息成功` });
+        this.toBack();
+        this.search();
+      }
+    },
+    // 执行返回
+    toBack() {
+      this.form = {};
+      this.view = 'list';
+    },
     // 上架
     async toPuton({ data }) {
       this.$confirm('是否确认上架该商品?', '提示', {