瀏覽代碼

fix(Unit/PersonInfoDetail): 修复证件信息相关的字段和格式问题

1. 修正发证机关字段名从issuingAuthority为issueAuthority的一致性问题
2. 调整defaultData的缩进格式
3. 恢复默认联系人开关表单配置
4. 移除多余的isDefault字段删除逻辑
5. 优化日期字段的格式化处理,补全月份日期前导零
xuzhancheng 5 天之前
父節點
當前提交
a3580c427a
共有 1 個文件被更改,包括 27 次插入24 次删除
  1. 27 24
      yudao-ui-admin-vue3/src/views/Unit/components/PersonInfoDetail.vue

+ 27 - 24
yudao-ui-admin-vue3/src/views/Unit/components/PersonInfoDetail.vue

@@ -147,9 +147,9 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="发证机关" prop="issuingAuthority">
+                <el-form-item label="发证机关" prop="issueAuthority">
                   <el-input
-                    v-model="certItem.issuingAuthority"
+                    v-model="certItem.issueAuthority"
                     placeholder="请输入发证机关"
                     clearable
                   />
@@ -534,15 +534,15 @@ const handleAssignmentChange = (val: string, certItem: Recordable) => {
 
 // 证件信息数组
 const defaultData = {
-  certificateNumber: '',
-  issueAuthority: '',
-  qualificationType: '',
-  assignment: '',
-  projectCode: '',
-  employUnit: '',
-  validityEndDate: '',
-  approveDate: '',
-  attach: []
+    certificateNumber: '',
+    issueAuthority: '',
+    qualificationType: '',
+    assignment: '',
+    projectCode: '',
+    employUnit: '',
+    validityEndDate: '',
+    approveDate: '',
+    attach: []
 }
 const qualificationList = ref<Recordable[]>([])
 const containerTypeValue = ref<string>('')
@@ -929,16 +929,16 @@ const memberSchema1 = computed<FormSchema[]>(() => [
       placeholder: '请输入邮箱'
     }
   },
-  // {
-  //   field: 'isDefault',
-  //   label: '是否默认联系人',
-  //   component: 'Switch',
-  //   componentProps: {
-  //     activeValue: '1',
-  //     inactiveValue: '0'
-  //   },
-  //   value: '0'
-  // }
+  {
+    field: 'isDefault',
+    label: '是否默认联系人',
+    component: 'Switch',
+    componentProps: {
+      activeValue: '1',
+      inactiveValue: '0'
+    },
+    value: '0'
+  }
 ])
 const equipmentList = ref<Recordable[]>([])
 // 证件信息表单配置
@@ -1199,7 +1199,6 @@ const open = (type: 'add' | 'edit', id?: string) => {
     }
     delete result.password
     delete result.username  
-    delete result.isDefault  
     console.log(result.roleList, 'result.roleList的值2')
     // 延迟设置值,确保 schema 已经渲染完成
     nextTick(() => {
@@ -1209,8 +1208,12 @@ const open = (type: 'add' | 'edit', id?: string) => {
     const qualifications = res.qualifications || []
     qualificationList.value = qualifications.map((item) => ({
       ...item,
-      approveDate: item.approveDate ? item.approveDate.join('-') : null,
-      validityEndDate: item.validityEndDate ? item.validityEndDate.join('-') : null,
+      approveDate: Array.isArray(item.approveDate) 
+        ? `${item.approveDate[0]}-${String(item.approveDate[1]).padStart(2, '0')}-${String(item.approveDate[2]).padStart(2, '0')}` 
+        : item.approveDate,
+      validityEndDate: Array.isArray(item.validityEndDate) 
+        ? `${item.validityEndDate[0]}-${String(item.validityEndDate[1]).padStart(2, '0')}-${String(item.validityEndDate[2]).padStart(2, '0')}` 
+        : item.validityEndDate,
       attach: item.attach ? JSON.parse(item.attach) : []
     }))
   })