Quellcode durchsuchen

feat(web-admin): 样本接收弹窗接种量文本输入、冻存仅选日期

共用 SampleReceptionDialog,生产工单与我的生产任务一并生效。

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu vor 2 Monaten
Ursprung
Commit
bf6b080240

+ 1 - 1
web-admin/src/api/sample-production-reception.ts

@@ -15,7 +15,7 @@ export type ProductionReceptionPayload = {
   infectiousFourTestResult?: string
   enrichedBloodWeightG?: number
   cryopreservationVolumeMl?: number
-  inoculationAmount?: number
+  inoculationAmount?: string
   cryopreservationTime?: string
   storageTotalTubes?: number
   availableCellCount1e7?: number

+ 16 - 1
web-admin/src/views/production/production-work-order/SampleReceptionDialog.vue

@@ -183,6 +183,8 @@
                     v-if="field.kind === 'text'"
                     v-model="prodForm[field.key]"
                     clearable
+                    :maxlength="field.maxLength"
+                    :show-word-limit="!!field.maxLength"
                   />
                   <DecimalInput
                     v-else-if="field.kind === 'number' || field.kind === 'integer'"
@@ -191,6 +193,14 @@
                     :precision="field.kind === 'integer' ? 0 : 4"
                     style="width: 100%"
                   />
+                  <el-date-picker
+                    v-else-if="field.kind === 'date'"
+                    v-model="prodForm[field.key]"
+                    type="date"
+                    value-format="YYYY-MM-DD"
+                    placeholder="选择日期"
+                    style="width: 100%"
+                  />
                   <el-date-picker
                     v-else-if="field.kind === 'datetime'"
                     v-model="prodForm[field.key]"
@@ -378,7 +388,12 @@
     prodForm.handlerName = rec.handlerName || ''
     prodForm.remark = rec.remark || ''
     for (const field of productionFieldDefs.value) {
-      prodForm[field.key] = rec[field.key as keyof ProductionReceptionRecord] as never
+      const raw = rec[field.key as keyof ProductionReceptionRecord]
+      if (field.kind === 'date') {
+        prodForm[field.key] = formatProcessTimeDate(raw != null ? String(raw) : '') || ''
+      } else {
+        prodForm[field.key] = raw as never
+      }
     }
   }