|
@@ -27,6 +27,7 @@
|
|
|
width="700"
|
|
|
v-loading="loading"
|
|
|
destroy-on-close
|
|
|
+ :before-close="handleClose"
|
|
|
>
|
|
|
<byForm
|
|
|
:formConfig="formConfig"
|
|
@@ -86,7 +87,7 @@
|
|
|
</byForm>
|
|
|
|
|
|
<template #footer>
|
|
|
- <el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
+ <el-button @click="handleClose" size="large">取 消</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@click="submitForm()"
|
|
@@ -261,7 +262,7 @@ const formConfig = computed(() => {
|
|
|
prop: "quantity",
|
|
|
label: "任务数量",
|
|
|
precision: 0,
|
|
|
- min: 0,
|
|
|
+ min: 1,
|
|
|
controls: false,
|
|
|
},
|
|
|
{
|
|
@@ -312,7 +313,7 @@ const formConfigOne = computed(() => {
|
|
|
prop: "quantity",
|
|
|
label: "任务数量",
|
|
|
precision: 0,
|
|
|
- min: 0,
|
|
|
+ min: 1,
|
|
|
controls: false,
|
|
|
},
|
|
|
{
|
|
@@ -380,11 +381,10 @@ const submitForm = () => {
|
|
|
message: "添加成功",
|
|
|
type: "success",
|
|
|
});
|
|
|
- productionProcessesList.value = [];
|
|
|
- productionObj.value = {};
|
|
|
- dialogVisible.value = false;
|
|
|
+ handleClose();
|
|
|
submitLoading.value = false;
|
|
|
getList();
|
|
|
+ getDict();
|
|
|
},
|
|
|
(err) => {
|
|
|
console.log(err);
|
|
@@ -466,7 +466,7 @@ const getDict = () => {
|
|
|
};
|
|
|
getDict();
|
|
|
getList();
|
|
|
-
|
|
|
+const changeId = ref("");
|
|
|
const changeFn = (val) => {
|
|
|
const current =
|
|
|
modalType.value == "add"
|
|
@@ -480,9 +480,11 @@ const changeFn = (val) => {
|
|
|
productionProcessesList.value &&
|
|
|
productionProcessesList.value.length > 0
|
|
|
) {
|
|
|
- let id = productionProcessesList.value[0].id;
|
|
|
- const index = formConfig.value.findIndex((x) => x.slotName === id);
|
|
|
- formConfig.value.splice(index, productionProcessesList.value.length);
|
|
|
+ // changeId.value = productionProcessesList.value[0].id;
|
|
|
+ // const index = formConfig.value.findIndex(
|
|
|
+ // (x) => x.slotName === changeId.value
|
|
|
+ // );
|
|
|
+ formConfig.value.splice(5, productionProcessesList.value.length);
|
|
|
productionProcessesList.value = [];
|
|
|
productionObj.value = {};
|
|
|
}
|
|
@@ -505,6 +507,17 @@ const getProductionDetails = (id) => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+const handleClose = () => {
|
|
|
+ if (
|
|
|
+ productionProcessesList.value &&
|
|
|
+ productionProcessesList.value.length > 0
|
|
|
+ ) {
|
|
|
+ formConfig.value.splice(5, productionProcessesList.value.length);
|
|
|
+ }
|
|
|
+ productionProcessesList.value = [];
|
|
|
+ productionObj.value = {};
|
|
|
+ dialogVisible.value = false;
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|