#7283 #7831 itemMigration #553

Merged
carlossa merged 77 commits from 7283-itemMigration into dev 2024-10-25 07:09:13 +00:00
1 changed files with 3 additions and 21 deletions
Showing only changes of commit 488dc74c1f - Show all commits

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, computed, onMounted, onBeforeMount, watch } from 'vue'; import { ref, computed, onMounted, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
@ -11,7 +11,6 @@ import ItemRequestDenyForm from './ItemRequestDenyForm.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const { t } = useI18n(); const { t } = useI18n();
const { notify } = useNotify(); const { notify } = useNotify();
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -31,6 +30,7 @@ const userParams = {
state: 'pending', state: 'pending',
}; };
const tableRef = ref();
watch( watch(
() => store.data, () => store.data,
(value) => (itemRequestsOptions.value = value) (value) => (itemRequestsOptions.value = value)
@ -162,9 +162,7 @@ const getState = (isOk) => {
const showDenyRequestForm = (requestId, rowIndex) => { const showDenyRequestForm = (requestId, rowIndex) => {
denyRequestId.value = requestId; denyRequestId.value = requestId;
console.log('denyRequestId.value: ', denyRequestId.value);
denyRequestIndex.value = rowIndex; denyRequestIndex.value = rowIndex;
console.log('denyRequestIndex.value: ', denyRequestIndex.value);
denyFormRef.value.show(); denyFormRef.value.show();
}; };
@ -172,32 +170,16 @@ const onDenyAccept = (_, responseData) => {
itemRequestsOptions.value[denyRequestIndex.value].isOk = responseData.isOk; itemRequestsOptions.value[denyRequestIndex.value].isOk = responseData.isOk;
itemRequestsOptions.value[denyRequestIndex.value].attenderFk = itemRequestsOptions.value[denyRequestIndex.value].attenderFk =
responseData.attenderFk; responseData.attenderFk;
console.log('itemRequestsOptions: ', itemRequestsOptions.value);
itemRequestsOptions.value[denyRequestIndex.value].response = responseData.response; itemRequestsOptions.value[denyRequestIndex.value].response = responseData.response;
console.log('itemRequestsOptions.value', itemRequestsOptions.value);
denyRequestId.value = null; denyRequestId.value = null;
denyRequestIndex.value = null; denyRequestIndex.value = null;
tableRef.value.reload();
}; };
onMounted(async () => { onMounted(async () => {
await arrayData.fetch({ append: false }); await arrayData.fetch({ append: false });
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
}); });
onBeforeMount(() => {
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const nextWeek = Date.vnNew();
nextWeek.setHours(23, 59, 59, 59);
nextWeek.setDate(nextWeek.getDate() + 7);
filterParams.value = {
from: today,
to: nextWeek,
state: 'pending',
};
});
</script> </script>
<template> <template>