no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-19 17:37:50 +07:00
parent f592008bbe
commit fbb59b99ff
5 changed files with 17 additions and 264 deletions

View file

@ -37,9 +37,6 @@ let dataForm = reactive({
positionLineId: "",
positionPathSideId: "",
positionTypeId: "",
// salaryAmount: null,
// mouthSalaryAmount: null,
// positionSalaryAmount: null,
});
onMounted(async () => {
@ -85,7 +82,6 @@ const loadTreeData = async () => {
};
function filterByPersonIdNull(obj: any) {
// console.log(obj);
if (obj.name === null && obj.isCondition != true) {
return true;
}
@ -102,8 +98,6 @@ const fetchplacementPosition = async () => {
await http
.get(config.API.placementPosition())
.then((res: any) => {
console.log("1221111111");
placementPosition.value = res.data.result;
})
.catch((e: any) => {
@ -164,8 +158,6 @@ const validateData = async () => {
};
const saveAppoint = async () => {
console.log("save", dataForm);
myFormPosition.value.validate().then(async (result: boolean) => {
if (result) {
const dataAppoint = await {
@ -177,16 +169,12 @@ const saveAppoint = async () => {
positionLineId: dataForm.positionLineId,
positionPathSideId: dataForm.positionPathSideId,
positionTypeId: dataForm.positionTypeId,
// salaryAmount: dataForm.salaryAmount,
// mouthSalaryAmount: dataForm.mouthSalaryAmount,
// positionSalaryAmount: dataForm.positionSalaryAmount,
};
console.log("save appoint===>", dataAppoint);
showLoader();
await http
.post(config.API.placementPass(), dataAppoint)
.then((res) => {
console.log("respone=>", res);
.then(() => {
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
@ -194,7 +182,6 @@ const saveAppoint = async () => {
})
.finally(async () => {
await closeAndClear();
// await resetFilter();
await fetchPublishFile();
await loadTreeData();
await fetchplacementPosition();
@ -217,15 +204,6 @@ const closeModal = () => {
"ข้อมูลมีการแก้ไข",
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
);
// $q.dialog({
// title: ``,
// message: `?`,
// cancel: "",
// ok: "",
// persistent: true,
// }).onOk(() => {
// closeAndClear();
// });
} else {
closeAndClear();
}
@ -243,9 +221,6 @@ const closeAndClear = async () => {
dataForm.positionLineId = "";
dataForm.positionPathSideId = "";
dataForm.positionTypeId = "";
// dataForm.salaryAmount = null;
// dataForm.mouthSalaryAmount = null;
// dataForm.positionSalaryAmount = null;
editDataStatus.value = false;
};
//
@ -292,10 +267,7 @@ const positionLevelOptions = ref<Object[]>([
]);
const selectedPosition = async (data: any) => {
// console.log("selecteds", data);
if (data.name == null && selected.value != data.keyId) {
// console.log("selecteds", data);
editDataStatus.value = true;
selected.value = data.keyId;
@ -376,7 +348,6 @@ const selectedPosition = async (data: any) => {
dataForm.positionPathSideId = "";
dataForm.positionTypeId = "";
}
// console.log("dataForm", dataForm);
};
const checkPosition = (val: string) => {
@ -394,36 +365,28 @@ watch(props, () => {
dataPersonal.map((data: any) => {
personal.value = data;
});
console.log("personal", personal.value);
}
// console.log("draft===>", personal.value.draft);
if (
personal.value &&
personal.value.draft === false &&
personal.value.positionNumber !== null
) {
// const findData = dataRespone.value.find(findByPerson);
let findData: any = null;
dataRespone.value.map((x: any) => {
findData = findByPerson(x);
// console.log(findData);
if (findData != null) {
// console.log("findData===>", findData);
selectedPosition(findData);
for (let i = 3; i <= findData.keyId.length; i += 2) {
expanded.value.push(findData.keyId.slice(0, i));
}
}
});
// loadTreeData();
// selectedPosition(findData.children.children.children)
}
});
function findByPerson(element: any): any {
// console.log("searchTree element===>", element)
if (
element.positionNumId &&
element.positionLineId === personal.value.positionLineId &&
@ -444,37 +407,12 @@ function findByPerson(element: any): any {
return null;
}
const clearPosition = () => {
// console.log(personal.value);
dialogConfirm(
$q,
async () => postClearPosition(),
"ยืนยันการคืนตำแหน่ง",
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
);
// $q.dialog({
// title: "",
// message: " ?",
// cancel: {
// flat: true,
// const: "negative",
// },
// persistent: true,
// })
// .onOk(async () => {
// showLoader();
// await http
// .post(config.API.clearPosition(personal.value.personalId), {})
// .then((res: Object) => success($q, ""))
// .catch((e: Object) => {
// console.log(e);
// })
// .finally(async () => {
// hideLoader();
// await closeAndClear();
// });
// })
// .onCancel(() => {})
// .onDismiss(() => {});
};
const postClearPosition = async () => {
showLoader();
@ -485,7 +423,7 @@ const postClearPosition = async () => {
})
.catch((e: Object) => {
console.log(e);
messageError($q, e);
})
.finally(async () => {
hideLoader();
@ -540,8 +478,6 @@ const postClearPosition = async () => {
</div>
<!--แสดง Total Count PositionNum-->
<!-- <q-badge rounded color="grey-2" text-color="dark"
:label="prop.node.totalPositionCount" /> -->
<q-badge
v-if="prop.node.totalPositionVacant > 0"
rounded
@ -790,55 +726,6 @@ const postClearPosition = async () => {
</div>
</div>
</div>
<!-- <div class="col-sx-12 col-sm-12 col-md-12">
<q-separator inset size="2px" class="q-my-md" />
</div> -->
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
<q-input
outlined
dense
lazy-rules
v-model="dataForm.salaryAmount"
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
:label="`${'เงินเดือน'}`"
@update:modelValue="clickEditRow"
type="number"
hide-bottom-space
/>
</div> -->
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
<q-input
outlined
dense
lazy-rules
v-model="dataForm.positionSalaryAmount"
:rules="[
(val) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`,
]"
:label="`${'เงินประจำตำแหน่ง'}`"
@update:modelValue="clickEditRow"
type="number"
hide-bottom-space
/>
</div> -->
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
<q-input
outlined
dense
lazy-rules
v-model="dataForm.mouthSalaryAmount"
:rules="[
(val) =>
!!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`,
]"
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
@update:modelValue="clickEditRow"
type="number"
hide-bottom-space
/>
</div> -->
</div>
</q-scroll-area>
</q-card>