Kaynağa Gözat

按钮防抖替换

lxf 1 yıl önce
ebeveyn
işleme
bd0926a5c5

+ 8 - 16
src/components/makeBOM/index.vue

@@ -206,7 +206,7 @@
     <div style="width: 100%; text-align: center; margin: 10px">
       <el-button v-if="props.detailStatus" @click="clickCancel()" size="large">关 闭</el-button>
       <el-button v-if="!props.detailStatus" @click="clickCancel()" size="large">取 消</el-button>
-      <el-button type="primary" @click="submitForm()" v-if="!props.detailStatus" :disabled="btnDisabled" size="large">确 定</el-button>
+      <el-button type="primary" @click="submitForm()" v-if="!props.detailStatus" size="large" v-preReClick>确 定</el-button>
     </div>
   </div>
 </template>
@@ -488,7 +488,6 @@ const handleMainSuccess = (response, uploadFile) => {
     fileUrl: uploadFile.raw.fileUrl,
   };
 };
-const btnDisabled = ref(false);
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.bomSpecList && formData.data.bomSpecList.length > 0) {
@@ -496,20 +495,13 @@ const submitForm = () => {
       if (formData.data.id) {
         type = "edit";
       }
-      btnDisabled.value = true;
-      proxy.post("/bom/" + type, formData.data).then(
-        () => {
-          ElMessage({
-            message: type == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          emit("clickCancel", true);
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/bom/" + type, formData.data).then(() => {
+        ElMessage({
+          message: type == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        emit("clickCancel", true);
+      });
     } else {
       return ElMessage("请添加规格");
     }

+ 8 - 16
src/components/makeGroupProduct/index.vue

@@ -191,7 +191,7 @@
     <div style="width: 100%; text-align: center; margin: 10px">
       <el-button v-if="props.detailStatus" @click="clickCancel()" size="large">关 闭</el-button>
       <el-button v-if="!props.detailStatus" @click="clickCancel()" size="large">取 消</el-button>
-      <el-button type="primary" @click="submitForm()" v-if="!props.detailStatus" :disabled="btnDisabled" size="large">确 定</el-button>
+      <el-button type="primary" @click="submitForm()" v-if="!props.detailStatus" size="large" v-preReClick>确 定</el-button>
     </div>
 
     <el-dialog title="选择BOM" v-if="openBOM" v-model="openBOM" width="84%">
@@ -453,7 +453,6 @@ const uploadMainFile = async (file) => {
 const handleMainSuccess = (response, uploadFile) => {
   formData.data.mainImgUrl = uploadFile.raw.fileUrl;
 };
-const btnDisabled = ref(false);
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.skuSpecList && formData.data.skuSpecList.length > 0) {
@@ -461,20 +460,13 @@ const submitForm = () => {
       if (formData.data.id) {
         type = "edit";
       }
-      btnDisabled.value = true;
-      proxy.post("/sku/" + type, formData.data).then(
-        () => {
-          ElMessage({
-            message: type == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          emit("clickCancel", true);
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/sku/" + type, formData.data).then(() => {
+        ElMessage({
+          message: type == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        emit("clickCancel", true);
+      });
     } else {
       return ElMessage("请添加规格");
     }

+ 8 - 16
src/components/makeProduct/index.vue

@@ -244,7 +244,7 @@
     <div style="width: 100%; text-align: center; margin: 10px">
       <el-button v-if="props.detailStatus" @click="clickCancel()" size="large">关 闭</el-button>
       <el-button v-if="!props.detailStatus" @click="clickCancel()" size="large">取 消</el-button>
-      <el-button type="primary" @click="submitForm()" v-if="!props.detailStatus" :disabled="btnDisabled" size="large">确 定</el-button>
+      <el-button type="primary" @click="submitForm()" v-if="!props.detailStatus" size="large" v-preReClick>确 定</el-button>
     </div>
 
     <el-dialog title="选择BOM" v-if="openBOM" v-model="openBOM" width="84%">
@@ -510,7 +510,6 @@ const uploadMainFile = async (file) => {
 const handleMainSuccess = (response, uploadFile) => {
   formData.data.mainImgUrl = uploadFile.raw.fileUrl;
 };
-const btnDisabled = ref(false);
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.skuSpecList && formData.data.skuSpecList.length > 0) {
@@ -518,20 +517,13 @@ const submitForm = () => {
       if (formData.data.id) {
         type = "edit";
       }
-      btnDisabled.value = true;
-      proxy.post("/sku/" + type, formData.data).then(
-        () => {
-          ElMessage({
-            message: type == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          emit("clickCancel", true);
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/sku/" + type, formData.data).then(() => {
+        ElMessage({
+          message: type == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        emit("clickCancel", true);
+      });
     } else {
       return ElMessage("请添加规格");
     }

+ 9 - 21
src/views/group/BOM/classification/index.vue

@@ -47,7 +47,7 @@
       </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </template>
     </el-dialog>
   </el-card>
@@ -144,11 +144,9 @@ const rules = ref({
   name: [{ required: true, message: "请输入分类名称", trigger: "blur" }],
   code: [{ required: true, message: "请输入分类编码", trigger: "blur" }],
 });
-const btnDisabled = ref(false);
 const clickModal = () => {
   modalType.value = "add";
   formData.data = {};
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const addChildNode = (row) => {
@@ -156,27 +154,18 @@ const addChildNode = (row) => {
   formData.data = {
     parentId: row.id,
   };
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    btnDisabled.value = true;
-    proxy.post("/bomClassify/" + modalType.value, formData.data).then(
-      () => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
-        openDialog.value = false;
-        btnDisabled.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        btnDisabled.value = false;
-      }
-    );
+    proxy.post("/bomClassify/" + modalType.value, formData.data).then(() => {
+      ElMessage({
+        message: modalType.value == "add" ? "添加成功" : "编辑成功",
+        type: "success",
+      });
+      openDialog.value = false;
+      getList();
+    });
   });
 };
 const clickUpdate = (row) => {
@@ -189,7 +178,6 @@ const clickUpdate = (row) => {
     sort: row.sort,
     remark: row.remark,
   };
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const clickDelete = (row) => {

+ 9 - 17
src/views/group/order/management/add.vue

@@ -296,8 +296,8 @@
       <div style="width: 100%; text-align: center; margin: 10px">
         <el-button @click="clickCancel()" v-if="route.query && route.query.detailId" size="large">关 闭</el-button>
         <el-button @click="clickCancel()" v-if="!(route.query && route.query.detailId)" size="large">取 消</el-button>
-        <el-button @click="submitForm('0')" v-if="!(route.query && route.query.detailId)" :disabled="btnDisabled" size="large">暂存</el-button>
-        <el-button type="primary" @click="submitForm('10')" v-if="!(route.query && route.query.detailId)" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button @click="submitForm('0')" v-if="!(route.query && route.query.detailId)" size="large" v-preReClick>暂 存</el-button>
+        <el-button type="primary" @click="submitForm('10')" v-if="!(route.query && route.query.detailId)" size="large" v-preReClick>确 定</el-button>
       </div>
     </el-card>
 
@@ -494,7 +494,6 @@ const clickDelete = (index) => {
 const updateValue = (val) => {
   formData.data.remark = val;
 };
-const btnDisabled = ref(false);
 const submitForm = (status) => {
   submit.value.handleSubmit(() => {
     if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
@@ -519,20 +518,13 @@ const submitForm = (status) => {
         type = "edit";
       }
       formData.data.status = status;
-      btnDisabled.value = true;
-      proxy.post("/orderInfo/" + type, formData.data).then(
-        () => {
-          ElMessage({
-            message: type == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          clickCancel();
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/orderInfo/" + type, formData.data).then(() => {
+        ElMessage({
+          message: type == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        clickCancel();
+      });
     } else {
       return ElMessage("请添加产品");
     }

+ 9 - 21
src/views/group/product/classification/index.vue

@@ -47,7 +47,7 @@
       </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </template>
     </el-dialog>
   </el-card>
@@ -144,11 +144,9 @@ const rules = ref({
   name: [{ required: true, message: "请输入分类名称", trigger: "blur" }],
   code: [{ required: true, message: "请输入分类编码", trigger: "blur" }],
 });
-const btnDisabled = ref(false);
 const clickModal = () => {
   modalType.value = "add";
   formData.data = {};
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const addChildNode = (row) => {
@@ -156,27 +154,18 @@ const addChildNode = (row) => {
   formData.data = {
     parentId: row.id,
   };
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    btnDisabled.value = true;
-    proxy.post("/skuClassify/" + modalType.value, formData.data).then(
-      () => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
-        openDialog.value = false;
-        btnDisabled.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        btnDisabled.value = false;
-      }
-    );
+    proxy.post("/skuClassify/" + modalType.value, formData.data).then(() => {
+      ElMessage({
+        message: modalType.value == "add" ? "添加成功" : "编辑成功",
+        type: "success",
+      });
+      openDialog.value = false;
+      getList();
+    });
   });
 };
 const clickUpdate = (row) => {
@@ -189,7 +178,6 @@ const clickUpdate = (row) => {
     sort: row.sort,
     remark: row.remark,
   };
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const clickDelete = (row) => {

+ 12 - 20
src/views/group/selling-price/charging-standard/addOrModify.vue

@@ -135,7 +135,7 @@
       </template>
     </byForm>
     <div style="width: 100%; text-align: center; margin: 10px">
-      <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">保 存</el-button>
+      <el-button type="primary" @click="submitForm()" size="large" v-preReClick>保 存</el-button>
     </div>
   </el-card>
 </template>
@@ -187,7 +187,6 @@ const rules = ref({
   costPrice: [{ required: true, message: "请输入成本价", trigger: "blur" }],
   sort: [{ required: true, message: "请输入排序", trigger: "blur" }],
 });
-const btnDisabled = ref(false);
 const type = ref("add");
 const submitForm = () => {
   submit.value.handleSubmit(() => {
@@ -234,24 +233,17 @@ const submitForm = () => {
           }
         }
       }
-      btnDisabled.value = true;
-      proxy.post("/priceBillingStandard/" + type.value, formData.data).then(
-        () => {
-          ElMessage({
-            message: type.value == "add" ? "保存成功" : "编辑成功",
-            type: "success",
-          });
-          const useTagsStore = useTagsViewStore();
-          useTagsStore.delVisitedView(router.currentRoute.value);
-          router.replace({
-            path: "/group/selling-price/charging-standard",
-          });
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/priceBillingStandard/" + type.value, formData.data).then(() => {
+        ElMessage({
+          message: type.value == "add" ? "保存成功" : "编辑成功",
+          type: "success",
+        });
+        const useTagsStore = useTagsViewStore();
+        useTagsStore.delVisitedView(router.currentRoute.value);
+        router.replace({
+          path: "/group/selling-price/charging-standard",
+        });
+      });
     } else {
       return ElMessage("请添加收费项目");
     }

+ 9 - 20
src/views/group/selling-price/price-system/index.vue

@@ -23,7 +23,7 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit"> </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </template>
     </el-dialog>
 
@@ -179,31 +179,21 @@ const formConfig = computed(() => {
 const rules = ref({
   name: [{ required: true, message: "请输入售价体系", trigger: "blur" }],
 });
-const btnDisabled = ref(false);
 const clickModal = () => {
   modalType.value = "add";
   formData.data = {};
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    btnDisabled.value = true;
-    proxy.post("/priceSystem/" + modalType.value, formData.data).then(
-      () => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
-        openDialog.value = false;
-        btnDisabled.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        btnDisabled.value = false;
-      }
-    );
+    proxy.post("/priceSystem/" + modalType.value, formData.data).then(() => {
+      ElMessage({
+        message: modalType.value == "add" ? "添加成功" : "编辑成功",
+        type: "success",
+      });
+      openDialog.value = false;
+      getList();
+    });
   });
 };
 const openDisposition = ref(false);
@@ -215,7 +205,6 @@ const clickDisposition = (row) => {
 const clickUpdate = (row) => {
   modalType.value = "edit";
   formData.data = row;
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const clickDelete = (row) => {

+ 9 - 20
src/views/group/subsidiary/business-division/index.vue

@@ -31,7 +31,7 @@
       </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </template>
     </el-dialog>
   </div>
@@ -414,7 +414,6 @@ const rules = ref({
   orderMode: [{ required: true, message: "请选择下单模式", trigger: "change" }],
   status: [{ required: true, message: "请选择状态", trigger: "change" }],
 });
-const btnDisabled = ref(false);
 const clickModal = () => {
   modalType.value = "add";
   formData.data = {
@@ -422,7 +421,6 @@ const clickModal = () => {
     wlnWarehouseCodeArr: [],
     wlnBrandArr: [],
   };
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const submitForm = () => {
@@ -437,22 +435,14 @@ const submitForm = () => {
     } else {
       formData.data.wlnWarehouseCode = "";
     }
-    btnDisabled.value = true;
-    proxy.post("/department/" + modalType.value, formData.data).then(
-      () => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
-        openDialog.value = false;
-        btnDisabled.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        btnDisabled.value = false;
-      }
-    );
+    proxy.post("/department/" + modalType.value, formData.data).then(() => {
+      ElMessage({
+        message: modalType.value == "add" ? "添加成功" : "编辑成功",
+        type: "success",
+      });
+      openDialog.value = false;
+      getList();
+    });
   });
 };
 const clickUpdate = (row) => {
@@ -469,7 +459,6 @@ const clickUpdate = (row) => {
     } else {
       formData.data.wlnWarehouseCodeArr = [];
     }
-    btnDisabled.value = false;
     openDialog.value = true;
   });
 };

+ 9 - 20
src/views/production/equipment/working-procedure/index.vue

@@ -23,7 +23,7 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit"> </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </template>
     </el-dialog>
   </div>
@@ -187,38 +187,27 @@ const rules = ref({
   name: [{ required: true, message: "请输入工序名称", trigger: "blur" }],
   manHour: [{ required: true, message: "请输入标准工时", trigger: "blur" }],
 });
-const btnDisabled = ref(false);
 const clickModal = () => {
   modalType.value = "add";
   formData.data = {};
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    btnDisabled.value = true;
-    proxy.post("/craftProcess/" + modalType.value, formData.data).then(
-      () => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
-        openDialog.value = false;
-        btnDisabled.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        btnDisabled.value = false;
-      }
-    );
+    proxy.post("/craftProcess/" + modalType.value, formData.data).then(() => {
+      ElMessage({
+        message: modalType.value == "add" ? "添加成功" : "编辑成功",
+        type: "success",
+      });
+      openDialog.value = false;
+      getList();
+    });
   });
 };
 const clickUpdate = (row) => {
   modalType.value = "edit";
   proxy.post("/craftProcess/detail", { id: row.id }).then((res) => {
     formData.data = res;
-    btnDisabled.value = false;
     openDialog.value = true;
   });
 };

+ 9 - 20
src/views/production/technology/management/index.vue

@@ -34,7 +34,7 @@
       </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </template>
     </el-dialog>
   </div>
@@ -286,38 +286,27 @@ const getDemandData = () => {
   });
 };
 getDemandData();
-const btnDisabled = ref(false);
 const clickModal = () => {
   modalType.value = "add";
   formData.data = {};
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    btnDisabled.value = true;
-    proxy.post("/equipment/" + modalType.value, formData.data).then(
-      () => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
-        openDialog.value = false;
-        btnDisabled.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        btnDisabled.value = false;
-      }
-    );
+    proxy.post("/equipment/" + modalType.value, formData.data).then(() => {
+      ElMessage({
+        message: modalType.value == "add" ? "添加成功" : "编辑成功",
+        type: "success",
+      });
+      openDialog.value = false;
+      getList();
+    });
   });
 };
 const clickUpdate = (row) => {
   modalType.value = "edit";
   proxy.post("/equipment/detail", { id: row.id }).then((res) => {
     formData.data = res;
-    btnDisabled.value = false;
     openDialog.value = true;
   });
 };

+ 8 - 16
src/views/production/warehouse/check/add.vue

@@ -69,7 +69,7 @@
       </byForm>
       <div style="width: 100%; text-align: center; margin: 10px">
         <el-button @click="clickCancel()" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </div>
     </el-card>
 
@@ -201,24 +201,16 @@ const changeDepartment = () => {
 const clickDelete = (index) => {
   formData.data.checkBomList.splice(index, 1);
 };
-const btnDisabled = ref(false);
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.checkBomList && formData.data.checkBomList.length > 0) {
-      btnDisabled.value = true;
-      proxy.post("/check/add", formData.data).then(
-        () => {
-          ElMessage({
-            message: "提交成功",
-            type: "success",
-          });
-          clickCancel();
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/check/add", formData.data).then(() => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        clickCancel();
+      });
     } else {
       return ElMessage("请添加BOM");
     }

+ 9 - 20
src/views/production/warehouse/management/index.vue

@@ -23,7 +23,7 @@
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit"> </byForm>
       <template #footer>
         <el-button @click="openDialog = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </template>
     </el-dialog>
   </div>
@@ -184,38 +184,27 @@ const rules = ref({
   type: [{ required: true, message: "请选择仓库类型", trigger: "change" }],
   name: [{ required: true, message: "请输入仓库名称", trigger: "blur" }],
 });
-const btnDisabled = ref(false);
 const clickModal = () => {
   modalType.value = "add";
   formData.data = {};
-  btnDisabled.value = false;
   openDialog.value = true;
 };
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    btnDisabled.value = true;
-    proxy.post("/warehouse/" + modalType.value, formData.data).then(
-      () => {
-        ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
-          type: "success",
-        });
-        openDialog.value = false;
-        btnDisabled.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        btnDisabled.value = false;
-      }
-    );
+    proxy.post("/warehouse/" + modalType.value, formData.data).then(() => {
+      ElMessage({
+        message: modalType.value == "add" ? "添加成功" : "编辑成功",
+        type: "success",
+      });
+      openDialog.value = false;
+      getList();
+    });
   });
 };
 const clickUpdate = (row) => {
   modalType.value = "edit";
   proxy.post("/warehouse/detail", { id: row.id }).then((res) => {
     formData.data = res;
-    btnDisabled.value = false;
     openDialog.value = true;
   });
 };

+ 8 - 16
src/views/production/warehouse/outbound/add.vue

@@ -67,7 +67,7 @@
       </byForm>
       <div style="width: 100%; text-align: center; margin: 10px">
         <el-button @click="clickCancel()" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </div>
     </el-card>
 
@@ -197,7 +197,6 @@ const selectBOM = (item) => {
 const clickDelete = (index) => {
   formData.data.inOutStorageBomList.splice(index, 1);
 };
-const btnDisabled = ref(false);
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.inOutStorageBomList && formData.data.inOutStorageBomList.length > 0) {
@@ -206,20 +205,13 @@ const submitForm = () => {
           return ElMessage("出库数量大于剩余库存数量");
         }
       }
-      btnDisabled.value = true;
-      proxy.post("/inOutStorage/add", formData.data).then(
-        () => {
-          ElMessage({
-            message: "提交成功",
-            type: "success",
-          });
-          clickCancel();
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/inOutStorage/add", formData.data).then(() => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        clickCancel();
+      });
     } else {
       return ElMessage("请添加BOM");
     }

+ 8 - 16
src/views/production/warehouse/putInStorage/add.vue

@@ -76,7 +76,7 @@
       </byForm>
       <div style="width: 100%; text-align: center; margin: 10px">
         <el-button @click="clickCancel()" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </div>
     </el-card>
 
@@ -201,24 +201,16 @@ const selectBOM = (item) => {
 const clickDelete = (index) => {
   formData.data.inOutStorageBomList.splice(index, 1);
 };
-const btnDisabled = ref(false);
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.inOutStorageBomList && formData.data.inOutStorageBomList.length > 0) {
-      btnDisabled.value = true;
-      proxy.post("/inOutStorage/add", formData.data).then(
-        () => {
-          ElMessage({
-            message: "提交成功",
-            type: "success",
-          });
-          clickCancel();
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/inOutStorage/add", formData.data).then(() => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        clickCancel();
+      });
     } else {
       return ElMessage("请添加BOM");
     }

+ 8 - 16
src/views/production/warehouse/transfer/index.vue

@@ -71,7 +71,7 @@
       </byForm>
       <div style="width: 100%; text-align: center; margin: 10px">
         <el-button @click="clickCancel()" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm()" :disabled="btnDisabled" size="large">确 定</el-button>
+        <el-button type="primary" @click="submitForm()" size="large" v-preReClick>确 定</el-button>
       </div>
     </el-card>
 
@@ -192,24 +192,16 @@ const selectBOM = (item) => {
 const clickDelete = (index) => {
   formData.data.inOutStorageBomList.splice(index, 1);
 };
-const btnDisabled = ref(false);
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     if (formData.data.inOutStorageBomList && formData.data.inOutStorageBomList.length > 0) {
-      btnDisabled.value = true;
-      proxy.post("/inOutStorage/add", formData.data).then(
-        () => {
-          ElMessage({
-            message: "提交成功",
-            type: "success",
-          });
-          clickCancel();
-        },
-        (err) => {
-          console.log(err);
-          btnDisabled.value = false;
-        }
-      );
+      proxy.post("/inOutStorage/add", formData.data).then(() => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        clickCancel();
+      });
     } else {
       return ElMessage("请添加BOM");
     }