Bläddra i källkod

增加总商品库商品选择

Guos 1 vecka sedan
förälder
incheckning
fd88a7aefd
2 ändrade filer med 25 tillägg och 11 borttagningar
  1. 2 2
      src/api/store/platformProduct.js
  2. 23 9
      src/views/store/platformProduct/index.vue

+ 2 - 2
src/api/store/platformProduct.js

@@ -46,9 +46,9 @@ export function delStoreProduct(productId) {
 }
 
 //编辑商品
-export function addOrEdit(data) {
+export function oneClickStorage(data) {
   return request({
-    url: '/store/platformProduct/addOrEdit',
+    url: '/store/platformProduct/oneClickStorage',
     method: 'post',
     data: data
   })

+ 23 - 9
src/views/store/platformProduct/index.vue

@@ -224,15 +224,22 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            icon="el-icon-document-copy"
+            @click="handleUpdate(scope.row, 'infoShow')"
           >详情
           </el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="productCopy(scope.row)"-->
+<!--          >一键入库-->
+<!--          </el-button>-->
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-document-copy"
-            @click="productCopy(scope.row)"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row, 'edit')"
           >一键入库
           </el-button>
         </template>
@@ -932,7 +939,7 @@ import {
   genFormatAttr,
   listStoreProduct,
   getStoreProduct,
-  addOrEdit,copyProduct,selectForbiddenKeywords,getExemptSecondMedicalDeviceList
+  oneClickStorage ,copyProduct,selectForbiddenKeywords,getExemptSecondMedicalDeviceList
 } from "@/api/store/platformProduct";
 import {getAllStoreProductCategory} from "@/api/store/storeProductCategory";
 import {getAllStoreProductRule} from "@/api/store/storeProductRule";
@@ -2135,15 +2142,22 @@ export default {
     },
 
     /** 修改按钮操作 */
-    handleUpdate(row) {
+    handleUpdate(row, type) {
       this.reset();
       var that = this;
+      console.log("type:",type)
       this.clearExpireErrors(); // 清空过期错误提示
       const productId = row.productId || this.ids
       getStoreProduct(productId).then(response => {
         this.open = true;
-        this.isViewMode = true; // 编辑模式
-        this.title = "商品详情";
+        if(type === 'infoShow'){
+          this.isViewMode = true; // 禁用编辑模式
+          this.title = "商品详情";
+        }
+        if(type === 'edit'){
+          this.isViewMode = false; // 禁用编辑模式
+          this.title = "一键复制到自己店铺";
+        }
         this.form = response.data;
         this.form.isShow = response.data.isShow.toString();
         this.form.isHot = response.data.isHot.toString();
@@ -2382,7 +2396,7 @@ export default {
       this.form.isCertificatePermanent = this.certificateValue ? 1 : 0;
 
       // 调用API提交数据
-      addOrEdit(this.form).then(response => {
+      oneClickStorage(this.form).then(response => {
         if (response.code === 200) {
           this.msgSuccess("操作成功!");
           this.open = false;