Merge branch 'develop' into working

This commit is contained in:
Tanyalak 2023-08-24 16:56:26 +07:00
commit 9104038918
9 changed files with 1429 additions and 838 deletions

View file

@ -26,6 +26,11 @@ export default {
insigniaDashboard: (insigniaPeriodId: string) => `${insignia}/request/dashboard/${insigniaPeriodId}`,
// record
noteround: () => `${insignia}/request/note`,
requestDocNote: (id:string) => `${insignia}/request/note/doc/${id}`,
noteSearch: () => `${insignia}/request/note/search`,
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
noteByid: (id: string) => `${insignia}/request/note/${id}`,
};

View file

@ -135,7 +135,7 @@
{{ props.row.fileName }}
</q-td>
<q-td key="btnMicrosoft" :props="props">
<q-btn flat dense round color="red" icon="picture_as_pdf">
<q-btn type="a" target="_blank" :href="props.row.pathName" flat dense round color="red" icon="picture_as_pdf">
<q-tooltip>ไฟล PDF</q-tooltip>
</q-btn>
<q-btn flat dense round color="blue" icon="mdi-file-word">

View file

@ -55,6 +55,8 @@ const {
showLoader,
hideLoader,
dialogConfirm,
dialogMessageNotify,
modalWarning
} = mixin;
const filterData = (options: any[], excludedGroups: any[]) => {
return options.filter(
@ -545,11 +547,6 @@ const putData = (id: string) => {
role: "mentor",
dated: date2.value instanceof Date ? dateToISO(date2.value) : dateToISO(new Date(date2.value)),
},
{
personal_id: caretaker2.value.id,
role: "mentor",
dated: date3.value instanceof Date ? dateToISO(date3.value) : dateToISO(new Date(date3.value)),
},
{
personal_id: commander.value.id,
role: "commander",
@ -560,6 +557,13 @@ const putData = (id: string) => {
role: "chairman",
},
];
if (caretaker2.value) {
assign_director.push({
personal_id: caretaker2.value.id,
role: "mentor",
dated: date3.value instanceof Date ? dateToISO(date3.value) : dateToISO(new Date(date3.value)),
});
}
const data = {
personalId: GUID,
fullname: fullname.value,
@ -621,7 +625,7 @@ const DataSave = async (id: string) => {
hideLoader();
});
} else {
notifyError($q, "กรุณากรอกข้อมูลให้ครบ");
dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
}
});
};
@ -860,7 +864,7 @@ watch(knowledge.value, () => {
:options="filtermantor(OPcaretaker, [caretaker2])" class="col-xs-12 col-sm-6" :readonly="status != true"
dense hide-bottom-space borderless :outlined="status == true" v-model="caretaker1"
:label="`ผู้ดูแลคนที่ 1`" option-label="name" />
<q-select :rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
<q-select clearable
:options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
hide-bottom-space class="col-xs-12 col-sm-6" :readonly="status != true" dense borderless
:outlined="status == true" v-model="caretaker2" :label="`ผู้ดูแลคนที่ 2`" />
@ -870,7 +874,7 @@ watch(knowledge.value, () => {
:options="filtermantor(OPcaretaker, [caretaker2])" class="col-xs-12 col-sm-6" :readonly="status != true"
dense hide-bottom-space borderless :outlined="status == true" v-model="caretaker1"
:label="`ผู้ดูแลคนที่ 1`" option-label="name" />
<q-select :rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
<q-select clearable
:options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
hide-bottom-space class="col-xs-12 col-sm-6" :readonly="status != true" dense borderless
:outlined="status == true" v-model="caretaker2" :label="`ผู้ดูแลคนที่ 2`" />
@ -1593,15 +1597,15 @@ watch(knowledge.value, () => {
</template>
</datepicker>
</div>
<q-select v-if="status == true" :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id"
<q-select clearable v-if="status == true" :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id"
option-label="name" class="col-xs-12 col-sm-8" :readonly="status != true" dense borderless
:outlined="status == true" v-model="caretaker2" label="ผู้ดูแลคนที่ 2" />
<q-select v-else :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
class="col-xs-12 col-sm-8" :readonly="status != true" dense borderless :outlined="status == true"
<q-select clearable v-else :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
class="col-xs-12 col-sm-8" :readonly="status != true " dense borderless :outlined="status == true"
v-model="caretaker2" label="ผู้ดูแลคนที่ 2" />
<div class="col-xs-12 col-sm-4">
<datepicker menu-class-name="modalfix" v-model="date3" :locale="'th'" autoApply borderless
:enableTimePicker="false" week-start="0" :readonly="status != true">
:enableTimePicker="false" week-start="0" :readonly="status != true | !caretaker2">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -1609,7 +1613,9 @@ watch(knowledge.value, () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input :rules="[(val) => !!val || 'กรุณาเลือกวันที่']" hide-bottom-space
<q-input hide-bottom-space
:disable="!caretaker2"
:readonly="status != true" dense s borderless :outlined="status == true"
class="full-width datepicker" :model-value="date3 != null ? date2Thai(date3) : null"
label="ลงวันที่">

View file

@ -54,7 +54,17 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "location",
align: "left",
label: "สถานที่ยื่นขอลาออกจากราชการ",
sortable: true,
field: "location",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionTypeOld",
align: "left",
@ -127,6 +137,7 @@ const visibleColumns = ref<string[]>([
"no",
"prefix",
"fullname",
"location",
"positionTypeOld",
"positionLevelOld",
"positionNumberOld",
@ -172,6 +183,7 @@ const columns2 = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionTypeOld",
align: "left",
@ -442,6 +454,9 @@ const saveOrder = async () => {
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td key="location" :props="props">
{{ props.row.location }}
</q-td>
<q-td key="positionTypeOld" :props="props">
{{ props.row.positionTypeOld }}
</q-td>

View file

@ -167,7 +167,7 @@
{{ props.row.fileName }}
</q-td>
<q-td key="btnMicrosoft" :props="props">
<q-btn flat dense round color="red" icon="picture_as_pdf">
<q-btn type="a" target="_blank" :href="props.row.pathName" flat dense round color="red" icon="picture_as_pdf">
<q-tooltip>ไฟล PDF</q-tooltip>
</q-btn>
</q-td>

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,18 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useCounterMixin } from '@/stores/mixin'
import http from "@/plugins/http";
import config from "@/app.config";
const mixin = useCounterMixin()
const { success, messageError,hideLoader,dialogConfirm } = mixin
const fileUpload = ref<any>(null);
const reason = ref<string>("");
const file = ref<string>("");
const documentTitle = ref<string>("");
const $q = useQuasar();
const filterKeyword = ref<string>("");
const filterDoc = ref<any>(null);
@ -45,27 +52,68 @@ const colums2 = ref<QTableProps["columns"]>([
sortable: true,
},
]);
const rows2 = ref<any>([
{
no: "1",
fileName: "test1",
annotation: "ทดสอบ",
file: "",
},
{
no: "2",
fileName: "test2",
annotation: "ทดสอบ",
file: "",
},
]);
const rows2 = ref<any>([]);
interface TypeData {
fileName:string
reason:string
pathName:string
}
const props = defineProps({
roundId: {
type: String,
},
});
onMounted(() => {
const getRequest = async () => {
await http
.get(config.API.requestDocNote(props.roundId as string))
.then((res:any) =>{
console.log(res)
const data = res.data.result
console.log(data)
data.map((item:TypeData) =>{
rows2.value.push({
fileName:item.fileName,
annotation:item.reason,
file:item.pathName
})
}
)
console.log(rows2.value)
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
});
}
const putRequest = () => {
const dataAppend = new FormData()
dataAppend.append("Name",documentTitle.value)
dataAppend.append("Reason",reason.value)
dataAppend.append("File",fileUpload.value)
http
.put(config.API.requestDocNote(props.roundId as string),dataAppend)
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
documentTitle.value = "";
reason.value = "";
fileUpload.value = null;
getRequest();
hideLoader();
});
}
onMounted(async() => {
console.log(props.roundId);
await getRequest()
});
const resetFilterRef = () => {
filterKeyword.value = "";
@ -77,6 +125,9 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
const save = () => {
dialogConfirm($q,()=>putRequest())
}
</script>
<template>
<Transition>
@ -119,6 +170,9 @@ const pagination = ref({
hide-bottom-space
/>
</div>
<div class="col-12 flex justify-end">
<q-btn label="บันทึก" @click="save" color="public" />
</div>
<div class="row col-12">
<q-space />
<q-input
@ -184,10 +238,13 @@ const pagination = ref({
{{ props.row.fileName }}
</q-td>
<q-td key="annotation" :props="props">
{{ props.row.annotation }}
{{ props.row.annotation !== null ? props.row.annotation:"-"}}
</q-td>
<q-td auto-width>
<q-btn
type="a"
:href="props.row.file"
target="_blank"
dense
size="14px"
flat

View file

@ -0,0 +1,55 @@
import { defineStore } from "pinia";
import { ref, } from "vue";
export const useResultDataStore = defineStore("insignia", () => {
const insignia = ref<string>('')
const insigniaOp = ref<any[]>([{ name: "ทั้งหมด", id: "" }])
const insigniaOp2 = ref<any[]>([])
const insigniaType = ref<any>()
const fetchDatainsignia = async (data: any) => {
data.forEach((e: any) => {
insigniaOp.value.push({ name: e.name, id: e.id })
});
data.forEach((e: any) => {
insigniaOp2.value.push({ name: e.name, id: e.id })
});
}
const fetchDatainsigniaType = async (data: any) => {
insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
}
const status = (val: string) => {
switch (val) {
case "PENDING":
return "รอบันทึกข้อมูล";
case "REJECT":
return "ยกเลิก";
case "DELETE":
return "ลบ";
case "DONE":
return "บันทึกลง ก.พ. 7 แล้ว";
}
}
const profileType = (val: string) => {
switch (val) {
case "officer":
return "ข้าราชการ กทม.สามัญ";
case "employee":
return "ลูกจ้างประจำ";
}
}
return {
insignia,
insigniaOp,
insigniaOp2,
insigniaType,
fetchDatainsignia,
fetchDatainsigniaType,
status,
profileType,
};
});

File diff suppressed because it is too large Load diff