+
{
diff --git a/src/modules/05_placement/components/Repatriate/DialogOrders.vue b/src/modules/05_placement/components/Repatriate/DialogOrders.vue
index 64d8af4d5..cebb91b6f 100644
--- a/src/modules/05_placement/components/Repatriate/DialogOrders.vue
+++ b/src/modules/05_placement/components/Repatriate/DialogOrders.vue
@@ -292,6 +292,6 @@ watch(
diff --git a/src/modules/05_placement/components/Transfer/DialogOrders.vue b/src/modules/05_placement/components/Transfer/DialogOrders.vue
index 315bb2324..8e784b0e4 100644
--- a/src/modules/05_placement/components/Transfer/DialogOrders.vue
+++ b/src/modules/05_placement/components/Transfer/DialogOrders.vue
@@ -255,6 +255,6 @@ watch(
diff --git a/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue b/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue
index 041aeb8fb..42470b3ca 100644
--- a/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue
+++ b/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue
@@ -263,6 +263,6 @@ watchEffect(() => {
diff --git a/src/modules/06_retirement/components/resign/DialogSendToCommand.vue b/src/modules/06_retirement/components/resign/DialogSendToCommand.vue
index 3774a9b65..065c80683 100644
--- a/src/modules/06_retirement/components/resign/DialogSendToCommand.vue
+++ b/src/modules/06_retirement/components/resign/DialogSendToCommand.vue
@@ -288,6 +288,6 @@ watchEffect(() => {
diff --git a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue
index 7ef0c9add..c749ad311 100644
--- a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue
+++ b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue
@@ -305,6 +305,6 @@ watch(
diff --git a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
index 47bc55040..8956663cc 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
@@ -283,6 +283,6 @@ watch(
diff --git a/src/modules/11_discipline/components/PopupSendToNext.vue b/src/modules/11_discipline/components/PopupSendToNext.vue
index 44435a96f..37799b7e8 100644
--- a/src/modules/11_discipline/components/PopupSendToNext.vue
+++ b/src/modules/11_discipline/components/PopupSendToNext.vue
@@ -208,7 +208,7 @@ watch(
diff --git a/src/modules/18_command/components/DialogCreateCommand.vue b/src/modules/18_command/components/DialogCreateCommand.vue
index 4143fae0f..2c3256cee 100644
--- a/src/modules/18_command/components/DialogCreateCommand.vue
+++ b/src/modules/18_command/components/DialogCreateCommand.vue
@@ -31,7 +31,7 @@ const modal = defineModel("modal", { required: true });
const props = defineProps({
commandTypeCode: String, // ไอดีประเภทคำสั่ง
- personsId: Array, // ไอดีคนที่เลือกออกคำสั่งส่งมาเป็น array
+ persons: Array, // ไอดีคนที่เลือกออกคำสั่งส่งมาเป็น array
});
const commandOp = ref([]); // ประเภทคำสั่ง
@@ -131,16 +131,22 @@ const columns = ref([
*/
function createCommand(isRedirect: boolean) {
dialogConfirm($q, async () => {
- const data = props.personsId;
+ const data = props?.persons?.map((e: any) => ({
+ refId: e.id,
+ prefix: e.prefix,
+ firstName: e.firstName,
+ lastName: e.lastName,
+ citizenId: e.citizenId,
+ }));
const body = {
commandYear: commandYear.value,
commandNo: commandNo.value,
commandTypeId: commandType.value,
- // persons: data,
+ persons: data,
};
showLoader();
await http
- .post(config.API.command, body)
+ .post(config.API.command + `/person`, body)
.then(async (res) => {
const id = await res.data.result;
if (isRedirect) {
@@ -164,32 +170,36 @@ function createCommand(isRedirect: boolean) {
*/
function addPersonalToCommand(isRedirect: boolean) {
dialogConfirm($q, async () => {
- const data = props.personsId;
+ const data = props?.persons?.map((e: any) => ({
+ refId: e.id,
+ prefix: e.prefix,
+ firstName: e.firstName,
+ lastName: e.lastName,
+ citizenId: e.citizenId,
+ }));
const body = {
commandId: selected.value[0].id,
persons: data,
};
- console.log("🚀 ~ dialogConfirm ~ body:", body);
- // showLoader();
- // await http
- // .post(config.API.transferReport, body)
- // .then((res) => {
- // const id = res.data.result
- modal.value = false;
- if (isRedirect) {
- router.push("/command/edit/18477dcd-2f14-4e49-8fca-a446164e8b59");
- } else {
- modal.value = false;
- clearValue();
- }
- // router.push("/command/edit/" + id);
- // })
- // .catch((e) => {
- // messageError($q, e);
- // })
- // .finally(() => {
- // hideLoader();
- // });
+ showLoader();
+ await http
+ .post(config.API.command + `/person`, body)
+ .then(async (res) => {
+ const id = await res.data.result;
+ modal.value = false;
+ if (isRedirect) {
+ router.push(`/command/edit/${id}`);
+ } else {
+ modal.value = false;
+ clearValue();
+ }
+ })
+ .catch((e) => {
+ messageError($q, e);
+ })
+ .finally(() => {
+ hideLoader();
+ });
});
}
@@ -201,18 +211,6 @@ function onSubmit(isRedirect: boolean) {
}
}
-/**
- * เปลี่ยน tab เเละ clear ค่า tab ก่อนหน้า
- * @param type แยกประเภท
- */
-function changeTab(type: string) {
- clearValue();
- selectCreate.value = type;
- if (type == "DRAF") {
- getListCommandDraf();
- }
-}
-
/** ปิด popup */
function closeModal() {
modal.value = false;
@@ -276,7 +274,7 @@ watch(
);
watch(modal, () => {
- if (modal.value && props.personsId?.length !== 0) {
+ if (modal.value && props.persons?.length !== 0) {
fetchCommandType();
}
});