Merge branch 'develop' into devTee
# Conflicts: # src/modules/18_command/components/DialogCreateCommandORG.vue
This commit is contained in:
commit
1b6bb495a5
10 changed files with 317 additions and 247 deletions
|
|
@ -36,7 +36,8 @@ const isStaff = defineModel<boolean>("isStaff");
|
|||
const rootId = defineModel<string>("rootId");
|
||||
|
||||
const props = defineProps({
|
||||
commandTypeCode: String, // ไอดีประเภทคำสั่ง
|
||||
commandTypeCode: { type: String, defult: "" }, // ไอดีประเภทคำสั่ง
|
||||
commandTypeCodeArray: { type: Array, defult: [] }, // ไอดีประเภทคำสั่ง
|
||||
systemName: String, // ไอดีประเภทคำสั่ง
|
||||
orgPublishDate: { type: Date || undefined, defult: undefined },
|
||||
});
|
||||
|
|
@ -168,16 +169,23 @@ function closeModal() {
|
|||
isCheckOrgPublishDate.value = false;
|
||||
rows.value = [];
|
||||
selected.value = [];
|
||||
commandType.value = "";
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลคำสั่ง */
|
||||
async function fetchCommandType() {
|
||||
const data = await storeCommand.getCommandTypes(); // ยิงไป get ที่ store
|
||||
// filter เฉพาะ code ของคำสั่งที่เลือก
|
||||
commandOp.value = await data.filter(
|
||||
(v: ListCommand) => v.code == props.commandTypeCode
|
||||
);
|
||||
commandType.value = commandOp.value[0].id;
|
||||
if (props.systemName === "SALARY" || props.systemName === "SALARY_EMP") {
|
||||
commandOp.value = await data.filter((v: ListCommand) =>
|
||||
props.commandTypeCodeArray?.includes(v.code)
|
||||
);
|
||||
} else {
|
||||
commandOp.value = await data.filter(
|
||||
(v: ListCommand) => v.code == props.commandTypeCode
|
||||
);
|
||||
commandType.value = commandOp.value[0].id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -210,20 +218,31 @@ function getPerson() {
|
|||
type: group.value,
|
||||
};
|
||||
|
||||
const pathAPI =
|
||||
props.systemName === "ORGANIZATION"
|
||||
? config.API.orgPosReport
|
||||
: props.systemName === "SALARY"
|
||||
? config.API.orgPosReport
|
||||
: props.systemName === "SALARY_EMP"
|
||||
? config.API.orgPosReport
|
||||
: props.systemName === "ACTING"
|
||||
? config.API.orgPosReport
|
||||
: "";
|
||||
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgPosReport, body)
|
||||
.post(pathAPI, body)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = data;
|
||||
selected.value = data; //select all
|
||||
hideLoader();
|
||||
selected.value = rows.value;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
watch(modal, async () => {
|
||||
|
|
@ -264,10 +283,18 @@ watch(modal, async () => {
|
|||
emit-value
|
||||
map-options
|
||||
lazy-rules
|
||||
use-input
|
||||
hide-bottom-space
|
||||
outlined
|
||||
readonly
|
||||
:readonly="
|
||||
props.systemName !== 'SALARY' &&
|
||||
props.systemName !== 'SALARY_EMP'
|
||||
"
|
||||
:class="
|
||||
props.systemName === 'SALARY' ||
|
||||
props.systemName === 'SALARY_EMP'
|
||||
? 'inputgreen'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue