From 53af5a49329644d0f64c17bab2039c11a687e502 Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:08:13 +0800 Subject: [PATCH 01/26] upload result v1 --- api/laboratory/forms100.py | 4 ++++ l2-frontend/src/components/UploadFile.vue | 2 +- l2-frontend/src/components/types-and-forms-file.ts | 14 ++++++++++++-- l2-frontend/src/ui-cards/LaboratoryHeader.vue | 3 +++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 api/laboratory/forms100.py diff --git a/api/laboratory/forms100.py b/api/laboratory/forms100.py new file mode 100644 index 0000000000..9ac40d0dd1 --- /dev/null +++ b/api/laboratory/forms100.py @@ -0,0 +1,4 @@ + +def form_01(request): + print('fdfd') + return diff --git a/l2-frontend/src/components/UploadFile.vue b/l2-frontend/src/components/UploadFile.vue index bc722d52ef..9eea5e58a5 100644 --- a/l2-frontend/src/components/UploadFile.vue +++ b/l2-frontend/src/components/UploadFile.vue @@ -141,7 +141,7 @@ const selectedForm = ref(null); const changeType = () => { fileFilter.value = `.${selectedType.value}`; - currentFileForms.value = getForms(String(selectedType.value), props.formsFile); + currentFileForms.value = getForms(String(selectedType.value), props.formsFile, props.uploadResult); if (currentFileForms.value.length > 0) { selectedForm.value = currentFileForms.value[0].id; } diff --git a/l2-frontend/src/components/types-and-forms-file.ts b/l2-frontend/src/components/types-and-forms-file.ts index 1d251fefa6..e738afec21 100644 --- a/l2-frontend/src/components/types-and-forms-file.ts +++ b/l2-frontend/src/components/types-and-forms-file.ts @@ -11,6 +11,7 @@ export interface formsFile { export default function typesAndForms() { const fileTypes = ref({ XLSX: { id: 'XLSX', label: 'XLSX' }, + PDF: { id: 'PDF', label: 'PDF' }, }); // todo - сделать соотношение - расширение файла - и все виды accept фильтров {xlsx: '.xlx, .xlsx, ws-excel'} const getTypes = (types: string[]): typesFile[] => { @@ -27,19 +28,28 @@ export default function typesAndForms() { return result; }; + const isResult = ref([ + 'api.laboratory.forms100.form_01', + ]); + /* (101.01) - 101 номер файла, 01 - номер функции в файле для обработки загруженного файла (см. parseFile) */ const fileForms = ref({ XLSX: { 'api.contracts.forms100.form_01': { id: 'api.contracts.forms100.form_01', label: 'Загрузка цен по прайсу' }, }, + PDF: { + 'api.laboratory.forms100.form_01': { id: 'api.laboratory.forms100.form_01', label: 'Загрузка PDF результата' }, + }, }); // todo - режим UploadResult - получать по расширению файла - только функции связанные с сохранением результата (анализаторы) // todo - UploadResult + forms - получать только выбранные isResult функции - const getForms = (type: string, forms: string[] = []): formsFile[] => { + const getForms = (type: string, forms: string[] = [], onlyResult = false): formsFile[] => { let result: formsFile[] = []; if (forms && forms.length > 0) { for (const form of forms) { - if (fileForms.value[type][form]) { + if (!onlyResult && fileForms.value[type][form]) { + result.push(fileForms.value[type][form]); + } else if (onlyResult && isResult.value.includes(form)) { result.push(fileForms.value[type][form]); } } diff --git a/l2-frontend/src/ui-cards/LaboratoryHeader.vue b/l2-frontend/src/ui-cards/LaboratoryHeader.vue index ed65fd5a6b..3c9c474103 100644 --- a/l2-frontend/src/ui-cards/LaboratoryHeader.vue +++ b/l2-frontend/src/ui-cards/LaboratoryHeader.vue @@ -36,6 +36,7 @@ + @@ -45,10 +46,12 @@ import LaboratorySelector from '@/ui-cards/LaboratorySelector.vue'; import ExecutionList from '@/ui-cards/ExecutionList.vue'; import LaboratoryJournal from '@/ui-cards/LaboratoryJournal.vue'; import LaboratoryPrintResults from '@/ui-cards/LaboratoryPrintResults.vue'; +import UploadFileModal from "@/modals/UploadFileModal.vue"; export default { name: 'LaboratoryHeader', components: { + UploadFileModal, LoadFile, LaboratorySelector, ExecutionList, From 0ab79f88f1e3f0ab0531c3f81616748d170ca4a5 Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:13:47 +0800 Subject: [PATCH 02/26] upload result v2 --- l2-frontend/src/components/types-and-forms-file.ts | 10 ++++++++-- l2-frontend/src/ui-cards/LaboratoryHeader.vue | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/l2-frontend/src/components/types-and-forms-file.ts b/l2-frontend/src/components/types-and-forms-file.ts index e738afec21..9268d8fb3d 100644 --- a/l2-frontend/src/components/types-and-forms-file.ts +++ b/l2-frontend/src/components/types-and-forms-file.ts @@ -28,7 +28,7 @@ export default function typesAndForms() { return result; }; - const isResult = ref([ + const isResultFunc = ref([ 'api.laboratory.forms100.form_01', ]); @@ -49,10 +49,16 @@ export default function typesAndForms() { for (const form of forms) { if (!onlyResult && fileForms.value[type][form]) { result.push(fileForms.value[type][form]); - } else if (onlyResult && isResult.value.includes(form)) { + } else if (onlyResult && isResultFunc.value.includes(form)) { result.push(fileForms.value[type][form]); } } + } else if (!forms && onlyResult) { + for (const func of isResultFunc.value) { + if (fileForms.value[type][func]) { + result.push(fileForms.value[type][func]); + } + } } else { result = Object.values(fileForms.value[type]); } diff --git a/l2-frontend/src/ui-cards/LaboratoryHeader.vue b/l2-frontend/src/ui-cards/LaboratoryHeader.vue index 3c9c474103..799468e6a5 100644 --- a/l2-frontend/src/ui-cards/LaboratoryHeader.vue +++ b/l2-frontend/src/ui-cards/LaboratoryHeader.vue @@ -36,7 +36,7 @@ - + From ec45efb4440694dae6a1a943e6bd49fcd3000b87 Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:44:31 +0800 Subject: [PATCH 03/26] upload result v3 --- l2-frontend/src/components/UploadFile.vue | 2 ++ l2-frontend/src/components/types-and-forms-file.ts | 2 +- l2-frontend/src/ui-cards/LaboratoryHeader.vue | 12 ++++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/l2-frontend/src/components/UploadFile.vue b/l2-frontend/src/components/UploadFile.vue index 9eea5e58a5..dcb3d02541 100644 --- a/l2-frontend/src/components/UploadFile.vue +++ b/l2-frontend/src/components/UploadFile.vue @@ -144,6 +144,8 @@ const changeType = () => { currentFileForms.value = getForms(String(selectedType.value), props.formsFile, props.uploadResult); if (currentFileForms.value.length > 0) { selectedForm.value = currentFileForms.value[0].id; + } else { + selectedForm.value = null; } }; diff --git a/l2-frontend/src/components/types-and-forms-file.ts b/l2-frontend/src/components/types-and-forms-file.ts index 9268d8fb3d..0fbcc495cd 100644 --- a/l2-frontend/src/components/types-and-forms-file.ts +++ b/l2-frontend/src/components/types-and-forms-file.ts @@ -43,7 +43,7 @@ export default function typesAndForms() { }); // todo - режим UploadResult - получать по расширению файла - только функции связанные с сохранением результата (анализаторы) // todo - UploadResult + forms - получать только выбранные isResult функции - const getForms = (type: string, forms: string[] = [], onlyResult = false): formsFile[] => { + const getForms = (type: string, forms: string[] = null, onlyResult = false): formsFile[] => { let result: formsFile[] = []; if (forms && forms.length > 0) { for (const form of forms) { diff --git a/l2-frontend/src/ui-cards/LaboratoryHeader.vue b/l2-frontend/src/ui-cards/LaboratoryHeader.vue index 799468e6a5..742023dea8 100644 --- a/l2-frontend/src/ui-cards/LaboratoryHeader.vue +++ b/l2-frontend/src/ui-cards/LaboratoryHeader.vue @@ -36,7 +36,15 @@ - + @@ -46,7 +54,7 @@ import LaboratorySelector from '@/ui-cards/LaboratorySelector.vue'; import ExecutionList from '@/ui-cards/ExecutionList.vue'; import LaboratoryJournal from '@/ui-cards/LaboratoryJournal.vue'; import LaboratoryPrintResults from '@/ui-cards/LaboratoryPrintResults.vue'; -import UploadFileModal from "@/modals/UploadFileModal.vue"; +import UploadFileModal from '@/modals/UploadFileModal.vue'; export default { name: 'LaboratoryHeader', From 5ee7d72a11ea330d7cde3aba20f359560291adaa Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:49:42 +0800 Subject: [PATCH 04/26] upload result v4 --- l2-frontend/src/components/types-and-forms-file.ts | 2 +- l2-frontend/src/ui-cards/LaboratoryHeader.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/l2-frontend/src/components/types-and-forms-file.ts b/l2-frontend/src/components/types-and-forms-file.ts index 0fbcc495cd..c1be0dc2e0 100644 --- a/l2-frontend/src/components/types-and-forms-file.ts +++ b/l2-frontend/src/components/types-and-forms-file.ts @@ -38,7 +38,7 @@ export default function typesAndForms() { 'api.contracts.forms100.form_01': { id: 'api.contracts.forms100.form_01', label: 'Загрузка цен по прайсу' }, }, PDF: { - 'api.laboratory.forms100.form_01': { id: 'api.laboratory.forms100.form_01', label: 'Загрузка PDF результата' }, + 'api.laboratory.forms100.form_01': { id: 'api.laboratory.forms100.form_01', label: 'Загрузка PDF результата из QMS' }, }, }); // todo - режим UploadResult - получать по расширению файла - только функции связанные с сохранением результата (анализаторы) diff --git a/l2-frontend/src/ui-cards/LaboratoryHeader.vue b/l2-frontend/src/ui-cards/LaboratoryHeader.vue index 742023dea8..16bf9cf26a 100644 --- a/l2-frontend/src/ui-cards/LaboratoryHeader.vue +++ b/l2-frontend/src/ui-cards/LaboratoryHeader.vue @@ -40,7 +40,8 @@
  • From ae06c0918444551c61bef1131b49244cde679197 Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:51:13 +0800 Subject: [PATCH 05/26] upload qms result v1 --- api/laboratory/forms100.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/laboratory/forms100.py b/api/laboratory/forms100.py index 9ac40d0dd1..c4e8979c21 100644 --- a/api/laboratory/forms100.py +++ b/api/laboratory/forms100.py @@ -1,4 +1,4 @@ def form_01(request): print('fdfd') - return + return {"ok": True, "result": [], "message": ""} From 6fae05365c5b36fce33ef74fec6ea47e21dba0ad Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:53:43 +0800 Subject: [PATCH 06/26] upload qms result v1.1 --- api/laboratory/forms100.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/laboratory/forms100.py b/api/laboratory/forms100.py index c4e8979c21..71ba2b849c 100644 --- a/api/laboratory/forms100.py +++ b/api/laboratory/forms100.py @@ -1,4 +1,4 @@ -def form_01(request): +def form_01(request_data): print('fdfd') return {"ok": True, "result": [], "message": ""} From 6b53b0b516b2cf1d5a0e1e5a139b9c2153b1ccc1 Mon Sep 17 00:00:00 2001 From: Well Date: Wed, 3 Jul 2024 16:54:35 +0800 Subject: [PATCH 07/26] todo complete --- l2-frontend/src/components/UploadFile.vue | 1 - l2-frontend/src/components/types-and-forms-file.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/l2-frontend/src/components/UploadFile.vue b/l2-frontend/src/components/UploadFile.vue index dcb3d02541..d2ae4e148d 100644 --- a/l2-frontend/src/components/UploadFile.vue +++ b/l2-frontend/src/components/UploadFile.vue @@ -77,7 +77,6 @@