This commit is contained in:
STW_TTTY\stwtt 2024-07-12 13:22:35 +07:00
parent 82b6f07897
commit 74bd72c70c
9 changed files with 123 additions and 75 deletions

View file

@ -271,34 +271,40 @@ function updateSelect() {
search.value = "";
}
function getOrgOp() {
http
.get(config.API.Kpiorg)
.then((res) => {
const data = res.data.result;
evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({
id: i.id,
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
i.lastName ? i.lastName : ""
}`,
}));
commanderIdMainOp.value = data.commander.map((i: any) => ({
id: i.id,
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
i.lastName ? i.lastName : ""
}`,
}));
commanderHighMainOp.value = data.chairman.map((i: any) => ({
id: i.id,
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
i.lastName ? i.lastName : ""
}`,
}));
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
function getOrgOp(check: boolean,id:string) {
if (check == false) {
http
.get(config.API.Kpiorg+`/${id}`)
.then((res) => {
const data = res.data.result;
evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({
id: i.id,
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
i.lastName ? i.lastName : ""
}`,
}));
commanderIdMainOp.value = data.commander.map((i: any) => ({
id: i.id,
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
i.lastName ? i.lastName : ""
}`,
}));
commanderHighMainOp.value = data.chairman.map((i: any) => ({
id: i.id,
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
i.lastName ? i.lastName : ""
}`,
}));
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
} else {
evaluatorIdMainOp.value = [];
commanderIdMainOp.value = [];
commanderHighMainOp.value = [];
}
}
function onSubmit() {
@ -346,7 +352,6 @@ watch(
(n) => {
if (n == true) {
fetchRoundOption();
getOrgOp();
}
}
);
@ -456,6 +461,7 @@ watch(
color="primary"
dense
v-model="props.selected"
@click="getOrgOp(props.selected,props.row.id)"
/>
</q-td>
<q-td