diff --git a/api/views.py b/api/views.py index e0092498cb..37429ef3ef 100644 --- a/api/views.py +++ b/api/views.py @@ -2655,13 +2655,19 @@ def update_price(request): current_price = None if request_data["id"] == -1: if request_data.get("typePrice") == "Работодатель": - current_price = PriceName(title=request_data["title"], date_start=request_data["start"], date_end=request_data["end"], company_id=request_data["company"]) + current_price = PriceName( + title=request_data["title"], symbol_code=request_data["code"], date_start=request_data["start"], date_end=request_data["end"], company_id=request_data["company"] + ) elif request_data.get("typePrice") == "Заказчик": hospital = Hospitals.objects.filter(pk=int(request_data["company"])).first() - current_price = PriceName(title=request_data["title"], date_start=request_data["start"], date_end=request_data["end"], hospital=hospital, subcontract=True) + current_price = PriceName( + title=request_data["title"], symbol_code=request_data["code"], date_start=request_data["start"], date_end=request_data["end"], hospital=hospital, subcontract=True + ) elif request_data.get("typePrice") == "Внешний исполнитель": hospital = Hospitals.objects.filter(pk=int(request_data["company"])).first() - current_price = PriceName(title=request_data["title"], date_start=request_data["start"], date_end=request_data["end"], hospital=hospital, external_performer=True) + current_price = PriceName( + title=request_data["title"], symbol_code=request_data["code"], date_start=request_data["start"], date_end=request_data["end"], hospital=hospital, external_performer=True + ) if current_price: current_price.save() Log.log( @@ -2673,6 +2679,7 @@ def update_price(request): else: current_price = PriceName.objects.get(pk=request_data["id"]) current_price.title = request_data["title"] + current_price.symbol_code = request_data["code"] current_price.date_start = request_data["start"] current_price.date_end = request_data["end"] if request_data.get("typePrice") == "Заказчик" or request_data.get("typePrice") == "Работодатель": @@ -2698,6 +2705,7 @@ def copy_price(request): current_price = PriceName.objects.get(pk=request_data["id"]) new_price = PriceName( title=f"{current_price.title} - новый прайс", + symbol_code=f"{current_price.symbol_code} - новый", date_start=current_price.date_start, date_end=current_price.date_end, company=current_price.company, diff --git a/contracts/models.py b/contracts/models.py index 487b6a731f..1204bf903c 100644 --- a/contracts/models.py +++ b/contracts/models.py @@ -68,7 +68,16 @@ def as_json(price): else: company_title = "" company_id = "" - json_data = {"id": price.id, "title": price.title, "start": price.date_start, "end": price.date_end, "company": company_id, "companyTitle": company_title, "uuid": str(price.uuid)} + json_data = { + "id": price.id, + "title": price.title, + "code": price.symbol_code, + "start": price.date_start, + "end": price.date_end, + "company": company_id, + "companyTitle": company_title, + "uuid": str(price.uuid), + } return json_data @staticmethod diff --git a/l2-frontend/src/construct/ConstructPrice.vue b/l2-frontend/src/construct/ConstructPrice.vue index 8fb30b100c..3ca506ed1f 100644 --- a/l2-frontend/src/construct/ConstructPrice.vue +++ b/l2-frontend/src/construct/ConstructPrice.vue @@ -20,6 +20,7 @@