@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.95 → 2.4.2-dev.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Site.js +31 -2
package/package.json
CHANGED
package/src/Site.js
CHANGED
|
@@ -20,6 +20,7 @@ import AgreementV2 from "./AgreementV2.js";
|
|
|
20
20
|
import { VALUES } from "./constants/site-status.js";
|
|
21
21
|
import { GeocodableMixin } from "./mixins/GeocodableMixin.js";
|
|
22
22
|
import { formatJstDate } from "./utils/index.js";
|
|
23
|
+
import { VALIDATION_ERRORS } from "./errorDefinitions.js";
|
|
23
24
|
|
|
24
25
|
const classProps = {
|
|
25
26
|
customerId: defField("customerId", {
|
|
@@ -57,10 +58,38 @@ const classProps = {
|
|
|
57
58
|
building: defField("building"),
|
|
58
59
|
securityType: defField("securityType", { required: true }),
|
|
59
60
|
constructionPeriodStartAt: defField("constructionPeriodStartAt", {
|
|
60
|
-
|
|
61
|
+
validator: (value, item) => {
|
|
62
|
+
if (!value || !item.constructionPeriodEndAt) return true;
|
|
63
|
+
if (value > item.constructionPeriodEndAt) {
|
|
64
|
+
return VALIDATION_ERRORS.CUSTOM_ERROR(
|
|
65
|
+
"CONSTRUCTION_PERIOD_START_AT_MUST_BE_BEFORE_END_AT",
|
|
66
|
+
"工期開始日は工期終了日以前の日付を指定してください。",
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
},
|
|
71
|
+
component: {
|
|
72
|
+
attrs: {
|
|
73
|
+
clearable: true,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
61
76
|
}),
|
|
62
77
|
constructionPeriodEndAt: defField("constructionPeriodEndAt", {
|
|
63
|
-
|
|
78
|
+
validator: (value, item) => {
|
|
79
|
+
if (!value || !item.constructionPeriodStartAt) return true;
|
|
80
|
+
if (value < item.constructionPeriodStartAt) {
|
|
81
|
+
return VALIDATION_ERRORS.CUSTOM_ERROR(
|
|
82
|
+
"CONSTRUCTION_PERIOD_END_AT_MUST_BE_AFTER_START_AT",
|
|
83
|
+
"工期終了日は工期開始日以降の日付を指定してください。",
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
},
|
|
88
|
+
component: {
|
|
89
|
+
attrs: {
|
|
90
|
+
clearable: true,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
64
93
|
}),
|
|
65
94
|
location: defField("location"),
|
|
66
95
|
remarks: defField("remarks"),
|