-
+
+ {needToFillPostamatId && (
+ <>
+
+
setPostamatId(value)}
+ />
+ {error && (
+ {error}
+ )}
+
+ >
+ )}
)}
diff --git a/src/Map/Popup/mode-popup/config.js b/src/Map/Popup/mode-popup/config.js
index 98b81df..0acd75a 100644
--- a/src/Map/Popup/mode-popup/config.js
+++ b/src/Map/Popup/mode-popup/config.js
@@ -1,6 +1,6 @@
import { STATUS_LABEL_MAPPER } from "../../../config";
-export const popupConfig = [
+export const commonPopupConfig = [
{
name: "Id",
field: "id",
@@ -11,11 +11,11 @@ export const popupConfig = [
},
{
name: "Район",
- field: "rayon_id",
+ field: "area_id",
},
{
name: "Округ",
- field: "okrug_id",
+ field: "district_id",
},
{
name: "Название",
@@ -36,40 +36,8 @@ export const popupConfig = [
},
];
-export const residentialPointConfig = [
- {
- name: "Id",
- field: "id",
- },
- {
- name: "Адрес",
- field: "address",
- },
- {
- name: "Район",
- field: "rayon_id",
- },
- {
- name: "Округ",
- field: "okrug_id",
- },
- {
- name: "Название",
- field: "name",
- },
- {
- name: "Категория",
- field: "category",
- },
- {
- name: "Статус",
- field: "status",
- render: (value) => STATUS_LABEL_MAPPER[value],
- },
- {
- name: "Прогнозный трафик",
- field: "prediction_current",
- },
+export const residentialPopupConfig = [
+ ...commonPopupConfig,
{
name: "Кол-во квартир",
field: "flat_cnt",
@@ -92,6 +60,7 @@ export const workingPointFields = [
{ name: "Факт", field: "fact" },
{ name: "Расхождение с прогнозом", field: "delta_current" },
{ name: "Зрелость", field: "age_day" },
+ { name: "id постамата", field: "postamat_id", empty: "Не указан" },
];
export const rivalsConfig = [
diff --git a/src/api.js b/src/api.js
index fe19a9d..eaedbba 100644
--- a/src/api.js
+++ b/src/api.js
@@ -1,5 +1,5 @@
import axios from "axios";
-import { useQuery } from "@tanstack/react-query";
+import { useMutation, useQuery } from "@tanstack/react-query";
import { STATUSES } from "./config";
import { usePointSelection } from "./stores/usePointSelection";
import { usePendingPointsFilters } from "./stores/usePendingPointsFilters";
@@ -113,3 +113,13 @@ export const useCanEdit = () => {
return data === "editor";
};
+
+export const useUpdatePostamatId = () => {
+ return useMutation({
+ mutationFn: (params) => {
+ return api.put(
+ `/api/placement_points/update_postamat_id?${params.toString()}`
+ );
+ },
+ });
+};
diff --git a/src/modules/Table/OnApprovalTable/MakeWorkingTable/MakeWorkingModal.jsx b/src/modules/Table/OnApprovalTable/MakeWorkingTable/MakeWorkingModal.jsx
index 0379793..1dfec91 100644
--- a/src/modules/Table/OnApprovalTable/MakeWorkingTable/MakeWorkingModal.jsx
+++ b/src/modules/Table/OnApprovalTable/MakeWorkingTable/MakeWorkingModal.jsx
@@ -1,5 +1,5 @@
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { api, getPoints } from "../../../../api";
+import { useQuery, useQueryClient } from "@tanstack/react-query";
+import { getPoints, useUpdatePostamatId } from "../../../../api";
import { Button, Modal } from "antd";
import { MakeWorkingTable } from "./MakeWorkingTable";
import { useEffect, useState } from "react";
@@ -7,16 +7,6 @@ import { usePopup } from "../../../../stores/usePopup";
import { useUpdateStatus } from "../../../../hooks/useUpdateStatus";
import { STATUSES } from "../../../../config";
-const useUpdatePostamatId = () => {
- return useMutation({
- mutationFn: (params) => {
- return api.put(
- `/api/placement_points/update_postamat_id?${params.toString()}`
- );
- },
- });
-};
-
export const MakeWorkingModal = ({ selectedIds, onClose, onSuccess }) => {
const { data } = useQuery(["make-working-table", selectedIds], async () => {
const params = new URLSearchParams({
diff --git a/src/modules/Table/columns.js b/src/modules/Table/columns.js
index 2614c7b..dd29cd4 100644
--- a/src/modules/Table/columns.js
+++ b/src/modules/Table/columns.js
@@ -9,15 +9,15 @@ export const columns = [
},
{
title: "Район",
- dataIndex: "rayon",
- key: "rayon",
+ dataIndex: "area",
+ key: "area",
width: "120px",
ellipsis: true,
},
{
title: "Округ",
- dataIndex: "okrug",
- key: "okrug",
+ dataIndex: "district",
+ key: "district",
width: "120px",
ellipsis: true,
},
diff --git a/src/stores/useLayersVisibility.js b/src/stores/useLayersVisibility.js
index a8a9a63..65a3f6a 100644
--- a/src/stores/useLayersVisibility.js
+++ b/src/stores/useLayersVisibility.js
@@ -8,8 +8,8 @@ const INITIAL_STATE = {
[LAYER_IDS.working]: false,
[LAYER_IDS.filteredWorking]: false,
[LAYER_IDS.cancelled]: false,
- [LAYER_IDS.pvz]: false,
- [LAYER_IDS.other]: false,
+ [LAYER_IDS.pvz]: true,
+ [LAYER_IDS.other]: true,
};
const STATIC_LAYERS = [LAYER_IDS.pvz, LAYER_IDS.other];
diff --git a/src/utils.js b/src/utils.js
index f7aca1c..cc59667 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -10,3 +10,6 @@ export function download(filename, data) {
downloadLink.click();
document.body.removeChild(downloadLink);
}
+
+export const isNil = (value) =>
+ value === undefined || value === null || value === "";