บรรจุ แต่งตั้ง ย้าย โอน => ปรับ code และ load

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-19 16:14:43 +07:00
parent 9f4aeec575
commit 34dc306288
30 changed files with 1154 additions and 1429 deletions

View file

@ -23,7 +23,6 @@ import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const router = useRouter();
const storeFn = useTransferDataStore();
const mixin = useCounterMixin();
const { statusText } = storeFn;
const {
showLoader,
@ -32,19 +31,20 @@ const {
messageError,
date2Thai,
dialogRemove,
findOrgName,
} = mixin;
} = useCounterMixin();
const modal = ref<boolean>(false);
const type = ref<string>("");
const optionsType = ref<OpType[]>([]);
/**
* Table
*/
const rows = ref<listMain[]>([]);
const rows2 = ref<listMain[]>([]);
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
const visibleColumns = ref<string[]>([
"no",
"fullname",
@ -127,15 +127,24 @@ const columns = ref<QTableProps["columns"]>([
format: (val) => statusText(val),
},
]);
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
//----( API)------//
const fecthlistOthet = async () => {
/**
* fetch รายการอนๆ
*/
function fecthlistOthet() {
showLoader();
await http
http
.get(config.API.otherMain())
.then((res) => {
let response = res.data.result;
rows.value = response;
//
rows2.value = rows.value.filter(
(e: listMain) =>
e.status !== "REPORT" &&
@ -155,14 +164,18 @@ const fecthlistOthet = async () => {
.finally(() => {
hideLoader();
});
};
//----()------//
const fecthTypeOption = async () => {
}
/**
* fetch รายการขอมลประเภทคำส
*/
function fecthTypeOption() {
showLoader();
type.value = "";
await http
http
.get(config.API.typeOrder())
.then((res) => {
// C-PM-08 C-PM-09
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09"
@ -174,33 +187,43 @@ const fecthTypeOption = async () => {
.finally(() => {
hideLoader();
});
};
}
//----( input)------//
const resetFilter = () => {
/**
* เซตขอมลในชอง input
*/
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
};
}
//----( Dialog)------//
const popup = () => {
/**
* เป popup งไปออกคำสงอนๆ
*/
function popup() {
modal.value = true;
filterKeyword2.value = "";
fecthTypeOption();
type.value = "";
};
// fetch
fecthTypeOption();
}
//----( modal)------//
const clickClose = () => {
/**
* popup งไปออกคำสงอนๆ
*/
function clickClose() {
modal.value = false;
};
}
//----( Dialog )------//
const clickDelete = (id: string) => {
dialogRemove($q, async () => {
/**
* นยนการลบรายการอนๆ
* @param id รายการอนๆ
*/
function clickDelete(id: string) {
dialogRemove($q, () => {
showLoader();
await http
http
.delete(config.API.otherByid(id))
.then(async () => {
await fecthlistOthet();
@ -213,21 +236,17 @@ const clickDelete = (id: string) => {
hideLoader();
});
});
};
}
//----()------//
const nextPage = (id: string) => {
/**
* redialect รายละเอยดรายการอนๆ
* @param id รายการอนๆ
*/
function nextPage(id: string) {
router.push({
path: `/placement/other/detail/${id}`,
});
};
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
}
onMounted(() => {
fecthlistOthet();
@ -361,6 +380,7 @@ onMounted(() => {
</div>
</div>
</q-card>
<Dialogbody
v-model:Modal="modal"
:clickClose="clickClose"