Просмотр исходного кода

feat(bx-mobile): add optional occur date on reimburse apply form

Mirror web-admin detail lines with a clearable YYYY-MM-DD input.

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 2 месяцев назад
Родитель
Сommit
49e4e604ca
1 измененных файлов с 16 добавлено и 3 удалено
  1. 16 3
      bx-mobile/src/views/reimburse/ReimburseApplyPage.vue

+ 16 - 3
bx-mobile/src/views/reimburse/ReimburseApplyPage.vue

@@ -133,6 +133,16 @@
               />
             </div>
 
+            <!-- 发生时间(可选) -->
+            <div class="field">
+              <label class="field-label">发生时间</label>
+              <input
+                class="form-input"
+                type="date"
+                v-model="line.occurDate"
+              />
+            </div>
+
             <!-- 删除行 -->
             <div v-if="form.details.length > 1" class="detail-line-actions">
               <button type="button" class="btn btn-sm btn-danger" @click="removeDetailLine(idx)">删除此行</button>
@@ -373,6 +383,7 @@ interface DetailLine {
   expenseItemId: number | string
   amount: string
   remark: string
+  occurDate: string
 }
 
 const form = reactive({
@@ -380,7 +391,7 @@ const form = reactive({
   remark: '',
   applicantId: '' as string,
   reimburseDate: todayYmd(),
-  details: [{ expenseItemId: '' as string | number, amount: '', remark: '' }] as DetailLine[],
+  details: [{ expenseItemId: '' as string | number, amount: '', remark: '', occurDate: '' }] as DetailLine[],
 })
 
 const submitting = ref(false)
@@ -729,7 +740,7 @@ function openExpensePicker(idx: number) {
 }
 
 function addDetailLine() {
-  form.details.push({ expenseItemId: '', amount: '', remark: '' })
+  form.details.push({ expenseItemId: '', amount: '', remark: '', occurDate: '' })
 }
 
 function removeDetailLine(index: number) {
@@ -792,6 +803,7 @@ async function onSubmit() {
         expenseItemId: String(d.expenseItemId),
         amount: Number(d.amount),
         remark: String(d.remark).trim(),
+        occurDate: d.occurDate ? String(d.occurDate) : undefined,
       })),
       ...invoicePayload,
     }
@@ -866,9 +878,10 @@ async function loadEditData() {
       expenseItemId: d.expenseId ?? d.expenseItemId ?? '',
       amount: String(d.amount ?? ''),
       remark: d.remark || '',
+      occurDate: d.occurDate || '',
     }))
     if (form.details.length === 0) {
-      form.details = [{ expenseItemId: '', amount: '', remark: '' }]
+      form.details = [{ expenseItemId: '', amount: '', remark: '', occurDate: '' }]
     }
     const linked = data.invoices || []
     await refreshWallet()