diff --git a/src/modules/04_registry/components/PopupHistory.vue b/src/modules/04_registry/components/PopupHistory.vue index 02f15e538..4f7746cbe 100644 --- a/src/modules/04_registry/components/PopupHistory.vue +++ b/src/modules/04_registry/components/PopupHistory.vue @@ -6,11 +6,13 @@ import config from "@/app.config"; import type { QForm } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; +import { useRouter } from "vue-router"; const myForm = ref(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin; +const { showLoader, hideLoader, messageError, date2Thai, dialogMessageNotify } = mixin; const $q = useQuasar(); +const router = useRouter(); const modal = ref(false); const employeeClass = ref(""); @@ -154,7 +156,7 @@ const clickSearch = async (type: string) => { date: date2Thai(e.date), })); } else { - notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา"); + dialogMessageNotify($q, "ไม่มีข้อมูลที่ต้องการค้นหา"); rows.value = []; } }) @@ -183,6 +185,9 @@ const filterFn = (val: string, update: any) => { }); } }; +const clickRedirect = (id: string) => { + router.push(`/registry/${id}`); +}; const paging = ref(true); const pagination = ref({ @@ -353,10 +358,20 @@ const paginationLabel = (start: number, end: number, total: number) => { {{ props.rowIndex + 1 }} {{ props.row.order }} - {{ - props.row.citizenId - }} - {{ props.row.name }} + {{ props.row.citizenId }} + {{ props.row.name }} {{ props.row.posNo }} {{ diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue index 063251e89..33a29dda5 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue @@ -29,7 +29,9 @@ const commander = ref([]); const status = ref(true); const saveEdit = (id: string) => { - dialogConfirm($q, () => console.log("save")); + dialogConfirm($q, async () => { + await postData("put"); + }); }; const edit = () => { status.value = true; @@ -55,7 +57,7 @@ const fecthAssign = async (id: string) => { director_id.value = res.data.data.chairman.name; director_id2.value = res.data.data.commander.name; - if(mentors.value.length != 0){ + if (mentors.value.length != 0) { director_id3.value = mentors.value[0].name; } commander.value = res.data.data.commander; @@ -127,7 +129,7 @@ const optionDirector = ref([]); const savaForm = async () => { await myForm.value!.validate().then((result: boolean) => { if (result) { - dialogConfirm($q, async () => await postData()); + dialogConfirm($q, async () => await postData("post")); } }); }; @@ -157,7 +159,7 @@ const clickdownloadFile = async (type: string) => { hideLoader(); }); }; -const postData = async () => { +const postData = async (action: string) => { const data = await { start_date: date_start.value, date_finish: date_finish.value, @@ -169,15 +171,32 @@ const postData = async () => { director2_dated: director2_dated.value, expand_month: expand_month.value, }; - await http - .post(config.API.createformReport(assignId.value), data) - .then(() => { - success($q, "บันทึกสำเร็จ"); - router.push(`/probation/detail/${personalId.value}/${assignId.value}`); - }) - .catch((e: any) => { - messageError($q, e); - }); + if (action === "post") { + await http + .post(config.API.createformReport(assignId.value), data) + .then(() => { + success($q, "บันทึกสำเร็จ"); + router.push(`/probation/detail/${personalId.value}/${assignId.value}`); + }) + .catch((e: any) => { + messageError($q, e); + }); + } else if (action === "put") { + await http + .put(config.API.createformReport(assignId.value), data) + .then(() => { + success($q, "บันทึกสำเร็จ"); + router.push(`/probation/detail/${personalId.value}/${assignId.value}`); + }) + .catch((e: any) => { + messageError($q, e); + }) + .finally(() => { + status.value = false; + // fecthAssign(assignId.value); + fecthResult(assignId.value); + }); + } }; const selectRuslt = () => { if (result.value !== 3) { diff --git a/src/modules/07_insignia/components/4_Allocate/Main.vue b/src/modules/07_insignia/components/4_Allocate/Main.vue index 5467d22ae..74cbea46c 100644 --- a/src/modules/07_insignia/components/4_Allocate/Main.vue +++ b/src/modules/07_insignia/components/4_Allocate/Main.vue @@ -12,7 +12,8 @@ import DialogEdit from "@/modules/07_insignia/components/4_Allocate/DialogEdit.v import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main"; import type { QTableProps, QInput } from "quasar"; -import { useQuasar } from "quasar"; +import { Loading, useQuasar } from "quasar"; +import type { load } from "@/router/loader"; const DataStore = useAllocateDataStore(); const mixin = useCounterMixin(); @@ -45,24 +46,28 @@ const profileType = ref(""); const filterKeyword = ref(""); const roundYear = ref(); const insigniaOp = ref([]); +const loadView = ref(false); onMounted(async () => { await fecthRound(); - await fecthInsigniaType(); + // await fecthInsigniaType(); }); const fecthRound = async () => { await http .get(config.API.noteround()) - .then((res) => { + .then(async (res) => { let data = res.data.result; - selectRoundOption.value = data.map((e: any) => ({ - id: e.id, - name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), - year: e.year, - })); - selectRound.value = data[0].id; - roundYear.value = data[0].year; + if (data.length !== 0) { + selectRoundOption.value = data.map((e: any) => ({ + id: e.id, + name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), + year: e.year, + })); + selectRound.value = data[0].id; + roundYear.value = data[0].year; + await fecthInsigniaType(); + } }) .catch((err) => { messageError($q, err); @@ -92,6 +97,7 @@ const fecthInsigniaType = async () => { let data = res.data.result; DataStore.fetchDatainsigniaType(data); tab.value = DataStore.insigniaType[0].name; + loadView.value = true; fecthInsignia(); }) .catch((err) => { @@ -281,7 +287,12 @@ const resetFilter = () => {
จัดสรรเครื่องราชอิสริยาภรณ์
- +
รอบ
{ + +
+ + ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ + +
+
+ { :actionType="actionType" /> - + diff --git a/src/modules/07_insignia/components/5_Borrow/Main.vue b/src/modules/07_insignia/components/5_Borrow/Main.vue index 26ff0092e..d97b20c90 100644 --- a/src/modules/07_insignia/components/5_Borrow/Main.vue +++ b/src/modules/07_insignia/components/5_Borrow/Main.vue @@ -26,42 +26,50 @@ const action = ref(""); const profileId = ref(""); const roundYear = ref(); const insigniaList = ref([]); +const loadView = ref(false); onMounted(async () => { await fecthRound(); - await fecthInsigniaType(); + // await fecthInsigniaType(); }); const fecthRound = async () => { + showLoader(); await http .get(config.API.noteround()) - .then((res) => { + .then(async (res) => { let data = res.data.result; - selectRoundAllOption.value = [ - { - name: "ทั้งหมด", - id: "0", - year: 0, - }, - ]; - data.map((e: any) => { - selectRoundOption.value.push({ - name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), - id: e.id, - year: e.year, + if (data.length !== 0) { + await fecthInsigniaType(); + selectRoundAllOption.value = [ + { + name: "ทั้งหมด", + id: "0", + year: 0, + }, + ]; + data.map((e: any) => { + selectRoundOption.value.push({ + name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), + id: e.id, + year: e.year, + }); + selectRoundAllOption.value.push({ + name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), + id: e.id, + year: e.year, + }); }); - selectRoundAllOption.value.push({ - name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), - id: e.id, - year: e.year, - }); - }); - selectRound.value = data[0].id; - yearRound.value = data[0].year; - roundYear.value = data[0].year; + selectRound.value = data[0].id; + yearRound.value = data[0].year; + roundYear.value = data[0].year; + } }) .catch((err) => { messageError($q, err); + }) + .finally(() => { + hideLoader(); }); }; @@ -73,7 +81,7 @@ const fecthInsignia = async () => { DataStore.fetchDataInsignia(data); }) .catch((err) => { - console.log(err); + messageError($q, err); }) .finally(async () => { insigniaList.value = await DataStore.insigniaOp.filter( @@ -88,11 +96,13 @@ const fecthInsigniaType = async () => { let data = res.data.result; DataStore.fetchDatainsigniaType(data); tab.value = DataStore.insigniaType[0].name; + loadView.value = true; await fecthInsignia(); }) .catch((err) => { - console.log(err); - }); + messageError($q, err); + }) + .finally(() => {}); }; const visibleColumns = ref([ @@ -367,7 +377,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
ยืม-คืนเครื่องราชฯ
- + { :type-id="tab" /> + +
+ + ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ + +
+
\ No newline at end of file + diff --git a/src/modules/10_order/components/PopupHistory.vue b/src/modules/10_order/components/PopupHistory.vue new file mode 100644 index 000000000..bbf1e0cf1 --- /dev/null +++ b/src/modules/10_order/components/PopupHistory.vue @@ -0,0 +1,412 @@ + + + + + diff --git a/src/modules/10_order/components/step/step02.vue b/src/modules/10_order/components/step/step02.vue index 5fc2269d8..496544e2c 100644 --- a/src/modules/10_order/components/step/step02.vue +++ b/src/modules/10_order/components/step/step02.vue @@ -41,9 +41,9 @@ const { const route = useRoute(); const $q = useQuasar(); const modalData = ref({ - salaryAmount: 0, - positionSalaryAmount: 0, - monthSalaryAmount: 0, + salaryAmount: null, + positionSalaryAmount: null, + monthSalaryAmount: null, }); const myForm = ref(null); const myFormAdd = ref(null); @@ -129,11 +129,9 @@ const getData = async (id: string) => { selectStatus: r.selectStatus !== null ? r.selectStatus : false, sequence: r.sequence !== null ? r.sequence : 0, refRecordId: r.refRecordId, - salaryAmount: r.salaryAmount !== 0 ? r.salaryAmount : null, - positionSalaryAmount: - r.positionSalaryAmount !== 0 ? r.positionSalaryAmount : null, - monthSalaryAmount: - r.monthSalaryAmount !== 0 ? r.monthSalaryAmount : null, + salaryAmount: r.salaryAmount, + positionSalaryAmount: r.positionSalaryAmount, + monthSalaryAmount: r.monthSalaryAmount, }); }); // console.log("list", list); @@ -275,11 +273,9 @@ const fetchSalary = async (personalId: string) => { console.log(res); const data = res.data.result; modalData.value = { - salaryAmount: data.salaryAmount !== 0 ? data.salaryAmount : null, - positionSalaryAmount: - data.positionSalaryAmount !== 0 ? data.positionSalaryAmount : null, - monthSalaryAmount: - data.monthSalaryAmount !== 0 ? data.monthSalaryAmount : null, + salaryAmount: data.salaryAmount === 0 && data.positionSalaryAmount === 0 && data.monthSalaryAmount===0 ? null : data.salaryAmount, + positionSalaryAmount: data.salaryAmount === 0 && data.positionSalaryAmount === 0 && data.monthSalaryAmount===0 ? null : data.positionSalaryAmount, + monthSalaryAmount: data.salaryAmount === 0 && data.positionSalaryAmount === 0 && data.monthSalaryAmount===0 ? null : data.monthSalaryAmount, }; // console.log("data", modalData.value); }) @@ -409,7 +405,7 @@ const addlist = async (data: Object) => { const save = async () => { // console.log("save===>", rows.value); // console.log(statuscode.value); - const check = rows.value.find((x: any) => x.salaryAmount == null); + const check = rows.value.find((x: any) => x.salaryAmount == 0); if ( (selected.value.length > 0 && !check) || (statuscode.value === true && selected.value.length > 0) @@ -547,7 +543,7 @@ const getClass = (val: boolean) => { { :dense="true" v-model="modalData.salaryAmount" :label="`${'เงินเดือน'}`" - :rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]" + :rules="[(val: any) => !!val || `${'กรุณากรอกเงินเดือน'}`]" hide-bottom-space />
diff --git a/src/modules/10_order/components/step/step04.vue b/src/modules/10_order/components/step/step04.vue index 440986627..8c093072d 100644 --- a/src/modules/10_order/components/step/step04.vue +++ b/src/modules/10_order/components/step/step04.vue @@ -263,7 +263,16 @@ const saveUpload = () => { dialogConfirm($q, async () => { showLoader() await postfileOrder(); - await postfileTailer(); + if (code.value != 'c-pm-10' && + code.value != 'c-pm-11' && + code.value != 'c-pm-12' && + code.value != 'c-pm-16' && + code.value != 'c-pm-18' && + code.value != 'c-pm-19' && + code.value != 'c-pm-20' && + code.value != 'c-pm-21') { + await postfileTailer(); + } await fetchAttachment(orderId.value); await fecthstatusOrder(); hideLoader() @@ -310,6 +319,9 @@ const postfileOrder = async () => { formData.append("File", fileOrder.value); await http .post(config.API.attachmentOrderId(orderId.value), formData) + .then((res) => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) .catch((e) => { messageError($q, e) }) @@ -352,10 +364,20 @@ const clickExecute = async (id: string) => { }; const validateFormUpload = () => { - return ( - fileOrder.value !== null && - fileTailer.value !== null - ); + if (code.value != 'c-pm-10' && + code.value != 'c-pm-11' && + code.value != 'c-pm-12' && + code.value != 'c-pm-16' && + code.value != 'c-pm-18' && + code.value != 'c-pm-19' && + code.value != 'c-pm-20' && + code.value != 'c-pm-21' && fileOrder.value !== null && fileTailer.value !== null) { + return true; + } else if (fileOrder.value !== null) { + return true; + } else { + return false; + } }; const validateForm = () => { @@ -545,17 +567,17 @@ const viewFileUpload = async (url: string) => { - - -
- - - -
- + + +
+ + + +
+ @@ -640,8 +662,8 @@ const viewFileUpload = async (url: string) => { - + @@ -654,6 +676,8 @@ const viewFileUpload = async (url: string) => { + +