@@ -449,7 +457,7 @@ onMounted(async () => {
}}
- {{ date2Thai(informaData.birthDate) }}
+ {{ informaData.birthDate ? date2Thai(informaData.birthDate) : "" }}
{{ age ? age : "-" }}
@@ -621,9 +629,7 @@ onMounted(async () => {
hide-bottom-space
class="inputgreen"
:model-value="
- formData.birthDate != null
- ? date2Thai(formData.birthDate)
- : null
+ formData.birthDate ? date2Thai(formData.birthDate) : null
"
:label="dataLabel.birthDate"
:rules="[
diff --git a/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue b/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue
index a58185bd1..3d4583bb1 100644
--- a/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue
+++ b/src/modules/04_registryNew/components/detail/Salary/01_PositionSalary.vue
@@ -1,5 +1,5 @@
diff --git a/src/modules/07_insignia/components/3_result/DialogForm.vue b/src/modules/07_insignia/components/3_result/DialogForm.vue
index 5106683b9..0e43594dc 100644
--- a/src/modules/07_insignia/components/3_result/DialogForm.vue
+++ b/src/modules/07_insignia/components/3_result/DialogForm.vue
@@ -4,14 +4,23 @@ import { QForm, useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
-/** import Type*/
+/**
+ * import Type
+ */
import type { DataOption } from "@/modules/04_registry/components/profileType";
import DialogHeader from "@/components/DialogHeader.vue";
-/** import Stores */
+/**
+ * import Stores
+ */
import { useCounterMixin } from "@/stores/mixin";
import { useResultDataStore } from "@/modules/07_insignia/storeResult";
-/** useStore*/
+
+/**
+ * use
+ */
+const $q = useQuasar();
+const myForm = ref
();
const DataStore = useResultDataStore();
const mixin = useCounterMixin();
const {
@@ -24,53 +33,9 @@ const {
notifyError,
} = mixin;
-const $q = useQuasar();
-const myForm = ref();
-
-const status = ref("");
-const Advertise = ref("");
-const issue = ref("");
-const brand = ref("");
-const cardid = ref("");
-const fullName = ref("");
-const volume = ref("");
-const episode = ref("");
-const duty = ref("");
-const announced = ref("");
-const position = ref("");
-const payment = ref("");
-const addressPayment = ref(null);
-const affiliationRequest = ref("");
-const affiliationReceived = ref("");
-const receivedate = ref();
-const announceDate = ref();
-const invoiceDate = ref(null);
-const filterinsigniaOp2 = ref(DataStore.insigniaOp2);
-const employeeClass = ref("");
-const employeeClassOps = ref([
- { id: "officer", name: "ข้าราชการ กทม.สามัญ" },
- { id: "employee", name: "ลูกจ้างประจำ" },
-]);
-const listPerson = ref([]);
-const paymentOp = [
- { label: "จัดส่งทางไปรษณีย์", value: "จัดส่งทางไปรษณีย์" },
- { label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
-];
-
-function clearAnnounceExam() {
- announceDate.value = null;
-}
-
-/** function reset วันที่ได้รับพระราชทานเครื่องราชอิสริยาภรณ์*/
-function clearDateReceivedate() {
- receivedate.value = null;
-}
-
-/** function reset วันที่จ่ายใบกำกับ*/
-function clearDateInvoiceDate() {
- invoiceDate.value = null;
-}
-
+/**
+ * Props
+ */
const props = defineProps({
modal: Boolean,
save: {
@@ -91,11 +56,58 @@ const props = defineProps({
profileType: {
type: String,
},
+ fecthlistInsignia: { type: Function, required: true },
});
-/** callback function จำทำงานเมื่อ props.modal = true เปิด popup เพิ่มรายชื่อบันทึกผล*/
+/**
+ * ตัวแปร
+ */
+const status = ref("");
+const Advertise = ref("");
+const issue = ref("");
+const brand = ref("");
+const cardid = ref("");
+const fullName = ref("");
+const volume = ref("");
+const episode = ref("");
+const duty = ref("");
+const announced = ref("");
+const position = ref("");
+const payment = ref("");
+const addressPayment = ref(null);
+const affiliationRequest = ref("");
+const affiliationReceived = ref("");
+const receivedate = ref();
+const announceDate = ref();
+const invoiceDate = ref(null);
+const filterinsigniaOp2 = ref([]);
+const employeeClass = ref("");
+const employeeClassOps = ref([
+ { id: "officer", name: "ข้าราชการ กทม.สามัญ" },
+ { id: "employee", name: "ลูกจ้างประจำ" },
+]);
+const paymentOp = [
+ { label: "จัดส่งทางไปรษณีย์", value: "จัดส่งทางไปรษณีย์" },
+ { label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
+];
+const formFilter = reactive({
+ page: 1,
+ pageSize: 10,
+ searchField: "citizenId",
+ searchKeyword: "",
+});
+
+/** function reset วันที่จ่ายใบกำกับ*/
+function clearDateInvoiceDate() {
+ invoiceDate.value = null;
+}
+
+/**
+ * callback function จำทำงานเมื่อ props.modal = true เปิด popup เพิ่มรายชื่อบันทึกผล
+ */
watch(props, () => {
if (props.modal === true) {
+ filterinsigniaOp2.value = DataStore.insigniaOp2;
employeeClass.value = "";
cardid.value = "";
fullName.value = "";
@@ -120,20 +132,23 @@ watch(props, () => {
}
} else {
status.value = "";
+ selectType();
}
});
-/** disbleStatus */
+/**
+ * disbleStatus
+ */
const disbleStatus = computed(() => {
if (employeeClass.value !== "") {
return false;
} else return true;
});
-// เลือกประเภทลูกจ้าง
-/** function เลือกประเภทลูกจ้าง */
-async function selectType() {
- // showLoader();
+/**
+ * function เลือกประเภทลูกจ้าง
+ */
+function selectType() {
cardid.value = "";
fullName.value = "";
position.value = "";
@@ -150,36 +165,13 @@ async function selectType() {
announced.value = "";
invoiceDate.value = null;
payment.value = "";
- // await fecthlistPerson();
}
-/** function เรียกหน่วยงาน*/
-// async function fecthlistPerson() {
-// await http
-// .get(config.API.profileOrganizRoot)
-// .then((res) => {
-// const id = res.data.result[0].id;
-// if (id !== "") {
-// findlist(id); // id หน่วยงานไปเรียกรายชื่อ
-// }
-// })
-// .catch((e) => {
-// messageError($q, e);
-// });
-// }
-
-const formFilter = reactive({
- page: 1,
- pageSize: 10,
- searchField: "citizenId",
- searchKeyword: "",
-});
-
/**
* function เรียกรายชื่อลูกจ้างตาม id หน่วยงาน
* @param id id หน่วยงาน
*/
-async function findlist(id: string = "", idCard: string) {
+function findlist(id: string = "", idCard: string) {
formFilter.searchKeyword = idCard;
http
.get(
@@ -207,43 +199,18 @@ async function findlist(id: string = "", idCard: string) {
.finally(() => {
hideLoader();
});
- // let data = [{}];
- // // ข้าราชการ
- // if (employeeClass.value === "officer") {
- // data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
- // // ลูกจ้างประจำ
- // } else if (employeeClass.value === "employee") {
- // data = [
- // { criteriaType: "is_retire", criteriaValue: "false" },
- // { criteriaType: "employee_class", criteriaValue: "perm" },
- // ];
- // }
- // await http
- // .post(config.API.profileSearchNewOcIdType(id, employeeClass.value), {
- // criterias: data,
- // })
- // .then((res) => {
- // listPerson.value = res.data.result;
- // })
- // .catch((e) => {
- // messageError($q, e);
- // })
- // .finally(() => {
- // hideLoader();
- // });
}
/**
* function เรียกข้อมูลบันทึกผลตาม id
- * @param id
+ * @param id personId
*/
-async function fectDataByid(id: string) {
+function fectDataByid(id: string) {
showLoader();
if (props.profileType !== undefined) {
- // employeeClass.value = props.profileType.toString();
employeeClass.value = "officer";
}
- await http
+ http
.get(config.API.noteByid(id))
.then((res) => {
let data = res.data.result;
@@ -275,7 +242,7 @@ async function fectDataByid(id: string) {
}
/** function บักทึกผล*/
-async function onSubmit() {
+function onSubmit() {
dialogConfirm($q, () => {
if (props.roundId !== undefined) {
showLoader();
@@ -299,9 +266,9 @@ async function onSubmit() {
http
.put(config.API.noteAdd(props.roundId), body)
.then(async () => {
+ await props.fecthlistInsignia?.();
await props.close?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
- await showLoader();
})
.catch((err) => {
messageError($q, err);
@@ -311,7 +278,9 @@ async function onSubmit() {
});
}
-/** function หาเลขประจำตัวประชาชน*/
+/**
+ * function หาเลขประจำตัวประชาชน
+ */
function searchcardid() {
if (cardid.value.length === 13) {
findlist("", cardid.value);
diff --git a/src/modules/07_insignia/components/3_result/Dialogbody.vue b/src/modules/07_insignia/components/3_result/Dialogbody.vue
index d6772eb94..1c8dae5ab 100644
--- a/src/modules/07_insignia/components/3_result/Dialogbody.vue
+++ b/src/modules/07_insignia/components/3_result/Dialogbody.vue
@@ -7,8 +7,14 @@ import config from "@/app.config";
/** import Type*/
import type { DataOption } from "@/modules/04_registry/components/profileType";
+/**
+ * import Components
+ */
+import DialogHeader from "../DialogHeader.vue";
+
/** import Stores */
import { useCounterMixin } from "@/stores/mixin";
+
/** useStore*/
const mixin = useCounterMixin();
const {
@@ -48,11 +54,6 @@ const props = defineProps({
dataModal: Object,
});
-/** function reset วันที่ประกาศราชกิจจานุเบกษา*/
-function clearReceiveDate() {
- Datereceive.value = null;
-}
-
/** function clearDate */
function clearReturnDate() {
Datereturn.value = null;
@@ -74,7 +75,7 @@ function close() {
* @param type receive,return
* @param id personId
*/
-async function onSubmit(type: string, id: string) {
+function onSubmit(type: string, id: string) {
dialogConfirm($q, () => {
const formData = new FormData();
if (props.dateCheckReceive === null) {
@@ -117,7 +118,7 @@ watch(
);
/** function เรียกหน่วยงาน*/
-async function fetchOrgList() {
+function fetchOrgList() {
showLoader();
http
.get(config.API.activeOrganization)
@@ -144,30 +145,6 @@ async function fetchOrgList() {
.finally(() => {
hideLoader();
});
- // showLoader();
- // await http
- // .get(config.API.insigniaOrg)
- // .then(async (response: any) => {
- // const orgArr = response.data.result.map((e: any) => ({
- // id: e.id,
- // name: e.name + `(${e.shortName})`,
- // }));
- // OrgList.value = orgArr;
- // OrgList2.value = orgArr;
- // // [
- // // {
- // // id: "00000000-0000-0000-0000-000000000000",
- // // name: "สำนักนายกรัฐมนตรี",
- // // },
- // // ...orgArr,
- // // ];
- // })
- // .catch((err) => {
- // messageError($q, err);
- // })
- // .finally(() => {
- // hideLoader();
- // });
}
/** callback function จำทำงานเมื่อ props มีการเปลี่ยนแปลง*/
@@ -203,19 +180,8 @@ watch(props, () => {
)
"
>
-
- รับ-คืนเครื่องราชฯ
-
-
+
+
diff --git a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue
index 3e65a95f7..2a84c1873 100644
--- a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue
+++ b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue
@@ -39,7 +39,7 @@ const returndate = ref
();
const reason = ref("");
const listPerson = ref([]);
const OrgList = ref([]);
-const filterOrgList = ref([]);
+const filterOrgList = ref([]);
const insigniaNoteProfileId = ref("");
const filterSelectRound = ref();
const selectRound = ref();
@@ -124,25 +124,32 @@ async function fecthlistInsignia() {
}
/** function ดึงข้อมูลรายการหน่วยงาน */
-// async function fetchOrgList() {
-// showLoader();
-// await http
-// .get(config.API.typeOc())
-// .then(async (response: any) => {
-// const orgArr = response.data.result.map((e: any) => ({
-// id: e.organizationId,
-// name: e.organizationName,
-// }));
-// OrgList.value = orgArr;
-// filterOrgList.value = OrgList.value;
-// })
-// .catch((err) => {
-// messageError($q, err);
-// })
-// .finally(() => {
-// hideLoader();
-// });
-// }
+
+/** funcion เรียกข้อมูลหน่วยงานจัดสรรเครื่องราชอิสริยาภรณ์ */
+async function fetchOrgList() {
+ http
+ .get(config.API.activeOrganization)
+ .then((res) => {
+ const data = res.data.result;
+
+ http
+ .get(config.API.orgByid(data.activeId))
+ .then(async (res) => {
+ const data = await res.data.result.map((item: any) => ({
+ id: item.orgTreeId,
+ name: item.orgName,
+ }));
+ OrgList.value = data;
+ filterOrgList.value = data;
+ })
+ .catch((err) => {
+ messageError($q, err);
+ });
+ })
+ .catch((err) => {
+ messageError($q, err);
+ });
+}
// ดึงข้อมูลการยืม-คืนมาแสดงเก็บไว้ก่อนเผื่อต้องเอาข้อมูลมาแสดงเพิ่ม
// const fetchData = async () => {
@@ -172,7 +179,6 @@ async function onSubmit() {
.then(async () => {
await props.closeAndFecth();
await clearData();
- // await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
@@ -189,7 +195,6 @@ async function onSubmit() {
.then(async () => {
await props.closeAndFecth();
await clearData();
- // await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
@@ -215,7 +220,6 @@ async function searchcardid() {
?.shortName || ""
})`;
insigniaNoteProfileId.value = node.id;
- insigniaNoteProfileId.value = node.id;
hideLoader();
} else {
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
@@ -229,7 +233,6 @@ async function searchcardid() {
fullName.value = "";
brand.value = "";
receivedate.value = null;
- // OrganazationId.value = "";
}
}
@@ -281,11 +284,13 @@ onMounted(() => {
/** function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล */
watch(props, () => {
- // type.value = props.type;
if (props.modal == true && props.roundId != "all") {
roundNo.value = props.roundId;
- fecthlistInsignia();
- // fetchOrgList();
+ if (props.action === "editData") {
+ // fetchOrgList();
+ } else {
+ fecthlistInsignia();
+ }
}
});
@@ -485,26 +490,26 @@ watch(props, () => {
+ />
+ -->
{
position: e.position,
status: status(e.status),
dateReceive: date2Thai(e.dateReceive),
- name: e.prefix + e.fullName,
+ name: e.fullName,
type: `${e.requestInsignia} (${
type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
""
})`,
- employeeType: profileType(e.profileType),
- profileType: e.profileType,
+ employeeType: profileType(
+ e.profileType === "" ? "officer" : e.profileType
+ ),
+ profileType: e.profileType === "" ? "officer" : e.profileType,
date: date2Thai(e.date),
volumeNo: e.volumeNo,
section: e.section,
diff --git a/src/modules/07_insignia/views/ResultPage.vue b/src/modules/07_insignia/views/ResultPage.vue
index b97e982f9..2f78d5363 100644
--- a/src/modules/07_insignia/views/ResultPage.vue
+++ b/src/modules/07_insignia/views/ResultPage.vue
@@ -4,19 +4,30 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
-/** import Type*/
+/**
+ * import Typฃ
+ */
import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
import type { QTableProps, QInput } from "quasar";
-/** import Components*/
+/**
+ * import Components
+ */
+import DialogHeader from "@/components/DialogHeader.vue";
import Dialogbody from "@/modules/07_insignia/components/3_result/Dialogbody.vue";
import DialogForm from "@/modules/07_insignia/components/3_result/DialogForm.vue";
import fileUploadview from "../components/3_result/fileUpload.vue";
-/** import Stores */
+/**
+ * import Stores
+ */
import { useResultDataStore } from "@/modules/07_insignia/storeResult";
import { useCounterMixin } from "@/stores/mixin";
-/** useStore*/
+
+/**
+ * use
+ */
+const $q = useQuasar();
const DataStore = useResultDataStore();
const mixin = useCounterMixin();
const {
@@ -28,8 +39,9 @@ const {
success,
} = mixin;
-const $q = useQuasar();
-
+/**
+ * ตัวแปร
+ */
const tab = ref("");
const selectRound = ref("");
const selectRoundOption = ref([]);
@@ -51,7 +63,9 @@ const dateCheckReceive = ref();
const dateCheckReturn = ref();
const dataModal = ref([]);
-/** ข้อมูล Tabla*/
+/**
+ * ข้อมูล Tabla
+ */
const columns = ref([
{
name: "no",
@@ -222,14 +236,15 @@ const visibleColumns = ref([
"address",
"action",
]);
-
const filterRef = ref();
const filter = ref("");
-/** function เรียกรอบการเสนอขอพระราชทานเครื่องราช*/
-async function fecthRound() {
+/**
+ *function เรียกรอบการเสนอขอพระราชทานเครื่องราช
+ */
+function fecthRound() {
showLoader();
- await http
+ http
.get(config.API.noteround())
.then(async (res) => {
let data = res.data.result;
@@ -252,9 +267,11 @@ async function fecthRound() {
});
}
-/** function เรียกประเภทเครื่องราช*/
-async function fecthInsignia() {
- await http
+/**
+ * function เรียกประเภทเครื่องราช
+ */
+function fecthInsignia() {
+ http
.get(config.API.insigniaOrg)
.then((res) => {
let data = res.data.result;
@@ -265,9 +282,11 @@ async function fecthInsignia() {
});
}
-/** function เรียกระดับเครื่องราช*/
-async function fecthInsigniaType() {
- await http(config.API.insigniaTypeOrg)
+/**
+ * function เรียกระดับเครื่องราช
+ */
+function fecthInsigniaType() {
+ http(config.API.insigniaTypeOrg)
.then((res) => {
let data = res.data.result;
DataStore.fetchDatainsigniaType(data);
@@ -279,7 +298,9 @@ async function fecthInsigniaType() {
});
}
-/** function เลือกประเภทเครื่องราช*/
+/**
+ * function เลือกประเภทเครื่องราช
+ */
function selectorInsignia() {
fecthlistInsignia();
}
@@ -295,7 +316,9 @@ function selectorRound(round: string) {
fecthlistInsignia();
}
-/** callback function จำทำงานเมื่อ tab มีการเปลี่ยนแปลง*/
+/**
+ * callback function จำทำงานเมื่อ tab มีการเปลี่ยนแปลง
+ */
watch(tab, () => {
if (tab.value !== "doc") {
DataStore.insignia = "";
@@ -308,22 +331,26 @@ watch(tab, () => {
}
});
-/** callback function จำทำงานเมื่อ modal มีการเปลี่ยนแปลง*/
-watch(modal, () => {
- if (modal.value == false) {
- fecthlistInsignia();
- }
-});
+/**
+ * callback function จำทำงานเมื่อ modal มีการเปลี่ยนแปลง
+ */
+// watch(modal, () => {
+// if (modal.value == false) {
+// fecthlistInsignia();
+// }
+// });
-/** function เรียกรายชื่อบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ */
-async function fecthlistInsignia() {
+/**
+ * function เรียกรายชื่อบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ
+ */
+function fecthlistInsignia() {
showLoader();
let data = {
insigniaTypeId: tab.value,
insigniaNoteId: selectRound.value,
insigniaId: DataStore.insignia,
};
- await http
+ http
.post(config.API.noteSearch(), data)
.then((res) => {
let data = res.data.result;
@@ -342,21 +369,16 @@ async function fecthlistInsignia() {
* @param event file
* @param action typepreview
*/
-async function uploadFile(event: any, action: string) {
+function uploadFile(event: any, action: string) {
if (selectRound.value !== undefined) {
let id = selectRound.value;
- dialogConfirm($q, async () => {
+ dialogConfirm($q, () => {
+ showLoader();
const formdata = new FormData();
formdata.append("file", event);
- await http
+ http
.put(config.API.uploadfileInsignia(action, id), formdata)
- .then(() => {
- success($q, "อัพโหลดไฟล์สำเร็จ");
- })
- .catch((err) => {
- messageError($q, err);
- })
- .finally(async () => {
+ .then(async () => {
await fecthlistInsignia();
if (action === "receice") {
fileResult.value = null;
@@ -364,7 +386,12 @@ async function uploadFile(event: any, action: string) {
fileinvoice.value = null;
}
- modelPerview.value = false;
+ await success($q, "อัพโหลดไฟล์สำเร็จ");
+ modelPerview.value = await false;
+ })
+ .catch((err) => {
+ messageError($q, err);
+ hideLoader();
});
}),
"ยืนยันการบันทึกรายการข้อมูล",
@@ -396,7 +423,9 @@ const save = () => {
console.log("save function");
};
-/** ข้อมูล ไฟล์*/
+/**
+ * ข้อมูล ไฟล์
+ */
const modelPerview = ref(false);
const rowspreview = ref([]);
const typepreview = ref("");
@@ -407,7 +436,7 @@ const fileInsignia = ref(null);
* @param event ไฟล
* @param actionType ประเภทไฟล์ receice,invoice
*/
-async function perviewfile(event: any, actionType: string) {
+function perviewfile(event: any, actionType: string) {
showLoader();
typepreview.value = actionType;
fileInsignia.value = event;
@@ -415,7 +444,7 @@ async function perviewfile(event: any, actionType: string) {
let id = selectRound.value.toString();
const formdata = new FormData();
formdata.append("file", event);
- await http
+ http
.put(config.API.previewfileInsignia(actionType, id), formdata)
.then((res) => {
let data = res.data.result;
@@ -448,8 +477,11 @@ async function perviewfile(event: any, actionType: string) {
}
}
+function closeDialogPerview() {
+ modelPerview.value = false;
+}
+
const resetFilter = () => {
- // reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
filter.value = "";
filterRef.value!.focus();
};
@@ -465,7 +497,9 @@ const paginationLabel = (start: number, end: number, total: number) => {
else return start + "-" + end + " ใน " + total;
};
-/** function openPopup */
+/**
+ * function openPopup
+ */
function OpenModal(data: any) {
dataModal.value = data;
ModalDialog.value = true;
@@ -520,8 +554,8 @@ function clearInsigniaFilters(name: string) {
}
/** hook*/
-onMounted(async () => {
- await fecthRound();
+onMounted(() => {
+ fecthRound();
});
@@ -937,6 +971,7 @@ onMounted(async () => {
:action="action"
:personId="personId"
:profileType="profileType"
+ :fecthlistInsignia="fecthlistInsignia"
/>
@@ -949,7 +984,8 @@ onMounted(async () => {
-
+
+
-
+ -->
{
{{ props.rowIndex + 1 }}
- {{ props.value }}
+ {{ props.value ?? "-" }}
diff --git a/src/modules/10_order/components/step/step04.vue b/src/modules/10_order/components/step/step04.vue
index c417f63a0..14ab30351 100644
--- a/src/modules/10_order/components/step/step04.vue
+++ b/src/modules/10_order/components/step/step04.vue
@@ -10,6 +10,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import axios from "axios";
import genReport from "@/plugins/genreport";
+import genReportXLSX from "@/plugins/genreportxlsx";
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
@@ -127,11 +128,19 @@ const downloadCover = async (type: string) => {
// โหลด เอกสารแนบท้าย
const downloadAttachment = async (type: string) => {
+ // if (type === "xlsx") {
+ // genReportXLSX(
+ // dataAttachmentxlxs.value,
+ // `เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
+ // type
+ // );
+ // } else {
genReport(
dataAttachment.value,
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
type
);
+ // }
};
const dataCover = ref
();
@@ -151,6 +160,7 @@ const fetchReportCover = async (type: string, orderId: string) => {
};
const dataAttachment = ref();
+// const dataAttachmentxlxs = ref();
// เรียกไฟล์ เอกสารแนบท้าย
const fetchReportAttachment = async (type: string, orderId: string) => {
showLoader();
@@ -164,6 +174,17 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
messageError($q, e);
hideLoader();
});
+
+ // showLoader();
+ // await http
+ // .get(config.API.reportOrderAttachment("xlsx", orderId, code.value))
+ // .then(async (res) => {
+ // dataAttachmentxlxs.value = res.data.result;
+ // })
+ // .catch(async (e) => {
+ // messageError($q, e);
+ // hideLoader();
+ // });
};
function genPDf(data: any) {
@@ -531,15 +552,15 @@ const viewFileUpload = async (url: string) => {
- ไฟล์ .xls
+ ไฟล์ .docx
diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue
index e170ba5c3..00d8267c0 100644
--- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue
+++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue
@@ -23,12 +23,14 @@ const profileId = defineModel("profileId", { required: true });
const props = defineProps({
typeLevel: { type: String, required: true },
isReserve: { type: Boolean, required: true },
+ remark: { type: String, required: true },
fetchData: {
type: Function,
},
});
const type = ref("");
+const note = ref("");
const typeRef = ref(null);
const isReadonly = ref(false); // อ่านได้อย่างเดียว
const isChange = ref(false); // มีการแก้ไขข้อมูลหรือไม่
@@ -75,6 +77,7 @@ function onSubmit() {
profileId: profileId.value,
type: type.value,
isReserve: isReserve.value,
+ remark: type.value === "NONE" ? note.value : undefined,
};
http
.post(config.API.salaryPeriodEmp() + `/change/type`, body)
@@ -92,10 +95,15 @@ function onSubmit() {
});
}
+function chengType() {
+ note.value = props.typeLevel === "NONE" ? props.remark : "";
+}
+
watch(
() => modal.value,
() => {
type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel;
+ note.value = props.typeLevel === "NONE" ? props.remark : "";
isReserve.value = props.isReserve;
isChange.value = false;
}
@@ -132,7 +140,7 @@ function inputEdit(val: boolean) {
:rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules
hide-bottom-space
- @update:model-value="isChange = true"
+ @update:model-value="(isChange = true), chengType()"
/>
@@ -144,6 +152,17 @@ function inputEdit(val: boolean) {
v-model="isReserve"
@update:model-value="isChange = true"
/>
+
+