谢杰标 2 năm trước cách đây
mục cha
commit
d8c6ea3951
1 tập tin đã thay đổi với 12 bổ sung5 xóa
  1. 12 5
      src/views/Marketing/goods/commodityManageMent/index.vue

+ 12 - 5
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -124,6 +124,7 @@
       title="商品复制机构选择"
       :isShow.sync="dialogCopyVisible"
       @submit="goodsCopy"
+      :disabledBtn="copyLoading"
     >
       <el-radio-group v-model="tenantId">
         <el-radio
@@ -158,6 +159,7 @@ export default {
   data() {
     return {
       loading: false, //当前表单加载是否加载动画
+      copyLoading: false,
       navText: {
         title: "商品列表",
         index: 0,
@@ -485,12 +487,17 @@ export default {
       if (!data.length) {
         return this.$message.warning("请先勾选商品");
       }
+      this.copyLoading = true;
       const goodsIds = data.map((item) => item.goodsId);
-      goodsCopy({ goodsIds, tenantId: this.tenantId }).then((res) => {
-        this.dialogCopyVisible = false;
-        this.$refs.tableList.clearMoreActive();
-        this.$message.success("商品复制成功");
-      });
+      goodsCopy({ goodsIds, tenantId: this.tenantId })
+        .then((res) => {
+          this.dialogCopyVisible = false;
+          this.$refs.tableList.clearMoreActive();
+          this.$message.success("商品复制成功");
+        })
+        .finally((e) => {
+          this.copyLoading = false;
+        });
     },
     // 批量上下架
     handelBatch(type) {