Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-09-30 14:45:45 +07:00
commit 56ebe0c1ee
8 changed files with 326 additions and 23 deletions

View file

@ -28,8 +28,7 @@ import DialogMovePos from "@/modules/02_organization/components/DialogMovePos.vu
import DialogHistoryPos from "@/modules/02_organization/components/DialogHistoryPos.vue"; //
import DialogSelectPerson from "@/modules/02_organization/components/DialogSelectPerson.vue"; //
import DialogSuccession from "@/modules/02_organization/components/DialogSuccession.vue"; //
/** importStore*/
import DialogCreateCommandORG from "@/modules/18_command/components/DialogCreateCommandORG.vue";
const $q = useQuasar();
const store = useOrganizational();
@ -177,7 +176,6 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const columnsExpand = ref<QTableProps["columns"]>([
{
name: "no",
@ -254,6 +252,8 @@ const columnsExpand = ref<QTableProps["columns"]>([
]);
const dialogPosition = ref<boolean>(false); //
const modalCommand = ref<boolean>(false); //
/**
* function openPopup เพมอตรากำล
* @param type ประเภท
@ -541,6 +541,19 @@ watch(
</q-menu>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
v-if="store.typeOrganizational === 'draft'"
flat
round
dense
color="add"
icon="mdi-account-arrow-right"
@click.prevent="modalCommand = true"
>
<q-tooltip>งไปออกคำส</q-tooltip>
</q-btn>
<q-space />
<div class="row q-gutter-md">
<div>
@ -892,6 +905,12 @@ watch(
<!-- บทอดตำแหน -->
<DialogSuccession v-model:modal="modalDialogSuccession" :rowId="rowId" />
<!-- dialog สรางคำส -->
<DialogCreateCommandORG
v-model:modal="modalCommand"
command-type-code="C-PM-38"
/>
</template>
<style lang="scss" scoped>

View file

@ -54,7 +54,7 @@ const visibleColumns2 = ref<string[]>([
"citizenId",
"fullname",
"organizationName",
"birthday",
"dateOfBirth",
"typeCommand",
]);
const columns2 = ref<QTableProps["columns"]>([
@ -115,11 +115,11 @@ const columns2 = ref<QTableProps["columns"]>([
},
},
{
name: "birthday",
name: "dateOfBirth",
align: "left",
label: "วัน/เดือน/ปี เกิด",
sortable: true,
field: "birthday",
field: "dateOfBirth",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@ -200,6 +200,8 @@ watch(
async () => {
if (props.Modal === true) {
rows.value = props.rows2 ? props.rows2 : [];
console.log(rows.value);
selected.value = [];
commandType.value = "";
const data = await storeCommand.getCommandTypes();

View file

@ -290,7 +290,7 @@ onMounted(async () => {
</q-card>
</div>
<div class="col-12" v-if="download10Url != ''">
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
<div
class="text-weight-medium row col-12 bg-grey-1 q-py-sm q-px-md items-center"
@ -328,7 +328,7 @@ onMounted(async () => {
lazy-rules
accept=".pdf"
:rules="
download10Url === '' ? [(val) => !!val || 'กรุณาเลือกไฟล์'] : []
download10Url === '' ? [(val:string) => !!val || 'กรุณาเลือกไฟล์'] : []
"
>
<template v-slot:prepend>

View file

@ -428,7 +428,7 @@ onMounted(async () => {
accept=".pdf"
:rules="
downloadFile1 === ''
? [(val) => !!val || 'กรุณาเลือกไฟล์']
? [(val:string) => !!val || 'กรุณาเลือกไฟล์']
: []
"
>
@ -524,7 +524,7 @@ onMounted(async () => {
accept=".pdf"
:rules="
downloadFile2 === ''
? [(val) => !!val || 'กรุณาเลือกไฟล์']
? [(val:string) => !!val || 'กรุณาเลือกไฟล์']
: []
"
>
@ -620,7 +620,7 @@ onMounted(async () => {
accept=".pdf"
:rules="
downloadFile3 === ''
? [(val) => !!val || 'กรุณาเลือกไฟล์']
? [(val:string) => !!val || 'กรุณาเลือกไฟล์']
: []
"
>
@ -716,7 +716,7 @@ onMounted(async () => {
accept=".pdf"
:rules="
downloadFile4 === ''
? [(val) => !!val || 'กรุณาเลือกไฟล์']
? [(val:string) => !!val || 'กรุณาเลือกไฟล์']
: []
"
>
@ -813,7 +813,7 @@ onMounted(async () => {
accept=".pdf"
:rules="
downloadFile5 === ''
? [(val) => !!val || 'กรุณาเลือกไฟล์']
? [(val:string) => !!val || 'กรุณาเลือกไฟล์']
: []
"
>
@ -909,7 +909,7 @@ onMounted(async () => {
accept=".pdf"
:rules="
downloadFile6 === ''
? [(val) => !!val || 'กรุณาเลือกไฟล์']
? [(val:string) => !!val || 'กรุณาเลือกไฟล์']
: []
"
>
@ -941,7 +941,7 @@ onMounted(async () => {
</div>
</q-card>
</div>
<div v-if="downloadDocEditUrl != ''" class="col-12">
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
<div
class="col-12 row items-center text-weight-medium bg-grey-1 q-py-sm q-px-md"

View file

@ -83,11 +83,11 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
{
name: "commandExcecuteDate",
name: "commandAffectDate",
align: "left",
label: "วันที่ลงนาม",
sortable: false,
field: "commandExcecuteDate",
field: "commandAffectDate",
format(val) {
return val ? date2Thai(val) : "-";
},
@ -95,11 +95,11 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
{
name: "commandAffectDate",
name: "commandExcecuteDate",
align: "left",
label: "วันที่คำสั่งมีผล",
sortable: false,
field: "commandAffectDate",
field: "commandExcecuteDate",
format(val) {
return val ? date2Thai(val) : "-";
},
@ -523,7 +523,9 @@ watch(
<q-btn
label="บันทึกและเลือกรายชื่อต่อ"
@click="() => onSubmit(false)"
:disable="selected.length == 0 && commandType == ''"
:disable="
selectCreate == 'NEW' ? commandType == '' : selected.length == 0
"
color="blue"
>
<q-tooltip>นทกและเลอกรายชอต</q-tooltip>
@ -531,7 +533,9 @@ watch(
<q-btn
label="บันทึกและไปยังหน้าคำสั่ง"
@click="() => onSubmit(true)"
:disable="selected.length == 0 && commandType == ''"
:disable="
selectCreate == 'NEW' ? commandType == '' : selected.length == 0
"
color="public"
>
<q-tooltip>นทกและไปยงหนาคำส</q-tooltip>

View file

@ -0,0 +1,277 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useCommandMainStore } from "@/modules/18_command/store/Main";
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
import DialogHeader from "@/components/DialogHeader.vue";
const storeCommand = useCommandMainStore();
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin();
const {
showLoader,
success,
messageError,
dialogConfirm,
hideLoader,
date2Thai,
} = mixin;
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
commandTypeCode: String, //
});
const commandOp = ref<ListCommand[]>([]); //
const commandType = ref<string>(""); //
const commandNo = ref<string>(""); //
const commandYear = ref<number>(new Date().getFullYear());
const commandAffectDate = ref<Date | null>(null); //
const commandExcecuteDate = ref<Date | null>(null); //
/**
* งกนสรางคำสงใหม
*/
function onSubmit() {
dialogConfirm($q, () => {});
}
/** ปิด popup */
function closeModal() {
modal.value = false;
clearValue();
}
function clearValue() {
commandNo.value = "";
commandYear.value = new Date().getFullYear();
commandAffectDate.value = null;
commandExcecuteDate.value = null;
}
/** ดึงข้อมูลคำสั่ง */
async function fetchCommandType() {
const data = await storeCommand.getCommandTypes(); // get store
// filter code
commandOp.value = await data.filter(
(v: any) => v.code == props.commandTypeCode
);
commandType.value = commandOp.value[0].id;
}
watch(modal, () => {
if (modal.value) {
fetchCommandType();
}
});
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 50vw">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader :tittle="'สร้างคำสั่ง'" :close="closeModal" />
<q-separator />
<q-card-section style="max-height: 50vh" class="scroll">
<div class="row q-sm q-col-gutter-sm">
<div class="col-12">
<q-select
v-model="commandType"
:label="`${'ประเภทคำสั่ง'}`"
option-label="name"
:options="commandOp"
option-value="id"
dense
emit-value
map-options
lazy-rules
use-input
hide-bottom-space
outlined
readonly
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-6">
<q-input
class="inputgreen"
outlined
dense
v-model="commandNo"
:label="`${'คำสั่งเลขที่'}`"
/>
</div>
<label class="col-1 flex justify-center items-center text-bold"
>/</label
>
<div class="col-5">
<datepicker
menu-class-name="modalfix"
v-model="commandYear"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
class="inputgreen"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
hide-bottom-space
:model-value="
commandYear == null ? null : commandYear + 543
"
:label="`${'พ.ศ.'}`"
:rules="[(val:string) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-6">
<datepicker
clearable
menu-class-name="modalfix"
v-model="commandAffectDate"
:locale="'th'"
autoApply
:enableTimePicker="false"
class="inputgreen"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
clearable
dense
outlined
hide-bottom-space
:model-value="
commandAffectDate == null
? null
: date2Thai(commandAffectDate)
"
:label="`${'วันที่ลงนาม'}`"
@clear="() => (commandAffectDate = null)"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-6">
<datepicker
clearable
menu-class-name="modalfix"
v-model="commandExcecuteDate"
:locale="'th'"
autoApply
:enableTimePicker="false"
class="inputgreen"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
clearable
dense
outlined
hide-bottom-space
class="inputgreen"
:model-value="
commandExcecuteDate == null
? null
: date2Thai(commandExcecuteDate)
"
:label="`${'วันที่คำสั่งมีผล'}`"
@clear="() => (commandExcecuteDate = null)"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<!-- <q-btn
label="บันทึกและเลือกรายชื่อต่อ"
@click="() => onSubmit(false)"
:disable="
selectCreate === 'NEW' ? commandType == '' : selected.length == 0
"
color="blue"
>
<q-tooltip>นทกและเลอกรายชอต</q-tooltip>
</q-btn> -->
<q-btn
label="บันทึกและไปยังหน้าคำสั่ง"
:disable="commandType == ''"
type="submit"
color="public"
>
<q-tooltip>นทกและไปยงหนาคำส</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
<style scoped></style>

View file

@ -707,7 +707,7 @@ onMounted(async () => {
<q-dialog v-model="modalComment" persistent>
<q-card style="min-width: 40%">
<q-form greedy @submit.prevent @validation-success="onSubmitComment">
<DialogHeader :tittle="'แสดงความเห็น'" :close="onCloseDialog" />
<DialogHeader :tittle="'รับทราบคำสั่ง'" :close="onCloseDialog" />
<q-separator />
<q-card-section>
@ -728,7 +728,7 @@ onMounted(async () => {
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn color="secondary" label="บันทึกความเห็น" type="onSubmit" />
<q-btn color="secondary" label="รับทราบ" type="onSubmit" />
</q-card-actions>
</q-form>
</q-card>

View file

@ -117,6 +117,7 @@ async function fetchListCommand() {
label="ค้นหา"
clearable
style="width: 300px"
@keydown.enter="(queryParams.page = 1), fetchListCommand()"
>
<template v-slot:append v-if="!queryParams.keyword">
<q-icon name="search" /> </template