refactor(placement): DialogSelectOrg LoadPosition
This commit is contained in:
parent
7bbd9ae933
commit
a7341c7440
2 changed files with 34 additions and 20 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import { ref, onMounted, watch } from "vue";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import { type QTableProps } from "quasar";
|
||||
import type {
|
||||
Positions,
|
||||
FormPosType,
|
||||
|
|
@ -23,13 +23,13 @@ const store = useSelectOrgStore();
|
|||
const selected = defineModel("selectedPos", { required: true }); //ตำแหน่งที่เลือก
|
||||
const positionId = defineModel<string>("positionId", { required: true }); //id ตำแหน่งที่เลือก
|
||||
const seletcId = defineModel<string>("seletcId", { required: true }); // ตำแหน่งที่เลือก
|
||||
const date = defineModel<Date>("datePos", { required: true }); //วันยที่รายงานคัว
|
||||
const date = defineModel<Date | null>("datePos", { required: true }); //วันยที่รายงานคัว
|
||||
const positionData = defineModel<any[]>("position", { required: true }); //ข้อมูลรายการเลขที่ตำแหน่ง
|
||||
const isAll = defineModel<boolean>("isAll", { required: true }); //แสดงตำแหน่งทั้งหมด
|
||||
const isBlank = defineModel<boolean>("isBlank", { required: true }); //แสดงเฉพาะตำแหน่งว่าง
|
||||
const isPosition = defineModel<string>("isPosition", { required: true });
|
||||
// const isPositionOld = defineModel<boolean>("isPositionOld", { required: true }); //แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม
|
||||
const posType = defineModel<FormPosType>("posType", { required: true }); //ตำแหน่งประเภท
|
||||
const posType = defineModel<FormPosType | null>("posType", { required: true }); //ตำแหน่งประเภท
|
||||
const posLevel = defineModel<string>("posLevel", { required: true }); //ระดับตำแหน่ง
|
||||
const optionPosType = defineModel<FormPosType[]>("optionPosType", {
|
||||
required: true,
|
||||
|
|
@ -47,6 +47,7 @@ const props = defineProps({
|
|||
onPosType: Function,
|
||||
nodeId: String,
|
||||
nodeLevel: Number,
|
||||
isLoadPosition: Boolean,
|
||||
});
|
||||
|
||||
//Table
|
||||
|
|
@ -248,15 +249,20 @@ watch(positionData, (newVal, oldVal) => {
|
|||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.isLoadPosition,
|
||||
(newVal) => {
|
||||
if (newVal && positionId.value) {
|
||||
onClickSelectPos(positionId.value);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
*/
|
||||
onMounted(async () => {
|
||||
if (positionId.value) {
|
||||
setTimeout(async () => {
|
||||
await onClickSelectPos(positionId.value);
|
||||
}, 1000);
|
||||
} else {
|
||||
if (!positionId.value) {
|
||||
positionRows.value = positionData.value;
|
||||
positionRowsData.value = positionData.value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue