ปรับ fe sprint2

This commit is contained in:
Kittapath 2023-06-19 15:50:50 +07:00
parent 8576f3c387
commit 0d6ff7be0a
83 changed files with 6932 additions and 2571 deletions

View file

@ -26,6 +26,16 @@
<div v-if="col.name == 'date'" class="table_ellipsis">
{{ date2Thai(col.value) }}
</div>
<div
v-else-if="
col.name == 'positionSalaryAmount' ||
col.name == 'mouthSalaryAmount' ||
col.name == 'amount'
"
class="table_ellipsis"
>
{{ col.value == null ? "" : col.value.toLocaleString("en-US") }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
</div>
@ -170,9 +180,9 @@
:borderless="!edit"
v-model="posNoId"
:rules="[
(val:string) => !!val || `${'กรุณาเลือกเลขที่ตำแหน่ง'}`,
(val:string) => !!val || `${'กรุณาเลือกตำแหน่งเลขที่'}`,
]"
:label="`${'เลขที่ตำแหน่ง'}`"
:label="`${'ตำแหน่งเลขที่'}`"
@update:modelValue="clickEditRow"
emit-value
map-options
@ -506,6 +516,16 @@
>
{{ date2Thai(col.value) }}
</div>
<div
v-else-if="
col.name == 'positionSalaryAmount' ||
col.name == 'mouthSalaryAmount' ||
col.name == 'amount'
"
class="table_ellipsis"
>
{{ col.value == null ? "" : col.value.toLocaleString("en-US") }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
</div>
@ -551,8 +571,7 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const { date2Thai, success, dateToISO, messageError } = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -592,6 +611,23 @@ const selected = ref<string>("");
const nodesTree = ref<treeTab[]>([]);
const refSelected = ref<DataOption | null>(null);
const refOptions = ref<DataOption[]>([
{
id: "17",
name: "**************** ข้าราชการสามัญ **********************",
disable: true,
},
{
id: "18",
name: "รักษาการในตำแหน่ง {ตำแหน่ง} ตั้งแต่ {วัน} {เดือน} {พ.ศ.} ถึงวันที่ {วัน} {เดือน} {พ.ศ.} คำสั่ง กทม.ที่ {ที่}/{พ.ศ} ลงวันที่ {วัน} {เดือน} {พ.ศ.}",
},
{
id: "19",
name: "ช่วยราชการ หน่วนงาน {สังกัด} ตั้งแต่ {วัน} {เดือน} {พ.ศ.} ถึงวันที่ {วัน} {เดือน} {พ.ศ.} คำสั่ง กทม.ที่ {ที่}/{พ.ศ} ลงวันที่ {วัน} {เดือน} {พ.ศ.}",
},
{
id: "20",
name: "รับโอน {ประเภทตำแหน่ง} จากตำแหน่ง {ตำแหน่ง} ระดับ {ระดับ} สังกัด {สังกัด} ตำแหน่งเลขที่ {ตำแหน่งเลขที่} เงินเดือน {เงินเดือน} เป็นตำแหน่ง {ตำแหน่ง} ระดับ {ระดับ} สังกัด {สังกัด} ตำแหน่งเลขที่ {ตำแหน่งเลขที่} เงินเดือน {เงินเดือน} คำสั่ง กทม.ที่ {ที่}/{พ.ศ} ลงวันที่ {วัน} {เดือน} {พ.ศ.}",
},
{
id: "0",
name: "**************** ครู **********************",
@ -707,6 +743,23 @@ const refOptions = ref<DataOption[]>([
},
]);
const refOptionsFilter = ref<DataOption[]>([
{
id: "17",
name: "**************** ข้าราชการสามัญ **********************",
disable: true,
},
{
id: "18",
name: "รักษาการในตำแหน่ง {ตำแหน่ง} ตั้งแต่ {วัน} {เดือน} {พ.ศ.} ถึงวันที่ {วัน} {เดือน} {พ.ศ.} คำสั่ง กทม.ที่ {ที่}/{พ.ศ} ลงวันที่ {วัน} {เดือน} {พ.ศ.}",
},
{
id: "19",
name: "ช่วยราชการ หน่วนงาน {สังกัด} ตั้งแต่ {วัน} {เดือน} {พ.ศ.} ถึงวันที่ {วัน} {เดือน} {พ.ศ.} คำสั่ง กทม.ที่ {ที่}/{พ.ศ} ลงวันที่ {วัน} {เดือน} {พ.ศ.}",
},
{
id: "20",
name: "รับโอน {ประเภทตำแหน่ง} จากตำแหน่ง {ตำแหน่ง} ระดับ {ระดับ} สังกัด {สังกัด} ตำแหน่งเลขที่ {ตำแหน่งเลขที่} เงินเดือน {เงินเดือน} เป็นตำแหน่ง {ตำแหน่ง} ระดับ {ระดับ} สังกัด {สังกัด} ตำแหน่งเลขที่ {ตำแหน่งเลขที่} เงินเดือน {เงินเดือน} คำสั่ง กทม.ที่ {ที่}/{พ.ศ} ลงวันที่ {วัน} {เดือน} {พ.ศ.}",
},
{
id: "0",
name: "**************** ครู **********************",
@ -930,7 +983,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "เลขที่ตำแหน่ง",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -1097,7 +1150,7 @@ const columnsHistory = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "เลขที่ตำแหน่ง",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -1312,7 +1365,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
};
const nodeTree = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1326,7 +1379,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -1334,7 +1387,7 @@ const nodeTree = async () => {
* get รายการ ตำแหน
*/
const fetchPosition = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.position)
.then((res) => {
@ -1411,12 +1464,12 @@ const fetchPosition = async () => {
})
.catch((e: any) => {})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
const fetchData = async () => {
showLoader();
loaderPage(true);
await http
.get(config.API.profileSalaryId(profileId.value))
.then((res) => {
@ -1458,7 +1511,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -1468,7 +1521,7 @@ const onSelected = async (id: string) => {
const fetchOrganization = async (id: string) => {
if (selected.value != "") {
showLoader();
loaderPage(true);
await http
.get(config.API.organizationName(id))
.then((res) => {
@ -1479,13 +1532,13 @@ const fetchOrganization = async (id: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
}
};
const fetchPositionNumber = async (id: string) => {
showLoader();
loaderPage(true);
await http
.get(config.API.getPositionNumberIdByOcId(id))
.then((res) => {
@ -1501,7 +1554,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};
@ -1603,7 +1656,7 @@ const templateDetail = async () => {
(r: DataOption) => r.id == posNoId.value
);
if (posNoF.length > 0) {
salaryClass.value = salaryClass.value + `เลขที่ตำแหน่ง${posNoF[0].name} `;
salaryClass.value = salaryClass.value + `ตำแหน่งเลขที่${posNoF[0].name} `;
}
const positionLineF = positionLineOptions.value.filter(
@ -1664,7 +1717,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
showLoader();
loaderPage(true);
await http
.post(config.API.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
@ -1699,7 +1752,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
showLoader();
loaderPage(true);
await http
.put(config.API.profileSalaryId(id.value), {
date: dateToISO(date.value),
@ -1742,7 +1795,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
showLoader();
loaderPage(true);
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1884,7 +1937,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
showLoader();
loaderPage(true);
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -1926,7 +1979,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
loaderPage(false);
});
};