บรรจุ แต่งตั้ง ย้าย โอน => ปรับ code และ load
This commit is contained in:
parent
9f4aeec575
commit
34dc306288
30 changed files with 1154 additions and 1429 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue