@@ -74,13 +77,13 @@
label="下发单位"
v-if="form.mailCategory === '感谢信'"
>
-
+
props.mailId, (val) => {
- form = reactive({});
-})
+watch(
+ () => props.mailId,
+ (val) => {
+ formRef.value.resetFields();
+ form.mailFirstCategory = null;
+ form.mailSecondCategory = null;
+ form.mailThreeCategory = null;
+ }
+);
const formRef = ref();
@@ -159,12 +168,9 @@ const rules = {
],
};
-
-
const emits = defineEmits(["update:data"]);
function handleCategoryChange(data, node) {
- form.mailCategory = data.label;
if (node.level === 1) {
form.mailFirstCategory = data.label;
form.mailSecondCategory = null;
@@ -195,7 +201,7 @@ function getSecondDepts() {
function getThreeDepts(secondDeptId) {
listThree({
- secondDeptId
+ secondDeptId,
}).then((data) => {
threeDepts.value = data;
});
@@ -203,7 +209,7 @@ function getThreeDepts(secondDeptId) {
function handleChangeDept(val) {
form.threeDeptId = null;
- getThreeDepts(val)
+ getThreeDepts(val);
}
function validate() {
@@ -211,6 +217,7 @@ function validate() {
formRef.value.validate((valid) => {
if (valid) {
emits("update:data", form);
+
resolve(true);
} else {
reject();