Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-08-08 15:28:04 +07:00
commit 3a6b4f83c8
8 changed files with 110 additions and 54 deletions

View file

@ -433,6 +433,8 @@ onMounted(() => {
lazy-rules
:rules="[(val:string) => !!val || `${'กรุณากรอกน้ำหนัก'}`,]"
hide-bottom-space
mask="#"
reverse-fill-mask
/>
</div>
<div class="col-4">

View file

@ -402,20 +402,24 @@ onMounted(() => {
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td
auto-width
v-if="
checkPermission($route)?.attrIsUpdate ||
checkPermission($route)?.attrIsDelete ||
checkPermission($route)?.attrIsGet
"
>
<q-td auto-width>
<q-btn
icon="mdi-dots-horizontal-circle-outline"
color="secondary"
flat
round
dense
v-if="
(props.row.status !== 'REPORT' &&
props.row.status !== 'DONE' &&
checkPermission($route)?.attrIsGet) ||
(checkPermission($route)?.attrIsDelete &&
props.row.status !== 'REPORT' &&
props.row.status !== 'DONE') ||
(checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsDelete) ||
checkPermission($route)?.attrIsGet
"
>
<q-menu
transition-show="jump-down"
@ -424,9 +428,10 @@ onMounted(() => {
<q-list dense style="min-width: 100px">
<q-item
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet &&
props.row.status !== 'REPORT' &&
props.row.status !== 'DONE' &&
checkPermission($route)?.attrIsUpdate
props.row.status !== 'DONE'
"
clickable
v-close-popup
@ -447,6 +452,7 @@ onMounted(() => {
<q-item
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet &&
props.row.status !== 'REPORT' &&
props.row.status !== 'DONE'
"

View file

@ -68,7 +68,6 @@ const formIndicators = reactive<FormIndicators>({
results: "",
obstacles: "",
suggestions: "",
result: "",
});
/** ข้อมูล Table */
const rows = ref<DevelopmentEvaluations[]>([]); //
@ -120,11 +119,11 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px ; ",
},
{
name: "result",
name: "results",
align: "left",
label: "ผลการดำเนินการ",
sortable: true,
field: "result",
field: "results",
headerStyle: "font-size: 14px",
style: "font-size: 14px ; ",
},
@ -231,7 +230,10 @@ function onSubmitIndicators() {
dialogConfirm($q, () => {
showLoader();
http
.put(config.API.developmentMainTab(path, id), formIndicators)
.put(config.API.developmentMainTab(path, id), {
...formIndicators,
results: status.value === "FINISH" ? formIndicators.results : undefined,
})
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
fetchData();
@ -482,7 +484,13 @@ defineExpose({
<q-card style="width: 900px; max-width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmitIndicators">
<DialogHeader
:tittle="isEdit ? 'แก้ไขตัวชี้วัด' : 'เพิ่มตัวชี้วัด'"
:tittle="
isEdit && typeAction === 'result'
? 'ผลการดำเนินการ'
: isEdit
? 'แก้ไขตัวชี้วัด'
: 'เพิ่มตัวชี้วัด'
"
:close="closeDialog"
/>
<q-separator />
@ -497,7 +505,7 @@ defineExpose({
outlined
class="inputgreen"
label="ผลการดำเนิดการ"
v-model="formIndicators.result"
v-model="formIndicators.results"
hide-bottom-space
lazy-rules
:rules="[

View file

@ -234,13 +234,13 @@ function fetchData() {
data.developmentProjectTechniqueActuals;
formData.projectModalPlanned = data.projectModalPlanned;
formData.projectModalActual = data.projectModalActual;
// formData.dateStart = data.dateStart;
// formData.dateEnd = data.dateEnd;
// formData.totalDate = data.totalDate;
// formData.developmentAddresss = data.developmentAddresss.map((e: any) => ({
// address: e.address,
// provinceId: e.provinceId,
// }));
formData.dateStart = data.dateStart;
formData.dateEnd = data.dateEnd;
formData.totalDate = data.totalDate;
formData.developmentAddresss = data.developmentAddresss.map((e: any) => ({
address: e.address,
provinceId: e.provinceId,
}));
const arrayExpanded = [
data.strategyChild1Planned,
@ -314,6 +314,7 @@ function onSubmit() {
http
.put(config.API.developmentMainTab("tab3", projectId.value), {
...formData,
totalDate: formData.totalDate === "" ? null : formData.totalDate,
reasonPlanned70: reasonPlanned70.value,
reasonPlanned20: reasonPlanned20.value,
reasonPlanned10: reasonPlanned10.value,
@ -376,14 +377,11 @@ const filterSelector = (val: string, update: Function) => {
});
};
watch(
() => [formData.dateStart, formData.dateEnd],
() => {
if (formData.dateStart && formData.dateEnd) {
formData.totalDate = diffDay(formData.dateStart, formData.dateEnd);
}
function updatetotalDate() {
if (formData.dateStart && formData.dateEnd) {
formData.totalDate = diffDay(formData.dateStart, formData.dateEnd);
}
);
}
/**
* function ไปย Tab อไป
@ -586,7 +584,9 @@ defineExpose({
:enableTimePicker="false"
week-start="0"
:max-date="formData.dateEnd"
@update:model-value="props.onCheckChangeData()"
@update:model-value="
props.onCheckChangeData(), updatetotalDate()
"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
@ -628,7 +628,9 @@ defineExpose({
:enableTimePicker="false"
week-start="0"
:min-date="formData.dateStart"
@update:model-value="props.onCheckChangeData()"
@update:model-value="
props.onCheckChangeData(), updatetotalDate()
"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{

View file

@ -89,7 +89,7 @@ interface FormProjectDetail {
strategyChildActualNode: number | null; //node ยุทธศาสตร์เป้าหมายตามจริง
dateStart: Date | null; //วันที่เริ่มต้น
dateEnd: Date | null; //วันที่สิ้นสุด
totalDate: number | null; //รวมระยะเวลา (วัน)
totalDate: number | null | string; //รวมระยะเวลา (วัน)
developmentAddresss: [{ address: string; provinceId: string }]; //ที่อยู่ ,จังหวัด
}

View file

@ -7,7 +7,6 @@ interface FormIndicators {
results: string;
obstacles: string;
suggestions: string;
result: string;
}
interface FormProject {

View file

@ -7,8 +7,8 @@ export default [
component: mainPage,
meta: {
Auth: true,
Key: [1],
Role: "organization",
Key: "SYS_ACTING",
Role: "STAFF",
},
},
];

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, onMounted, reactive, watch } from "vue";
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { checkPermission } from "@/utils/permissions";
import http from "@/plugins/http";
import config from "@/app.config";
@ -27,7 +28,9 @@ const nodeTree = ref<DataTree[]>([]);
const posmasterId = ref<string>("");
const isAll = ref<boolean>(false);
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบัน*/
/**
* function เรยกขอมลโครงสราง แบบป
*/
function fetchOrganizationActive() {
showLoader();
http
@ -140,7 +143,9 @@ const columns = ref<QTableProps["columns"]>([
]);
const keyword = ref<string>("");
/** function fetch รายชื่อ*/
/**
* function fetch รายช
*/
function fetchPosMaster() {
showLoader();
http
@ -185,11 +190,13 @@ function selectPosition(data: ListPerson) {
});
}
/** รายชื่อคนรักษาการ*/
/********** รายชื่อคนรักษาการ **************/
const rowListPerson = ref<ListPerson[]>([]);
const keywordAct = ref<string>("");
/** function fetch รายชื่อรักษาการ */
/**
* function fetch รายชอรกษาการ
*/
function fetchListAct() {
showLoader();
http
@ -254,6 +261,7 @@ onMounted(() => {
</div>
<q-card style="height: 100%">
<q-card-section :horizontal="$q.screen.gt.sm">
<!-- โครงสราง -->
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
<div>
<q-input dense outlined v-model="filter" label="ค้นหา">
@ -305,7 +313,7 @@ onMounted(() => {
<div v-if="prop.node.posMaster">
<q-list dense v-for="col in prop.node.posMaster">
<q-item
clickable
:clickable="checkPermission($route)?.attrIsGet"
:active="posmasterId == col.posmasterId"
:class="posmasterId !== col.posmasterId ? 'text-info' : ''"
active-class="my-list-link text-primary text-weight-medium"
@ -325,6 +333,7 @@ onMounted(() => {
<q-separator :vertical="$q.screen.gt.xs" />
<!-- รายช -->
<q-card-section
v-if="posmasterId"
class="col-lg-9 col-md-8 col-xs-12 scroll"
@ -390,12 +399,21 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr
:props="props"
:class="
checkPermission($route)?.attrIsUpdate &&
'cursor-pointer'
"
>
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
@click="selectPosition(props.row)"
@click="
checkPermission($route)?.attrIsUpdate &&
selectPosition(props.row)
"
>
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
@ -464,8 +482,20 @@ onMounted(() => {
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width v-if="rowListPerson.length !== 1" />
<q-th auto-width v-if="rowListPerson.length !== 1" />
<q-th
auto-width
v-if="
rowListPerson.length !== 1 &&
checkPermission($route)?.attrIsUpdate
"
/>
<q-th
auto-width
v-if="
rowListPerson.length !== 1 &&
checkPermission($route)?.attrIsUpdate
"
/>
<q-th auto-width />
<q-th
v-for="col in props.cols"
@ -479,11 +509,16 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td auto-width v-if="rowListPerson.length !== 1">
<q-tr :props="props">
<q-td
auto-width
v-if="
rowListPerson.length !== 1 &&
checkPermission($route)?.attrIsUpdate
"
>
<q-btn
dense
size="12px"
flat
round
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
@ -494,10 +529,15 @@ onMounted(() => {
<!-- <q-tooltip>เลอนลำดบข</q-tooltip> -->
</q-btn>
</q-td>
<q-td auto-width v-if="rowListPerson.length !== 1">
<q-td
auto-width
v-if="
rowListPerson.length !== 1 &&
checkPermission($route)?.attrIsUpdate
"
>
<q-btn
dense
size="12px"
flat
round
:color="
@ -514,10 +554,10 @@ onMounted(() => {
<!-- <q-tooltip>เลอนลำดบลง</q-tooltip> -->
</q-btn>
</q-td>
<q-td>
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
dense
size="12px"
flat
round
color="red"
@ -539,7 +579,6 @@ onMounted(() => {
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
<!-- <template v-slot:pagination="scope">