瀏覽代碼

Merge branch 'ScrmStores' into yjb_ScrmStores

zhangqin 4 天之前
父節點
當前提交
1bd50022de
共有 2 個文件被更改,包括 35 次插入1 次删除
  1. 8 0
      src/api/hisStore/storeProduct.js
  2. 27 1
      src/views/hisStore/storeProduct/index.vue

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

@@ -117,3 +117,11 @@ export function sync580(productId) {
   })
 }
 
+
+export function updateIsShow(productIds) {
+  return request({
+    url: '/store/store/storeProduct/updateFsStoreProductIsShowBatch/' + (Array.isArray(productIds) ? productIds.join(',') : productIds),
+    method: 'post'
+  })
+}
+

+ 27 - 1
src/views/hisStore/storeProduct/index.vue

@@ -282,6 +282,17 @@
           v-hasPermi="['store:storeProduct:sync']"
         >同步</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-close"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchOff"
+          v-hasPermi="['store:storeProduct:updateIsShow']"
+        >批量下架</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -927,7 +938,8 @@ import {
   exportStoreProduct,
   importTemplate,
   batchModify,
-  sync580
+  sync580,
+  updateIsShow
 } from "@/api/hisStore/storeProduct";
 import { getAllStoreProductCategory } from "@/api/hisStore/storeProductCategory";
 import { getAllStoreProductRule } from "@/api/hisStore/storeProductRule";
@@ -1710,6 +1722,20 @@ export default {
         this.getList();
         this.msgSuccess("同步成功");
       }).catch(function() {});
+    },
+    /** 批量下架按钮操作 */
+    handleBatchOff (row) {
+      const productIds = (row && row.productId) || this.ids;
+      this.$confirm('是否确认批量下架商品编号为"' + productIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        return updateIsShow(productIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("下架成功");
+      }).catch(function() {});
     }
   }
 };