|
@@ -47,7 +47,7 @@
|
|
</byForm>
|
|
</byForm>
|
|
<template #footer>
|
|
<template #footer>
|
|
<el-button @click="openDialog = false" size="large">取 消</el-button>
|
|
<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>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</el-card>
|
|
</el-card>
|
|
@@ -144,11 +144,9 @@ const rules = ref({
|
|
name: [{ required: true, message: "请输入分类名称", trigger: "blur" }],
|
|
name: [{ required: true, message: "请输入分类名称", trigger: "blur" }],
|
|
code: [{ required: true, message: "请输入分类编码", trigger: "blur" }],
|
|
code: [{ required: true, message: "请输入分类编码", trigger: "blur" }],
|
|
});
|
|
});
|
|
-const btnDisabled = ref(false);
|
|
|
|
const clickModal = () => {
|
|
const clickModal = () => {
|
|
modalType.value = "add";
|
|
modalType.value = "add";
|
|
formData.data = {};
|
|
formData.data = {};
|
|
- btnDisabled.value = false;
|
|
|
|
openDialog.value = true;
|
|
openDialog.value = true;
|
|
};
|
|
};
|
|
const addChildNode = (row) => {
|
|
const addChildNode = (row) => {
|
|
@@ -156,27 +154,18 @@ const addChildNode = (row) => {
|
|
formData.data = {
|
|
formData.data = {
|
|
parentId: row.id,
|
|
parentId: row.id,
|
|
};
|
|
};
|
|
- btnDisabled.value = false;
|
|
|
|
openDialog.value = true;
|
|
openDialog.value = true;
|
|
};
|
|
};
|
|
const submitForm = () => {
|
|
const submitForm = () => {
|
|
submit.value.handleSubmit(() => {
|
|
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) => {
|
|
const clickUpdate = (row) => {
|
|
@@ -189,7 +178,6 @@ const clickUpdate = (row) => {
|
|
sort: row.sort,
|
|
sort: row.sort,
|
|
remark: row.remark,
|
|
remark: row.remark,
|
|
};
|
|
};
|
|
- btnDisabled.value = false;
|
|
|
|
openDialog.value = true;
|
|
openDialog.value = true;
|
|
};
|
|
};
|
|
const clickDelete = (row) => {
|
|
const clickDelete = (row) => {
|