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

feat(web-admin): add sample-payments API clients and progress tags

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 1 месяц назад
Родитель
Сommit
1bc44cab13

+ 21 - 0
web-admin/src/api/protocol-sample-payment.ts

@@ -135,3 +135,24 @@ export function fetchDeleteProtocolRefundRecord(recordId: string) {
     showSuccessMessage: true
   })
 }
+
+export function fetchSamplePaymentList(params?: {
+  page?: number
+  pageSize?: number
+  keyword?: string
+  payMode?: string
+  progressStatus?: string
+  installmentDueDateStart?: string
+  installmentDueDateEnd?: string
+}) {
+  return request.get<PageList<Record<string, unknown>>>({
+    url: '/web/admin/sample-payments',
+    params
+  })
+}
+
+export function fetchSamplePaymentDetail(samplePaymentId: string) {
+  return request.get<Record<string, unknown>>({
+    url: `/web/admin/sample-payments/${samplePaymentId}`
+  })
+}

+ 12 - 2
web-admin/src/utils/status-tag-registry.ts

@@ -99,9 +99,9 @@ export const sampleStatusLabel = createLabelGetter(sampleStatus)
 export const sampleStatusTagType = createTagTypeGetter(sampleStatus)
 
 export const payStatus: StatusRegistry = {
-  dfj: { label: '待缴费', tagType: 'info' },
+  dfj: { label: '已缴费', tagType: 'primary' },
   jfqrz: { label: '缴费确认中', tagType: 'warning' },
-  yjf: { label: '已缴费', tagType: 'success' },
+  yjf: { label: '缴费成功', tagType: 'success' },
   tfqrz: { label: '退费确认中', tagType: 'warning' },
   ytf: { label: '已退费', tagType: 'danger' }
 }
@@ -123,6 +123,16 @@ export const payMode: StatusRegistry = {
 export const payModeLabel = createLabelGetter(payMode)
 export const payModeTagType = createTagTypeGetter(payMode)
 
+/** 按样本列表整体进度(勿与转账笔 payStatus 混用:payStatus.dfj=已缴费) */
+export const samplePaymentProgress: StatusRegistry = {
+  dfj: { label: '待缴费', tagType: 'info' },
+  jfqrz: { label: '缴费确认中', tagType: 'warning' },
+  bfyj: { label: '部分已缴', tagType: 'primary' },
+  yjq: { label: '已缴清', tagType: 'success' }
+}
+export const samplePaymentProgressLabel = createLabelGetter(samplePaymentProgress)
+export const samplePaymentProgressTagType = createTagTypeGetter(samplePaymentProgress)
+
 export const transferType: StatusRegistry = {
   wxzz: { label: '微信转账', tagType: 'success' },
   zzbzz: { label: '支付宝转账', tagType: 'primary' },