diff --git a/src/pages/salesOrder/FundRecordList.vue b/src/pages/salesOrder/FundRecordList.vue index 1ae71cc..f332a70 100644 --- a/src/pages/salesOrder/FundRecordList.vue +++ b/src/pages/salesOrder/FundRecordList.vue @@ -89,71 +89,15 @@ @click="openEndTime" /> - - + - - - - - + :item="item" + @detail="toDetail(item)" + /> + @@ -201,7 +145,8 @@ import { MasterDetailPage, useMasterDetailPane } from "timi-tdesign-mobile"; import { type DropdownValue } from "tdesign-mobile-vue"; import FundRecordDetail from "@/pages/salesOrder/FundRecordDetail.vue"; -import { TimeLabel, Time } from "timi-web"; +import FundRecordListCell from "@/pages/salesOrder/component/FundRecordListCell.vue"; +import { Time } from "timi-web"; import { useUserStore } from "timi-web-api"; import CustomerAPI from "@/api/CustomerAPI"; import SalesOrderAPI from "@/api/SalesOrderAPI"; @@ -210,11 +155,8 @@ import type { FundOperationType, FundRecord, FundRecordStatus } from "@/types/Sa import { buildPresetDateRange, parseDateFilterType, parseDateTime } from "@/utils/date"; import { DATE_FILTER_OPTIONS as dateOptions, type DateFilterType } from "@/utils/dateFilter"; import { getErrorMessage } from "@/utils/error"; -import { formatPackageAmount } from "@/utils/package"; -import { getFundOperationText, getFundStatusText } from "@/utils/salesOrder"; import { Message } from "@/utils/message"; import { permissionCodes } from "@/utils/permission"; -import { getCustomerPhotoURL } from "@/utils/customer"; import type { Customer } from "@/types/Customer"; @@ -475,39 +417,6 @@ function buildUnixRange(): [number | undefined, number | undefined] { ]; } -function getOperatorText(item: FundRecord): string { - return item.operator?.nick || item.operator?.name || item.operatorUserId || "未知"; -} - -function getVerifierText(item: FundRecord): string { - return item.verifier?.nick || item.verifier?.name || item.verifierUserId || "未核销"; -} - -function getCustomerText(item: FundRecord): string { - return item.customer?.name || item.customer?.code || item.customerId || "未知客户"; -} - -function getOperationClass(type?: FundOperationType): string { - return ({ - RECEIVE: "receive", - REFUND: "refund", - CONFIRM_NO_REFUND: "confirm-no-refund", - REVOKE: "revoke" - } as Record)[type || ""] || "unknown"; -} - -function getStatusTheme(statusValue?: FundRecordStatus): "success" | "warning" | "danger" | "default" { - return statusValue === "VERIFIED" ? "success" : statusValue === "PENDING" ? "warning" : statusValue === "REJECTED" ? "danger" : "default"; -} - -function getRecordStatusText(item: FundRecord): string { - return item.revokeRecordId ? "已被冲正" : getFundStatusText(item.status); -} - -function getRecordStatusTheme(item: FundRecord): "success" | "warning" | "danger" | "default" { - return item.revokeRecordId ? "danger" : getStatusTheme(item.status); -} - async function toDetail(item: FundRecord): Promise { openDetail(item.id || ""); } @@ -530,121 +439,13 @@ onMounted(async () => { .sales-order-record-list { padding: var(--tui-nav-height) 0 1rem; - - .item { - - .avatar { - width: 3.5rem; - height: 3.5rem; - } - - .title { - gap: .25rem; - display: flex; - font-size: .75rem; - align-items: center; - justify-content: space-between; - - .customer { - font-weight: 600; - } - - .type { - font-weight: 700; - - &.receive { - color: #15803d; - } - - &.refund { - color: #dc2626; - } - - &.confirm-no-refund { - color: #2563eb; - } - - &.revoke { - color: #7c3aed; - } - } - } - - .description { - display: flex; - align-items: start; - justify-content: space-between; - - .operator { - gap: 0; - color: var(--td-text-color-secondary); - display: flex; - font-size: .75rem; - flex-wrap: wrap; - line-height: 1.5; - flex-direction: column; - - .field { - gap: .25rem; - display: inline-flex; - } - - .label { - color: var(--td-text-color-placeholder); - } - } - - .amounts { - display: flex; - font-size: .75rem; - line-height: 1.5; - align-items: end; - flex-direction: column; - - .label { - color: var(--td-text-color-placeholder); - } - - .order-amount, - .unpaid-amount, - .record-amount { - display: flex; - align-items: baseline; - white-space: nowrap; - } - } - } - } -} - -:deep(.sales-order-record-list .avatar .t-image__img) { - width: 100%; - height: 100%; - object-fit: cover; - border-radius: inherit; -} - -:global(html.theme-dark) .sales-order-record-list { - .fallback { - background: #115e59; + .records { + gap: .5rem; + margin: .75rem; + display: flex; + flex-direction: column; } - .operation-type { - &.receive { - color: #86efac; - } - - &.refund { - color: #fca5a5; - } - - &.confirm-no-refund { - color: #93c5fd; - } - - &.revoke { - color: #c4b5fd; - } - } } + diff --git a/src/pages/salesOrder/component/FundRecordListCell.vue b/src/pages/salesOrder/component/FundRecordListCell.vue new file mode 100644 index 0000000..9f97184 --- /dev/null +++ b/src/pages/salesOrder/component/FundRecordListCell.vue @@ -0,0 +1,199 @@ + + + + +