Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-10-03 09:56:59 +07:00
commit 7d4d2e157c
16 changed files with 59 additions and 55 deletions

View file

@ -377,6 +377,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -406,6 +406,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -333,6 +333,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-15'"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -325,6 +325,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -211,6 +211,8 @@ watch(
if (modal.value === true) {
rows.value = props.rows ? props.rows : [];
selected.value = [];
commandType.value = "";
filter.value = "";
const status = DataStore.DataMainOrig.find((x: any) => x.id == examId);
if (status?.examTypeName !== "") {
const data = await storeCommand.getCommandTypes();
@ -464,6 +466,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -351,7 +351,6 @@ async function getTable() {
posmasterId: data.posmasterId,
statusNameCheck: convertContainStatus(data.statusId),
deferment: data.isRelief,
statusName:
data.isRelief === true &&
data.statusId == "PREPARE-CONTAIN" &&
@ -373,6 +372,11 @@ async function getTable() {
data.nodeShortName +
"" +
data.posMasterNo,
prefix: data.prefix,
firstName: data.firstname,
lastName: data.lastname,
citizenId: data.citizenId,
id: data.id,
};
rowsAll.value.push(rowData);
});

View file

@ -310,6 +310,6 @@ watchEffect(() => {
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-14'"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -292,6 +292,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-16'"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -255,6 +255,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
command-type-code="C-PM-13"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -263,6 +263,6 @@ watchEffect(() => {
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-18'"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -288,6 +288,6 @@ watchEffect(() => {
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-17'"
:persons-id="selected.map((r) => r.id)"
:persons="selected"
/>
</template>

View file

@ -305,6 +305,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons-id="selected.map((r:any) => r.id)"
:persons="selected"
/>
</template>

View file

@ -283,6 +283,6 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons-id="selected.map((r:dataType) => r.id)"
:persons="selected"
/>
</template>

View file

@ -208,7 +208,7 @@ watch(
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-32'"
:persons-id="selected.map((r:any) => r.id)"
:persons="selected"
/>
</template>

View file

@ -23,7 +23,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "isDone",
align: "left",
label: "บันทึกที่ทะเบียนประวัติแล้ว",
label: "ลงทะเบียนประวัติ",
sortable: true,
field: "isDone",
headerStyle: "font-size: 14px; width: 50px;",
@ -32,7 +32,7 @@ const baseColumns = ref<QTableProps["columns"]>([
{
name: "isDoneIDP",
align: "left",
label: "บันทึก IDP ที่ทะเบียนประวัติแล้ว",
label: "IDP ลงทะเบียนประวัติ",
sortable: true,
field: "isDoneIDP",
headerStyle: "font-size: 14px; width: 50px;",

View file

@ -31,7 +31,7 @@ const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
commandTypeCode: String, //
personsId: Array, // array
persons: Array, // array
});
const commandOp = ref<ListCommand[]>([]); //
@ -131,16 +131,22 @@ const columns = ref<QTableProps["columns"]>([
*/
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();
}
});