Kaynağa Gözat

feat(web-admin): add paymentScheduleStatus to status-tag registry

Lift schedule open/cleared/void labels from PaymentBySampleTab so Web and mobile share one source.

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 3 hafta önce
ebeveyn
işleme
b592aaec2e

+ 9 - 0
web-admin/src/utils/status-tag-registry.ts

@@ -188,6 +188,15 @@ export const samplePaymentProgress: StatusRegistry = {
 export const samplePaymentProgressLabel = createLabelGetter(samplePaymentProgress)
 export const samplePaymentProgressTagType = createTagTypeGetter(samplePaymentProgress)
 
+/** 应缴批次 scheduleStatus(勿与样本进度 samplePaymentProgress 混用:open=待缴清,dfj=待缴费) */
+export const paymentScheduleStatus: StatusRegistry = {
+  open: { label: '待缴清', tagType: 'warning' },
+  cleared: { label: '已缴清', tagType: 'success' },
+  void: { label: '已作废', tagType: 'info' }
+}
+export const paymentScheduleStatusLabel = createLabelGetter(paymentScheduleStatus)
+export const paymentScheduleStatusTagType = createTagTypeGetter(paymentScheduleStatus)
+
 export const transferType: StatusRegistry = {
   wxzz: { label: '微信转账', tagType: 'success' },
   zzbzz: { label: '支付宝转账', tagType: 'primary' },

+ 2 - 20
web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue

@@ -414,6 +414,8 @@
     payModeTagType,
     samplePaymentProgressLabel,
     samplePaymentProgressTagType,
+    paymentScheduleStatusLabel,
+    paymentScheduleStatusTagType,
     protocolStatusDisplayLabel,
     protocolStatusTagType,
     payStatusLabel,
@@ -495,26 +497,6 @@
     return formatDisplayOrDash(d)
   }
 
-  function paymentScheduleStatusLabel(status: string) {
-    const map: Record<string, string> = {
-      open: '待缴清',
-      cleared: '已缴清',
-      void: '已作废'
-    }
-    return map[status] || status || '—'
-  }
-
-  function paymentScheduleStatusTagType(
-    status: string
-  ): 'success' | 'warning' | 'danger' | 'info' | 'primary' {
-    const map: Record<string, 'success' | 'warning' | 'danger' | 'info' | 'primary'> = {
-      open: 'warning',
-      cleared: 'success',
-      void: 'info'
-    }
-    return map[status] || 'info'
-  }
-
   function scheduleCanConfirm(sch: ScheduleRow) {
     const arrears = Number(sch.arrearsAmount)
     if (!(arrears > 0)) return false