update wrokflow

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-18 12:06:01 +07:00
parent b4c7ee8129
commit ecb5e6b7c3
11 changed files with 414 additions and 92 deletions

View file

@ -15,7 +15,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 },
});
@ -89,14 +89,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) => {
@ -112,6 +112,9 @@ function onCloseModal() {
modal.value = false;
selected.value = [];
rows.value = [];
isAcceptSetting.value = false;
isApproveSetting.value = false;
isReasonSetting.value = false;
}
watch(modal, (val) => {