* добавлены операции и услуги операций
* добавлена выборка и подсчет по датам для роли зав. * переключатель ролей * выбор отделений для роли зав.
This commit is contained in:
@@ -19,7 +19,7 @@ export const useReportStore = defineStore('reportStore', () => {
|
||||
}
|
||||
})
|
||||
|
||||
const timestampCurrentRange = ref([timestampNow.value, timestampNow.value])
|
||||
const timestampCurrentRange = ref([null, null])
|
||||
|
||||
const dataOnReport = ref(null)
|
||||
|
||||
@@ -74,6 +74,9 @@ export const useReportStore = defineStore('reportStore', () => {
|
||||
const form = {
|
||||
metrics: reportForm.value,
|
||||
observationPatients: patientsData.value['observation'],
|
||||
unwantedEvent: {
|
||||
comment: reportForm.comment
|
||||
},
|
||||
...assignForm
|
||||
}
|
||||
|
||||
@@ -99,21 +102,40 @@ export const useReportStore = defineStore('reportStore', () => {
|
||||
await axios.get('/api/report')
|
||||
.then((res) => {
|
||||
reportInfo.value = res.data
|
||||
|
||||
reportForm.value.metrika_item_3 = reportInfo.value.department?.recipientCount
|
||||
reportForm.value.metrika_item_7 = reportInfo.value.department?.extractCount
|
||||
reportForm.value.metrika_item_8 = reportInfo.value.department?.currentCount
|
||||
|
||||
timestampCurrentRange.value = [
|
||||
reportInfo.value.dates.startAt,
|
||||
reportInfo.value.dates.endAt,
|
||||
]
|
||||
})
|
||||
.finally(() => {
|
||||
isLoadReportInfo.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const getDataOnReportDate = async () => {
|
||||
await axios.get(`/api/metric-forms/1/report-by-date?sent_at=${timestampCurrentRange.value}`)
|
||||
.then(res => {
|
||||
dataOnReport.value = res.data
|
||||
})
|
||||
.catch(err => {
|
||||
// Отчета на выбранную дату не найдено
|
||||
if (err.code === 404) {}
|
||||
})
|
||||
const getDataOnReportDate = async (dateRange) => {
|
||||
isLoadReportInfo.value = true
|
||||
timestampCurrentRange.value = dateRange
|
||||
await axios.get(`/api/report?startAt=${timestampCurrentRange.value[0]}&endAt=${timestampCurrentRange.value[1]}`)
|
||||
.then((res) => {
|
||||
reportInfo.value = res.data
|
||||
|
||||
reportForm.value.metrika_item_3 = reportInfo.value.department?.recipientCount
|
||||
reportForm.value.metrika_item_7 = reportInfo.value.department?.extractCount
|
||||
reportForm.value.metrika_item_8 = reportInfo.value.department?.currentCount
|
||||
|
||||
timestampCurrentRange.value = [
|
||||
reportInfo.value.dates.startAt,
|
||||
reportInfo.value.dates.endAt,
|
||||
]
|
||||
})
|
||||
.finally(() => {
|
||||
isLoadReportInfo.value = false
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user