update workflow
This commit is contained in:
parent
1eead8c579
commit
6bc00f9064
3 changed files with 13 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ const { dialogConfirm, showLoader, hideLoader, messageError } =
|
|||
useCounterMixin();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const { stateId, fetchData } = defineProps({
|
||||
const props = defineProps({
|
||||
stateId: { type: String, require: true },
|
||||
fetchData: { type: Function, require: true },
|
||||
});
|
||||
|
|
@ -91,14 +91,14 @@ function onSubmit() {
|
|||
showLoader();
|
||||
await http
|
||||
.post(config.API.workflow + `add-step`, {
|
||||
stateId: stateId,
|
||||
stateId: props.stateId,
|
||||
profileId: selected.value[0].id,
|
||||
isAcceptSetting: isAcceptSetting.value,
|
||||
isApproveSetting: isApproveSetting.value,
|
||||
isReasonSetting: isReasonSetting.value,
|
||||
})
|
||||
.then(async () => {
|
||||
await fetchData?.();
|
||||
await props.fetchData?.();
|
||||
onCloseModal();
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,10 @@ async function fetchCheckState() {
|
|||
await fetchData();
|
||||
const data = await res.data.result;
|
||||
stateId.value = data.stateId;
|
||||
state.value = data.stateNo === 4 ? 5 : data.stateNo;
|
||||
state.value =
|
||||
data.stateNo === itemState.value.length
|
||||
? data.stateNo + 1
|
||||
: data.stateNo;
|
||||
permission.value = {
|
||||
isChangeState: data.can_change_state,
|
||||
isOperate: data.can_operate,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const id = ref<string>(
|
|||
const myform = ref<QForm | null>(null); //form
|
||||
const tranferOrg = ref(""); //สถานที่ยื่นขอลาออกจากราชการ
|
||||
const dateCommand = ref<Date>(new Date()); //วันที่ยื่นขอลาออกจากราชการ
|
||||
const dateLeave = ref<Date>(new Date()); //วันที่ขอลาออกจากราชการ
|
||||
const dateLeave = ref<Date | null>(null); //วันที่ขอลาออกจากราชการ
|
||||
const noteReason = ref(""); //เหตุผลที่ลาออกจากราชการ
|
||||
const modal = ref<boolean>(false); //ตัวแปร dialog
|
||||
|
||||
|
|
@ -83,10 +83,14 @@ async function onSubmit() {
|
|||
$q,
|
||||
() => {
|
||||
showLoader();
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("Location", tranferOrg.value);
|
||||
formData.append("SendDate", dateToISO(dateCommand.value));
|
||||
formData.append("ActiveDate", dateToISO(dateLeave.value));
|
||||
formData.append(
|
||||
"ActiveDate",
|
||||
dateLeave.value !== null ? dateToISO(dateLeave.value) : ""
|
||||
);
|
||||
formData.append("Reason", noteReason.value);
|
||||
formData.append("file", files.value);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue