ปรับบรรจุ แต่งตั้ง
This commit is contained in:
parent
0973093813
commit
6a4568ec36
2 changed files with 30 additions and 22 deletions
|
|
@ -139,8 +139,6 @@ function updateSelected(data: TreeMain) {
|
||||||
const isAll = ref<boolean>(false);
|
const isAll = ref<boolean>(false);
|
||||||
const isBlank = ref<boolean>(false);
|
const isBlank = ref<boolean>(false);
|
||||||
async function fetchDataTable(id: string, level: number = 0) {
|
async function fetchDataTable(id: string, level: number = 0) {
|
||||||
console.log(props.dataRow);
|
|
||||||
|
|
||||||
showLoader();
|
showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
node: level,
|
node: level,
|
||||||
|
|
@ -196,9 +194,6 @@ async function fetchPosFind(level: number, id: string) {
|
||||||
.post(config.API.orgPosFind, body)
|
.post(config.API.orgPosFind, body)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
||||||
console.log(props?.dataRow);
|
|
||||||
|
|
||||||
expanded.value = data;
|
expanded.value = data;
|
||||||
nodeId.value = id;
|
nodeId.value = id;
|
||||||
positionId.value = props?.dataRow?.posmasterId;
|
positionId.value = props?.dataRow?.posmasterId;
|
||||||
|
|
@ -224,7 +219,6 @@ async function onClickSubmit() {
|
||||||
} else {
|
} else {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
personalId: props?.dataRow?.personalId,
|
personalId: props?.dataRow?.personalId,
|
||||||
node: dataPosMaster.node,
|
node: dataPosMaster.node,
|
||||||
|
|
@ -239,6 +233,7 @@ async function onClickSubmit() {
|
||||||
posLevelId: selectedPos.value[0].posLevelId, //ชื่อตำแหน่ง
|
posLevelId: selectedPos.value[0].posLevelId, //ชื่อตำแหน่ง
|
||||||
posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง
|
posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง
|
||||||
reportingDate: datePos.value,
|
reportingDate: datePos.value,
|
||||||
|
posmasterId: dataPosMaster.id,
|
||||||
typeCommand: props.typeCommand,
|
typeCommand: props.typeCommand,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -277,8 +272,6 @@ watch(
|
||||||
() => modal.value,
|
() => modal.value,
|
||||||
async () => {
|
async () => {
|
||||||
if (modal.value) {
|
if (modal.value) {
|
||||||
console.log(props?.dataRow);
|
|
||||||
|
|
||||||
await fetchOrganizationActive();
|
await fetchOrganizationActive();
|
||||||
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
|
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
|
||||||
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
|
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
|
||||||
|
|
@ -319,22 +312,18 @@ function filterNodeFn(data: any, id: string) {
|
||||||
watch(
|
watch(
|
||||||
() => isAll.value,
|
() => isAll.value,
|
||||||
(value, oldVal) => {
|
(value, oldVal) => {
|
||||||
console.log("value", value);
|
if (value !== oldVal) {
|
||||||
console.log("oldVal", oldVal);
|
fetchDataTable(nodeId.value, nodeLevel.value);
|
||||||
isAll.value = value;
|
}
|
||||||
|
|
||||||
fetchDataTable(nodeId.value, nodeLevel.value);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => isBlank.value,
|
() => isBlank.value,
|
||||||
(value, oldVal) => {
|
(value, oldVal) => {
|
||||||
console.log("isBlank value", value);
|
if (value !== oldVal) {
|
||||||
console.log("isBlank oldVal", oldVal);
|
fetchDataTable(nodeId.value, nodeLevel.value);
|
||||||
isBlank.value = value;
|
}
|
||||||
|
|
||||||
fetchDataTable(nodeId.value, nodeLevel.value);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -234,14 +234,14 @@ function convertBmaOfficer(val: string) {
|
||||||
* แปลงสถานะบรรจุ
|
* แปลงสถานะบรรจุ
|
||||||
* @param val type
|
* @param val type
|
||||||
*/
|
*/
|
||||||
function convertContainStatus(val: string) {
|
function convertContainStatus(val: string, type: string = "") {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "UN-CONTAIN":
|
case "UN-CONTAIN":
|
||||||
return "ยังไม่บรรจุ";
|
return "ยังไม่บรรจุ";
|
||||||
case "PREPARE-CONTAIN":
|
case "PREPARE-CONTAIN":
|
||||||
return "เตรียมบรรจุ";
|
return "เตรียม" + (type != "" ? type : "บรรจุ");
|
||||||
case "CONTAIN":
|
case "CONTAIN":
|
||||||
return "บรรจุแล้ว";
|
return (type != "" ? type : "บรรจุ") + "แล้ว";
|
||||||
case "DISCLAIM":
|
case "DISCLAIM":
|
||||||
return "สละสิทธิ์";
|
return "สละสิทธิ์";
|
||||||
default:
|
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
|
* @param val true/false
|
||||||
|
|
@ -322,7 +337,11 @@ async function getTable() {
|
||||||
posLevelCandidateName: data.posLevelCandidateName,
|
posLevelCandidateName: data.posLevelCandidateName,
|
||||||
posmasterId: data.posmasterId,
|
posmasterId: data.posmasterId,
|
||||||
|
|
||||||
statusName: convertContainStatus(data.statusId),
|
statusName:
|
||||||
|
convertContainStatus(data.statusId) +
|
||||||
|
(data.typeCommand != ""
|
||||||
|
? convertTypeCommand(data.typeCommand)
|
||||||
|
: ""),
|
||||||
organizationName:
|
organizationName:
|
||||||
data.root +
|
data.root +
|
||||||
" " +
|
" " +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue