Răsfoiți Sursa

✨ feat(disability-person-management): 新增出生日期字段支持

- 在表单初始值中添加出生日期字段
- 在创建和更新表单中新增出生日期输入控件
- 在提交数据时包含出生日期字段
- 在查看详情页面显示出生日期信息
yourname 2 săptămâni în urmă
părinte
comite
9ccac92c46

+ 49 - 1
allin-packages/disability-person-management-ui/src/components/DisabilityPersonManagement.tsx

@@ -82,7 +82,8 @@ const DisabilityPersonManagement: React.FC = () => {
       jobStatus: 0,
       specificDisability: '',
       idValidDate: undefined,
-      disabilityValidDate: undefined
+      disabilityValidDate: undefined,
+      birthDate: undefined
     }
   });
 
@@ -247,6 +248,7 @@ const DisabilityPersonManagement: React.FC = () => {
         // 日期字段
         idValidDate: formData.idValidDate,
         disabilityValidDate: formData.disabilityValidDate,
+        birthDate: formData.birthDate,
         id: data.id // 确保包含ID
       };
 
@@ -755,6 +757,26 @@ const DisabilityPersonManagement: React.FC = () => {
                       )}
                     />
 
+                    <FormField
+                      control={createForm.control}
+                      name="birthDate"
+                      render={({ field }) => (
+                        <FormItem>
+                          <FormLabel>出生日期</FormLabel>
+                          <FormControl>
+                            <Input
+                              type="date"
+                              placeholder="选择出生日期"
+                              {...field}
+                              value={field.value ? new Date(field.value).toISOString().split('T')[0] : ''}
+                              onChange={(e) => field.onChange(e.target.value ? new Date(e.target.value) : undefined)}
+                            />
+                          </FormControl>
+                          <FormMessage />
+                        </FormItem>
+                      )}
+                    />
+
                     <FormField
                       control={createForm.control}
                       name="disabilityId"
@@ -1133,6 +1155,26 @@ const DisabilityPersonManagement: React.FC = () => {
                     )}
                   />
 
+                  <FormField
+                    control={updateForm.control}
+                    name="birthDate"
+                    render={({ field }) => (
+                      <FormItem>
+                        <FormLabel>出生日期</FormLabel>
+                        <FormControl>
+                          <Input
+                            type="date"
+                            placeholder="选择出生日期"
+                            {...field}
+                            value={field.value ? (field.value instanceof Date ? field.value : new Date(field.value)).toISOString().split('T')[0] : ''}
+                            onChange={(e) => field.onChange(e.target.value ? new Date(e.target.value) : undefined)}
+                          />
+                        </FormControl>
+                        <FormMessage />
+                      </FormItem>
+                    )}
+                  />
+
                   <FormField
                     control={updateForm.control}
                     name="disabilityId"
@@ -1508,6 +1550,12 @@ const DisabilityPersonManagement: React.FC = () => {
                   <label className="text-sm font-medium">身份证号</label>
                   <p className="text-sm text-muted-foreground">{viewData.personInfo.idCard}</p>
                 </div>
+                <div>
+                  <label className="text-sm font-medium">出生日期</label>
+                  <p className="text-sm text-muted-foreground">
+                    {viewData.personInfo.birthDate ? format(new Date(viewData.personInfo.birthDate), 'yyyy-MM-dd') : '未填写'}
+                  </p>
+                </div>
                 <div>
                   <label className="text-sm font-medium">残疾证号</label>
                   <p className="text-sm text-muted-foreground">{viewData.personInfo.disabilityId}</p>