ปรับบรรจุ แต่งตั้ง

This commit is contained in:
Warunee Tamkoo 2024-05-01 10:07:45 +07:00
parent 0973093813
commit 6a4568ec36
2 changed files with 30 additions and 22 deletions

View file

@ -139,8 +139,6 @@ function updateSelected(data: TreeMain) {
const isAll = ref<boolean>(false);
const isBlank = ref<boolean>(false);
async function fetchDataTable(id: string, level: number = 0) {
console.log(props.dataRow);
showLoader();
const body = {
node: level,
@ -196,9 +194,6 @@ async function fetchPosFind(level: number, id: string) {
.post(config.API.orgPosFind, body)
.then((res) => {
const data = res.data.result;
console.log(props?.dataRow);
expanded.value = data;
nodeId.value = id;
positionId.value = props?.dataRow?.posmasterId;
@ -224,7 +219,6 @@ async function onClickSubmit() {
} else {
dialogConfirm($q, async () => {
showLoader();
const body = {
personalId: props?.dataRow?.personalId,
node: dataPosMaster.node,
@ -239,6 +233,7 @@ async function onClickSubmit() {
posLevelId: selectedPos.value[0].posLevelId, //
posLevelName: selectedPos.value[0].posLevelName, //
reportingDate: datePos.value,
posmasterId: dataPosMaster.id,
typeCommand: props.typeCommand,
};
@ -277,8 +272,6 @@ watch(
() => modal.value,
async () => {
if (modal.value) {
console.log(props?.dataRow);
await fetchOrganizationActive();
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
@ -319,22 +312,18 @@ function filterNodeFn(data: any, id: string) {
watch(
() => isAll.value,
(value, oldVal) => {
console.log("value", value);
console.log("oldVal", oldVal);
isAll.value = value;
fetchDataTable(nodeId.value, nodeLevel.value);
if (value !== oldVal) {
fetchDataTable(nodeId.value, nodeLevel.value);
}
}
);
watch(
() => isBlank.value,
(value, oldVal) => {
console.log("isBlank value", value);
console.log("isBlank oldVal", oldVal);
isBlank.value = value;
fetchDataTable(nodeId.value, nodeLevel.value);
if (value !== oldVal) {
fetchDataTable(nodeId.value, nodeLevel.value);
}
}
);
</script>

View file

@ -234,14 +234,14 @@ function convertBmaOfficer(val: string) {
* แปลงสถานะบรรจ
* @param val type
*/
function convertContainStatus(val: string) {
function convertContainStatus(val: string, type: string = "") {
switch (val) {
case "UN-CONTAIN":
return "ยังไม่บรรจุ";
case "PREPARE-CONTAIN":
return "เตรียมบรรจุ";
return "เตรียม" + (type != "" ? type : "บรรจุ");
case "CONTAIN":
return "บรรจุแล้ว";
return (type != "" ? type : "บรรจุ") + "แล้ว";
case "DISCLAIM":
return "สละสิทธิ์";
default:
@ -249,6 +249,21 @@ function convertContainStatus(val: string) {
}
}
function convertTypeCommand(val: string) {
switch (val) {
case "APPOINTED":
return "บรรจุแต่งตั้ง";
case "APPOINT":
return "แต่งตั้ง";
case "SLIP":
return "เลื่อน";
case "MOVE":
return "ย้าย";
default:
return "";
}
}
/**
* แปลงสถานะการสงรายช
* @param val true/false
@ -322,7 +337,11 @@ async function getTable() {
posLevelCandidateName: data.posLevelCandidateName,
posmasterId: data.posmasterId,
statusName: convertContainStatus(data.statusId),
statusName:
convertContainStatus(data.statusId) +
(data.typeCommand != ""
? convertTypeCommand(data.typeCommand)
: ""),
organizationName:
data.root +
" " +