|
@@ -68,6 +68,7 @@
|
|
|
v-model="taskForm.baseFormIds"
|
|
|
multiple
|
|
|
placeholder="Select"
|
|
|
+ @change="onTaskFormIdChange"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
@@ -122,7 +123,7 @@ const taskForm = ref({
|
|
|
formName: "",
|
|
|
baseFormIds: "",
|
|
|
workOrderId: "",
|
|
|
- info:{}
|
|
|
+ info: {},
|
|
|
});
|
|
|
const rules = reactive({
|
|
|
formName: [{ required: true, trigger: "blur" }],
|
|
@@ -139,7 +140,22 @@ const props = defineProps({
|
|
|
},
|
|
|
},
|
|
|
});
|
|
|
+
|
|
|
+const onTaskFormIdChange = () => {
|
|
|
+ // 如果taskForm.formName是空的
|
|
|
+ if (!taskForm.value.formName) {
|
|
|
+ if (taskForm.value.baseFormIds.length > 0) {
|
|
|
+ options.value.forEach((element) => {
|
|
|
+ if (element.value == taskForm.value.baseFormIds[0]) {
|
|
|
+ taskForm.value.formName = element.label;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const handleClose = () => {
|
|
|
+ taskFormRef.value.resetFields();
|
|
|
editDialog.value.visible = false;
|
|
|
value1.value = [];
|
|
|
};
|
|
@@ -177,8 +193,6 @@ const onSelected = () => {
|
|
|
ElMessage.success("添加成功!");
|
|
|
dataList();
|
|
|
handleClose();
|
|
|
- taskForm.value.baseFormIds = [];
|
|
|
- taskForm.value.formName = "";
|
|
|
} else {
|
|
|
ElMessage.error(data.msg);
|
|
|
}
|