fixing bug organization set isOffice

This commit is contained in:
Warunee Tamkoo 2024-09-16 10:12:56 +07:00
parent d659b0930d
commit 6a471aa3f9

View file

@ -110,7 +110,7 @@ function onSubmit() {
rootId = level.value === 0 ? store.draftId : props.dataNode?.orgRootId;
}
const body = {
let body = {
["org" + type + "Name"]: formData.orgName,
["org" + type + "ShortName"]: formData.orgShortName,
["org" + type + "Code"]: formData.orgCode,
@ -122,9 +122,15 @@ function onSubmit() {
[nameId]: rootId,
responsibility:
formData.responsibility != null ? formData.responsibility : "",
isOfficer: formData.isOfficer,
};
if (type === "Child1") {
body = {
...body,
isOfficer: formData.isOfficer,
};
}
//
if (actionType.value === "ADD") {
await http
@ -352,25 +358,6 @@ function onChangeIsOfficer() {
);
}
}
// watch(
// () => formData.isOfficer,
// (newData, oldData) => {
// if (
// newData === true &&
// oldData === false &&
// checkIsOfficer.value === true &&
// props.modal === true
// ) {
// dialogConfirm(
// $q,
// () => (formData.isOfficer = true),
// "",
// " . ?",
// () => (formData.isOfficer = false)
// );
// }
// }
// );
</script>
<template>