Много чего

This commit is contained in:
brusnitsyn
2025-12-25 17:30:50 +09:00
parent c4bb7ec6f9
commit a5209f45c8
25 changed files with 1521 additions and 574 deletions

View File

@@ -90,56 +90,37 @@ const columns = ref([
}
])
const showArchiveHistoryModal = ref(false)
const selectedPatientId = ref(null)
const selectedPatientInfo = ref({})
const rowProps = (row) => ({
onDblclick: () => {
selectedPatientId.value = row.id
selectedPatientInfo.value = {id: row.id, type: row.history_type}
showArchiveHistoryModal.value = true
}
})
const pagination = computed(() => {
if (filtersRef.value.view_type === 'si') {
return {
page: meta.value.si.current_page || 1,
pageCount: meta.value.si.last_page || 1,
pageSize: meta.value.si.per_page || 15,
itemCount: meta.value.si.total || 0,
pageSizes: [15, 50, 100],
showSizePicker: true,
prefix({ itemCount }) {
return `Всего карт ${itemCount}.`
},
onUpdatePage: (page) => {
handlePageChange(page)
},
onUpdatePageSize: handlePageSizeChange
}
} else {
return {
page: meta.value.mis.current_page || 1,
pageCount: meta.value.mis.last_page || 1,
pageSize: meta.value.mis.per_page || 15,
itemCount: meta.value.mis.total || 0,
pageSizes: [15, 50, 100],
showSizePicker: true,
prefix({ itemCount }) {
return `Всего карт ${itemCount}.`
},
onUpdatePage: (page) => {
handlePageChange(page)
},
onUpdatePageSize: handlePageSizeChange
}
return {
page: meta.value.current_page || 1,
pageCount: meta.value.last_page || 1,
pageSize: meta.value.per_page || 15,
itemCount: meta.value.total || 0,
pageSizes: [15, 50, 100],
showSizePicker: true,
prefix({ itemCount }) {
return `Всего карт ${itemCount}`
},
onUpdatePage: (page) => {
handlePageChange(page)
},
onUpdatePageSize: handlePageSizeChange
}
})
const onCloseWithoutSave = () => {
selectedPatientId.value = null
selectedPatientInfo.value = null
}
const onUpdateHistory = ({data, patientId}) => {
console.log(data)
if (dataTable.value.length > 0) {
let needUpdateItem = dataTable.value.findIndex(itm => itm.id === patientId)
dataTable.value[needUpdateItem] = {
@@ -156,7 +137,7 @@ watch(() => props.data, (newData) => {
<template>
<NDataTable remote striped :loading="isLoading" :row-props="rowProps" :columns="columns" :pagination="pagination" :max-height="maxHeight" size="small" :min-height="minHeight" :data="dataTable" />
<ArchiveHistoryModal v-model:open="showArchiveHistoryModal" :patient-id="selectedPatientId" @history-updated="onUpdateHistory" @close-without-save="onCloseWithoutSave" />
<ArchiveHistoryModal v-model:open="showArchiveHistoryModal" :patient-info="selectedPatientInfo" @history-updated="onUpdateHistory" @close-without-save="onCloseWithoutSave" />
</template>
<style scoped>