Merge branch 'develop' into nice_dev

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-01 11:58:45 +07:00
commit d7c164ac9b
4 changed files with 63 additions and 24 deletions

View file

@ -79,7 +79,7 @@
:error="yearInputCheck"
error-message="กรุณากรอก ปี ที่ยื่นขอพระราชทานเครื่องราชฯ"
/>
<datepicker
v-else
menu-class-name="modalfix"
@ -457,6 +457,17 @@
</template>
</datepicker>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
v-model="note"
label="หมายเหตุ"
dense
:outlined="edit"
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
/>
</div>
</div>
</q-card-section>
<q-separator />
@ -576,8 +587,10 @@ const Ops = ref<InsigniaOps>({
const OpsFilter = ref<InsigniaOps>({
insigniaOptions: [],
});
const note = ref<string>();
const insigniaType = ref<string>();
const year = ref<number|null>(0);
const year = ref<number | null>(0);
const no = ref<string>();
const issue = ref<string>();
const volumeNo = ref<string>();
@ -623,6 +636,7 @@ profileData.insignia.columns.length == 0
"dateAnnounce",
"refCommandNo",
"refCommandDate",
"note",
"createdAt",
])
: (visibleColumns.value = profileData.insignia.columns);
@ -770,7 +784,19 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "note",
align: "left",
label: "หมายเหตุ",
sortable: true,
field: "note",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const columnsHistory = ref<QTableProps["columns"]>([
{
name: "year",
@ -1021,7 +1047,6 @@ const fetchData = async () => {
.get(config.API.profileInsignId(profileId.value))
.then((res) => {
let data = res.data.result;
console.log(data);
rows.value = [];
data.map((e: any) => {
rows.value.push({
@ -1042,9 +1067,9 @@ const fetchData = async () => {
refCommandDate: e.refCommandDate,
createdFullName: e.createdFullName,
createdAt: e.createdAt,
note: e.note,
});
});
console.log(data)
})
.catch((e) => {
messageError($q, e);
@ -1083,7 +1108,7 @@ const getData = () => {
const row = rows.value[rowIndex.value];
insigniaId.value = row.insigniaId;
insigniaType.value = row.insigniaType;
year.value = row.year == null ? null:row.year;
year.value = row.year == null ? null : row.year;
no.value = row.no;
issue.value = row.issue;
volumeNo.value = row.volumeNo;
@ -1095,7 +1120,8 @@ const getData = () => {
refCommandNo.value = row.refCommandNo;
refCommandDate.value = row.refCommandDate;
id.value = row.id;
yearInput.value = row.year !== 0 ? (Number(row.year) + 543).toLocaleString():'';
yearInput.value =
row.year !== 0 ? (Number(row.year) + 543).toLocaleString() : "";
receiveDateInput.value = row.receiveDate
? convertDateDisplay(row.receiveDate)
: "";
@ -1185,6 +1211,7 @@ const saveData = async () => {
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
note: note.value,
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -1225,6 +1252,7 @@ const editData = async () => {
refCommandDate.value == null
? null
: dateToISO(refCommandDate.value as Date),
note: note.value,
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -1297,7 +1325,6 @@ const clickClose = async () => {
* @param props props ใน row เลอก
*/
const selectData = async (props: DataProps) => {
console.log(props.row);
modalEdit.value = true;
modal.value = true;
edit.value = false;
@ -1305,7 +1332,7 @@ const selectData = async (props: DataProps) => {
rowIndex.value = props.rowIndex;
insigniaId.value = props.row.insigniaId;
insigniaType.value = props.row.insigniaType;
year.value = props.row.year == 0 ? 0:props.row.year;
year.value = props.row.year == 0 ? 0 : props.row.year;
no.value = props.row.no;
issue.value = props.row.issue;
volumeNo.value = props.row.volumeNo;
@ -1320,7 +1347,8 @@ const selectData = async (props: DataProps) => {
props.row.refCommandDate == "-" ? null : props.row.refCommandDate;
id.value = props.row.id;
yearInput.value = props.row.year !== 0 ? (Number(props.row.year) + 543).toLocaleString():'';
yearInput.value =
props.row.year !== 0 ? (Number(props.row.year) + 543).toLocaleString() : "";
receiveDateInput.value = convertDateDisplay(props.row.receiveDate);
dateAnnounceInput.value = props.row.dateAnnounce
? convertDateDisplay(props.row.dateAnnounce as Date)
@ -1467,8 +1495,7 @@ watch(
} else {
dateAnnounceInput.value = "";
}
}
else if (value.length === 0) {
} else if (value.length === 0) {
dateAnnounce.value = null;
}
}
@ -1483,8 +1510,7 @@ watch(
} else {
refCommandDateInput.value = "";
}
}
else if (value.length === 0) {
} else if (value.length === 0) {
refCommandDate.value = null;
}
}
@ -1513,8 +1539,7 @@ watch(
const dateVal = Number(value) - 543;
yearInputCheck.value = false;
year.value = dateVal;
}
else if (value.length === 0) {
} else if (value.length === 0) {
year.value = 0;
}
}

View file

@ -8,6 +8,7 @@ import config from "@/app.config";
import type {
DataOption,
ObjectSalaryRef,
FormData
} from "@/modules/13_salary/interface/index/Main";
import type {
SalaryPosType,
@ -46,7 +47,7 @@ const props = defineProps({
});
const salaryId = ref<string>("");
const formData = reactive({
const formData = reactive<FormData>({
salaryType: "", //* (OFFICER->"",EMPLOYEE->"")
posTypeId: "", //*
posLevelId: "", //*
@ -168,7 +169,11 @@ watch(
if (salaryPosTypeOption.value.length === 0) {
await fetchPosType();
}
if (props.typeAction === "add") {
formData.date = new Date()
formData.startDate = new Date()
formData.endDate = new Date()
}
if (props.typeAction === "edit") {
await showLoader();
if (props.data) {
@ -237,9 +242,6 @@ function createSalary() {
});
}
/** function checkEndDate*/
function checkEndDate() {
if (formData.endDate !== null && formData.startDate !== null) {
@ -286,10 +288,10 @@ async function downloadFile(url: string, type: string, fileName: string) {
<Header :tittle="title" :close="closeDialog" />
<q-separator />
<q-card-section class="scroll" style="max-height: 70vh;">
<q-card-section class="scroll" style="max-height: 70vh">
<div class="row col-12 q-col-gutter-sm">
<div class="col-md-12">
<div class="row col-12 q-col-gutter-sm ">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-md-3">
<q-select
ref="salaryTypeRef"

View file

@ -45,11 +45,23 @@ interface ObjectSalaryRateRef {
[key: string]: any;
}
interface FormData{
salaryType:string
posTypeId:string
posLevelId:string
isActive:boolean
date:Date |null
startDate:Date |null
endDate:Date |null
details:string
isSpecial:boolean
}
export type {
DataOption,
NewPagination,
ItemsMenu,
ObjectSalaryRef,
ObjectSalaryRateRef,
DataOptionShort
DataOptionShort,
FormData,
};

View file

@ -84,7 +84,7 @@ export const useCounterMixin = defineStore("mixin", () => {
const month = dateMoment.format(isFullMonth ? "MMMM" : "MMM");
const year = +dateMoment.format("YYYY") + 543;
return `${day} ${month} ${year}${
isTime ? dateMoment.format(" hh:mm น.") : ""
isTime ? dateMoment.format(" HH:mm น.") : ""
}`;
}