Ver Fonte

商品复制功能

yjwang há 5 dias atrás
pai
commit
f11f5387a1
2 ficheiros alterados com 36 adições e 1 exclusões
  1. 8 0
      src/api/store/storeProduct.js
  2. 28 1
      src/views/store/storeProduct/index.vue

+ 8 - 0
src/api/store/storeProduct.js

@@ -206,4 +206,12 @@ export function getProductrAuthInfo(query) {
 }
 
 
+export function copyProduct(data) {
+  return request({
+    url: '/store/storeProduct/copyProduct',
+    method: 'post',
+    data: data
+  })
+}
+
 

+ 28 - 1
src/views/store/storeProduct/index.vue

@@ -424,6 +424,13 @@
             @click="handleDelete(scope.row)"
           >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document-copy"
+            @click="productCopy(scope.row)"
+          >一键复制
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -1175,7 +1182,8 @@ import {
   batchModify,
   sync580,
   updateIsShow,
-  getProductrAuthInfo
+  getProductrAuthInfo,
+  copyProduct
 } from "@/api/store/storeProduct";
 import {getAllStoreProductCategory} from "@/api/store/storeProductCategory";
 import {getAllStoreProductRule} from "@/api/store/storeProductRule";
@@ -2361,6 +2369,25 @@ export default {
           done();
         })
         .catch(_ => {});
+    },
+    /**
+     * 复制商品
+     * **/
+    productCopy(row){
+      this.$confirm('确认是否复制当前《'+row.productName+'》商品!', '复制商品', {
+        confirmButtonText: '确 认',
+        cancelButtonText: '取 消',
+        type: 'warning'
+      }).then(() => {
+        copyProduct(row).then(response => {
+          if(response.code === 200){
+            this.$message.success("操作成功!")
+            this.getList();
+          }
+        })
+      }).catch(() => {
+
+      });
     }
   }
 };