diff --git a/api/construct/views.py b/api/construct/views.py index 0ab55344a4..51bd3db887 100644 --- a/api/construct/views.py +++ b/api/construct/views.py @@ -82,6 +82,8 @@ def change_tube_for_fractions(request): fractions_id = request_data.get("fractionsIds") old_tube = request_data.get("oldTube") new_tube = request_data.get("newTube") + if not new_tube: + return JsonResponse({"ok": False, "message": "Не выбрана пробирка"}) result = Fractions.change_relation_tube(fractions_id, old_tube, new_tube) if result: Log.log( diff --git a/directory/models.py b/directory/models.py index f06a3530a1..277b83fb7e 100644 --- a/directory/models.py +++ b/directory/models.py @@ -582,6 +582,7 @@ def as_json(research): "pk": research.pk, "title": research.title, "internalCode": research.internal_code, + "code": research.code, "hide": research.hide, "order": research.sort_weight, } diff --git a/l2-frontend/src/construct/ConstructLaboratory.vue b/l2-frontend/src/construct/ConstructLaboratory.vue index 6649fb0ab5..077af09189 100644 --- a/l2-frontend/src/construct/ConstructLaboratory.vue +++ b/l2-frontend/src/construct/ConstructLaboratory.vue @@ -123,7 +123,8 @@ const filteredResearchTubes = computed(() => researchTubes.value.map(tubes => { const result = tubes.researches.filter(research => { const researchTitle = research.title.toLowerCase(); const researchInternalCode = research.internalCode.toLowerCase(); - return researchTitle.includes(searchTerm) || researchInternalCode.includes(searchTerm); + const researchCode = research.code.toLowerCase(); + return researchTitle.includes(searchTerm) || researchInternalCode.includes(searchTerm) || researchCode.includes(searchTerm); }); if (result) { return { researches: result, tubes: tubes.tubes }; diff --git a/l2-frontend/src/construct/FractionsGroup.vue b/l2-frontend/src/construct/FractionsGroup.vue index 4a7d6f0fd5..d068f91e8a 100644 --- a/l2-frontend/src/construct/FractionsGroup.vue +++ b/l2-frontend/src/construct/FractionsGroup.vue @@ -9,9 +9,9 @@