Compare commits

..

No commits in common. "a40fe7605e06162fca9bde3281ed940d9e026d7b" and "b1609de97965baecdb834db0ddc407870133c896" have entirely different histories.

13 changed files with 165 additions and 362 deletions

View file

@ -40,9 +40,6 @@ const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const isLeave = defineModel<boolean>("isLeave", {
required: true,
});
const citizenId = defineModel<string>("citizenId", {
required: true,
});
const baseColumns = ref<QTableColumn[]>([
{
@ -617,7 +614,7 @@ onMounted(() => {
disable
v-model="formData.status"
label="ใช้งาน"
keep-color
keep-color="primary"
/>
</div>
</div>
@ -645,7 +642,6 @@ onMounted(() => {
v-model:modal="modalCommand"
v-model:command="command"
v-model:command-id="commandId"
:citizen-id="citizenId"
/>
</template>

View file

@ -46,9 +46,6 @@ const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const isLeave = defineModel<boolean>("isLeave", {
required: true,
});
const citizenId = defineModel<string>("citizenId", {
required: true,
});
const baseColumns = ref<QTableColumn[]>([
{
@ -980,7 +977,6 @@ onMounted(() => {
v-model:modal="modalCommand"
v-model:command="command"
v-model:command-id="commandId"
:citizen-id="citizenId"
/>
</template>

View file

@ -39,9 +39,6 @@ const profileId = ref<string>(
const isLeave = defineModel<boolean>("isLeave", {
required: true,
});
const citizenId = defineModel<string>("citizenId", {
required: true,
});
const store = useGovernmentPosDataStore();
const {
@ -1624,7 +1621,6 @@ onMounted(async () => {
v-model:modal="modalCommand"
v-model:command="command"
v-model:commandId="commandId"
:citizen-id="citizenId"
/>
</template>

View file

@ -65,22 +65,13 @@ const storeRegistry = useRegistryNewDataStore();
<PerformSpecialWork :is-leave="storeRegistry.isLeave" />
</q-tab-panel>
<q-tab-panel v-if="empType != '-employee'" name="5">
<ActingPos
:is-leave="storeRegistry.isLeave"
:citizen-id="storeRegistry.citizenId"
/>
<ActingPos :is-leave="storeRegistry.isLeave" />
</q-tab-panel>
<q-tab-panel v-if="empType != '-employee'" name="6">
<HelpGovernmentDetail
:is-leave="storeRegistry.isLeave"
:citizen-id="storeRegistry.citizenId"
/>
<HelpGovernmentDetail :is-leave="storeRegistry.isLeave" />
</q-tab-panel>
<q-tab-panel name="7">
<Postion
:is-leave="storeRegistry.isLeave"
:citizen-id="storeRegistry.citizenId"
/>
<Postion :is-leave="storeRegistry.isLeave" />
</q-tab-panel>
</q-tab-panels>
</template>

View file

@ -39,9 +39,6 @@ const profileId = ref<string>(
const isLeave = defineModel<boolean>("isLeave", {
required: true,
});
const citizenId = defineModel<string>("citizenId", {
required: true,
});
const store = useSalaryDataStore();
const {
@ -1627,7 +1624,6 @@ onMounted(async () => {
v-model:modal="modalCommand"
v-model:command="command"
v-model:commandId="commandId"
:citizen-id="citizenId"
/>
</template>

View file

@ -45,10 +45,7 @@ const tab = ref<string>("1");
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="1">
<PositionSalary
:is-leave="storeRegistry.isLeave"
:citizen-id="storeRegistry.citizenId"
/>
<PositionSalary :is-leave="storeRegistry.isLeave" />
</q-tab-panel>
<q-tab-panel name="2">
<NotReceiveSalary :is-leave="storeRegistry.isLeave" />

View file

@ -553,17 +553,12 @@ onMounted(async () => {
</q-form>
<div class="col-12">
{{ typeEmp }}
<!-- v-if="typeEmp != 'employee'" -->
<Workflow
v-if="typeEmp != 'employee'"
v-model:is-check-data="isCheckData"
ref="workflowRef"
:id="requestId"
:sys-name="
typeEmp !== 'employee'
? 'REGISTRY_PROFILE'
: 'REGISTRY_PROFILE_EMP'
"
sys-name="REGISTRY_PROFILE"
/>
</div>
</div>

View file

@ -53,7 +53,6 @@ const props = defineProps({
const modalCommand = ref<boolean>(false);
const command = ref<string>("");
const commandId = ref<string>("");
const commandCitizenId = ref<string>("");
let roleAdmin = ref<boolean>(false);
const edit = ref<boolean>(true);
@ -913,10 +912,9 @@ function onSearchAdd() {
}
function onRefCommand(data: any) {
modalCommand.value = true;
command.value = data.refCommandNo;
commandId.value = data.commandId;
commandCitizenId.value = data.citizenId;
modalCommand.value = true;
// commandId.value = 'bdf9da91-ba45-497a-a2b7-cc49e2446d97'; //
}
@ -1789,7 +1787,6 @@ onMounted(async () => {
v-model:modal="modalCommand"
v-model:command="command"
v-model:commandId="commandId"
v-model:citizen-id="commandCitizenId"
/>
</template>

View file

@ -36,7 +36,6 @@ const props = defineProps({
const avatar = ref<string>("");
const fullName = ref<string>("");
const position = ref<string>("");
const citizenId = ref<string>("");
const isLoading = ref<boolean>(true);
/** function เรียกข้อมูลส่วนตัว*/
@ -49,7 +48,6 @@ function fetchInformation() {
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
position.value = data.position;
citizenId.value = data.citizenId;
if (data.avatarName) {
await fetchProfile(data.id as string, data.avatarName);
@ -222,7 +220,6 @@ watch(
v-if="type === 'posSalary'"
v-model:profileId="profileId"
:employeeClass="employeeClass"
:citizenId="citizenId"
/>
<InfoDiscipline
v-if="type === 'discipline'"

View file

@ -26,7 +26,6 @@ const {
/** props*/
const profileId = defineModel<string>("profileId", { required: true });
const employeeClass = defineModel<string>("employeeClass", { required: true });
const citizenId = defineModel<string>("citizenId", { required: true });
const modalCommand = ref<boolean>(false);
const command = ref<string>("");
@ -471,7 +470,6 @@ onMounted(() => {
v-model:modal="modalCommand"
v-model:command="command"
v-model:commandId="commandId"
:citizen-id="citizenId"
/>
</template>

View file

@ -19,7 +19,6 @@ const { showLoader, hideLoader, messageError } = useCounterMixin();
const modal = defineModel<boolean>("modal", { required: true });
const command = defineModel<string>("command", { required: true });
const commandId = defineModel<string>("commandId", { required: true });
const citizenId = defineModel<string>("citizenId", { required: true });
const promises = ref<any>([]);
const tab = ref<string>("main"); //tab
@ -38,7 +37,6 @@ function closeDialog() {
modal.value = false;
command.value = "";
commandId.value = "";
citizenId.value = "";
}
/**
@ -90,25 +88,13 @@ async function downloadCover(type: string) {
*/
async function fetchDataCommand(type: string) {
let newType = type === "cover" ? "คำสั่ง" : "แนบท้าย";
const pathAPI =
type === "cover"
? config.API.fileByFile(
"ระบบออกคำสั่ง",
newType,
commandId.value,
newType
)
: config.API.subFileByFileName(
"ระบบออกคำสั่ง",
newType,
commandId.value,
citizenId.value,
newType
);
await http
.get(pathAPI)
.get(
config.API.fileByFile("ระบบออกคำสั่ง", newType, commandId.value, newType)
)
.then(async (res) => {
const data = res.data;
console.log(res);
if (type === "cover") {
dataCover.value = data;

View file

@ -43,7 +43,7 @@ async function fetchData() {
? "Live"
: data.isSignature === false
? "Digital"
: "Live";
: "";
isStatus.value = data.status;
isDraft.value = data.isDraft;
isSign.value = data.isSign;
@ -174,12 +174,11 @@ onMounted(async () => {
<q-item tag="label" v-ripple>
<q-item-section avatar>
<!-- :disable="isSignature !== null || store.readonly" -->
<q-radio
v-model="signaturetype"
val="Digital"
color="primary"
disable
:disable="isSignature !== null || store.readonly"
/>
</q-item-section>
<q-item-section>

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, computed } from "vue";
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import axios from "axios";
@ -42,23 +42,12 @@ const isAuthority = defineModel<boolean>("isAuthority", { required: true }); //
const isCheckAuthority = ref<boolean>(false); //
const isAttachment = defineModel<boolean>("isAttachment", { required: true }); //
const fileUploadOrder = ref<any>(null); //
// const fileUploadTailer = ref<any>(null); //
const fileUploadTailer = ref<any>(null); //
const fileOrder = ref<any>(null); //
// const fileTailer = ref<any>(null); //
const fileTailer = ref<any>(null); //
const isLoad = ref<boolean>(true); //
const modalPerView = ref<boolean>(false);
//
const attachmentList = ref<any[]>([]);
const attachmentFiles = ref<Record<number, any>>({});
const isFileTailer = computed(() => {
//
return (
attachmentList.value.length > 0 &&
attachmentList.value.every((person) => !!attachmentFiles.value[person.id])
);
});
/**
* งกนยนยนการสงใหอำนาจลงนามอน
@ -99,9 +88,7 @@ async function updateCheckboxAuthority(val: boolean) {
.put(config.API.command + `/pending-check/${commandId.value}`, {
sign: val,
})
.then(() => {
isAttachment.value && fetchLists();
})
.then(() => {})
.catch((err) => {
messageError($q, err);
})
@ -117,7 +104,7 @@ async function updateCheckboxAuthority(val: boolean) {
function onUploadFile(group: string) {
showLoader();
let type = group === "order" ? "คำสั่ง" : "แนบท้าย";
// let file = group === "order" ? fileUploadOrder.value : fileUploadTailer.value;
let file = group === "order" ? fileUploadOrder.value : fileUploadTailer.value;
const fileName = { fileName: type };
http
.post(config.API.file("ระบบออกคำสั่ง", type, commandId.value), {
@ -131,11 +118,7 @@ function onUploadFile(group: string) {
res.data[key]?.fileName !== ""
);
foundKey &&
(await uploadFileDoc(
res.data[foundKey]?.uploadUrl,
fileUploadOrder.value,
group
));
(await uploadFileDoc(res.data[foundKey]?.uploadUrl, file, group));
})
.catch((err) => {
messageError($q, err);
@ -151,12 +134,7 @@ function onUploadFile(group: string) {
* @param file ไฟลองการอปโหลด
* @param group ประเภพไฟล "คำสั่ง","แนบท้าย"
*/
async function uploadFileDoc(
uploadUrl: string,
file: any,
group: string,
id?: string
) {
async function uploadFileDoc(uploadUrl: string, file: any, group: string) {
const formData = new FormData();
formData.append("file", file);
showLoader();
@ -176,11 +154,7 @@ async function uploadFileDoc(
if (group === "order") {
fileUploadOrder.value = null;
} else {
attachmentList.value.forEach((e) => {
if (e.id === id) {
e.file = null;
}
});
fileUploadTailer.value = null;
}
hideLoader();
});
@ -193,40 +167,15 @@ async function uploadFileDoc(
async function fetchDoc(group: string) {
showLoader();
let type = group === "order" ? "คำสั่ง" : "แนบท้าย";
if (group === "order") {
await fetchDocOrder(type);
} else {
attachmentList.value.forEach(async (e) => {
await fetchDocTailer(type, e.id);
});
}
}
async function fetchDocOrder(type: string) {
await http
.get(config.API.file("ระบบออกคำสั่ง", type, commandId.value))
.then((res) => {
const data = res.data[0];
fileOrder.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
async function fetchDocTailer(type: string, id: string) {
await http
.get(config.API.subFile("ระบบออกคำสั่ง", type, commandId.value, id))
.then((res) => {
const data = res.data[0];
attachmentList.value.forEach((e) => {
if (e.id === id) {
attachmentFiles.value[e.id] = data;
}
});
if (group === "order") {
fileOrder.value = data;
} else {
fileTailer.value = data;
}
})
.catch((e) => {
messageError($q, e);
@ -241,33 +190,18 @@ const dataFile = ref<DataFileDownload>();
* ดาวนโหลดลงกไฟล
* @param fileName file name
*/
function downloadFile(
file: any,
group: string,
isView: boolean = false,
id: string
) {
function downloadFile(file: any, group: string, isView: boolean = false) {
let type = group === "order" ? "คำสั่ง" : "แนบท้าย";
const pathApi =
group === "order"
? config.API.fileByFile(
"ระบบออกคำสั่ง",
type,
commandId.value,
file.fileName
)
: config.API.subFileByFileName(
"ระบบออกคำสั่ง",
type,
commandId.value,
id,
file.fileName
);
showLoader();
http
.get(pathApi)
.get(
config.API.fileByFile(
"ระบบออกคำสั่ง",
type,
commandId.value,
file.fileName
)
)
.then((res) => {
const data = res.data;
dataFile.value = data;
@ -323,49 +257,6 @@ function onConfirmOrder() {
}
}
/** ดึงข้อมูล บุคคล */
async function fetchLists() {
await http
.get(config.API.commandAction(commandId.value, "tab2"))
.then(async (res) => {
const data = await res.data.result;
attachmentList.value = data.commandRecives.map((item: any) => ({
id: item.citizenId,
name: item.prefix + item.firstName + " " + item.lastName,
file: null,
}));
})
.catch((e) => {
messageError($q, e);
});
}
function onUploadFileTailer(id: string, file: any) {
const type = "แนบท้าย";
const fileName = { fileName: type };
http
.post(config.API.subFile("ระบบออกคำสั่ง", type, commandId.value, id), {
replace: true,
fileList: fileName,
})
.then(async (res) => {
const foundKey: string | undefined = Object.keys(res.data).find(
(key) =>
res.data[key]?.fileName !== undefined &&
res.data[key]?.fileName !== ""
);
foundKey &&
(await uploadFileDoc(res.data[foundKey]?.uploadUrl, file, type, id));
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
onMounted(async () => {
isCheckDraft.value = isDraft.value;
isCheckAuthority.value = isAuthority.value;
@ -373,7 +264,6 @@ onMounted(async () => {
isLoad.value = false;
let promises = [fetchDoc("order")];
if (isAttachment.value) {
await fetchLists();
promises.push(fetchDoc("tailer"));
}
await Promise.all(promises).finally(() => {
@ -428,172 +318,141 @@ onMounted(async () => {
/>
</div>
<div class="row col-12" style="padding-left: 50px" v-if="isAuthority">
<div
class="row col-12 q-col-gutter-sm"
style="padding-left: 50px"
v-if="isAuthority"
>
<div class="col-12 text-header">
ปโหลดเอกสารสแกนกลบเขาสระบบ
</div>
<div class="col-6 q-col-gutter-sm">
<div class="col-6">
<q-card
bordered
class="row col-12"
style="border: 1px solid #d6dee1"
<div class="col-6">
<q-card
bordered
class="row col-12"
style="border: 1px solid #d6dee1"
>
<div
class="row items-center col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
>
<div
class="row items-center col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
คำส
<q-space />
<q-btn
v-if="fileOrder"
rounded
flat
dense
color="primary"
icon="mdi-eye"
@click.prevent="downloadFile(fileOrder, 'order', true)"
>
คำส
<q-space />
<q-btn
v-if="fileOrder"
rounded
flat
dense
color="primary"
icon="mdi-eye"
@click.prevent="
downloadFile(fileOrder, 'order', true, '')
"
>
<q-tooltip>ไฟลคำส</q-tooltip>
</q-btn>
<q-btn
v-if="fileOrder"
rounded
flat
dense
color="red"
icon="mdi-download"
@click.prevent="
downloadFile(fileOrder, 'order', false, '')
"
>
<q-tooltip>ดาวนโหลดไฟลคำส</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 q-pa-md" v-if="step === 2">
<q-file
outlined
dense
v-model="fileUploadOrder"
label="เลือกไฟล์คำสั่ง"
hide-bottom-space
accept=".pdf"
:readonly="store.readonly"
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
<q-tooltip>ไฟลคำส</q-tooltip>
</q-btn>
<q-btn
v-if="fileOrder"
rounded
flat
dense
color="red"
icon="mdi-download"
@click.prevent="downloadFile(fileOrder, 'order')"
>
<q-tooltip>ดาวนโหลดไฟลคำส</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 q-pa-md" v-if="step === 2">
<q-file
outlined
dense
v-model="fileUploadOrder"
label="เลือกไฟล์คำสั่ง"
hide-bottom-space
accept=".pdf"
:readonly="store.readonly"
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
<template v-slot:after>
<q-btn
@click.prevent="onUploadFile('order')"
flat
round
icon="mdi-upload"
:color="fileUploadOrder == null ? 'grey-5' : 'blue-5'"
:disable="fileUploadOrder == null"
/>
</template>
</q-file>
</div>
</q-card>
</div>
<template v-slot:after>
<q-btn
@click.prevent="onUploadFile('order')"
flat
round
icon="mdi-upload"
:color="fileUploadOrder == null ? 'grey-5' : 'blue-5'"
:disable="fileUploadOrder == null"
/>
</template>
</q-file>
</div>
</q-card>
</div>
<div class="col-6" v-if="isAttachment">
<q-card
bordered
class="row col-12"
style="border: 1px solid #d6dee1"
<div class="col-6" v-if="isAttachment">
<q-card
bordered
class="row col-12"
style="border: 1px solid #d6dee1"
>
<div
class="row items-center col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
>
<div
class="row items-center col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
เอกสารแนบทาย
<q-space />
<q-btn
v-if="fileTailer"
rounded
flat
dense
color="primary"
icon="mdi-eye"
@click.prevent="downloadFile(fileTailer, 'tailer', true)"
>
เอกสารแนบทาย
</div>
<div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-md q-col-gutter-sm">
<div
v-for="(person, idx) in attachmentList"
:key="person.id"
class="col-12"
>
<q-card flat bordered class="q-pa-sm">
<div class="row items-center">
<div class="text-weight-medium">
{{ person.name }}
</div>
<q-space />
<q-btn
v-if="attachmentFiles[person.id]"
@click.prevent="
downloadFile(
attachmentFiles[person.id],
'tailer',
true,
person.id
)
"
flat
dense
color="primary"
icon="mdi-eye"
class="q-mr-xs"
>
<q-tooltip>ไฟลเอกสารแนบทาย</q-tooltip>
</q-btn>
<q-btn
v-if="attachmentFiles[person.id]"
@click.prevent="
downloadFile(
attachmentFiles[person.id],
'tailer',
false,
person.id
)
"
flat
dense
color="red"
icon="mdi-download"
>
<q-tooltip>ดาวนโหลดไฟลเอกสารแนบทาย</q-tooltip>
</q-btn>
</div>
<q-file
v-if="step === 2"
outlined
dense
v-model="person.file"
label="เลือกไฟล์เอกสารแนบท้าย"
hide-bottom-space
accept=".pdf"
:readonly="store.readonly"
class="full-width"
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
<template v-slot:after>
<q-btn
@click.prevent="
onUploadFileTailer(person.id, person.file)
"
flat
round
icon="mdi-upload"
:color="person.file == null ? 'grey-5' : 'blue-5'"
:disable="person.file == null"
/>
<q-tooltip>ปโหลดไฟลเอกสารแนบทาย</q-tooltip>
</template>
</q-file>
</q-card>
</div>
</div>
</q-card>
</div>
<q-tooltip>ไฟลเอกสารแนบทาย</q-tooltip>
</q-btn>
<q-btn
v-if="fileTailer"
rounded
flat
dense
color="red"
icon="mdi-download"
@click.prevent="downloadFile(fileTailer, 'tailer')"
>
<q-tooltip>ดาวนโหลดไฟลแนบทาย</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 q-pa-md" v-if="step === 2">
<q-file
outlined
dense
v-model="fileUploadTailer"
label="เลือกไฟล์เอกสารแนบท้าย"
hide-bottom-space
accept=".pdf"
:readonly="store.readonly"
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
<template v-slot:after>
<q-btn
@click.prevent="onUploadFile('tailer')"
flat
round
icon="mdi-upload"
:color="fileUploadTailer == null ? 'grey-5' : 'blue-5'"
:disable="fileUploadTailer == null"
/>
<q-tooltip>ปโหลดไฟลเอกสารแนบทาย</q-tooltip>
</template>
</q-file>
</div>
</q-card>
</div>
</div>
@ -603,7 +462,7 @@ onMounted(async () => {
step === 2 &&
isAuthority &&
fileOrder &&
(!isAttachment || isFileTailer)
(!isAttachment || fileTailer)
"
>
<q-btn
@ -613,14 +472,14 @@ onMounted(async () => {
:color="
!isAuthority ||
fileOrder === null ||
(!isFileTailer && isAttachment)
(fileTailer === null && isAttachment)
? 'grey-5'
: 'public'
"
:disable="
!isAuthority ||
fileOrder === null ||
(!isFileTailer && isAttachment)
(fileTailer === null && isAttachment)
"
/>
</div>